Skip to main content

cout & cerr like in C++

Usge:

from stdcpp import cout, cerr, endl

cout << "Hello" << " " << "world!" << endl
cerr << "Hello" << " " << "world!" << endl

Bonus 1:

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:

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:

from stdcpp import coutln, cerrln

coutln << "Hello world!"
cerrln << "Hello world!"

Bonus 4:

from stdcpp import cdbg

x = 123
y = 'foobar'

cdbg << x << y

result:

x: int = 123
y: str = 'foobar'

Metadata

Release files for stdcpp 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stdcpp 0.5.0
File Size Uploaded Provenance Actions
stdcpp-0.5.0.tar.gz 2.0 kB Without provenance Details for stdcpp-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for stdcpp 0.5.0
File Interpreter ABI Platform Actions
stdcpp-0.5.0-py3-none-any.whl Python 3 none any Details for stdcpp-0.5.0-py3-none-any.whl

Total release size: 4.4 kB

Release files / stdcpp-0.5.0.tar.gz

Download URL stdcpp-0.5.0.tar.gz
Size 2.0 kB
Tags Source
SHA-256 checksum
How to use checksums
64ed505970ea6780ac37f291ab0ce22543a958a1946dc90b0748ba1c056d52d9
BLAKE2b-256 checksum
How to use checksums
23d53a128a7586c8b46e69eb8cf7fef0bcf9053d00d7eb52510020450215f03e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.10.12 Linux/5.15.0-91-generic

Release files / stdcpp-0.5.0-py3-none-any.whl

Download URL stdcpp-0.5.0-py3-none-any.whl
Size 2.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c6c691086cdce07edcb8c87d5b2e632df7034d12a8b6f68bb49d72c012bf0aa
BLAKE2b-256 checksum
How to use checksums
2f30068808dc6641dd9be9a323f08faa9523b6de7924a9e7ac8580e372d421c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.10.12 Linux/5.15.0-91-generic

Security for stdcpp 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page