Skip to content

Instantly share code, notes, and snippets.

@SoutrikBandyopadhyay
Created February 18, 2021 17:08
Show Gist options
  • Select an option

  • Save SoutrikBandyopadhyay/fb6c3b029a1e6647566e5f3d32e21538 to your computer and use it in GitHub Desktop.

Select an option

Save SoutrikBandyopadhyay/fb6c3b029a1e6647566e5f3d32e21538 to your computer and use it in GitHub Desktop.
x = '''from setuptools import setup
from Cython.Build import cythonize
import numpy
import scipy
setup(
include_dirs=[numpy.get_include(),scipy.get_include()],
ext_modules = cythonize("*.pyx",annotate=True, build_dir= "build", compiler_directives={'language_level' : "3"})
)''',
main = input("Enter the name of main python file (without extension, case sensitive): ")
y = f'''python setup.py build_ext --inplace
python {main}.py'''
with open("setup.py","w") as f:
f.write(x)
f.close()
with open("dev.bat","w") as f:
f.write(y)
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment