I am a newbie to Python.
I have two .py files: main.py and func.py. func.py has a function and main.py has a code calling the function. When I run it I got error message - "NameError: name 'print_ln' is not defined".
Anyone knows how to call a function which is not defined in the same .py file?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Note that this forum is not appropriate for questions related to how to program in python... Usually the python list is a better place (python-list@python.org) and they can point you to tutorials, etc.
Cheers,
Fabio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am a newbie to Python.
I have two .py files: main.py and func.py. func.py has a function and main.py has a code calling the function. When I run it I got error message - "NameError: name 'print_ln' is not defined".
Anyone knows how to call a function which is not defined in the same .py file?
You have to import it.
Note that this forum is not appropriate for questions related to how to program in python... Usually the python list is a better place (python-list@python.org) and they can point you to tutorials, etc.
Cheers,
Fabio