Ask coding questions

← Back to all posts
Solved : How to locate files in folders???
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
MatthewWhite5
mrajkondawar
RomanKubiv
Comments
hotnewtop
gautam235

Have you found a solution to this?

RomanKubiv

@gautam235 yes look at the edit

madmonster

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

Geocube101

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