{ "info": { "author": "David Marble", "author_email": "davidmarble@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Environment :: Win32 (MS Windows)", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.4", "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.0", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3" ], "description": "pywin\n=====\n\n**pywin** is a lightweight python 2.5-3.3 launcher and switcher for\nWindows command line and MSYS/MINGW32. It's similar to the `py.exe\nlauncher/switcher available in python\n3.3 `__, but\nwritten with basic Windows batch scripts and a shell script for\nMSYS/MINGW32 support. I use bash and command line shell tools from\n`msysgit `__, based on MSYS/MINGW32, to do\nmost of my python development on Windows.\n\n**pywin** supports several useful features defined in `PEP\n397 `__, such as command line\nconventions and hash bang #! python version headers in source files.\nWhile pywin lacks some of py.exe's features, it has the basics and a few\nextras of its own.\n\nRequirements\n------------\n\n- Windows >= XP for command prompt support\n- Windows >= Vista for MSYS/MINGW support (requires ``mklink`` for\n symbolic links)\n- At least one installation of python 2.5 up to 3.3 (though it's not\n useful without at least two)\n- easy\\_install, pip, or git\n\nInstallation\n------------\n\n- Make sure the main python installation you want pywin to live under\n is in the PATH.\n- With multiple python installations, it's recommended to have only the\n main and Scripts directories from one installation in your PATH. For\n example, ``C:\\Python27;C:\\Python27\\Scripts``.\n\neasy\\_install\n~~~~~~~~~~~~~\n\n.. code:: sh\n\n easy_install pywin\n\npip\n~~~\n\n.. code:: sh\n\n pip install pywin\n\nfrom source\n~~~~~~~~~~~\n\n.. code:: sh\n\n git clone git://github.com/davidmarble/pywin.git\n cd pywin\n python setup.py install\n\nGetting Started\n---------------\n\n.. code:: sh\n\n # Assuming pywin was installed with Python27\n\n C:\\>pyassoc\n\n HKEY_CURRENT_USER\\Software\\Classes python keys created successfully.\n\n .py files will launch with \"C:\\Python27\\pywin.bat\"\n\n C:\\>pywin genlaunchers\n\n Generating launchers...\n\n C:\\Python27\\python2.7.bat -> C:\\Python27\\python.exe\n C:\\Python27\\python2.6.bat -> C:\\Python26\\python.exe\n C:\\Python27\\python2.5.bat -> C:\\Python25\\python.exe\n C:\\Python27\\python3.0.bat -> C:\\Python30\\python.exe\n C:\\Python27\\python3.1.bat -> C:\\Python31\\python.exe\n C:\\Python27\\python3.2.bat -> C:\\Python32\\python.exe\n C:\\Python27\\python3.3.bat -> C:\\Python33\\python.exe\n\n C:\\>pywin # launch first python found in PATH\n\n C:\\>pywin -2.7 # launch python 2.7\n\n C:\\>pywin setdefault 3.3\n\n Setting default python for active session to: 3.3\n C:\\Python33;C:\\Python33\\Scripts -- now at front of PATH\n\n # Create a test file with a specified python version in the header\n C:\\>echo #! /usr/bin/python2.7 > test.py\n C:\\>echo import sys;print(\"\\n %s\"%sys.exec_prefix) >> test.py\n C:\\>test.py\n \n C:\\Python27\n\n C:\\>pywin -3.2 test.py # launch test.py with python 3.2\n\n C:\\Python32\n\nOverview\n--------\n\n**pywin** and its associated scripts are installed in the main directory\nof the active python version (e.g. C:27). There's no need to install it\nunder more than one version of python (if you do, you'll have to run\n``pywin genlaunchers`` for each version you install it under). Make sure\nthat this main python directory is always on the path. Alternatively you\ncan move the included scripts to another directory in your path.\n\nAuto-generate version-specific launchers\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n**pywin** can create individual launch scripts to directly access core\npython installations (e.g. python2.7). These can be called directly with\nor without arguments from the Windows command prompt and MSYS/MINGW bash\nprompt. To use this feature, call\n\n.. code:: sh\n\n pywin genlaunchers\n\nLaunchers are created for all machine-wide and user-specific python\ninstallations found in the Windows registry. Windows batch files will be\nadded to the directory where **pywin** is located. MSYS/MINGW32 relies\non Windows links created programmatically with ``mklink``, which is why\nyou must have Windows >= Vista installed to make use of this project.\n\nLaunch a specific python version using pywin\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code:: sh\n\n pywin -2.7 # launch python 2.7\n pywin -3.2 test.py # launch test.py with python 3.2\n\nAutomatically invoke the right python with a script header\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nAdd a directive to the first or second line of a source file to have the\ncorrect interpreter called. Currently this only supports python\nlaunchers created by the ``pywin genlaunchers`` command. To use this\nfeature, you must associate the .py extension with pywin.bat using the\nincluded ``pyassoc`` utility.\n\n.. code:: sh\n\n pyassoc\n\npywin\n-----\n\n**NOTE:** ``pywin`` commands work from both Windows command line and\nMSYS/MINGW32 shell.\n\ngenlaunchers\n~~~~~~~~~~~~\n\n.. code:: sh\n\n pywin genlaunchers\n\nSearch for python installations and create batch files in the same\ndirectory where pywin is installed.\n\nNote if you're using MSYS/MINGW32 this must be run again in the\nMSYS/MINGW32 shell, and you must have Windows >= Vista.\n\nsetdefault\n~~~~~~~~~~\n\n.. code:: sh\n\n pywin setdefault \n\nSet the default python to ``.`` version. Adds the right\npython home directory and its associated Scripts directory to the front\nof PATH. Removes any other existing reference to a python Scripts\ndirectory in PATH.\n\nExample\n\n.. code:: sh\n\n # Existing PATH: C:\\Windows\\System32;C:\\Windows;C:\\Python27;C:\\Python27\\Scripts\n\n pywin setdefault 3.3\n\n # New PATH: C:\\Python33;C:\\Python33\\Scripts;C:\\Windows\\System32;C:\\Windows;C:\\Python27;\n # C:\\Python27 is preserved so that pywin can be found.\n\n``pywin setdefault`` is only active for the current cmd.exe (or\nMSYS/MINGW32 shell) session. If you want to change the\ndefault python permanently, you need to change your system or user\nPATH and make sure pywin is installed for that python version.\n\nWhen calling this from MSYS/MINGW32, enter a dot first so the changes to\n$PATH propagate to your active shell. E.g. ``. pywin setdefault 3.3``\n\nlaunch with version and/or source\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code:: sh\n\n pywin [-] []\n\nLaunch either a specific ``.`` version of python, or a\nsource file, or both. Note that specifying a version of python on the\ncommand line will override any version in the header of the source file.\n\nExample\n\n.. code:: sh\n\n # launch python 2.7\n pywin -2.7\n\n # launch test.py with python 3.2\n pywin -3.2 test.py\n\n # launch test.py according to Version Search Order below\n pywin test.py\n\nVersion Search Order\n~~~~~~~~~~~~~~~~~~~~\n\n**pywin** will launch the first version of python found among:\n\n1. Any version specified after a #! in the first 2 lines of the source.\n The interpreter will be invoked with any additional parameters.\n\n examples:\n\n ::\n\n #! python3.3\n #! /usr/bin/python2.7 -v\n\n2. If the environment variable ``VIRTUAL_ENV`` is set, use that\n virtualenv's ``python.exe``.\n3. If the environment variable ``PYTHONHOME`` is set, use its\n ``python.exe``.\n4. If none of the above, fall back to the first ``python.exe`` found on\n the path.\n\npyassoc\n-------\n\n.. code:: sh\n\n pyassoc [original] [all_users]\n\nWith no arguments, ``pyassoc`` will register the .py extension to run\nwith ``%pyhome%\\pywin.bat``. This change is made in the registry to\n``HKEY_CURRENT_USER``, so that when .py files are invoked, any\nmachine-wide setting is overridden.\n\nNote that registry settings have no effect on launch .py files under\nMSYS/MINGW32.\n\nParameters\n~~~~~~~~~~\n\n- **original** - restore .py registry settings to launch with\n ``%pyhome%\\python.exe``\n- **all\\_users** - if administrator, apply changes to\n ``HKEY_LOCAL_MACHINE`` and remove any ``HKEY_CURRENT_USER`` python\n keys. Note that users can override this with their own\n ``HKEY_CURRENT_USER`` values.\n\n%pyhome%\n~~~~~~~~\n\nThe variable ``%pyhome%`` used by ``pyassoc`` is set in this manner:\n\n1. If the environment variable ``PYTHONHOME`` is set, use it.\n2. If the environment variable ``DEFAULTPYTHON`` is set, use it. This is\n set when you call ``pywin setdefault ``, but only lasts for\n the current session.\n3. The path the ``pyassoc.bat`` script is in.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/davidmarble/pywin/", "keywords": "python windows version switcher launcher", "license": "BSD 3-clause", "maintainer": null, "maintainer_email": null, "name": "pywin", "package_url": "https://pypi.org/project/pywin/", "platform": "WIN32,WIN64", "project_url": "https://pypi.org/project/pywin/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/davidmarble/pywin/" }, "release_url": "https://pypi.org/project/pywin/0.3.1/", "requires_dist": null, "requires_python": null, "summary": "Lightweight python 2.5-3.3 launcher and switcher for Windows command line and MSYS/MINGW32. Partly PEP 397 compliant.", "version": "0.3.1" }, "last_serial": 777031, "releases": { "0.3.1": [ { "comment_text": "", "digests": { "md5": "54aa878622bccc6aba0530fe86d74732", "sha256": "4f9195735d6fd726a4e90b7f950383c964ecd52614453a5dd4dfae3a86b8163a" }, "downloads": -1, "filename": "pywin-0.3.1.zip", "has_sig": false, "md5_digest": "54aa878622bccc6aba0530fe86d74732", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25350, "upload_time": "2013-03-31T00:31:33", "url": "https://files.pythonhosted.org/packages/23/f5/744fc05b39ab479749c2eb9ba5cdf57b932a41a0bc23d833a47cb6314638/pywin-0.3.1.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "54aa878622bccc6aba0530fe86d74732", "sha256": "4f9195735d6fd726a4e90b7f950383c964ecd52614453a5dd4dfae3a86b8163a" }, "downloads": -1, "filename": "pywin-0.3.1.zip", "has_sig": false, "md5_digest": "54aa878622bccc6aba0530fe86d74732", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25350, "upload_time": "2013-03-31T00:31:33", "url": "https://files.pythonhosted.org/packages/23/f5/744fc05b39ab479749c2eb9ba5cdf57b932a41a0bc23d833a47cb6314638/pywin-0.3.1.zip" } ] }