Here is my python code: /root/project/test.py
file = open('./test.txt', 'a')
file.write('Hello World\n')
file.close()
when I use crontab
* * * * * python3 /root/project/test.py
to run the python demo
I want the test.txt
to be created and writed in the /root/project/
but actually it is created and writed in the /root/
I am so sad. How can I do it without change the python code?