{ "info": { "author": "Jad Nohra", "author_email": "jadnohra@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2 :: Only", "Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Testing", "Topic :: Terminals", "Topic :: Utilities" ], "description": "python-c\r\n========\r\n\r\nAn alternative to python -c with much less typing, at the price of being dirtier.\r\n\r\n**Installation**::\r\n\r\n $ pip install python-c\r\n\r\nUsage\r\n=====\r\n\r\nIf you have a file named foo.py with::\r\n\r\n def quite():\r\n return 5\r\n def loud():\r\n print 'hello'\r\n def double(arg):\r\n return arg*2\r\n\r\nInstead of::\r\n\r\n $ python -c \"import foo; foo.loud();\"\r\n hello\r\n\r\nYou can now write::\r\n\r\n $ python-c foo 'loud()'\r\n hello\r\n\r\nYou can load multiple files::\r\n\r\n $ python-c foo,foo2 'loud()'\r\n hello\r\n\r\nor directories::\r\n\r\n $ python-c ./,./dir1,./dir2/test.py 'loud()'\r\n hello\r\n\r\nIn cases where it works (e.g clashes between files are benign), you can **minimize your typing** and omit the first argument, the current directory is then loaded by default::\r\n\r\n $ python-c 'loud()'\r\n hello\r\n\r\nPrinting\r\n========\r\n\r\nPrinting is handled for you::\r\n\r\n $ python-c foo 'quite()'\r\n 5\r\n\r\nThe result of the call (if any) is printed, even though the function does not call 'print'.\r\n\r\nMore examples\r\n=============\r\n\r\nYou can pass arguments to your functions::\r\n\r\n $ python-c foo 'double(2)'\r\n 4\r\n\r\nYou can execute arbitrary code in your single line::\r\n\r\n $ python-c foo '\"hot\" if double(2) == 4 else \"cold\"'\r\n hot\r\n\r\nThis includes printing::\r\n\r\n $ python-c foo.py 'print \"double {} is {}\".format(2, double(2))'\r\n double 2 is 4\r\n\r\nRationale\r\n=========\r\n**Time** is our most valuable non-possesion. The python interpreter must be clean and unambiguous, including the way it handls it's option '-c'. However, more often than not, I will accept being dirty (e.g live with benign clashes between files) and simply type **python-c 'test23()'** as opposed to the double as long **python -c 'import foo.py; foo.test23()'**. Such dirty functionality should not be built into the interpreter, hence *python-c*: the tool playfully indicates its motivation by saving you from typing a space between 'python' and '-c'.", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/jadnohra/python-c/archive/v1.0.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jadnohra/python-c", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "python-c", "package_url": "https://pypi.org/project/python-c/", "platform": "", "project_url": "https://pypi.org/project/python-c/", "project_urls": { "Download": "https://github.com/jadnohra/python-c/archive/v1.0.tar.gz", "Homepage": "https://github.com/jadnohra/python-c" }, "release_url": "https://pypi.org/project/python-c/1.0/", "requires_dist": null, "requires_python": "", "summary": "An alternative to python -c with much less typing, at the price of being dirtier.", "version": "1.0" }, "last_serial": 2956758, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "ed51af817e5f4626707f35157c6380fd", "sha256": "1b3c15aad2fba5a1c61e67ad7bb41efdb1e949ce9c08e69ca0d6643ecf066feb" }, "downloads": -1, "filename": "python-c-1.0.tar.gz", "has_sig": false, "md5_digest": "ed51af817e5f4626707f35157c6380fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3186, "upload_time": "2017-06-17T09:05:37", "url": "https://files.pythonhosted.org/packages/a6/ae/59c8ef092cbab8bebad5ddd48e0935981a155fb871f2a1e539be7568cfef/python-c-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ed51af817e5f4626707f35157c6380fd", "sha256": "1b3c15aad2fba5a1c61e67ad7bb41efdb1e949ce9c08e69ca0d6643ecf066feb" }, "downloads": -1, "filename": "python-c-1.0.tar.gz", "has_sig": false, "md5_digest": "ed51af817e5f4626707f35157c6380fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3186, "upload_time": "2017-06-17T09:05:37", "url": "https://files.pythonhosted.org/packages/a6/ae/59c8ef092cbab8bebad5ddd48e0935981a155fb871f2a1e539be7568cfef/python-c-1.0.tar.gz" } ] }