I have the following lines:
#!/root/p34/bin/python
import os
import sys
for i in range(10):
print(i)
currentFile = os.path.abspath(__file__)
print(currentFile)
os.execv(currentFile, sys.argv)
When I try to run from console(Ubuntu 14.04) ./restart.py I get:
': [Errno 2] No such file or directory'
When I run /root/p34/bin/python restart.py
I get python error:
Traceback (most recent call last):
File "restart.py", line 10, in <module>
os.execv(currentFile, sys.argv)
FileNotFoundError: [Errno 2] No such file or directory
Can anyone help me with this problem?