+ 1
What is current working directory of this app coz I m unable to import file.
How to import file in py of sololearn ide https://code.sololearn.com/c28uFEnnvmP1/?ref=app
7 Respuestas
+ 3
you didnt called the function use os.getcwd(). you forgot the brackets. Also if you are having trouble using file in python you can put the required file in the root directory of python script or you can write full path to the file in your script using double slashes or raw string
+ 1
But I dont know what are my root directories??
+ 1
After calling function, the output is not desirable...
Plz help
+ 1
are you using any specific ide? Root directory is the one where your python script file is located, so if you are using any specific ide you can check from there where the file is saved or as I said above use getcwd() with brackets and it will work
+ 1
I'm using sololearn ide in android. And getcwd() is only showing '\' this
+ 1
Why and what kind of file do you want to use in sololearn? I dont think you can do that in sololearn.
+ 1
I want to use txt file. Just for trying os module