Re: calling Python script from another Python script (Windows, multiple installation problem)

2014-03-26 Thread Martin Landa
Dne středa, 26. března 2014 13:54:02 UTC+1 Chris Angelico napsal(a): > On Wed, Mar 26, 2014 at 11:49 PM, Martin Landa wrote: > > > # get full path including file extension for scripts > > > fcmd = get_real_command(args[0]) this function returns

Re: calling Python script from another Python script (Windows, multiple installation problem)

2014-03-26 Thread Martin Landa
Dne středa, 26. března 2014 13:29:47 UTC+1 Martin Landa napsal(a): > not really, I am just searching for a better solution based on virtualenv or > something similar... particularly I am using something like if sys.platform == "win32": # get full pat

Re: calling Python script from another Python script (Windows, multiple installation problem)

2014-03-26 Thread Martin Landa
Hi, > it should be possible to specify the path of the desired python > > interpreter along with the executed script as an argument to > > Popen(...). This should make the selection of the used python > > explicit. > > Or are there any other disadvantages of the current approach, which > > y

calling Python script from another Python script (Windows, multiple installation problem)

2014-03-26 Thread Martin Landa
Hi all, I am trying to fix a bug in the project which I am working for. The program starts on Windows via bat file which calls a Python script to set up the environment including GUI and allow to launch program-specific tools. Some of the tools are written in C, some in Python. These commands a

ctypes: catch system exit from C library

2011-11-03 Thread Martin Landa
Hi all, in my python application I am calling functions from a C library via `ctypes` interface. Some fns from that C library calls `exit()` on error. It causes that the python application crashes even without any notification. Is it possible to catch library system exit calls from such python app

send command to parent shell

2010-10-13 Thread Martin Landa
Hi, is there a way how to send command from python script to the shell (known id) from which the python script has been called? More precisely, the goal is to exit running bash (on Linux) or cmd (on Windows) directly from wxPython application, currently user needs to quit wxPython application and

Re: ctypes: pointer to method

2010-08-08 Thread Martin Landa
On Aug 7, 12:46 pm, Martin Landa wrote: > the problem occurs when restype is not None, but c_int. E.g. solved. Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: ctypes: pointer to method

2010-08-07 Thread Martin Landa
Hi, On Aug 5, 9:32 pm, Nobody wrote: >         errtype = CFUNCTYPE(c_int, POINTER(c_char), POINTER(c_int)) >         errfunc = errtype(print_error) >         G_set_error_routine(errfunc) the problem occurs when restype is not None, but c_int. E.g. if hasattr(_libs['grass_gis'], 'G_set_error_rou

Re: ctypes: pointer to method

2010-08-06 Thread Martin Landa
Hi, On Aug 6, 10:10 pm, Martin Landa wrote: > Any idea how to solve it. Thanks, Martin I overlooked note """ Make sure you keep references to CFUNCTYPE objects as long as they are used from C code. ctypes doesn’t, and if you don’t, they may be garbage collected, crashing y

Re: ctypes: pointer to method

2010-08-06 Thread Martin Landa
Hi, On Aug 5, 9:32 pm, Nobody wrote: > I don't know about methods, but it works for functions. > > > Sample code: > > >     ... > >     G_set_error_routine(byref(self._print_error)) > > This won't work; you have to be more explicit, e.g.: > >         errtype = CFUNCTYPE(c_int, POINTER(c_char), PO

ctypes: pointer to method

2010-08-05 Thread Martin Landa
Hi, is it possible to pass pointer to a method using ctypes. Sample code: ... G_set_error_routine(byref(self._print_error)) ... def _print_error(self, msg, type): """!Redirect stderr""" self.log.write(msg) gives me G_set_error_routine(byref(self._print_error

python extension dynamic linking

2008-09-01 Thread Martin Landa
Hi, I am writing Python extension in C++, in this extension I am using methods from another Python extension. On Linux I am currently linking my extension with used Python extension -- what is quite ugly. gcc ... -lgdi where gdi is a link to C++ extension imported by 'module' I would like to av

string conversion latin2 to ascii

2007-11-27 Thread Martin Landa
2) to get -> Ukazka_moznosti_vyuziti_programu_OpenJUMP_v_SOA Thanks for any hits! Regards, Martin Landa -- http://mail.python.org/mailman/listinfo/python-list