I convert my python code to c by cython and after that compile .c file and use .so in my project.
My problem:
I use __file__
in my python code and in while compile by gcc, it doesn't get error. but when I run program and import .so in other python files, appear an error from __file__
line.
How can solve this problem? Is there any method to replace with __file__
?
__file__
does now work on recent versions of Cython (>0.27) when run on Python 3.5+. – Gauvin__file__
gives me "built-in" instead of the filename in Cython >0.29 on Python 3.7.0 – Demob