Robert Berman wrote:
I have a number of functions written in a python script called script1.py. In another script, script2.py, I need to use a number of the functions residing in script1.py. How do I make these functions known to script2.py.

Thank you,

script1.py:

def f(n):
  return n + 1



script2.py:

import script1

y = script1.f(3)


(I would suggest to use more meaningful names than scriptX.py)

Sincerely,
Albert
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to