how do i make exteranl module work under debug session?
Hi guys! I'm writing a small DLL thingy that requieres the use of loading the Python interpreter and executing a series of scripts. I have generated an interface to my dll with SWIG and put it in. It works like this: 1) a small .exe loads the .dll and calls the main init() function 2) the dll starts up some services, among them Py_Initialize () 3) i tell python to execute: execfile("kikura.py") (kikura.py is the file that SWIG generates for the shadow classes) All this works in the release version, but in the debug version i get this error message along with an assert failure: Fatal Python error: Interpreter not initialized (version mismatch?) Now, this might due to a fault of mine, but... The thing is that the windows installer of python didn't come with debug libraries or .dll, so i downloaded the python source, and compiled those, and am using those for the debug, but the original instalation ones for release version. Can anyone help? Thanx -- http://mail.python.org/mailman/listinfo/python-list
how do i add a new path into sys.path?
on my system(win2k server, python 2.3.5), >>> import sys >>> print sys.path ['C:\\', 'C:\\WINNT\\system32\\python23.zip', 'C:\\Python23\\lib\\site-packages\\Pythonwin', 'C:\\Python23\\lib\\site-packages\\win32', 'C:\\Python23\\lib\\site-packages\\win32\\lib', 'C:\\Python23\\lib\\site-packages', 'C:\\Python23\\DLLs', 'C:\\Python23\\lib', 'C:\\Python23\\lib\\plat-win', 'C:\\Python23\\lib\\lib-tk', 'C:\\Python23', 'D:\\Program Files\\DeLano Scientific\\PyMOL\\modules'] now, i wanna add "C:\Python23\Pmw\Pmw_1_2\lib" into sys.path, how? any help would be appreciated. with my kind regards, Wen -- http://mail.python.org/mailman/listinfo/python-list
Re: how do i add a new path into sys.path?
if i wanna add the path "C:\temp" into sys.path, and make it available for any other new python apps, like i add C:\temp into windows path , how? thank you. "apa" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > You can do it this way: > > sys.path.append("C:\Temp") > > Alejandro > -- http://mail.python.org/mailman/listinfo/python-list
Re: how do i add a new path into sys.path?
if i wanna add the path "C:\temp" into sys.path, and make it available for any other new python apps, like i add C:\temp into windows path , how? thank you. "apa" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > You can do it this way: > > sys.path.append("C:\Temp") > > Alejandro > -- http://mail.python.org/mailman/listinfo/python-list
import __main__ where can i find a module called "__main__.py"?
and, in which case, the following case will happen: if __name__!='__main__': do_sth() any help would be appreciated. -- http://mail.python.org/mailman/listinfo/python-list
what's the difference between *.dll and *.pyd if both of them are extended python module?
i have written python extend module by c/c++, but i saw a module of a software(pyMOL, you can get it from http://pymol.sourceforge.net/) called _cmd.pyd instead of _cmd.dll. and it is written by c/c++ also, the author use makefile to compile it into _cmd.pyd. i have some question about it: 1. what's the difference between them? i saw the code is same as common c++ extended python module, can i use microsoft visual C++ to create a dll project for compiling it as _cmd.dll? 2. i have never written a module with extension *.pyd, how to make a *.pyd? and, i doubt, how the author debug the _cmd.pyd, only by Makefile? 3. i have a common problem about writting a extend module by c/c++, i often use msvc to write it, but i only can invoke release dll, not debug dll, even i use command like this: python_d test.py, in which case, test.py import test.dll, and invoke test.hello() api. why? anybody has nice way to debug it? thank you. any help would be appreciated. with my best regards, Wen -- http://mail.python.org/mailman/listinfo/python-list
question on "import __main__"
i have written some code in test.py as below: import __main__ if __name__!='__main__': print 1 print 2 when i run test.py, i got 2 on the screen. now, i have some question about the code, 1. since no __main__ module at all, why it's legal to write "import __main__"? 2. since if running a script independently, the __name__ should be '__main__', why it's not in the above code? thank you in advance. with my kind regards, Wen -- http://mail.python.org/mailman/listinfo/python-list
Well, Python is hard to learn...
due to the work reason, i have to learn python since last month. i have spent 1 week on learning python tutorial and felt good. but i still don't understand most part of sourcecode of PYMOL(http://pymol.sourceforge.net/) as before. it sucks. anybody do the same thing as i am doing? i wanna seek a buddy to disscuss it together. -- http://mail.python.org/mailman/listinfo/python-list
pyMPI momory leak
Hi, I have been using pyMPI to parallelize my code and found that the function mpi.send() leaks memory a lot and thus is not really working for large amount fo data communication. It actually fails after the leak accumulates more than 2G. I wonder if others have the same experience or I did something wrong. I compiled python 2.4, mpich 1.2.6, pyMPI 2.1b4 on Opteron cluster running Rocks 3.3. Here is a small test script with 2 CPUs to demo the memory leak: import mpi n = 1 i=0 data = [0]*4 while i < n: if mpi.rank==1: mpi.send(data, 0) elif mpi.rank==0: msg, status = mpi.recv() n+=1 if one watchs the memory usage using 'top', one can see one process use little and constant amount of memory (recv for rank=0) and the other process uses more and more memory (send for rank=1). -- http://mail.python.org/mailman/listinfo/python-list
pymat on 64bit linux
Hi, Has anyone been able to get pymat work on a 64bit linux system? I compiled the CVS version of pymat with python2.3/matlab7.01 on Mandrake10.1 64bit system, it can start the engine and use put/get function, but segfaults with eval function. -- http://mail.python.org/mailman/listinfo/python-list
python3 html to rtf or doc
Looking for a library or utility that could transform html to rtf in redhat environment. Googled a while still could not find a solution I like. Any suggestions would be much appreciated Thanks in advance Wen With python2.7 and zopyx.convert, was able to do html to rtf export, with some css kept and images as well. zopyx.convert zopy.convert2 seem don't support python3 Recently switched to python36, with pandoc for html to rtf, found out it doesn't do style or images when export now. Html code is not in fixed format. -- https://mail.python.org/mailman/listinfo/python-list
RE: python3 html to rtf or doc
Thank you so much Dennis for the direction. :) Wen -Original Message- From: Python-list On Behalf Of Dennis Lee Bieber Sent: Wednesday, 1 May 2019 4:27 PM To: python-list@python.org Subject: Re: python3 html to rtf or doc On Wed, 1 May 2019 00:16:43 +, Wen-Chen Hol declaimed the following: >Looking for a library or utility that could transform html to rtf in redhat >environment. >Googled a while still could not find a solution I like. >Any suggestions would be much appreciated Thanks in advance Wen With >python2.7 and zopyx.convert, was able to do html to rtf export, with some css >kept and images as well. >zopyx.convert zopy.convert2 seem don't support python3 Recently >switched to python36, with pandoc for html to rtf, found out it doesn't do >style or images when export now. >Html code is not in fixed format. Might I suggest Calibre? https://calibre-ebook.com/download_linux HTML is supposed to be one of the supported inputs, and RTF is an option for output conversion. Not sure if it can be scripted -- nor if it works with Python 3.x (requires 2.6+). I only have minimal experience with the Windows version (using a DeDRM plugin to unlock backups of my B&N Nook books; and sometimes doing an epub to epub import/export as I've encountered epubs that have corrupted formats and are unreadable in my Nooks -- Calibre loads and "converts" them into another epub that is valid) -- Wulfraed Dennis Lee Bieber AF6VN wlfr...@ix.netcom.com -- https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list
cross-compiling python: reviewers needed
Hello, I have a small patch for Python SVN that makes it possible to cross-compile python on Unix to various other Unix targets. I have successfully built a binary for FreeBSD on Linux. The patch is available at https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1597850&group_id=5470 (file cross.patch) but it awaits further review. I'm looking for people willing to try this out, and give further review to the patch, so it may be applied to SVN. All you need is a bit of time, and experience in cross-compiling. -- http://mail.python.org/mailman/listinfo/python-list
Re: [ANN] PyInstaller 1.3 released
Giovanni Bajo escreveu: > Hello, > > PyInstaller 1.3 is out! > > Grab latest version at: > http://pyinstaller.python-hosting.com/ > > > Description > --- > PyInstaller is a program that converts (packages) Python programs into > stand-alone executables, under Windows, Linux and Irix. Its main > advantages over similar tools are that PyInstaller works with any > version of Python since 1.5, it builds smaller executables thanks to > transparent compression, it is multi-platform (so you can build one-file > binaries also under Linux), and use the OS support to load the dynamic > libraries, thus ensuring full compatibility. that sounds really cool. Is it possible to use this in cross-compiling mode? Ie. build a standalone .exe for windows on a linux machine? -- http://mail.python.org/mailman/listinfo/python-list
MacOS X drag & drop?
Hi there, this might not be the right group to ask, but I'm looking for some hints on making a drag & droppable application on MacOS X. I succeeded in producing a bundle that calls a python script. When I drop a file onto the application, the python script is called with the following arguments, ['/Users/hanwen/src/maclily/BUILD/lilypond.app/Contents/MacOS/lilypond', '-psn_0_3145729'] how can I find the path to the dropped file from -psn_0_3145729 ? Or is this signaled to the script through a different channel? Thanks! -- Han-Wen Nienhuys - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen -- http://mail.python.org/mailman/listinfo/python-list