I want to store some data and allocate some variables for it. This variable should be accessible from another python file.
FILE 1
server_ip ="BLAH"
pswd ="BLEH"
FILE 2
server = // server_ip of file 1
password = /pswd of file 1
Depending where is file1.py. If it's in the same directory, use
import file1
server = file1.server_ip
password = file1.pswd
If it isn't in the same directory, try:
import sys
sys.path.append(r"whatever\the\path\to\file1\is")
import file1
server = file1.server_ip
password = file1.pswd