I have a library that I use from python . Interaction according to this scheme .
The problem is this: the python process works with superuser rights, but the library functions from the library that are called by this process work without superuser rights, and therefore return an error.
How to be in this situation?
Update: I work with django . Initially I tried to run compiled object files from python - it works as it should.
But in views.py
tried to call it using different methods (for example, such ) - it didn't work out:
[Errno 2] No such file or directory
although the object file is in the same directory as views.py
.
sudo python file.py
I determined it simply - I ran the Python code, which calls the sishny both with the superuser's rights, and without it, and received many times the same error result. - Vladislavfoo.so
file, withfoo
foo.so
for Python, which is simply imported:import foo
2.libfoo.so
Sishnaya library that you want to use with ctypes, cffi 3../foo
executable file that you can run usingsubprocess
module. - jfs