Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #46328 > unrolled thread

Python #ifdef

Started byCarlos Nepomuceno <carlosnepomuceno@outlook.com>
First post2013-05-28 22:46 +0300
Last post2013-05-28 16:04 -0700
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  Python #ifdef Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-28 22:46 +0300
    Re: Python #ifdef 88888 Dihedral <dihedral88888@gmail.com> - 2013-05-28 16:04 -0700

#46328 — Python #ifdef

FromCarlos Nepomuceno <carlosnepomuceno@outlook.com>
Date2013-05-28 22:46 +0300
SubjectPython #ifdef
Message-ID<mailman.2317.1369770400.3114.python-list@python.org>
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? 		 	   		  

[toc] | [next] | [standalone]


#46348

From88888 Dihedral <dihedral88888@gmail.com>
Date2013-05-28 16:04 -0700
Message-ID<aabfb355-7210-44a5-9576-357bc82abb47@googlegroups.com>
In reply to#46328
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.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web