Python: opening files on computer

any file I try to open is always undefined… I have tried to put them in the same folder also with no luck opening them from there. I have tried to make my own excel spreadsheet and saved it as . csv file extension. I have tied to get a path to have the actual path… I use both pycharm and Visual Studio Code. How in the world if someone send you a folder or project to work on, could you ever make this happen?
Is there somewhere I can go that really helps with this? YouTube don’t seem to have it… Thanks to Anybody…


Welcome to forums

Can you share screenshot how you are giving a try and getting error?


Well you need to use specific commands to open certain files, depending on their extension.
You cannot just “open” an excel spreadsheet or csv - you need to use a specific command designed to actually read whatever is inside. It’s just like how you need a specific program to open those files in the first place. Can’t open an excel document with paint.

For example pandas.read_csv("filepath") for csv.

For further help please provide some example code.

1 Like

Hello… thanks for responding. Just got in and will put together some screen shots with code tonight… thanks again

Thanks for your answer. just got back and will put together some screen shots and code. Thanks again… will get back shortly.

I’m not sure why it would work before in VS Code, but I got the excel sheet which I converted into a CSV file to work today… I watch Mike Dane again, but this time it worked.

the csv file create from excel.excel_to_csv_file

I’m assuming you can see the screen shot I uploaded, and for some reason after putting the csv file i made from excel into the same folder again (Visual Studio Code) I now could read it. How ever I will look up pandas and take your advise… thank you for helping…