{ "info": { "author": "TitanSnow", "author_email": "tttnns1024@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Environment :: Console", "Environment :: Win32 (MS Windows)", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: Microsoft :: Windows", "Operating System :: Microsoft :: Windows :: Windows 10", "Operating System :: Microsoft :: Windows :: Windows 7", "Operating System :: Microsoft :: Windows :: Windows 8", "Operating System :: Microsoft :: Windows :: Windows 8.1", "Operating System :: Microsoft :: Windows :: Windows Server 2003", "Operating System :: Microsoft :: Windows :: Windows Server 2008", "Operating System :: Microsoft :: Windows :: Windows Vista", "Operating System :: Microsoft :: Windows :: Windows XP", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Terminals" ], "description": "========\nyawinpty\n========\nyet another winpty binding for python\n\n.. image:: https://ci.appveyor.com/api/projects/status/vaa9vkgs8ihivyg9?svg=true\n :target: https://ci.appveyor.com/project/TitanSnow/yawinpty\n :alt: Build status\n.. image:: https://img.shields.io/github/license/PSoWin/yawinpty.svg\n :target: LICENSE\n :alt: LICENSE\n.. image:: https://img.shields.io/pypi/v/yawinpty.svg\n :target: https://pypi.org/project/yawinpty\n :alt: PyPI version\n.. image:: https://img.shields.io/pypi/status/yawinpty.svg\n :target: https://pypi.org/project/yawinpty\n :alt: Development status\n.. image:: https://img.shields.io/pypi/dm/yawinpty.svg\n :target: https://pypi.org/project/yawinpty\n :alt: Download per month\n.. image:: https://img.shields.io/pypi/wheel/yawinpty.svg\n :target: https://pypi.org/project/yawinpty\n :alt: wheel\n.. image:: https://img.shields.io/pypi/pyversions/yawinpty.svg\n :target: https://pypi.org/project/yawinpty\n :alt: Support python versions\n\ninstall\n=======\n\n.. code-block:: bash\n\n pip install yawinpty\n\nruntime library dependency of pre-built wheels\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n\npython 3.5+\n depends on `Visual C++ Redistributable for Visual Studio 2015`_\n\nolder python\n depends on *both* `Visual C++ Redistributable for Visual Studio 2015`_ and `Microsoft Visual C++ 2008 Redistributable Package`_\n\n.. _`Visual C++ Redistributable for Visual Studio 2015`: https://www.microsoft.com/en-us/download/details.aspx?id=48145\n.. _`Microsoft Visual C++ 2008 Redistributable Package`: https://www.microsoft.com/en-us/download/details.aspx?id=5582\n\nbuild from source\n=================\n\npython 3.5+\n install `Visual C++ 2015 Build Tools`_, then use ``python setup.py build`` to build\n\nolder python\n +----------+-----------------------+\n |Visual C++|CPython version |\n +==========+=======================+\n |10.0 |3.3, 3.4 |\n +----------+-----------------------+\n |9.0 |2.6, 2.7, 3.0, 3.1, 3.2|\n +----------+-----------------------+\n\n \u807dinstall *both* `Visual C++ 2015 Build Tools`_ and the matching version of Visual C++ Build Tools. open \"Visual C++ *2015* Build Tools Command Prompt\" with the same arch as python, then use ``python setup.py build`` to build\n\n.. _`Visual C++ 2015 Build Tools`: http://landinghub.visualstudio.com/visual-cpp-build-tools\n\nbasic example\n=============\n\n.. code-block:: python\n\n from yawinpty import *\n\n with Pty() as pty:\n pty.spawn(SpawnConfig(SpawnConfig.flag.auto_shutdown, cmdline='python -c \"print(\\'HelloWorld!\\')\"'))\n with open(pty.conout_name(), 'r') as f:\n print(f.read())\n\n\nusing ``yawinpty``\n==================\n\nthe common goal to use ``yawinpty`` is to open a pseudo terminal then spawn a process in it and send input to it's stdin and get output from it's stdout. yawinpty.Pty wrapper a pseudo-terminal and do the jobs\n\n*class* yawinpty.\\ *Pty*\\ (*config=yawinpty.Config()*)\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n\nyawinpty.Pty accept a instance of yawinpty.Config as its config\n\n*class* yawinpty.\\ *Config*\\ (:emphasis:`\\*flags`)\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n\nfor the flags to init a \"config class\" is commonly a set of Class.flag.\\*. example\\:\n\n.. code-block:: python\n\n cfg = yawinpty.Config(yawinpty.Config.flag.plain_output)\n\n``help(yawinpty.Config.flag)`` for more supported flags\n\nfor ``yawinpty.SpawnConfig`` it's similar\n\n``help(yawinpty.Config)`` for more methods\n\ninstances of the ``Pty`` class have the following methods\\:\n\nPty.\\ *conin_name*\\ ()\n>>>>>>>>>>>>>>>>>>>>>>\n\nPty.\\ *conout_name*\\ ()\n>>>>>>>>>>>>>>>>>>>>>>>\n\nPty.\\ *conerr_name*\\ ()\n>>>>>>>>>>>>>>>>>>>>>>>\n\nget the name of console in/out/err pipe. the name could be passed to builtin ``open`` to open the pipe\n\nPty.\\ *agent_process_id*\\ ()\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n\nget the process id of the agent process\n\nPty.\\ *set_size*\\ ()\n>>>>>>>>>>>>>>>>>>>>\n\nset window size of the terminal\n\nPty.\\ *spawn*\\ (\\ *spawn_config*\\ )\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n\nspawn a process in the pty. spawn_config is a instance of ``yawinpty.SpawnConfig``. note that one Pty instance could only spawn once otherwise ``yawinpty.RespawnError`` would be raised\n\nreturns a tuple of *process id, thread id* of spawned process\n\n*class* yawinpty.\\ *SpawnConfig*\\ (:emphasis:`\\*spawnFlags, appname=None, cmdline=None, cwd=None, env=None`)\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n\n``spawnFlags``\n the flags from ``yawinpty.SpawnConfig.flag``\n``appname``\n full path to executable file. can be ``None`` if ``cmdline`` is specified\n``cmdline``\n command line passed to the spawned process\n``cwd``\n working directory for the spawned process\n``env``\n the environ for the spawned process, a dict like ``{'VAR1': 'VAL1', 'VAR2': 'VAL2'}``\n\nnote that init a ``SpawnConfig`` *does not* spawn a process. a process is spawned only when calling ``Pty.spawn()``. one SpawnConfig instance could be used multitimes\n\nPty.\\ *wait_agent*\\ (\\ *timeout = yawinpty.INFINITE*\\ )\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n\nPty.\\ *wait_subprocess*\\ (\\ *timeout = yawinpty.INFINITE*\\ )\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n\nwait for agent/spawned process to exit. raise yawinpty.TimeoutExpired if out of timeout\n\nPty.\\ *close*\\ ()\n>>>>>>>>>>>>>>>>>\n\nkill processes not exited, close pty and release Windows resource\n\nexceptions\n>>>>>>>>>>\n\nall winpty related exceptions are subclasses of ``yawinpty.WinptyError``. ``help(yawinpty)`` for more information\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/PSoWin/yawinpty", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "yawinpty-extra", "package_url": "https://pypi.org/project/yawinpty-extra/", "platform": "Windows", "project_url": "https://pypi.org/project/yawinpty-extra/", "project_urls": { "Homepage": "https://github.com/PSoWin/yawinpty" }, "release_url": "https://pypi.org/project/yawinpty-extra/0.1.0.dev1/", "requires_dist": [ "pypiwin32", "yawinpty (>=0.4.3.dev4)" ], "requires_python": "", "summary": "yet another winpty binding for python (extra package)", "version": "0.1.0.dev1" }, "last_serial": 3026213, "releases": { "0.1.0.dev1": [ { "comment_text": "", "digests": { "md5": "a0183eb4cdd477e17d949e93b92cb888", "sha256": "0e522895fa13a2476739badf6062b3cebeb6a80b7b68c79cee54761fcd5af2ae" }, "downloads": -1, "filename": "yawinpty_extra-0.1.0.dev1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a0183eb4cdd477e17d949e93b92cb888", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6721, "upload_time": "2017-07-16T07:50:27", "url": "https://files.pythonhosted.org/packages/a4/81/c98523f8ac136c0522c9d02a4574a37b62eba75cc829dc9e7dc878bd0a14/yawinpty_extra-0.1.0.dev1-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a0183eb4cdd477e17d949e93b92cb888", "sha256": "0e522895fa13a2476739badf6062b3cebeb6a80b7b68c79cee54761fcd5af2ae" }, "downloads": -1, "filename": "yawinpty_extra-0.1.0.dev1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a0183eb4cdd477e17d949e93b92cb888", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6721, "upload_time": "2017-07-16T07:50:27", "url": "https://files.pythonhosted.org/packages/a4/81/c98523f8ac136c0522c9d02a4574a37b62eba75cc829dc9e7dc878bd0a14/yawinpty_extra-0.1.0.dev1-py2.py3-none-any.whl" } ] }