Skip to main content

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

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.0.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

stdcpp-0.4.0-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

Details for the file stdcpp-0.4.0.tar.gz.

File metadata

  • Download URL: stdcpp-0.4.0.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

Hashes for stdcpp-0.4.0.tar.gz
Algorithm Hash digest
SHA256 855f1fd2adbf585fec98c19c5708385198114888b5f23937f91117c5b9e769c8
MD5 2818c5b193bb932d6cfb4da417c0bce1
BLAKE2b-256 c435f10a5e222abfceafb10ab97ebf7d627c975fbac465fc4ce1449002e5528c

See more details on using hashes here.

File details

Details for the file stdcpp-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: stdcpp-0.4.0-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

Hashes for stdcpp-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1ce803c918632462b3a9909d33ced1d3f6cf36fbc7afcd0a25ce6578f5207ce7
MD5 9b691a1e3f2a1da500b3c1ec3689846f
BLAKE2b-256 df6bc6a7b81536ebe6bcaab0d37bab7c70e73879f3bbbc19f5881002fd87c59c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page