cout & cerr like in C++
Project description
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 cdbg
x = 123
y = 'foobar'
cdbg << x << y
result:
x: int = 123
y: str = 'foobar'
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
stdcpp-0.4.1.tar.gz
(2.0 kB
view details)
Built Distribution
File details
Details for the file stdcpp-0.4.1.tar.gz
.
File metadata
- Download URL: stdcpp-0.4.1.tar.gz
- Upload date:
- Size: 2.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/5.15.0-91-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5bf99b265bccc5253a317727ec350ced7806cf92405fd2a5edf01f36eefee7a |
|
MD5 | 76eed69d5be49211cc7dd5c468d6ef86 |
|
BLAKE2b-256 | d5c623d2ba063dccc45a4f1bd26bb1fe315c9955a66c3aa6e60cc99a01c90ffc |
File details
Details for the file stdcpp-0.4.1-py3-none-any.whl
.
File metadata
- Download URL: stdcpp-0.4.1-py3-none-any.whl
- Upload date:
- Size: 2.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/5.15.0-91-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f9410cbae07f0d2f680847c9829a1edbda2752f2e058d220b2def56e4eff743 |
|
MD5 | d75b504c374fde2eee08516a488a4eee |
|
BLAKE2b-256 | de3e768769e82561dcdc83fffd524e288805e3acf89af792f30e6413e01ea7b9 |