You are not logged in.

#1 2009-08-24 21:46:56

B4RR13N705
Member
Registered: 2009-06-08
Posts: 87

Importing variables to a python script

Hi, i have a doubt.
For example:
i have a *.py file that contains:

a = 1
b = 2
c = 3

and i want to import this variables into another script, so, for the new script, a = 1, b = 2, etc
Is there any way?


OS -----> Arch Linux     DE -----> KDE4
CPU ---> 2.66GHz         RAM ---> 512 MB
SWAP -> 2 G                / -------> 10 G
/home -> 50 G             /boot ---> 64 MB

Offline

#2 2009-08-24 22:58:06

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Importing variables to a python script

from firstscript import a,b,c

or from firstscript import *, but don't do that.

Offline

Board footer

Powered by FluxBB