Importing variables from another file?

Ofek picture Ofek · Jun 23, 2013 · Viewed 348.8k times · Source

How can I import variables from one file to another?

example: file1 has the variables x1 and x2 how to pass them to file2?

How can I import all of the variables from one to another?

Answer

ennuikiller picture ennuikiller · Jun 23, 2013
from file1 import *  

will import all objects and methods in file1