Re: ctypes CDLL - which paths are searched?

2008-01-21 Thread Thomas Heller
Helmut Jarausch schrieb: > Hi, > > how can I specify the paths to be searched for a dynamic library > to be loaded by ctypes' CDLL class on a Linux system. > > Do I have to set os.environment['LD_LIBRARY_PATH'] ? > ctypes passes the argument given to CDLL(path) straight to the dlopen(3) call, s

Re: Embedding Python - Freeing Python Objects Not Using Py_DECREF

2008-01-17 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: > Hello, > > I'm embedding Python interpreter in a Win32 console application. I use > C++. > > I would like to use the WinAPI LoadLibrary function to load the python > dll at runtime (followed by GetProcAddress calls), so that I have to > make no assumptions about the l

Re: for loop without variable

2008-01-09 Thread Thomas Heller
erik gartz schrieb: > Hi. I'd like to be able to write a loop such as: > for i in range(10): > pass > but without the i variable. The reason for this is I'm using pylint > and it complains about the unused variable i. Pychecker won't complain if you rename 'i' to '_', IIRC: for _ in range(10)

Re: pydepend (checking dependencies like jdepend) ?

2008-01-04 Thread Thomas Heller
Stefan Schukat schrieb: > No, py2exe does not display such information but has an algorithm to > collect such information. > Perhaps this is a starting point for you. If py2exe is run with the -x flag, it does display a cross-reference in a browser window. Thomas -- http://mail.python.org/mailm

Re: ctypes - pointer to array of structs?

