Re: Threading and GIL

2009-05-07 Thread googler . 1 . webmaster
hey, thanks, that works fine. I wrapped it around, done a lot of tests and it works fine. Just had done a few other things to make it stable. cheers. -- http://mail.python.org/mailman/listinfo/python-list

Re: Threading and GIL

2009-05-07 Thread googler . 1 . webmaster
Hi, thats the reason why its not working. Imagine the end() method of the thread object is called so the C++ Function is opened where the code for this method is in. At a line the Code ...->End() is called which waits that the C++ Thread class is finished. BUT here is the problem: In the Method o

Threading and GIL

2009-05-06 Thread googler . 1 . webmaster
Hi! I have a big problem I can't solve and I hope anyone of you can help me. I use the Python C API and in C++ I have a class which represets a thread object, similiar to the thread class of the known Python Thread class but with some needed additions so thats the reason why I have to built my own

Re: Interrupt Python C API

2009-04-16 Thread googler . 1 . webmaster
On 16 Apr., 11:08, Piet van Oostrum wrote: > > googler.1.webmas...@spamgourmet.com (g1w) wrote: > >g1w> hi, yes, thats true, Alan Touring told us, so it would be nice to let > >g1w> the user abort it. > >g1w> Is there a chance for windows, too? > > I don't know. I have no access to Python on W

Re: Interrupt Python C API

2009-04-15 Thread googler . 1 . webmaster
hi, yes, thats true, Alan Touring told us, so it would be nice to let the user abort it. Is there a chance for windows, too? -- http://mail.python.org/mailman/listinfo/python-list

Interrupt Python C API

2009-04-14 Thread googler . 1 . webmaster
Hi, I just have a design problem and don't know how to solve it. I call a function which executes a simple "PyRun_String(...)" command. imagine the script while 1: pass is executed so the app would hang. Is there any chance to break out this PyRun_String-function? I just searched the forums for t

Re: PyEval_EvalCode(...) problem

2009-03-10 Thread googler . 1 . webmaster
http://rafb.net/p/Uyb5Ps45.html Pelase note, when I call PyObject_CallObject(...) in the wrapped C register(..) method it works fine. -- http://mail.python.org/mailman/listinfo/python-list

PyEval_EvalCode(...) problem

2009-03-10 Thread googler . 1 . webmaster
Hi! I have a problem with PyEval_EvalCode(...) I compile the following code and execute them with PyEval_EvalCode (...) class MyClass(mod.Upper): pass register(MyClass) #just the type, not the instance Thats all. So register(...) is a Python C API method so i take the type and store it in

Re: ImportError in embedded Python Interpreter

2009-01-30 Thread googler . 1 . webmaster
Hi! Okay, thats just the question. I did that what you wrote but it doesn't really works. What is, if Py_SetProgramName() gets a NULL Pointer, if argv[0] is empty? Well, the problem is, in my opinion that os.environ returns some paths in python.exe and in my embedded interpreter if I call os.envi

Re: ImportError in embedded Python Interpreter

2009-01-30 Thread googler . 1 . webmaster
Hi! Thanks. Well, os.py is found and all the others which don't need a library. I tested this: I execute Py_Main(...) in my app which executes the console interpreter and i tried to execute "import socket" which works. So Py_Main has something what my created PyRun_SimpleString doesn't have. Ma

Re: ImportError in embedded Python Interpreter

2009-01-29 Thread googler . 1 . webmaster
Hi! Okay, I checkede Py_Main(...) and called some python code there. There it works too. So I know whats missing. sys.environ.. returns nothing. How can I set the paths with the Python C API? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

ImportError in embedded Python Interpreter

2009-01-29 Thread googler . 1 . webmaster
Hi, i have a problem. I compiled Python and the socket module so I got this structure. (all on windows) C:\test\dll_files\python25.dll C:\test\my_app C:\test\dll_files\DLLs\ C:\test\dll_files\python.exe If I run python.exe I get the console and I can call "import socket" which succeeds. I wrote

ImportError in embedded Python Interpreter

2009-01-29 Thread googler . 1 . webmaster
Hi, i have a problem. I compiled Python and the socket module so I got this structure. (all on windows) C:\test\dll_files\python25.dll C:\test\my_app C:\test\dll_files\DLLs\ C:\test\dll_files\python.exe If I run python I get the console and I can call "import socket" which succeeds. I wrote a sm

Re: Python C API (PyObject_CallMethod clear object)

