# Pipe stdout/stderr to TXT/HTML (Windows only)
## Tested against Windows 10 / Python 3.11 / Anaconda
### pip install outerr2html
### pip install ansi2html (if you want HTML output too)
```PY
from outerr2html import stdout_redirector, libc, config
config.enco = "utf-8"
import sys
import os
import time
with stdout_redirector(
outfolder="c:\\htmltestoutput",
print_stdout=True,
print_stderr=True,
line_limit_out=1000, # creates a new file when limit has been reached
line_limit_err=1000,
sleep_at_end=2,
convert2html=False,
sleep_between_checks=0.1,
):
for h in range(10):
sys.stderr.write("stderr test\n")
sys.stderr.flush() # necessary
os.system("echo console test") # won't be captured with ipython
libc.puts(b"C test") # won't be captured with ipython
libc.fflush(None) # necessary
print("python test ")
print(1234)
time.sleep(1)
print("oi") # not captured
import pandas as pd
from PrettyColorPrinter import add_printer
add_printer(1)
df = pd.read_csv(
r"https://github.com/datasciencedojo/datasets/raw/master/titanic.csv",
engine="python",
on_bad_lines="skip",
encoding="utf-8",
encoding_errors="ignore",
)
with stdout_redirector(
outfolder="c:\\htmltestoutput",
print_stdout=True,
print_stderr=True,
line_limit_out=1000,
line_limit_err=1000,
sleep_at_end=2,
convert2html=False,
sleep_between_checks=0.1,
):
for h in range(10):
sys.stderr.write("stderr test\n")
sys.stderr.flush() # necessary
print(df)
os.system("echo console test") # won't be captured with ipython
libc.puts(b"C test") # won't be captured with ipython
libc.fflush(None) # necessary
print("python test ")
print(1234)
time.sleep(1)
print("oi") # not captured
```
Raw data
{
"_id": null,
"home_page": "https://github.com/hansalemaos/outerr2html",
"name": "outerr2html",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "requests, ip, v4",
"author": "Johannes Fischer",
"author_email": "aulasparticularesdealemaosp@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/69/d1/ff5a5bf7d7ccbe079e821f2b271a6ea47ed13d1fe5e7f41a7131da741baf/outerr2html-0.11.tar.gz",
"platform": null,
"description": "\r\n# Pipe stdout/stderr to TXT/HTML (Windows only)\r\n\r\n## Tested against Windows 10 / Python 3.11 / Anaconda\r\n\r\n### pip install outerr2html\r\n\r\n### pip install ansi2html (if you want HTML output too)\r\n\r\n\r\n```PY\r\nfrom outerr2html import stdout_redirector, libc, config\r\n\r\nconfig.enco = \"utf-8\"\r\nimport sys\r\nimport os\r\nimport time\r\n\r\nwith stdout_redirector(\r\n outfolder=\"c:\\\\htmltestoutput\",\r\n print_stdout=True,\r\n print_stderr=True,\r\n line_limit_out=1000, # creates a new file when limit has been reached\r\n line_limit_err=1000,\r\n sleep_at_end=2,\r\n convert2html=False,\r\n sleep_between_checks=0.1,\r\n):\r\n for h in range(10):\r\n sys.stderr.write(\"stderr test\\n\")\r\n sys.stderr.flush() # necessary\r\n os.system(\"echo console test\") # won't be captured with ipython\r\n libc.puts(b\"C test\") # won't be captured with ipython\r\n libc.fflush(None) # necessary\r\n print(\"python test \")\r\n print(1234)\r\n time.sleep(1)\r\nprint(\"oi\") # not captured\r\n\r\nimport pandas as pd\r\nfrom PrettyColorPrinter import add_printer\r\n\r\nadd_printer(1)\r\ndf = pd.read_csv(\r\n r\"https://github.com/datasciencedojo/datasets/raw/master/titanic.csv\",\r\n engine=\"python\",\r\n on_bad_lines=\"skip\",\r\n encoding=\"utf-8\",\r\n encoding_errors=\"ignore\",\r\n)\r\nwith stdout_redirector(\r\n outfolder=\"c:\\\\htmltestoutput\",\r\n print_stdout=True,\r\n print_stderr=True,\r\n line_limit_out=1000,\r\n line_limit_err=1000,\r\n sleep_at_end=2,\r\n convert2html=False,\r\n sleep_between_checks=0.1,\r\n):\r\n for h in range(10):\r\n sys.stderr.write(\"stderr test\\n\")\r\n sys.stderr.flush() # necessary\r\n print(df)\r\n os.system(\"echo console test\") # won't be captured with ipython\r\n libc.puts(b\"C test\") # won't be captured with ipython\r\n libc.fflush(None) # necessary\r\n print(\"python test \")\r\n print(1234)\r\n time.sleep(1)\r\nprint(\"oi\") # not captured\r\n```\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Pipe stdout/stderr to TXT/HTML (Windows only)",
"version": "0.11",
"project_urls": {
"Homepage": "https://github.com/hansalemaos/outerr2html"
},
"split_keywords": [
"requests",
" ip",
" v4"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a760e21ae5cfbf0cc79252acfe33ff84cfa8693047e561119bb21c4cb3fa10c9",
"md5": "f8340f829a534097d5e1eba8060241a7",
"sha256": "34407c2f27181972b2a59fca876bb6cae9d996e71fe1428a8fd07a10b9d3db6f"
},
"downloads": -1,
"filename": "outerr2html-0.11-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f8340f829a534097d5e1eba8060241a7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 12070,
"upload_time": "2024-04-03T03:17:49",
"upload_time_iso_8601": "2024-04-03T03:17:49.598329Z",
"url": "https://files.pythonhosted.org/packages/a7/60/e21ae5cfbf0cc79252acfe33ff84cfa8693047e561119bb21c4cb3fa10c9/outerr2html-0.11-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "69d1ff5a5bf7d7ccbe079e821f2b271a6ea47ed13d1fe5e7f41a7131da741baf",
"md5": "42f39543650e5149d7b6e19acb92b3d1",
"sha256": "f089cbc6ea18dab7144cf42a305fdcc6edd95f753ed4978edbd3611573321d27"
},
"downloads": -1,
"filename": "outerr2html-0.11.tar.gz",
"has_sig": false,
"md5_digest": "42f39543650e5149d7b6e19acb92b3d1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11924,
"upload_time": "2024-04-03T03:17:51",
"upload_time_iso_8601": "2024-04-03T03:17:51.205155Z",
"url": "https://files.pythonhosted.org/packages/69/d1/ff5a5bf7d7ccbe079e821f2b271a6ea47ed13d1fe5e7f41a7131da741baf/outerr2html-0.11.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-03 03:17:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hansalemaos",
"github_project": "outerr2html",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "aiofiles",
"specs": []
},
{
"name": "tkkillablethreads",
"specs": []
}
],
"lcname": "outerr2html"
}