Skip to content

A python module that makes c++ print syntax just work, for some reason.

Notifications You must be signed in to change notification settings

sudo-prime/cprint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Tired of python's simple, short, elegant print statements?

Used to program in c++ and find yourself struggling to remember python's print syntax?

Do you prefer doing things the hard way even when there's an easy solution?

Have I got the module for you!

cprint

A python module that makes c++ print syntax just work, for some reason.

Usage

First, import the module like so:

from cprint import *

After that, anything is possible! Just kidding - only one very specific and unhelpful thing is possible that wasn't possible before!

You can now use the following syntax in python:

cout << "Hello " << "World" << endl;
Hello World

There's a catch or two, though.

  1. To actually print to the screen, endl must be called. For example:
cout << "test";

This won't print anything. However,

cout << "test" << endl;

will print the string "test". endl doesn't need to be inline, though:

cout << "test";
cout << endl;

will also print the string "test".

  1. The semicolon is not required, but encouraged. If you're going to take the time to import and use a module that is essentially useless, you should at least go the extra mile to make sure that your experience is as genuine and authentic as possible. The semicolon is the cherry on top.

Installation

I still haven't figured out how to package and distribute python modules as of yet, so for now, just download or copy and paste the code into a file called cprint.py and import it as shown above.

Contact

If you think there's a way to expand upon my code, let me know. I'm willing to make this thing worse than it already is.

About

A python module that makes c++ print syntax just work, for some reason.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages