Python Forum
Accessing Files via Mobaxterm - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Accessing Files via Mobaxterm (/thread-15466.html)



Accessing Files via Mobaxterm - Omer123 - Jan-18-2019

[align=left]Hello, I have problems with accessing files through a code via mobaxterm:
The code takes a txt file as an input, and outputs an output txt file as an output
My code goes something like this:
import sys
import os
functions blah blah
file_output = open(sys.argv[2], "w")
file_input = open(sys.argv[1], "r")
os.chmod(sys.argv[2], 0o777)[/align]
Now, whenever I try to run the program with mobaxterm I get this message (movie.txt) is the input file:
https://imgur.com/a/FV759B7
What's wrong here? what do i need to do?


RE: Accessing Files via Mobaxterm - micseydel - Jan-23-2019

The error seems pretty self-explanatory to me, it can't find the file. You need to either move the file to the same directory as where you're running the Python script, or provide the full path.

Also, in the future, please copy-paste the full error message rather than provide a screenshot.