You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import sys
from pypreprocessor import pypreprocessor
#exclude
if sys.version[:3].split('.')[0] == '2':
pypreprocessor.defines.append('python2')
if sys.version[:3].split('.')[0] == '3':
pypreprocessor.defines.append('python3')
pypreprocessor.parse()
#endexclude
from print_python_version import print_python_version
print_python_version()
In "print_python_version.py"
def print_python_version():
#ifdef python2
print('You are using Python 2x')
#else
#ifdef python3
print('You are using python 3x')
#else
print('Python version not supported')
#endifall
And the output of "python py2and3.py" is :
You are using Python 2x
You are using python 3x
Python version not supported
which means things such as #ifdef and #else are NOT effective in the file "print_python_version.py" anymore.
How can I make the macro effective all over the files in the project ?
The text was updated successfully, but these errors were encountered:
Hello.
I tested pypreprocessor as following
In "py2and3.py"
In "print_python_version.py"
And the output of "python py2and3.py" is :
which means things such as #ifdef and #else are NOT effective in the file "print_python_version.py" anymore.
How can I make the macro effective all over the files in the project ?
The text was updated successfully, but these errors were encountered: