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()
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.3.0.tar.gz
(1.2 kB
view hashes)
Built Distribution
stdcpp-0.3.0-py3-none-any.whl
(1.6 kB
view hashes)