2008-01-04 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: > (Is this the right place to ask ctypes questions? There's a mailing list > but the last post to it seems to have been in November 2006.) You could use the ctypes-users mailing list: https://lists.sourceforge.net/lists/listinfo/ctypes-users It is also available via gm

Re: PIL question

2007-11-16 Thread Thomas Heller
Thomas Heller schrieb: > I'm trying to read an image with PIL, crop several subimages out of it, > and try to combine the subimages again into a combined new one. This is > a test script, later I want to only several single images into a combined one. [...] > Here is the code;

PIL question

2007-11-16 Thread Thomas Heller
I'm trying to read an image with PIL, crop several subimages out of it, and try to combine the subimages again into a combined new one. This is a test script, later I want to only several single images into a combined one. I have to work with 16-bit color windows bitmaps in BMP format. My input

Re: trapping DLL import issues without blocking pop up window

2007-11-02 Thread Thomas Heller
alf schrieb: > Hi, > > there is following issue: "import cx_Oracle" on windows pops up a nice > 'DLL missing' window in case there indeed is no CLI.DLL (or something > like that). Then the exception is raised. > > Catching the exception is obviously not a problem, but the popup > practical

Re: Help ctypes on arm linux not compile

2007-10-30 Thread Thomas Heller
Samuel M. Smith schrieb: > I have built python 1.5.1 from source for an embedded ARM9 debian > linux Sarge distribution but > ctypes doesn't build. Anybody have any idea what the problem is? Do > I have to have the libffi package > installed. > See my errors below. ctypes won't work with Pyth

Re: Is there a way to tell if a script has been run by Pythonw.exe instead of Python.exe?

2007-10-19 Thread Thomas Heller
Metalone schrieb: > Thanks to all, I learned something in each post. > When using py2exe to build an executable sys.executable does not > provide the name of the python interpreter but the name of the > executable generated by py2exe. > When running the executable built with py2exe you might be i

Re: ANN: magnitude 0.9.2

2007-10-18 Thread Thomas Heller
Joan M. Garcia schrieb: > Following the feedback on the first release of magnitude it > has changed enough to deserve a second release, which > modifies the API, solves a couple of bugs, and brings it in > line with python's style guide. Main changes: > > * imul, idiv had wrong output unit, so th

Re: Getting error message/trace over the C API

2007-10-16 Thread Thomas Heller
Sami Vaisanen schrieb: > Hello group, > > I'm writing a C++ based application that embeds the python engine. Now I > have a problem regarding exception/error information. Is there a way to > get the exception message and possibly the traceback into a string for > example? I've been eyeballing the

Re: Keeping track of subclasses and instances?

2007-10-10 Thread Thomas Heller
Karlo Lozovina schrieb: > Hi, > > what's the best way to keep track of user-made subclasses, and instances of > those subclasses? I just need a pointer in a right direction... thanks. > New style classes have a __subclasses__ class method that shows the direct subclasses: Python 2.4.4 (#71, Oc

Re: Where's the Starship's crew?

2007-10-05 Thread Thomas Heller
Dick Moores schrieb: > > > I didn't check on all of them, but the only one I found was Mark > Hammond . > > Dick Moores > There are more. Think of it as a game you have to solve. -- http://mail.python.or

Re: Get the complete command line as-is

2007-09-13 Thread Thomas Heller
wangzq schrieb: > On Sep 12, 3:20 pm, Laurent Pointal <[EMAIL PROTECTED]> wrote: >> wangzq a écrit : >> >> > Hello, >> >> > I'm passing command line parameters to my browser, I need to pass the >> > complete command line as-is, for example: >> >> > test.py "abc def" xyz >> >> > If I use ' '.join(sy

Re: py2exe - change name of exe created

2007-09-07 Thread Thomas Heller
imageguy schrieb: [...] >> > Note that every thing works fine with this and creates an exe program >> > called >> > "myprogram.exe" >> >> > I would like to setup program to create an output called; >> > "MyBestProgram.exe" >> >> > IS that at all possible ? >> >> Yes. Use a 'dest_base' key in the d

Re: debugging program that uses ctypes

2007-09-07 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: > hi all, I have a python program that calls a dll through ctypes > (py2.5). In some (reproducible) > conditions the program crashes with an error in ctypes module. You mean a segfault? > How can I trace down the problem? I have created a debug build of > python but I a

Re: py2exe - change name of exe created

2007-09-07 Thread Thomas Heller
imageguy schrieb: > Sorry for the double post, sent it to quickly. > > I have a setup script like this; > > setup(windows = [{"script":"myprogram.py", >"icon_resources":[(0,"nabbitt.ico")], > "other_resources": [(24,1,manifest)]} > ], > name

Re: Fatal Python error using ctypes & python exceptions

2007-08-31 Thread Thomas Heller
mmacrobert schrieb: > Hi Everyone, > I've created a 'C' dll that is accessed via ctypes library containing > a bunch of functions. I've successfully been able to use the > functions. However, I would like to throw python exceptions from some > of them. > > I throw them using: ::PyErr_SetString(::P

Re: ctypes and C99 complex numbers

2007-08-16 Thread Thomas Heller
Eugen Wintersberger schrieb: > Hi there > I want to use ctypes in connection with C functions that use complex > datatypes defined in the C99 standard. Does someone know a simple way > how to implement this? Are there any plans to integrate the C99 complex > data types in the ctypes module? I hav

Re: Move files/directories to Recycle Bin using standard Python libs

2007-08-15 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: > On Aug 15, 11:39 am, Kevin D. Smith <[EMAIL PROTECTED]> wrote: >> I would like to move files and directories to the Recycle Bin on >> Windows from Python. I have found some older articles describing how >> to do this, but they require additional packages to be installe

Re: ming on win32 anyone ? [help a noob]

2007-08-15 Thread Thomas Heller
daz.diamond schrieb: > hoping someone can help ... > > how do I install ming (with python) on win32? have downloaded the > tar.gz of ming-0.3.0 which doesn't have a handy self-installer, and > I'm absolutely foxed as to what to do next ... the install > instructions in the package seem to be linux

Re: renaming an open file in nt like unix?

2007-07-13 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: > Hi. I'm writing an archival system which I'd like to be portable > to Windows. > > The system relies on the property of Unix which allows a > process to keep a file open even if another process renames > it while it is open. Neither process sees any anomaly or > erro

Re: Re-raising exceptions with modified message

2007-07-05 Thread Thomas Heller
Christoph Zwerschke schrieb: > What is the best way to re-raise any exception with a message > supplemented with additional information (e.g. line number in a > template)? I have the impression that you do NOT want to change the exceptions, instead you want to print the traceback in a customized

Re: The best platform and editor for Python

2007-07-05 Thread Thomas Heller
QOTW? Gregor Horvath schrieb: > That's a property of open source projects. > Features nobody really needs are not implemented. > > Gregor -- http://mail.python.org/mailman/listinfo/python-list

Re: Interest in a one-day business conference for Python, Zope and Plone companies ?

2007-07-04 Thread Thomas Heller
eGenix Team: M.-A. Lemburg schrieb: > Hello, > > eGenix is looking into organizing a one day conference > specifically for companies doing business with Python, Zope and > Plone. The conference will likely be held in or close to > Düsseldorf, Germany, which is lively medium-sized city, with good >

Re: 16bit hash

2007-06-27 Thread Thomas Heller
Robin Becker schrieb: > Josiah Carlson wrote: >> Robin Becker wrote: >>> Is the any way to get an efficient 16bit hash in python? >> >> hash(obj)&65535 >> >> - Josiah > yes I thought of that, but cannot figure out if the internal hash really > distributes the bits evenly. Particularly since it

Re: "assert" annoyance

2007-06-22 Thread Thomas Heller
Paul Rubin schrieb: > So I have some assert statements in my code to verify the absence of > some "impossible" conditions. They were useful in debugging and of > course I left them in place for "real" runs of the program. Umpteen > hours into a run, an assertion failed, and of course since failur

Re: ctypes pointer

2007-06-19 Thread Thomas Heller
mclaugb schrieb: > I have a simple function > > void adder(double a, double b, double *c){ > *c = a+b; > } > > i have created a shared dll -- "small_dll4.dll" of it using visual studio. > > now i wish to call it from python. > to do so, i have done the following: > > libx = cdll("small_dll4.dll

Re: very simple shared dll with ctypes

2007-06-19 Thread Thomas Heller
mclaugb schrieb: > I have created a simple windows small_dll.dll exporting a function that does > a computation using C and C++ classes which i wish to call from Python. I > have read lots of ctypes documentation but I still dont quite understand how > to call the function. > > As a test, I have

Re: Optimizing constants in loops

2007-06-13 Thread Thomas Heller
Michael Hoffman schrieb: > The peephole optimizer now takes things like > > if 0: > do_stuff() > > and optimizes them away, and optimizes away the conditional in "if 1:". > > What if I had a function like this? > > def func(debug=False): > for index in xrange(100): > if de

Re: FAQ: how to vary the byte offset of a field of a ctypes.Structure

2007-05-31 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: > How do I vary the byte offset of a field of a ctypes.Structure? > > How do I "use the dynamic nature of Python, and (re-)define the data > type after the required size is already known, on a case by case > basis"? > > \\\ > > For example, suppose sometimes I receive

Re: with ctypes, how to parse a multi-string

2007-05-31 Thread Thomas Heller
Eric schrieb: > Hi, > > I am currently dealing with ctypes, interfacing with winscard libbrary > (for smart card access). > > Several APIs (e.g. SCardListReaderGroupsW ) take a pointer to an > unicode string as a parameter , which points at function return to a > "sequence" of unicode strings, NU

Re: calldll for Python 2.5

2007-05-16 Thread Thomas Heller
Larry Bates schrieb: > I've implemented several libraries using calldll (originally on > Python 2.2) and posted recipe on ASPN for a general implementation > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146847. > If I were doing it over again today, I would use ctypes, but I > have thous

ctypes-1.0.2 for 64-bit Windows

2007-05-15 Thread Thomas Heller
For the brave enough to run a 64-bit Python under a 64-bit Windows installation, I have added a first version of ctypes for win64 in the sourceforge download area. It does NOT use the same sourcecode as the 'official' version, the code has been patched by merging selected commits from the Python S

ANN: ctypes 1.0.2 released

2007-05-15 Thread Thomas Heller
ctypes 1.0.2 released - May 15, 2007 Overview ctypes is an advanced ffi (Foreign Function Interface) package for Python 2.3 and higher. ctypes allows to call functions exposed from dlls/shared libraries and has extensive facilities to create,

Re: ctypes: Problems using Windows-DLL from VB example code

2007-05-09 Thread Thomas Heller
>> Have you tried to pass the structure by reference? >> >> dso_lib.port_init(byref(init_data)) > > That gives me another exeption: > > print dso_lib.port_init(byref(init_data)) > ValueError: Procedure called with not enough arguments (4 bytes missing) or > wrong calling convention Please t

Re: ctypes: Problems using Windows-DLL from VB example code

2007-05-09 Thread Thomas Heller
Noralf Trønnes schrieb: > Hi > > I'm trying to use a DLL from Python using ctypes. > The call to dso_lib.capture_hold_chk() does return 232. So it seem to work. > The call to dso_lib.port_init(init_data) gives: > WindowsError: exception: access violation reading 0x0006 > > Any suggestions? >

Re: subprocess "handle is invalid" error

2007-04-18 Thread Thomas Heller
Grant Edwards schrieb: > I'm trying to use the py-gnuplot module on windows, and have > been unable to get it to work reliably under Win2K and WinXP. > > By default, it uses popen(gnuplotcmd,'w'), but in some > situations that consistently gets an "invalid operand" IOError > when write() is called

Re: python - dll access (ctypes or swig)

2007-04-18 Thread Thomas Heller
Alex Martelli schrieb: > Larry Bates <[EMAIL PROTECTED]> wrote: >... >> I guess I was the only one it wasn't "obvious" to . I've always >> written my COM servers as .EXE files even though they cannot be run >> independently. What I find is "odd" is that I can create a .DLL or an >> .EXE of my

Re: Create new processes over telnet in XP

2007-03-24 Thread Thomas Heller
Irmen de Jong schrieb: > Shane Geiger wrote: >> This reminds me of something I once wanted to do: How can I install >> Python in a totally non-gui way on Windows (without the use of VNC)? I >> think I was telnetted into a computer (or something like that) and I was >> unable to run the usual P

Re: Technical Answer - Protecting code in python

2007-03-22 Thread Thomas Heller
Bart Willems schrieb: > Aaah, *now* we're getting somewhere... :-) > >>> All he wants is something that turns 'readable, >>> changeable python' into 'unreadable, immutable python'. >> >> chown scriptuser script.py # a unique user >> chmod a-rwx script.py >> chmod u+rx script.py >> >> I believe

Re: ANN: ActivePython 2.5.0.0 is now available

2007-03-15 Thread Thomas Heller
Trent Mick schrieb: > [EMAIL PROTECTED] wrote: >> >> is ctypes supported on ActivePython for Windows x64? >> > > No. > http://aspn.activestate.com/ASPN/docs/ActivePython/2.5/whatsincluded.html > > My understanding (from http://www.python.org/sf/1545507) is that ctypes isn't > yet ported to Win

Re: C++ and Python

2007-03-10 Thread Thomas Heller
Alex Martelli schrieb: > hg <[EMAIL PROTECTED]> wrote: >... >> target but rather C: I need to integrate a printer driver and and would >> like if possible to avoid all of the .h stuff involved with SWIG (I am not >> being sarcastic): if I can setup my prototypes directly in python, why go >> th

Re: py2exe: LoadLibrary(pythondll) failed

2007-03-03 Thread Thomas Heller
zxo102 schrieb: > Hi there, >I py2exe my test.py as test.exe with a lot of dll and pyc in that > directory. If I move the test.exe into another directory and run it > from there, it gives me an error " LoadLibrary(pythondll) failed... > python24.dll". How can I set it up correctly for this te

Re: Py2EXE problem

2007-02-28 Thread Thomas Heller
Sick Monkey schrieb: > Ok I found an extremely easy way to resolving this issue (I cannot believe I > did not think of it sooner). > > After Py2exe created the .exe file I noticed a "library.zip" file. I took a > look at the Py2exe output, and saw all of the libraries that it failed to > insert.

Re: py2exe, library.zip and python.exe

2007-02-28 Thread Thomas Heller
Martin Evans schrieb: > I have converted a Python script using py2exe and have it set to not bundle > or compress. The result is my exe and all the support files including > library.zip (exactly as planned - nice job py2exe). > > Question: My py2exe application needs to be able to execute extra

Re: Recreating a char array from a pointer

2007-02-24 Thread Thomas Heller
buffinator schrieb: > I have an application that has to send a string as a pointer to memory, > and then another one that has to retriece it and fetch the string. > Converting the string to an array and sending the pointer was easy > > import array > a=array.array("c","mytextgoeshere") > my_poin

Re: pyinstaller fails to create exe-File

2007-02-23 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: > Hi ! > > I am trying to create an exe file using pyinstaller. Running the > created exe-File gives the error message > "" > Traceback (most recent call last): > File "", line 8, in > File "E:\Documents\mich\job\abs\backup_skript\buildbackup\out1.pyz/ > email", lin

Re: LoadLibrary(pythondll) failed

2007-02-10 Thread Thomas Heller
acncgc schrieb: > I get an following error as I turn on my laptop; > > LoadLibrary(pythondll) failed > > After this error internet browser ( IE or mozilla) doesn't connect. I > can't browse any site. > > Any idea?? > This looks like a message from a broken py2exe'd application. You have to fi

Re: Partial 1.0 - Partial classes for Python

2007-02-08 Thread Thomas Heller
Ziga Seilnacht schrieb: > Thomas Heller wrote: >> >> Do you have a pointer to that post? >> > > I think that he was refering to this post: > http://mail.python.org/pipermail/python-list/2006-December/416241.html > > If you are interested in various implem

Re: Partial 1.0 - Partial classes for Python

2007-02-07 Thread Thomas Heller
Carl Banks schrieb: > On Feb 7, 10:17 am, "Carl Banks" <[EMAIL PROTECTED]> wrote: >> On Feb 7, 8:51 am, Thomas Heller <[EMAIL PROTECTED]> wrote: >> >> >> >> > Martin v. Löwis schrieb: >> >> > > I'm happy to an

Re: Partial 1.0 - Partial classes for Python

2007-02-07 Thread Thomas Heller
Martin v. Löwis schrieb: > I'm happy to announce partial 1.0; a module to implement > partial classes in Python. It is available from > > http://cheeseshop.python.org/pypi/partial/1.0 > > A partial class is a fragment of a class definition; > partial classes allow to spread the definition of > a

Re: how to unistall a Python package?

2007-01-26 Thread Thomas Heller
Colin J. Williams schrieb: > With Windows, a few packages, eg. PythonWin, also modify the registry. > numpy, the elaboration of numarray/numeric, and PythonWin have > RemoveXXX.exe in C:\Python25. > > I don't know whether this is the standard approach. There doesn't seem > to be a reference to

Re: py2exe: zipfile=None raised ImportError

2007-01-11 Thread Thomas Heller
(I forgot to copy the list ;-) Tim schrieb: > > I'm at the end of my limited experience... > > > > I'm using py2exe to create an executable. I'm using bundle level 1. > > When I don't use the zipfile option, the executable and library.zip get > > created and the executable works correctly. > > >

Re: help: code formatter?

2007-01-08 Thread Thomas Heller
siggi schrieb: > Hi all, > > as a newbie I have problems with formatting code of downloaded programs, > because IDLE's reformatting capabilities are limited . Incorrect > indentation, mixing of TAB with BLANKs or eol are often very nasty to > correct. > Is there a simple code formatter that first

Re: where to ask questions related to comtypes?

2007-01-04 Thread Thomas Heller
wcc schrieb: > Hello group, > > Is there a separate mailing list for comtypes? Or this is the > appropriate place to post questions related to this package(from Thomas > Heller)? It seems the python-win32 mailing list is the place where the most COM knowledge is, so tha

Re: question on creating class

2007-01-04 Thread Thomas Heller
wcc schrieb: > Hello, > > How do I create a class using a variable as the class name? > > For example, in the code below, I'd like replace the line > > class TestClass(object): > with something like > class eval(className) (object): > > Is it possible? Thanks for your help. > > className = "T

Re: M. Hammonds python panel

2007-01-03 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: > Hello all > > I am a great fan of Mark Hammonds python pannel. But since starship > went down it didn't come up again ...with the link in my favs to > http://starship.python.net/crew/mhammond/mozilla/pythonpanel.xul > still pointing nowhere. > > Maybe Mark is around h

Re: Why does Python never add itself to the Windows path?

2007-01-02 Thread Thomas Heller
Ben Sizer schrieb: > Gabriel Genellina wrote: > >> Notice that there is NO need to alter the system path. You just have >> to tell Windows where python.exe resides; there is a per-application >> path located at >> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths. >> In order

Re: Python Wrapper for C# Com Object

2007-01-02 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: > [EMAIL PROTECTED] skrev: > >> Hi, >> >> I wish to write a Python wrapper for my C# COM object but am unsure >> where to start. I have a dll and a tlb file, and I can use this object >> in C via the following code - >> >> // ConsolApp.cpp : Defines the entry point for t

Re: How a script can know if it has been called with the -i command line option?

2006-12-21 Thread Thomas Heller
Michele Simionato schrieb: > The subject says it all, I would like a script to act differently when > called as > $ python script.py and when called as $ python -i script.py. I looked > at the sys module > but I don't see a way to retrieve the command line flags, where should > I look? > TIA, > >

Re: Has comparison of instancemethods changed between python 2.5 and 2.4?

2006-12-15 Thread Thomas Heller
Frank Niessink schrieb: [...] > Now, with Python 2.5 (and not with Python 2.4) I have a callback that is > not being added to the list because, apparently, it compares equal to > some of the callbacks already in the list. However, the instance the two > methods belong to are different, i.e. id(

comtypes

2006-12-07 Thread Thomas Heller
comtypes seems to gain some attention (comtypes is a pure Python, lightweight COM client and server framework, based on the ctypes Python FFI package.) I'll try to release a new version over the next days. However, I'm wondering what would be the correct list to discuss this package... - the pyt

Re: PythonTidy

2006-12-07 Thread Thomas Heller
Chuck Rhode schrieb: > Thomas Heller wrote this on Tue, Dec 05, 2006 at 07:06:30PM +0100. My > reply is below. > >> There is still one major issue. pythonTidy uses open(input-file, >> "rb") to open the Python module to tidy up. That does not work on >> Win

Re: PythonTidy

2006-12-05 Thread Thomas Heller
Chuck Rhode schrieb: > That went well. PythonTidy has been looked at at least 10**2 times, > and I have received a couple of complaints, which I hope I have > addressed satisfactorily -- plenty good enough for a beta test. The > basic concept stands. Sure. There is still one major issue. python

Re: PythonTidy

2006-12-01 Thread Thomas Heller
Chuck Rhode schrieb: > Thomas Heller wrote this on Thu, Nov 30, 2006 at 09:50:25PM +0100. My > reply is below. > >> The two things that bother me at the moment are how the comments are >> formatted (dunno if that can be customized or changed easily), and >> it would

Re: good documentation about win32api ??

2006-12-01 Thread Thomas Heller
krishnakant Mane schrieb: > On 1 Dec 2006 09:56:09 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >> http://msdn.microsoft.com covers the API itself, although you need to >> transliterate from the C code to python. > Exactly! that's where the problem lyes. > I am pritty well to do with wind

Re: PythonTidy

2006-11-30 Thread Thomas Heller
Chuck Rhode schrieb: > I couldn't find a routine to clean up, regularize, and reformat Python > code, so I wrote one: > > http://www.lacusveris.com/PythonTidy/PythonTidy.python > > Now, I'm looking for beta-testers. Compensation is a bit on the low > side. In fact it's limited to the satisfac

Re: Python spam?

2006-11-30 Thread Thomas Heller
Aahz schrieb: > Anyone else getting "Python-related" spam? So far, I've seen messages > "from" Barry Warsaw and Skip Montanaro (although of course header > analysis proves they didn't send it). I'm getting spam not only from Barry, but also from myself ;-) with forged headers. But I'm not sure w

Re: DDE (eSignal)

2006-11-30 Thread Thomas Heller
BBands schrieb: > I have a Python ap that needs current stock prices, which I want to get > from eSignal's DDE server. Following the win32all example: > > import win32ui > import dde > server = dde.CreateServer() > server.Create("eSignalDDE") > conversation = dde.CreateConversation(server) > conve

Re: Reading text labels from a Win32 window

2006-11-29 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: > [EMAIL PROTECTED] schrieb: > >> Does anyone know of a way to read text labels from a Win32 application. >> I am familiar with using pywin32 and the SendMessage function to >> capture text from Buttons,text boxex, comboboxes, etc, however, the >> text I am would like to

Re: select() on WinXP

2006-11-23 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: > I'm using it for sockets, it works on linux but not on Windows. The > actual code is something like (server side): > > r, w, e = select.select(self.clients, [], self.clients, 5) > > where self.clients is a list of accepted sockets. > The docs for select.select say:

Re: how to print pdf with python on a inkjet printer.

2006-11-19 Thread Thomas Heller
Gabriel Genellina schrieb: > At Friday 17/11/2006 17:40, Tim Roberts wrote: > >> > double wow! as it is my customer wants me to print to the default >> > printer. >> > can you please help me with the command for rendering the pdf to the >> > printer with acrobat using python? >> >>You'll have to

Re: announce: FAQs suggested

2006-11-10 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: >> > > > http://effbot.org/pyfaq/suggest.htm >> > > FAQ: How do I say returns void in ctypes? >> > That's in the ctypes documentation, where it belongs. >> >> Thank you, before I never had found "Use None for void a function not >> returning anything" at: >> http://starsh

Re: announce: FAQs suggested

2006-11-10 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: > Thanks again for making time to comment - insights into the perspective > of the author are invaluable. But if by chance you have time to > continue: > >> > > http://effbot.org/pyfaq/suggest.htm >> > http://docs.python.org/dev/lib/ctypes-return-types.html >> A note co

Re: announce: FAQs suggested

2006-11-10 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: >> > > http://effbot.org/pyfaq/suggest.htm >> > FAQ: How do I say returns void in ctypes? >> That's in the ctypes documentation, where it belongs. > > Thank you, before I never had found "Use None for void a function not > returning anything" at: > http://starship.python

[Ann] ctypes wiki

2006-11-09 Thread Thomas Heller
I have installed a wiki which could / should be used to document the ctypes package and ctypes related packages (like comtypes, for example). ctypes is a foreign function library for Python: http://starship.python.net/crew/theller/ctypes/ I hope the wiki will evolve over time into a useful

Re: ctypes, python 2.5, WinFunctionType and _as_parameter_

2006-11-07 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: > Hello, > > how to get at the function address of a WinFunctionType ctypes object ? > With ctypes 1.0, I used just myfunc._as_parameter_ and all was well. > With ctypes 1.0.1, that ships with python 2.5, WinFunctionType has no > longer an _as_parameter_ attribute I thi

Re: py2exe questions

2006-11-04 Thread Thomas Heller
Marc 'BlackJack' Rintsch schrieb: > In <[EMAIL PROTECTED]>, Jerry wrote: > >> Despite what everyone is saying though, I believe that any and all >> solutions will require that the byte-code be extracted to some >> directory before being run. > > It's not Python bytecode. The problem is native li

Re: py2exe questions

2006-11-03 Thread Thomas Heller
Larry Bates schrieb: > Doug Stell wrote: >> I have 2 questions about py2exe or any similar utility. >> >> 1. Is it possible to create a single Windows executable that does not >> blow out to a folder full of files and can be called from scripts >> using command line arguments? >> >> 2. If the abo

Re: Slightly OT: Is pyhelp.cgi documentation search broken?

2006-10-27 Thread Thomas Heller
Joel Hedlund schrieb: > Hi! > > For a number of days I haven't been able to search the online python > docs at: > > http://starship.python.net/crew/theller/pyhelp.cgi > > that is the "search the docs with" link at this page: > > http://www.python.org/doc/ > > Instead of the search engine, I g

Re: Slightly OT: Is pyhelp.cgi documentation search broken?

2006-10-26 Thread Thomas Heller
Joel Hedlund schrieb: > Hi! > > For a number of days I haven't been able to search the online python > docs at: > > http://starship.python.net/crew/theller/pyhelp.cgi > > that is the "search the docs with" link at this page: > > http://www.python.org/doc/ > > Instead of the search engine, I g

Re: Python 2.5 ; Effbot console ; thank ; pb release.

2006-10-24 Thread Thomas Heller
Ben Finney schrieb: > "Hendrik van Rooyen" <[EMAIL PROTECTED]> writes: > > [quoting problems fixed] > >> "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: >> > some days, I ask myself why I shouldn't just use GPL for >> > everything I do, and ship it as source code only. >> >> because then you would de

Re: Using Python scripts in Windows Explorer

2006-10-20 Thread Thomas Heller
Ben Sizer schrieb: > I'd like to be able to drag a file onto a Python script in Windows > Explorer, or send that file to the script via the Send To context-menu > option, so I can then process that file via sys.argc. > > Unfortunately, I can't drag items onto the Python script, because > Windows d

Re: pywin32 COM sort in Excel (late binding fails, early binding works) (+py2exe)

2006-10-19 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: > ISSUE: COM Excel Sort works with Early Binding, but not Late Binding, > but py2exe only does Late Binding > > I have code similar to this (type from notes, so there may be a > typo...) > > import win32com.client > xl = win32com.client.Dispatch("Excel.Application") > x

Re: OT: What's up with the starship?

2006-10-15 Thread Thomas Heller
T. Bryan schrieb: > Thomas Heller wrote: > >> I cannot connect to starship.python.net: neither http, nor can I login >> interactively with ssl (and the host key seems to have changed as well). >> >> Does anyone know more? > > starship.python.net was compro

OT: What's up with the starship?

2006-10-13 Thread Thomas Heller
I cannot connect to starship.python.net: neither http, nor can I login interactively with ssl (and the host key seems to have changed as well). Does anyone know more? Thanks, Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: ctypes, arrays and pointers

2006-10-06 Thread Thomas Heller
Richard Jones schrieb: > Does anyone know how to do the equivalent of this using ctypes? > > image_data = malloc(width * height * components); > row_pointers = png_get_rows(png_ptr, info_ptr); > for (y = 0; y < height; y++) > memcpy(&image_data[width * components * y], >

Re: ctypes and setjmp

2006-10-06 Thread Thomas Heller
Richard Jones schrieb: > Currently ctypes can't play well with any C code that requires use of setjmp > as part of its API. > > libpng is one of those libraries. > > Can anyone think of a reasonable solution to this? Perhaps ctypes might be > patched to offer setjmp support in foreign function de

Re: Ctypes and freeing memory

2006-10-06 Thread Thomas Heller
Oliver Andrich schrieb: > On 10/6/06, Thomas Heller <[EMAIL PROTECTED]> wrote: >> Chris Mellon has already pointed out a possible solution, but there is also a >> different way. You could use a subclass of c_char_p as the restype >> attribute: >> >> class St

Re: News on versions modules for Python-2.5?

2006-10-06 Thread Thomas Heller
Méta-MCI schrieb: > Hi, all! > > > Any news, on release Python-2.5 for many modules/lib? > Some exemples: > > Console (Effbot) > SciPy > Iconvcodec > DirectPython > SendKeys > Dislin > PyGame > Twain > etc. > > > And who can confirm that these modules are in

Re: Ctypes and freeing memory

2006-10-06 Thread Thomas Heller
Oliver Andrich schrieb: > Hi everybody, > > I am currently playing around with ctypes and a C library (libWand > from ImageMagick), and as I want to easily deploy it on Mac, Linux and > Windows, I prefer a ctypes solution over a C module. At least on > windows, I would have resource problems to co

Re: Getting a ValueError with comtypes

2006-10-05 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: > Thomas, > > Thanks a ton for the quick response. > > I called GetModule('quartz.dll'), and now I can at least call > IMediaControl::Run. I get another error, but that's my problem (I > don't have the graph set correctly yet). > > You mentioned that you sometimes cre

Re: Getting a ValueError with comtypes

2006-10-05 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: > Hello, > > I am working with comtypes to interface Microsoft's DirectShow library. Cool, another one using comtypes! > First, I found a Type Library on the internet that was created for > accessing DirectShow from .NET. It seems that DirectShow only comes > with ID

Re: ctypes.c_void_p(-1) might not be C return (void *) -1

2006-09-29 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: >> I've started a wiki page where I already added an entry about the above >> question. >> Do you think the entry would have answered your question? >> http://starship.python.net/crew/theller/moin.cgi/CodeSnippets > > As concise as I now can imagine, yes thank you. > >

Re: ctypes.c_void_p(-1) might not be C return (void *) -1

2006-09-28 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: >> Subject: Python CTypes translation of (pv != NULL) I've started a wiki page where I already added an entry about the above question. Do you think the entry would have answered your question? http://starship.python.net/crew/theller/moin.cgi/CodeSnippets (My wiki sho

Re: Python CTypes translation of (pv != NULL)

2006-09-27 Thread Thomas Heller
False in a boolean >> expression (and you could assume that non-NULL pointers are True, as >> any other object in general), > > I see this now that you show the clueless newbie me, yes thank you. > Except now by showing me here we have provoked the authority Thomas > Hell

Re: Python CTypes translation of (pv != NULL)

2006-09-26 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: > Q: The C idea of (pv != NULL) is said most directly in Python ctypes > how? > > A: We are of course supposed to write something like: > > def c_not_null(pv): > return (ctypes.cast(pv, ctypes.c_void_p).value != None) > > Yes? > > Working from

Re: py2exe compression not working with Python 2.5

2006-09-22 Thread Thomas Heller
nikie schrieb: > When I try to compress the output of py2exe like this: > > from distutils.core import setup > import py2exe > > setup(console=['hello.py'], options={"py2exe": {"compressed": 1}}) > > I get strange error messages: > > Adding zlib.pyd to C:\tests\CanControllerTest\New Folde

<    1   2   3   4   5   >