2009-01-26 Thread googler . 1 . webmaster
the hook is, how to delete the locals of this function, maybe thats a workaround? thanks and bye. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python C API (PyObject_CallMethod clear object)

2009-01-26 Thread googler . 1 . webmaster
On 26 Jan., 03:25, "Gabriel Genellina" wrote: > En Sun, 25 Jan 2009 23:46:01 -0200,   > escribió: > > > > > I have a problm with deallocating stuff. I call a function with this > > command: > > > PyObject *rvalue = PyObject_CallMethod(obj, "execute","",NULL); > > > if(rvalue==NULL) > >     PyErr_

Python C API (PyObject_CallMethod clear object)

2009-01-25 Thread googler . 1 . webmaster
Hi! I have a problm with deallocating stuff. I call a function with this command: PyObject *rvalue = PyObject_CallMethod(obj, "execute","",NULL); if(rvalue==NULL) PyErr_Print(); else Py_DECREF(rvalue); Can it be, that something is missing here? Imagine I allocate an object of a type: t

Re: MaxInt on Vista-64bit?

2009-01-24 Thread googler . 1 . webmaster
Hi! Thanks for the fast answer. Yes, its enough but I never thought that Vista64 is not a real 64-bit operating system :-o. -- http://mail.python.org/mailman/listinfo/python-list

MaxInt on Vista-64bit?

2009-01-24 Thread googler . 1 . webmaster
Hi! I downloaded Python64 for Windows Vista64 but the value returned from sys.maxint is just a 32bit integer. I found out, thats by design, Microsoft decided to make the long value 32bit. What can I do to compile python 2.6 with maxint of 64bit integers? Can I replace the int values to a int64 va

Re: Python 2.6.1 @executable_path

2009-01-12 Thread googler . 1 . webmaster
Hi! Woow, thanks. The unix command install_name_tool solved my problem. Thanks a lot. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.6.1 @executable_path

2009-01-11 Thread googler . 1 . webmaster
yeap, okay, its just the beginning so I didn't know that the framework is still the dylib file. Well, I only want to compile python and put the framework in the subdirectory. Thats all. And the current state is, that the framework is not found because the path of the compiled Python library is hard

Re: Python 2.6.1 @executable_path

2009-01-11 Thread googler . 1 . webmaster
Thank you, I found PySys_SetPythonHome() to set the path where the lib folder of Python is, but I guess they are not really implemented because they are fixed compiled with an absolute path, aren't they? Thats the problem. I hadn't compiled Python and I don't know if I should compile it as a dylib

Re: Python 2.6.1 @executable_path

2009-01-11 Thread googler . 1 . webmaster
Hi! :) Thank you. I found PySys_SetPythonHome() to set the path where the lib folder of Python is, but I guess they are not really implemented because they are fixed compiled for an absolute path, aren't they? Thats the whole problem. Do you have a suggestoin for the command line how I can build

Re: Python 2.6.1 @executable_path

2009-01-10 Thread googler . 1 . webmaster
hmm.. very strange. Is it so complicated to compile python that I can move the framework to the app folder? hmm. thats really strange :-( /myapp.app /subfolder/Python.framework any suggestions? Thank you very muc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.6.1 @executable_path

2009-01-10 Thread googler . 1 . webmaster
Thanks for the link but I don't want to do a make a python script as an applicatin, I want to embedd python into a C++ app so thats the reason why I have to compile Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.6.1 @executable_path

2009-01-10 Thread googler . 1 . webmaster
I want to embedd it into my app so on the 'customers'-mac I want to put python into a subdirectory of my app. and with the configure command above, that will not work because the library has to be on every system in /Library/Framework/ so I found out that @executable_path is replaced by the path o

Re: Python 2.6.1 @executable_path

2009-01-10 Thread googler . 1 . webmaster
I want to embedd it into another app so on the 'customers'-mac I want to put python into a subdirectory of my app. bye -- http://mail.python.org/mailman/listinfo/python-list

Python 2.6.1 @executable_path

2009-01-10 Thread googler . 1 . webmaster
Hi! I asked something similar a few days ago. Is it possible to compile Python 2.6.1 with a dynamic path on Mac OSX Leopard 10.5.x. I found out that I could use @executable_path but I don't know how the configure command would look like. This is my current configure command for the default /Libra

Python 2.6.1 @executable_path

2009-01-10 Thread googler . 1 . webmaster
Hi! I asked something similar a few days ago. Is it possible to compile Python 2.6.1 with a dynamic path on MacOSX? I don't know how the configure command would look like. This is my current configure command for the default /Library/ Frameworks/ path: ./configure --with-framework-name=Python --

Python 2.6.1 @executable_path

2009-01-10 Thread googler . 1 . webmaster
Hi! I asked something similar a few days ago. Is it possible to compile Python 2.6.1 with a dynamic path? I don't know how the configure command would look like. This is my current configure command for the default /Library/ Frameworks/ path: ./configure --with-framework-name=Python --with-unive

Re: Python 2.6 fails on compiling > Bug report

2009-01-09 Thread googler . 1 . webmaster
Hi! :) >Sorry, there were a few line wrap-arounds in the diff file due to long >lines but the changes for the four significant lines should be easy to >do manually. Hadn't done that before but I found a ressource how to read that syntax. x86_64 would be enough. i test that again. Thank you. :) -

