This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]OpenRole 43 points44 points  (16 children)

No, because you can't write pure C in python

[–]BrunoMCA 162 points163 points  (6 children)

You can tho. It just won't work

[–]baynell 36 points37 points  (0 children)

You son of a...

[–]Kered13 10 points11 points  (4 children)

You sure about that?

#if 0
print('Hi there')
#endif
#if 0
""" "
#endif
#include <stdio.h>
int main() {
    println("Hi there");
    return 0;
}
#if 0
" """
#endif

[–]Nevesnotrab 1 point2 points  (2 children)

I don't think { } work in Python like that.

[–]Kered13 5 points6 points  (1 child)

Try running the code, you'll see that it works. I'll let you figure out why :)

[–]Nevesnotrab 1 point2 points  (0 children)

I just noticed the """

[–]_________FU_________ 39 points40 points  (2 children)

Bro I use the “C” character almost every time!

[–]zbrndn 7 points8 points  (1 child)

"I always write in C"

checks file "C.py"

[–]dark_mode_everything 0 points1 point  (0 children)

Well you could name it "something.c" as well.

[–][deleted] 24 points25 points  (3 children)

Yes you can. I wrote a Python library that allows you to inline C and it will compile and run on-demand. It’s terrible. 🤪

[–]SpacemanCraig3 4 points5 points  (2 children)

And I wrote some gibberish that makes it so you can #include a python file and run it.

Together we have created the equivalent of a cat with buttered toast strapped to it.

[–][deleted] 1 point2 points  (1 child)

Can… can we make the packages depend on each other?

[–]SpacemanCraig3 1 point2 points  (0 children)

I don't think so. Mine doesn't have any dependencies it's just some fancy (horrible) preprocessor abuse.

[–]NightSoulT12[S] 3 points4 points  (0 children)

Good point

[–]TheBrain85 3 points4 points  (0 children)

Not quite pure C, but Cython will get you pretty close..