t 'Hello'
> print globals()['infile']
> print zipfile
>
>
> Calling test_exec.py results into this output:
>
> ./test_exec.py
> Read from globals: /data/S0012230_0010.ZIP
> Read from zipfile: /data/S0012230_0010.ZIP
>
>
> It
>
>
I have a python script in production doing what you want using smtplib
and it works perfectly. Send us your code and the errors you are getting.
Regards.
--
Marcelo Ramos
Fedora Core 5 | 2.6.16
Socio UYLUG Nro 125
--
http://mail.python.org/mailman/listinfo/python-list
# Make directory for unzipping
> os.mkdir(zipBase)
>
> # Move the zip file to the subdirectory
> shutil.move(zip, zipBase)
>
> # Make system call "unzip"
> subprocess.Popen(["unzip", zipBas
The fixed line is:
execfile('/scripts/second.py', globvars, locvars)
What you want is the function globals().
Try putting this line in second.py:
print globals()['infile']
Using the dictionary returned by globals() you can make second.py to
read the contents of testexec.py's globvars dictionary.
locvars is populated with the local variables of second.py and that is
what you want.
Regards.
--
Marcelo Ramos
Fedora Core 5 | 2.6.16
Socio UYLUG Nro 125
--
http://mail.python.org/mailman/listinfo/python-list
ssing when I am embedding my
> python script in the C code the local directory is no longer the
> directory where my C code resides. How can i tell python to load the
> module from my current local directory?
>
>
Try adding the directory where your mymodule module lives to the