Hi all, Does pyext offer Python bindings for functions like canvas_getcurrentdir() from m_pd.h?
I looked at the source code and noticed that pyext appends the current directory to the Python search path, so that I get the current directory via sys.path[-1]. I'm a little worried, though, that this behavior may change in a future revision of pyext. Best, Peter
Hi Peter,
Am 11.03.2008 um 08:57 schrieb Peter Brinkmann:
Does pyext offer Python bindings for functions like
canvas_getcurrentdir() from m_pd.h?
currently it doesn't, but i'll see if i can add it
I looked at the source code and noticed that pyext appends the
current directory to the Python search path, so that I get the
current directory via sys.path[-1]. I'm a little worried, though,
that this behavior may change in a future revision of pyext.
You are right... it's not a good idea to rely on that, also because
any other Python script in the same process changing the path will
interfere with this assumption.
gr~~~
Hi Thomas, Thanks for your reply!
Does pyext offer Python bindings for functions like
canvas_getcurrentdir() from m_pd.h?
currently it doesn't, but i'll see if i can add it
That would be great. Not to seem greedy, but there are a few more functions in there that would be good to have, such as canvas_dspstate().
In addition (and almost more importantly), I would like to have pyext set the working directory of the Python interpreter to canvas_getcurrentdir() upon initialization. Best, Peter
Peter Brinkmann schrieb:
That would be great. Not to seem greedy, but there are a few more functions in there that would be good to have, such as canvas_dspstate().
Probably, i'll see what's possible.
In addition (and almost more importantly), I would like to have pyext set the working directory of the Python interpreter to canvas_getcurrentdir() upon initialization.
The problem is that there is only one interpreter per process and there can be multiple py/pyext instances, hence your wish can't be fulfilled.
gr~~~
Hi all,
I don't think it makes sense to have python's CWD follow that of the patch - what if there are two patches in different directories? It's probably better to make things explicit via canvas_getcurrentdir().
cheers Miller
On Tue, Mar 11, 2008 at 11:42:33AM -0400, Peter Brinkmann wrote:
Hi Thomas, Thanks for your reply!
Does pyext offer Python bindings for functions like
canvas_getcurrentdir() from m_pd.h?
currently it doesn't, but i'll see if i can add it
That would be great. Not to seem greedy, but there are a few more functions in there that would be good to have, such as canvas_dspstate().
In addition (and almost more importantly), I would like to have pyext set the working directory of the Python interpreter to canvas_getcurrentdir() upon initialization. Best, Peter
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list