commands.getoutput("touch /mytxt.txt")
x="hello"
commands.getoutput("echo x | cat >> /mytxt.txt".format(x))
I tried to run this code in python live interpreter , it runs perfectly ,data is inserted into the file. but when i put this code in python program it shows no such file and directory. but file mytxt gets created into the / folder