I simply need to run the python[V:2.6] script as ./test.py. The output of print(a) which is 'hello world', should be saved into "file.txt" how can i do this inside the python script? I know,
./test.py > file.txt
test.py
#!/usr/bin/python
a = 'hello world'
print(a)
f = open('/root/file.txt', 'w')