About 50 results
Open links in new tab
  1. How do I call a function from another .py file? [duplicate]

    Note that file is one of Python's core modules, so I suggest you change the filename of file.py to something else. Note that if you're trying to import functions from a.py to a file called b.py, you will …

  2. Calling a Python function from another file - Stack Overflow

    Aug 18, 2015 · 1 The python interpreter does not find your module "helpers". With what operating system do you work? When you are under Unix/Linux or similar, and your files are in the same …

  3. Python 3: How to call function from another file and pass arguments to ...

    Sep 17, 2016 · I want to call a function from another file and pass arguments from current file to that file. With below example, In file bye.py I want to call function " me " from " hi.py " file and pass " goodbye …

  4. Python Calling Function from Another File - Stack Overflow

    May 4, 2017 · I am using Python 2.7 on Windows 7 Professional. I am trying to call a function saved in another file to run in this file's code. Function called dosomething is found in anotherfile.py anotherfile....

  5. How can I make one python file run another? - Stack Overflow

    How can I make one python file to run another? For example I have two .py files. I want one file to be run, and then have it run the other .py file.

  6. Python: Can't import a function from another.py file

    16 I have a file named handshake.py. Where there is a function send_data (argument). I want to import that function into another file named siptest.py. I am encountering two problems. I am using microsoft …

  7. python - how to call a function from another file? - Stack Overflow

    Oct 9, 2011 · Thank you, how can I call the if name__=='__main ': or is the only way to call it from the function? its fine, but when I do it I get errors about variables not being global, I can change it but …

  8. Call function from another file without import clause?

    Feb 7, 2021 · Is is possible to call a function from another file without placing from import clause? I'd like to write Python code shorter and cleaner here, so I'm curious if there is a way to do that. For exam...

  9. python - importing functions from another jupyter notebook - Stack …

    May 29, 2018 · The %run command tells the notebook to run the specified file and the -i option runs that file in the IPython namespace, which is not really meaningful in this simple example but is useful if …

  10. python - How to call a script from another script? - Stack Overflow

    134 Another way: File test1.py: print "test1.py" File service.py: import subprocess subprocess.call("test1.py", shell=True) The advantage to this method is that you don't have to edit an …