Skip to content
← Back to Community
Solved : How to locate files in folders???
Profile icon
RomanKubiv

https://repl.it/@RomanKubiv/DarkseagreenExcitingOmnipage (a test repl in which i was trying to figure this out)

how do you reference files from within your code?
eg (the link above) how would i print out the contents of the file called File???

(ik this is realy simple but i cannot find the answer anywhere and the built in repl manual doesent help.)

Thanks

Edit : add a dot to the begining of your path. Eg ". //folder//file

Voters
Profile icon
235baron
Profile icon
AlanaReyna
Profile icon
MatthewWhite5
Profile icon
mrajkondawar
Profile icon
RomanKubiv
Comments
hotnewtop
Profile icon
gautam235

Have you found a solution to this?

Profile icon
RomanKubiv

@gautam235 yes look at the edit

Profile icon
madmonster

Maybe repl.it python files can only open files in its directories?

Profile icon
Geocube101

That's almost correct. Your using the wrong slash.
Should be / not \