Problems with import

2007-12-04 Thread alexLIGO
Hi,

I have some problems when importing a library. Suppose I have a
directory /home/user/pythonlib/package in which I have a python-
library called test.py. Now I want to import that, so I put the
following directory into the PYTHONPATH: /home/user/pythonlib and in
my main python script I put:

from package import test.

BUT I get an error:

ImportError: cannot import name test

So how can I test and check what is going on, why python does not find
the library?


Thanks
  Alex
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Save/Store whole class (or another object) in a file

2006-10-25 Thread alexLIGO
Hi,

Fredrik Lundh wrote:

 [EMAIL PROTECTED] wrote:

  thanks for the reply,but unfortunately this does not work with the type
  of classes I am dealing with. When trying to pickle the class I get the
  following error:
 
   File /usr/lib/python2.4/copy_reg.py, line 76, in _reduce_ex
  raise TypeError(a class that defines __slots__ without 
  TypeError: a class that defines __slots__ without defining __getstate__
  cannot be pickled
 
  So there is something missing in this class?

 did you remember to read the error message before posting ?


of course I read the error-message, I understand the error-message, BUT
this message is not telling me how anyway to save the data of such a
class in a file!  It does not tell me, that there is absolutely no way
to do that. Maybe there is, maybe there is not.
Thats why I am posting it here!

Alex

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Save/Store whole class (or another object) in a file

2006-10-18 Thread alexLIGO
Hi,

thanks for the reply,but unfortunately this does not work with the type
of classes I am dealing with. When trying to pickle the class I get the
following error:

 File /usr/lib/python2.4/copy_reg.py, line 76, in _reduce_ex
raise TypeError(a class that defines __slots__ without 
TypeError: a class that defines __slots__ without defining __getstate__
cannot be pickled

So there is something missing in this class? Or any other idea how to
do this?

Alex


Sybren Stuvel wrote:
 [EMAIL PROTECTED] enlightened us with:
  is it possible in python (with/without matplotlib, numpy etc) to
  store a whole class with its data into a file

 Check out the pickle module.
 
 Sybren
 -- 
 Sybren Stüvel
 Stüvel IT - http://www.stuvel.eu/

-- 
http://mail.python.org/mailman/listinfo/python-list


Save/Store whole class (or another object) in a file

2006-10-17 Thread alexLIGO
Hi,

is it possible in python (with/without matplotlib, numpy etc) to store
a whole class with its data into a file, instead it to reconstruct
every time again? So is there an analogous to the matlab functions
load/save available?

Thanks
  Alex

-- 
http://mail.python.org/mailman/listinfo/python-list


How to get the output from os.system() into a variable?

2005-10-05 Thread alexLIGO
Hi,

I would like to execute some command in python on the bash, e.g.

os.system('globus-job-run mike4.cct.lsu.edu/jobmanager-pbs -l
/bin/date')

and want the result of the output in a vector, so something like:

result=python_command(' command_on_the_bash ')

Is that possible? And how to do that?

Thanks
Alexander Dietz

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to get the output from os.system() into a variable?

2005-10-05 Thread alexLIGO
Hi,

thank you very much for your tipps. I get it to work!

Alexander

-- 
http://mail.python.org/mailman/listinfo/python-list


visit_decref: Assertion `gc-gc.gc_refs != 0' failed.

2005-09-05 Thread alexLIGO
Hi,

I got this error when trying to execute the following python command
with in a C module:  Py_BuildValue

Do anyone have any idea what this error is about?
And does anyone have any idea how to debug a python script?

Thanks
Alexander

-- 
http://mail.python.org/mailman/listinfo/python-list


Problems with os.system

2005-09-02 Thread alexLIGO
Hi,

I am trying to run a python script that executes several other programs
on the bash (under linux) and reads some of the output of those
programs. This works fine for a couple of os.system() calls, but then
it does not work anymore. os.system() returns always -1, but when
executing exactly the same program directly on the linux-bash it works!

Could this be a memory problem? It happens when there is much data
stored in a python list. How can I check the memory usage in my python
script? Can I force python to execute the program on the bash? What can
I do?

I would very appreciate help in that.

Alexander

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Problems with os.system

2005-09-02 Thread alexLIGO
No I read some other data files that has been created by the other
program. I am not interested in the stdout or err of that program...

-- 
http://mail.python.org/mailman/listinfo/python-list