{ "info": { "author": "Matthew Rahtz", "author_email": "matthew.rahtz@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Utilities" ], "description": "TmuxProcess\n===========\n\nIf you're prototyping with multiple processes all trying to send debug prints to\nthe same terminal, things can get very confusing.\n\n``TmuxProcess`` is an extension of the ``multiprocessing`` ``Process`` class which\nautomatically sets up a tmux session with a separate tmux window for each\nprocess created. With standard output for each process linked to a separate window,\nit's much easier to keep track of what each individual process is doing.\n(Standard input can also be tied to each separate window, so you can also send\ndifferent commands to different processes.)\n\nRequirements\n------------\n\ntmux, and that's it!\n\nInstallation\n------------\n\n::\n\n pip install tmuxprocess\n\nUsage\n-----\n\nIf you only care about standard output being redirected::\n\n from tmuxprocess import TmuxProcess\n import time\n\n def f(name):\n print(\"{} running\".format(name))\n while True:\n print(\"{} sleeping\".format(name))\n time.sleep(1)\n\n p1 = TmuxProcess(target=f, args=(\"f1\", ))\n print(\"Run\")\n print(\" tmux attach -t {}\".format(p1.tmux_sess))\n print(\"to interact with each process.\")\n p1.start()\n p2 = TmuxProcess(target=f, args=(\"f2\", ))\n p2.start()\n\nInput and output from the main process will remain on the launching terminal.\nWhen the first process is created, a new tmux session will be launched in the\nbackground, a new tmux window created in that session, and standard output\nredirected to that window. When the second process is created, a second tmux\nwindow will be created in the same session, and its standard output similarly\nredirected.\n\nIf you also want standard input redirection, initialise with ``mode='inout'``::\n\n from tmuxprocess import TmuxProcess\n\n def f(name):\n print(\"{} running\".format(name))\n while True:\n s = input()\n print(\"{} read:\".format(name), s)\n\n p1 = TmuxProcess(target=f, mode='inout', args=(\"f1\", ))\n print(\"Run\")\n print(\" tmux attach -t {}\".format(p1.tmux_sess))\n print(\"to interact with each process.\")\n p1.start()\n p2 = TmuxProcess(target=f, mode='inout', args=(\"f2\", ))\n p2.start()\n\nHowever, with this mode, because of the way that standard input redirection\nis implemented, note that you will have to manually kill the session\nonce done.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mrahtz/tmuxprocess", "keywords": "multiprocessing process tmux", "license": "", "maintainer": "", "maintainer_email": "", "name": "tmuxprocess", "package_url": "https://pypi.org/project/tmuxprocess/", "platform": "", "project_url": "https://pypi.org/project/tmuxprocess/", "project_urls": { "Homepage": "https://github.com/mrahtz/tmuxprocess" }, "release_url": "https://pypi.org/project/tmuxprocess/0.2.0/", "requires_dist": null, "requires_python": "", "summary": "Redirect I/O from processes to different tmux windows", "version": "0.2.0" }, "last_serial": 4314689, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "38ae0a5b3abacd268815ce2b9d36d3c1", "sha256": "4957c02b26c668e695535dfa6dfbd7b939cd8b09f850e4b9c96177a012acbf31" }, "downloads": -1, "filename": "tmuxprocess-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "38ae0a5b3abacd268815ce2b9d36d3c1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4664, "upload_time": "2018-01-01T20:17:06", "url": "https://files.pythonhosted.org/packages/41/90/13de330ca9bf72fd1b92a40f36889f9f6fec4fc2ee2554dbb72d7cd9cc91/tmuxprocess-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c541902f2f2d3be471e413c8d96e5781", "sha256": "7d59f710bb908e676b0c09da2657ea9bc33c27a1a3d6d001d14bb27dfd6fabeb" }, "downloads": -1, "filename": "tmuxprocess-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c541902f2f2d3be471e413c8d96e5781", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2833, "upload_time": "2018-01-01T20:17:10", "url": "https://files.pythonhosted.org/packages/95/e1/e8e7fb6903e5868daf967beebbaf15c517e15bf6b7deeb771bb7f8838f82/tmuxprocess-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "8c9456785481d3df69982a137ff253cb", "sha256": "649a291c4f2282d12da8406e0f3dea9ad8645a653d76c3670ff2f48b6457e560" }, "downloads": -1, "filename": "tmuxprocess-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "8c9456785481d3df69982a137ff253cb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3049, "upload_time": "2018-09-27T01:37:02", "url": "https://files.pythonhosted.org/packages/4a/45/fd9928527a68a2870f7fb95dd715d54bd9780e65578e9065ddcb36d2dbb6/tmuxprocess-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d85f49890c90da650d190626b5a07a6d", "sha256": "c14705107c6a796a18c7d374590c569a7e6393c53785caacc35909e0d5c94506" }, "downloads": -1, "filename": "tmuxprocess-0.2.0.tar.gz", "has_sig": false, "md5_digest": "d85f49890c90da650d190626b5a07a6d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2954, "upload_time": "2018-09-27T01:34:49", "url": "https://files.pythonhosted.org/packages/f6/18/ed6364e2d69494fab7a8271275f3b012e8ad48be407d1c3806659f14286e/tmuxprocess-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8c9456785481d3df69982a137ff253cb", "sha256": "649a291c4f2282d12da8406e0f3dea9ad8645a653d76c3670ff2f48b6457e560" }, "downloads": -1, "filename": "tmuxprocess-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "8c9456785481d3df69982a137ff253cb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3049, "upload_time": "2018-09-27T01:37:02", "url": "https://files.pythonhosted.org/packages/4a/45/fd9928527a68a2870f7fb95dd715d54bd9780e65578e9065ddcb36d2dbb6/tmuxprocess-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d85f49890c90da650d190626b5a07a6d", "sha256": "c14705107c6a796a18c7d374590c569a7e6393c53785caacc35909e0d5c94506" }, "downloads": -1, "filename": "tmuxprocess-0.2.0.tar.gz", "has_sig": false, "md5_digest": "d85f49890c90da650d190626b5a07a6d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2954, "upload_time": "2018-09-27T01:34:49", "url": "https://files.pythonhosted.org/packages/f6/18/ed6364e2d69494fab7a8271275f3b012e8ad48be407d1c3806659f14286e/tmuxprocess-0.2.0.tar.gz" } ] }