How to run new file .
Hi..
May be silly Question...
But I m serious..
I want to make new file like test.py.
When i push Run Button, every time main.py file run.
How can I run my test.py file?
Thank you..
There are a couple ways to do this. The best way is to add import
statement to line 1 on main.py
. Import statements basically allow you to take variables, functions and classes from another file to your file, but as a side effect, it also runs it. An import statement, on its own line, is the word import
followed by a space, then the filename without the .py
extension.
So if you wanted to run ggg.py
, type import ggg
, or if you wanted to import ttest1.py
, type import ttest1
.
Thank you very much @drwhonerd99..
I solved the problem...
Thanks...
@choisangyeon You are very welcome! Happy coding!
Hi @drwhonerd99.
I have one more Question.
How to run a file under new fold?
Thanks
I tested your answer and it doesn,t work!
Why?
This file cannot be displayed: