Can't seem to run multiple python files in one project
sodalover

I have two .py files in my project. The first file, main.py ran 100% fine. I added a second file, hell.py, which only has print('hello') in it. When I switch the file viewer to hell.py, clicked run, and the console only displays the output of main.py, but does not display 'hello'. Why can't I get 'hello' to show up?

You are viewing a single comment. View All
Answered by Geocube101 [earned 5 cycles]
View Answer
Stan085

you can also use exec(open("hell.py").read()) (this would be useful if you have a variable named hell, because import would override it, and this also saves some memory space)