# cout & cerr like in C++
## Usge:
```py
from stdcpp import cout, cerr, endl
cout << "Hello" << " " << "world!" << endl
cerr << "Hello" << " " << "world!" << endl
```
## Bonus 1:
```py
from stdcpp import Stream
s = Stream('log.txt', 'a+')
s << "Hello "
s.close()
with Stream('log.txt', 'a+') as s:
s << "world!" << endl
```
## Bonus 2:
```py
import io
from stdcpp import Stream, cout
ios = io.StringIO()
s = Stream(ios)
s << "Hello world!" << endl
ios.seek(0)
cout << ios.read()
```
## Bonus 3:
```py
from stdcpp import coutln, cerrln
coutln << "Hello world!"
cerrln << "Hello world!"
```
## Bonus 4:
```py
from stdcpp import cdbg
x = 123
y = 'foobar'
cdbg << x << y
```
result:
```
x: int = 123
y: str = 'foobar'
```
Raw data
{
"_id": null,
"home_page": "https://github.com/gergelyk/python-stdcpp",
"name": "stdcpp",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Grzegorz Krason",
"author_email": "grzegorz.krason@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/23/d5/3a128a7586c8b46e69eb8cf7fef0bcf9053d00d7eb52510020450215f03e/stdcpp-0.5.0.tar.gz",
"platform": null,
"description": "# cout & cerr like in C++\n\n## Usge:\n\n```py\nfrom stdcpp import cout, cerr, endl\n\ncout << \"Hello\" << \" \" << \"world!\" << endl\ncerr << \"Hello\" << \" \" << \"world!\" << endl\n```\n\n## Bonus 1:\n\n```py\nfrom stdcpp import Stream\n\ns = Stream('log.txt', 'a+')\ns << \"Hello \"\ns.close()\n\nwith Stream('log.txt', 'a+') as s:\n s << \"world!\" << endl\n```\n\n## Bonus 2:\n\n```py\nimport io\nfrom stdcpp import Stream, cout\n\nios = io.StringIO()\ns = Stream(ios)\ns << \"Hello world!\" << endl\nios.seek(0)\ncout << ios.read()\n```\n\n## Bonus 3:\n\n```py\nfrom stdcpp import coutln, cerrln\n\ncoutln << \"Hello world!\"\ncerrln << \"Hello world!\"\n```\n\n## Bonus 4:\n```py\nfrom stdcpp import cdbg\n\nx = 123\ny = 'foobar'\n\ncdbg << x << y\n```\n\nresult:\n```\nx: int = 123\ny: str = 'foobar'\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "cout & cerr like in C++",
"version": "0.5.0",
"project_urls": {
"Homepage": "https://github.com/gergelyk/python-stdcpp",
"Repository": "https://github.com/gergelyk/python-stdcpp"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2f30068808dc6641dd9be9a323f08faa9523b6de7924a9e7ac8580e372d421c5",
"md5": "dc16bc90c387833d279455e466e0a877",
"sha256": "7c6c691086cdce07edcb8c87d5b2e632df7034d12a8b6f68bb49d72c012bf0aa"
},
"downloads": -1,
"filename": "stdcpp-0.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "dc16bc90c387833d279455e466e0a877",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 2374,
"upload_time": "2024-01-16T23:24:02",
"upload_time_iso_8601": "2024-01-16T23:24:02.393493Z",
"url": "https://files.pythonhosted.org/packages/2f/30/068808dc6641dd9be9a323f08faa9523b6de7924a9e7ac8580e372d421c5/stdcpp-0.5.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "23d53a128a7586c8b46e69eb8cf7fef0bcf9053d00d7eb52510020450215f03e",
"md5": "6c44b93864c2fcb8e098f3a21e4e24c2",
"sha256": "64ed505970ea6780ac37f291ab0ce22543a958a1946dc90b0748ba1c056d52d9"
},
"downloads": -1,
"filename": "stdcpp-0.5.0.tar.gz",
"has_sig": false,
"md5_digest": "6c44b93864c2fcb8e098f3a21e4e24c2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 2041,
"upload_time": "2024-01-16T23:24:04",
"upload_time_iso_8601": "2024-01-16T23:24:04.147549Z",
"url": "https://files.pythonhosted.org/packages/23/d5/3a128a7586c8b46e69eb8cf7fef0bcf9053d00d7eb52510020450215f03e/stdcpp-0.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-16 23:24:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "gergelyk",
"github_project": "python-stdcpp",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "stdcpp"
}