File not opening | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

File not opening

#py3 #file is in my D: Drive password_file= open("jyyk.txt", 'r') passw= password_file.read(2) print(passw) password_file.close() #File location- D:\shaurya #Coding on website not on IDE

23rd Jan 2022, 11:19 AM
Shaurya Agarwal
Shaurya Agarwal - avatar
6 Answers
+ 1
i faced the same problem when i was a beginner, this is thw problem of code editor, open the complete folder of your project in your code editor and type. passfile = open (filename , 'r' , encoding= 'UTF-8' , errors='ignore')
25th Jan 2022, 7:17 AM
Saad Khan
Saad Khan - avatar
+ 1
Means should I use an IDE and provide it the complete path to my file @Saad Khan
25th Jan 2022, 7:21 AM
Shaurya Agarwal
Shaurya Agarwal - avatar
0
Give the absolute path to the file otherwise run python in same folder
23rd Jan 2022, 11:28 AM
Gayashan Pananwala
Gayashan Pananwala - avatar
0
@Gayashan Pananwla , Given the required info
24th Jan 2022, 4:26 AM
Shaurya Agarwal
Shaurya Agarwal - avatar
0
yup! use VS code, install it after watching tutorial from YouTube, because if you forgot to add VS code to file explorer, you wight encounter the same problem
25th Jan 2022, 7:23 AM
Saad Khan
Saad Khan - avatar
0
Thanks
25th Jan 2022, 7:27 AM
Shaurya Agarwal
Shaurya Agarwal - avatar