r/learnpython • • Jan 08 '23
*urgent ish*
I don’t have a scoobie what’s wrong here, been coding a couple months (not a crazy am tho as have been away) And completing free conde camp p4e course, and gunna move on to other after
And I’m tryna get this thing open but aprently it’s not in the dorectory Wich I think it is…. Please.. need help
Thanks (Excuse my shyte spelling)
(Using vs code) - on the left it says (where my file is)
EX.07-01 ex_07-01.py Workfile.txt
I’m tryna get work file to open
My code is just
F = open(‘workfile.txt’) For line in f: Print(f)
Thnx
0
Upvotes
View all comments
Show parent comment
3
u/Diapolo10 I write code for a living -- https://github.com/Diapolo10 Jan 08 '23
That's not necessary,
opendefaults to'rt'mode. You only need to change the mode if you want to write, or process the file as bytes.