Hi, can someone help me, please? I am using the code playground, on python, and was wondering if you could import modules, and functions from those modules into another python file. Can you import things from your own computer (not in sololearn), do you have to export everything in order to import?
3/12/2021 9:25:15 AM
Kamil Hamid2 Answers
New AnswerYou simply create a file, and import anything from it in another file with exporting. It won't work on sololearn !
s = ''' def greeting(name): print(f'Hello {name}, how are you?') ''' with open('mymodule.py','w') as f: f.write(s) import mymodule mymodule.greeting('John')
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message