Re: exec a string in an embedded environment
I can't post that much of what I have done but some questions might answer if you e-mail me the question to my gmail.com address. [EMAIL PROTECTED] //Tommy -- http://mail.python.org/mailman/listinfo/python-list
Re: exec a string in an embedded environment
No it didn't help me :( the foo_ptr that is returned from PyRun_String is not a callable object. Therefor I can't call it from PyObject_Call. I would like to do the exact same procedure as I do when the code is located in a module (file). pModule = PyImport_Import(pName); Py_DECREF(pName); if (pModule != NULL) { pFunc = PyObject_GetAttrString(pModule, inArg->funcName); /* pFunc is a new reference */ if (pFunc && PyCallable_Check(pFunc)) { It must be possible to import a module written inside a string with a similar approach. The ultimate solution would be to change the PyImport_Import() call to something that creates an object from a string Now some of you think why not have the code inside a file. We need to create encrypted script files, thats why. I hope someone can help me //Tommy -- http://mail.python.org/mailman/listinfo/python-list
Re: Getting Python Accepted in my Organisation
I have done the same thing in my organisation. Show them concrete examples of when they can benefit from Python to Convince them. My colleagues and bosses has been conviced and therefore my current work task is to integrate the interpreter in a VxWorks environment so "everyone" at the company can use it within our context. If you are good at convincing you can be lucky and get some fun work tasks. :) Good luck! //T -- http://mail.python.org/mailman/listinfo/python-list
typo in the documentation or am I stupid?
In the embedding Python manual at Python.org an example is presented that uses the function: PyDict_GetAttrString. Is it possible that this is a typo? I have searched the source code and I can't find it, I have also used google and I only get 4 hits. In for example Programming Python another function with similar name is described: PyObject_GetAttrString. Could that be the one that fit into the example? Hopefully someone knows the answer to my question ;) //Tommy Link to the spot at Python.org: http://docs.python.org/ext/pure-embedding.html -- http://mail.python.org/mailman/listinfo/python-list
Re: global interpreter lock
Thanks, PyThread_release_lock() is implemented in all thread_xxx.h files. So I thought right but specified my question like a stupid ;) //T -- http://mail.python.org/mailman/listinfo/python-list
global interpreter lock
I just need confirmation that I think right. Is the files thread_xxx.h (xxx = nt, os2 or whatever) responsible for the global interpreter lock in a multithreaded environment? I'm currently writing my own thread_VW for VxWorks, thats why I'm asking. //Tommy -- http://mail.python.org/mailman/listinfo/python-list
Re: Controlling memory allocation
Yep! I redirect Free, Realloc and Malloc. (calloc is never used by Python). "The more I thoug..." That could be a possible problem. I will look in to it today and try and find out if that occurs and in that case how often. //T -- http://mail.python.org/mailman/listinfo/python-list
Re: Controlling memory allocation
Hello. I have done the thing you are requesting. You can easily create your own memory pool and have Python to use it. I added some rows to Pyconfig.h: #ifdef malloc #undef malloc #endif /*malloc*/ #define malloc Python_malloc Then I have some overhead in my own Python_malloc(size_t nBytes) -- http://mail.python.org/mailman/listinfo/python-list
Re: Extend Python
What is Qt? I have looked at PyQT and I canĀ“t use it. I haven't tried it but the PyQT license makes the program useless. :( Any other suggestions? -- http://mail.python.org/mailman/listinfo/python-list
Extend Python
Hi All I have a problem with extentions of Python. Background: I'm workin within a large industrial control system and I have created a Port for VxWorks. In the system we have different permissions depending on which state the controller is in. To perform some actions in some states may even injure or kill people. Therefor we need "intelligent" wrappers between Python and C-code. My Question: Swig offers some great features but is to basic for us. Is there another program that creates more readble code that can be easily edited? How much work is it to write our own wrappers? //T -- http://mail.python.org/mailman/listinfo/python-list
Embed Python
Hi, Background: Im currently working on my own Python port for VxWorks this is part of my master thesis. What I want to do is to only to embed the interpreter and not the compiler. Both to save memory on the target device and to be get some security in the device. It is a mission critical device im applying it to. Question: Is there any obvious way to see what files that are needed for the interpreter and which files that are needed by the compiler? //Tommy -- http://mail.python.org/mailman/listinfo/python-list