+ 2

Where is the location of text files?

Okay so we have to type in the name of the txt file but where is it's location? If we are gonna make a txt file and store it somewhere from where u can run it in your python code. Where will it be?

5th Oct 2019, 4:01 PM
Thashreef Mohammed
Thashreef Mohammed - avatar
3 ответов
+ 2
If you're speaking of loading text files from a program, then usually, by default your program will look in the place from where it was started. You can change that by modifying path (check os module) or by writing the place into your open command, like: open('c:/users/you/desktop/blabla.txt')
5th Oct 2019, 6:31 PM
HonFu
HonFu - avatar
0
Oh cool, now i get it.. thnx
6th Oct 2019, 3:58 AM
Thashreef Mohammed
Thashreef Mohammed - avatar