Re: Python 2.6 fails on compiling > Bug report

2009-01-09 Thread googler . 1 . webmaster
hi, thanks for your help. May the diff file is wrong? on my system it doesn't work. Well, set the -enable-universalsdk= path occurs that error. Hmm. that is really a disaster, isn't it :( hm. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.6 fails on compiling > Bug report

2009-01-09 Thread googler . 1 . webmaster
Hi! I didn't wanted to post 11.000 Lines here, so I uploaded it here: http://rapidshare.com/files/181425216/config.log.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.6 fails on compiling > Bug report

2009-01-09 Thread googler . 1 . webmaster
hm... any ideas? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.6 fails on compiling > Bug report

2009-01-08 Thread googler . 1 . webmaster
Hi searched for "Library/Frameworks/" in the config file and edited it to "@executable_path". Well my configure and make command worked very fine. Just 'make install' aborted after this error message. test -d "/Applications/Python 2.6" || mkdir -p "/Applications/Python 2.6" test -d "/Application

Python 2.6 fails on compiling > Bug report

2009-01-08 Thread googler . 1 . webmaster
Hi! I compiled Python 2.6.1 on a Mac OSX 10.5.5 Intel machine with this configure command and got this message FAILS: ./configure --with-framework-name=Python --with- universal-archs=all --enable-framework --enable- universals...@executable_path/my/path/to/app WORKS: ./configur

Compile as static library

2009-01-06 Thread googler . 1 . webmaster
Hi! I have a big problem with compiling Python on MacOSX. I compile it - everything works ./configure make so I get a libpython2.5.a file which I include into a Xcode Project. I want to static link it with my project (works in Debug mode but not in Release) 1. Is there a static library flag whi

Re: Python with PyGIL_Ensure?

2008-12-25 Thread googler . 1 . webmaster
and merry christmas :) -- http://mail.python.org/mailman/listinfo/python-list

Python with PyGIL_Ensure?

2008-12-25 Thread googler . 1 . webmaster
Hi! I have a small problem with my python embedded interpreter. I do some stuff where two threads exists which do some pythons stuff in the same stuff. So bpoth call PyGILState_Ensure() which occurs a crash. What can I do, that one thread waits until the other thread released the gil state? Than

Re: Python C API

2008-12-05 Thread googler . 1 . webmaster
Hi! Any ideas? Thanks, :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python C API

2008-12-05 Thread googler . 1 . webmaster
Hi! thats a very interesting point and good to know. I have to release the GIL but how do I do? In this case i need PyEval_AcquireLock and PyEval_ReleaseLock? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Python C API

2008-12-05 Thread googler . 1 . webmaster
Hi :) I have a main() function of my app which intializes the Python Interpreter and some other stuff. When I am finished I call: PyGILState state = PyGILState_Ensure() //call PyRun_String() PyGILStateRelease(state); The first question is, I found out the API contains other commands lik PyEval_A

Re: Python Embedding Thread

2008-07-22 Thread googler . 1 . webmaster
Hi! I fixed the code. This code snippet runs in a seperate thread: PyObject *dict=NULL; PyGILState_STATE state = PyGILState_Ensure(); dict = CreateMyGlobalDictionary();

Re: Python Embedding Thread

2008-07-21 Thread googler . 1 . webmaster
Hi! Thank you very much for your answers. I have a menue with a script in it. So my app starts a new thread for each script. So I would like to run two scripts all the same time. Could someone give me a tip, what I have to set in my code? Thank you :) -- http://mail.python.org/mailman/listinfo/p

Re: Python Embedding Thread

2008-07-21 Thread googler . 1 . webmaster
Does anyone has a tip? -- http://mail.python.org/mailman/listinfo/python-list