Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Comments on How and where does Python code start running? How can I control that?
Post
How and where does Python code start running? How can I control that?
+6
−0
Suppose I have some code in a file myscript.py
like:
def my_function():
print("Test")
What steps do I need to take in order to make my_function
run? That is to say: how do I get Python to run myscript.py
; and from there, how do I choose my_function
as the starting point for the code? In particular, do I need to use a specific name for my starting function (such as main
, as seen in some other programming languages)?
1 comment thread