Python #ifdef

C

Carlos Nepomuceno

Are there Python 'preprocessor directives'?

I'd like to have something like '#ifdef' to mix code from Python 2 and 3 ina single file.

Is that possible? How?
 
8

88888 Dihedral

Carlos Nepomucenoæ–¼ 2013å¹´5月29日星期三UTC+8上åˆ3時46分37秒寫é“:
Are there Python 'preprocessor directives'?

I'd like to have something like '#ifdef' to mix code from Python 2 and 3 in a single file.

Is that possible? How?

Use execfile(filename) at the beginning to get what you want.
The .pyc version is preferred.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,164
Latest member
quinoxflush
Top