May-08-2019, 12:02 PM
Hello all,
First time on this forum and new to Python (which I am studying in my old age specifically for data analysis and machine learning).
I got myself a couple of courses to get started. I am working my way through a data visualisation with matplotlib using the anaconda install and the Spyder editor (as is prescribed in the course). I am doing fine with the actual code and examples but I am really lost when it comes to referring to files outside the immediate directory (C:\Users\name\.spyder-py3 in my case. The course is great bu the instructor keeps accessing files using commands such as
For example, I have the course of an external hard dish mapped to say, G:\. The full path of the file is, say G:\Python course\Data Files\File.txt . Using that full path in a Spyder command line yields and error. I don't seem to find the right syntax for accessing the file using the full path (maybe spaces are an issue, maybe it just can't be done like that...I just don't know).
Sorry for this very basic question, but if someone could give me some pointers, that would be brilliant.
Thank you all
Chris
First time on this forum and new to Python (which I am studying in my old age specifically for data analysis and machine learning).
I got myself a couple of courses to get started. I am working my way through a data visualisation with matplotlib using the anaconda install and the Spyder editor (as is prescribed in the course). I am doing fine with the actual code and examples but I am really lost when it comes to referring to files outside the immediate directory (C:\Users\name\.spyder-py3 in my case. The course is great bu the instructor keeps accessing files using commands such as
with open("File.txt","r") as shortnamein which File.txt is assumed to be in the local directory. I did copy the files I need to access in the local directory described above, out of sheer frustration, but I just couldn't couldn't access them on remote directories.
For example, I have the course of an external hard dish mapped to say, G:\. The full path of the file is, say G:\Python course\Data Files\File.txt . Using that full path in a Spyder command line yields and error. I don't seem to find the right syntax for accessing the file using the full path (maybe spaces are an issue, maybe it just can't be done like that...I just don't know).
Sorry for this very basic question, but if someone could give me some pointers, that would be brilliant.
Thank you all
Chris