Re: modifying DLL string table programatically (Was: Win32 Binary-only for 2.3.x?)

2006-01-09 Thread Thomas Heller
Trent Mick <[EMAIL PROTECTED]> writes: > [Thomas Heller wrote] >> py2exe also does something like this in the copy of pythonXY.dll that it >> creates, to avoid the resulting exe pulling in sys.path entries from the >> registry. > > Do you have a quick pointer to

Re: Calling foreign functions from Python? ctypes?

2006-01-10 Thread Thomas Heller
"Delaney, Timothy (Tim)" <[EMAIL PROTECTED]> writes: > Thomas Heller wrote: > >> As the author, I would be happy to see ctypes included with the >> standard Python build. > > I'm sure you know the magical incantation to get that to happen ... >

Re: AW: Calling foreign functions from Python? ctypes?

2006-01-10 Thread Thomas Heller
"Gerald Klix" <[EMAIL PROTECTED]> writes: > I read the whol email thread carefully and could not find any sentence by > Guido, which states that he does not accept ctypes for the standard library. > He just declined to rewrite winreg. Did I miss something? Maybe I misinterpreted what he wrote my

Re: Calling foreign functions from Python? ctypes?

2006-01-10 Thread Thomas Heller
"Martin v. Löwis" <[EMAIL PROTECTED]> writes: > Thomas Heller wrote: >> It has been proposed to include it in core Python, but Guido didn't >> accept it. The thread starts here: >> >> http://mail.python.org/pipermail/python-dev/2004-January/th

Re: ctypes & C++

2006-01-10 Thread Thomas Heller
[EMAIL PROTECTED] writes: > Thomas, > > Ctypes doesn't work to call arbitrary C++ code, is that correct? > > Skip Yes, that's correct. It doesn't do C++ name-(un)mangling, nor has it the C++ calling conventions. And so on... Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: (Fucking) Unicode: console print statement and PythonWin: replacement for off-table chars HOWTO?

2006-01-11 Thread Thomas Heller
"Robert" <[EMAIL PROTECTED]> writes: > > Guess I have to create special C-code for my major wide unicode needs - > especially listctrl-SetItem and TextOut-Stuff... > > Or does anybody know of some existing wide-unicode functions/C-code > parallel to normal pywin32? You could use ctypes to access

Re: Unicode style in win32/PythonWin

2006-01-12 Thread Thomas Heller
"Robert" <[EMAIL PROTECTED]> writes: > Neil Hodgson wrote: >> Robert: >> >> > After "is_platform_unicode = ", scintilla displays some unicode >> > as you showed. but the win32-functions (e.g. MessageBox) still do not >> > pass through wide unicode. >> >> Win32 issues are better discussed on th

Re: Unicode style in win32/PythonWin

2006-01-13 Thread Thomas Heller
"Robert" <[EMAIL PROTECTED]> writes: > Thomas Heller schrieb: >> So after these assignments: >> >> ctypes.windll.user32.MessageBoxW.argtypes = (c_int, c_wchar_p, >>c_wchar_p, c_int) >> c

XEmacs python-mode question

2006-01-13 Thread Thomas Heller
I'm trying to customize the python interpreter that is used to execute my scripts from within WinXP, XEmacs, python-mode version $Revision4.70$, but cannot get it to work. The only thing that works is M-x customize-group python, and change the value of 'Python Command'. However, this changes the

Re: XEmacs python-mode question

2006-01-13 Thread Thomas Heller
[EMAIL PROTECTED] writes: > Thomas> I'm trying to customize the python interpreter that is used to > Thomas> execute my scripts from within WinXP, XEmacs, python-mode > Thomas> version $Revision4.70$, but cannot get it to work. > > Thomas> The only thing that works is M-x customize

Re: How to convert arbitrary objects directly to base64 without initial string conversion?

2006-07-13 Thread Thomas Heller
Russell Warren schrieb: > I've got a case where I want to convert binary blocks of data (various > ctypes objects) to base64 strings. > > The conversion calls in the base64 module expect strings as input, so > right now I'm converting the binary blocks to strings first, then > converting the resul

Re: Tkinter module not found

2006-08-08 Thread Thomas Heller
John Salerno schrieb: > Tim Chase wrote: >>> The cause of this is usually that you are using a different >>> version of Python than the one you installed Tkinter into, but >>> being a Linux newbie I have yet to discover how to redirect >>> the 'python' command to invoke the newer version of Python.

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: 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: 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: 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: > 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: 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, 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], >

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: 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

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: 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: 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: 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: 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: 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: 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: 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

[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: 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

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://starsh

Re: import hook

2006-06-11 Thread Thomas Heller
Alex Martelli wrote: > Jeremy Sanders <[EMAIL PROTECTED]> wrote: > >> Hi - Is it possible to override the import process so that if in my program >> I do >> >> import foo.bar >> >> Python will look for bar in a directory which isn't called foo? >> >> I want my module/program to be able to be ru

Re: VC++ types to ctypes

2006-06-12 Thread Thomas Heller
lux wrote: > Hi to all, > i need to traslate this struct in python using ctypes > > struct Soptions > { > char chVolumeLabel[128]; > __int32 nSessionToImport; > BS_BOOL bJolietFileSystem; > BS_BOOL bBootable; > TCHAR chBootImage[_MAX_PATH]; > BS_BOOL bFinalize; > BS_BOOL bTestBu

Unicode problem with exec

2006-06-23 Thread Thomas Heller
I'm using code.Interactive console but it doesn't work correctly with non-ascii characters. I think it boils down to this problem: Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> print u"ä" ä

Re: Py_NewInterpreter(), is this a bug in the python core?

2006-07-10 Thread Thomas Heller
freesteel schrieb: > /* > Is this a bug in Py_NewInterpreter? > > The function below "MyThread" is instantiated from a windows worker > thread, but I don't > think that is relevant. > (I can try this on a linux box, but I would have to compile a python > library with debugging > enabled.) > > The

Re: PIL 2.5 win32 binaries?

2006-09-18 Thread Thomas Heller
GHUM schrieb: > On the PIL website I read: > > The current free version is PIL 1.1.5, which has been tested with > Python 1.5.2 and newer, including 2.3 and 2.5. > > but in downloads I cannot see any binaries for windows and Python 2.5 > > Are they somewhere available? > > Best wishes, > > Har

Re: new string method in 2.5 (partition)

2006-09-19 Thread Thomas Heller
John Salerno schrieb: > Bruno Desthuilliers wrote: > >> Err... is it me being dumb, or is it a perfect use case for str.split ? > > Hmm, I suppose you could get nearly the same functionality as using > split(':', 1), but with partition you also get the separator returned as > well. Well, x.spl

Re: Using py2exe to wrap a service?

2006-09-20 Thread Thomas Heller
Tim Golden schrieb: > [EMAIL PROTECTED] > > [... snip ...] > > | File "win32com\client\__init__.pyc", line 73, in GetObject > | File "win32com\client\__init__.pyc", line 88, in Moniker > | pywintypes.com_error: (-2147221020, 'Invalid syntax', None, None) > | > | The offending line is: > | im

Re: Question about the article "py2exe compiler" in Python Cookbook by Alexander Semenov

2006-09-22 Thread Thomas Heller
Daniel Mark schrieb: > Hello all: > > I follow the following tutorial > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/108598 > Description: > script for making executables with py2exe > ## > from distutils.core import setup > import sys, os, py2exe > > name = sys.argv[1]

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

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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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-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: 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-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

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: 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(

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: 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: 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: 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: 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: 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: 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: file_name_fixer.py

2006-01-25 Thread Thomas Heller
Richie Hindle <[EMAIL PROTECTED]> writes: > [Fredrik] >> so re.sub("([_.])\\1+", "\\1", newname) replaces runs consisting >> of either a . or an _ followed by one or more copies of itself, with >> a single instance of itself. > > ...and this: > def isprime(n): return n > 1 and not re

Re: py-ext: casting pointers to ints on 32bit and 64bit systems

2006-01-27 Thread Thomas Heller
Alexander Schmolck <[EMAIL PROTECTED]> writes: > what's the best approach to write C(++)-extension code that has to > create a python int from a C pointer and vice versa so that it works > smoothly on 32 bit and 64 platforms (on which sizeof(int) != > sizeof(*void)) equally work (under unix,mac&wi

Re: newbie - script works in PythonWin - fails from Python

2006-02-03 Thread Thomas Heller
[EMAIL PROTECTED] writes: > Hi, > > This is all I get: > > error 250477278 > Traceback (most recent call last): > File "script1.py", line 5, in ? > Inst = lib.Initialize(0) > WindowsError: exception code 0xeedfade > > I get this when running python.exe script1.py > > ** When run from inside

Re: sys.path and unicode folder names

2006-02-08 Thread Thomas Heller
>> Nir Aides wrote: >>> Is there a solution or a work around for the sys.path problem with >>> unicode folder names on Windows XP? >>> >>> I need to be able to import modules from a folder with a non-ascii name. > Martin v. Löwis wrote: >> If the name is restricted to the CP_ACP code page (i.e.

Re: Single-file executables

2006-02-12 Thread Thomas Heller
Martin v. Löwis wrote: > Kevin Walzer wrote: >> The apps I've seen created by py2exe aren't single-file at all, the >> install folder is full of files besides the main program. I'm >> looking for a solution that stuffs all libraries, scripts, and the >> Python runtime into one file. Usually the

Re: Arcane deployment considerations

2006-02-13 Thread Thomas Heller
Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > Thomas Heller <[EMAIL PROTECTED]> wrote: > . > . > . >> Usually the bundle=1 option in py2exe can create a single file exe, but it >

Re: May i customize basic operator (such as 1==3)?

2006-02-22 Thread Thomas Heller
Carl Friedrich Bolz wrote: > kanchy kang wrote: >> many people write test cases with python scripts. >> in these test scripts, there are many validation statements, >> for example, in unittest, failUnless(a == b),(a/b may be stringType or >> intType...) >> >> during running test scripts, if there

Re: Newbie question: Multiple installations of Python on Windows machines

2006-02-22 Thread Thomas Heller
Don Taylor wrote: > I have Python 2.4.2 installed on a Windows XP machine. > > There is an application that I want to use that refuses to install > unless I have Python 2.3.x installed. (The only way that I can install > this is to use it's .exe installer) > > Can I install two versions of Pyt

Re: Simple System Tray Icon

2006-03-02 Thread Thomas Heller
3c273 wrote: > Hello, > I have a short looping script that runs in the background (Windows 2000) and > I want to have a tray icon so I know that it is running. I have looked at > wxTaskBarIcon and the examples on the web and in the demo, but it seems > pretty complex and I haven't had any success e

Re: py2exe and library.zip

2005-05-04 Thread Thomas Heller
Timothy Smith <[EMAIL PROTECTED]> writes: > is it possible instead of py2exe putting all library's in a zip file, > to just put them in a sub dir? You can subclass the build_exe command (the extending sample shows how to do this, althoutgh for a different purpose), and copy the files into a sub d

Re: py2exe and library.zip

2005-05-04 Thread Thomas Heller
Just <[EMAIL PROTECTED]> writes: > In article <[EMAIL PROTECTED]>, > Peter Hansen <[EMAIL PROTECTED]> wrote: > >> [ ... ] (Note to self: check if zip files that can >> be in sys.path can be compressed, > > Yes. > >> and if py2exe compresses them.) > > Don't know, but I assume yes. There's an op

Re: Q: The `print' statement over Unicode

2005-05-04 Thread Thomas Heller
François Pinard <[EMAIL PROTECTED]> writes: > Hi, people. I hope someone would like to enlighten me. > > For any application handling Unicode internally, I'm usually careful > at properly converting those Unicode strings into 8-bit strings before > writing them out. > > However, this morning, I m

Re: py2exe for WMI

2005-05-24 Thread Thomas Heller
Tim Golden schrieb: > | Hello All. > | I'm trying to 'compile-to-EXE' a python program which uses > | Win32 & WMI to > | pull system info. from the PC such as serial number, CPU > | speed, etc. I'm > | having problems with py2exe -- with regard to Win2000 & WinXP > | platforms. It > | seems

Re: Running in Release or Debug version of the python interpreter?

2005-05-24 Thread Thomas Heller
Raphael Zulliger schrieb: > Hi > > I have to check wheter a .py script is run within the debug or the > release version of an embedded python interpreter (in short, wheter > python24_d.dll or python24.dll is in use). > > long version: I'm using ctypes to load my own dll. There exists 2 > versi

Re: py2exe for WMI

2005-05-24 Thread Thomas Heller
Tim Golden schrieb: > [Thomas Heller] > > [... snip problems with py2exe & WMI ...] > > | The OP of the thread Tim mentions here already had a solution, if I > | understood him correctly, and the other things that were suggested > | didn't work. Basically

Re: open file in dir independently of operating system

2005-05-25 Thread Thomas Heller
Gerald Klix schrieb: > Hi, > it`s > > import os > f = open( os.path.join( dir , 'configuration.smo' ), 'r' ) *nix-heads everywhere? For a text file, I would prefer: f = open( os.path.join( dir , 'configuration.smo' ), 'U' ) and for a binary file: f = open( os.path.join( dir , 'configuration

Re: odbc and python

2005-06-03 Thread Thomas Heller
Giles Brown schrieb: > MM wrote: > >>Are there any other odbc packages other than the win32all and mxodbc >>ones? The win32all odbc.pyd can't access table structure info like >>SQLColumns, and mxobdc requires a commercial license which is >>unjustifiable for this tiny project. Any other OS alterna

Re: bdist_wininst to distribute a patched python

2005-06-03 Thread Thomas Heller
mg <[EMAIL PROTECTED]> writes: > Hi, > > Because of I have patched Python, I would like to create a Windows > installer containing my patched-Python. So, I try to use the option > 'bdist_wininst' on the setup.py file distributed by python it is > supported ? bdist_wininst can only be used to

Re: couple of new python articles on onlamp

2005-06-03 Thread Thomas Heller
Jeremy Jones <[EMAIL PROTECTED]> writes: > I've got a couple of new articles on ONLamp: > > Writing Google Desktop Search Plugins > http://www.onlamp.com/pub/a/python/2005/06/01/kongulo.html > > and > > Python Standard Logging > http://www.onlamp.com/pub/a/python/2005/06/02/logging.html > > > Comm

Re: running distutils installer without admin on windows

2005-06-08 Thread Thomas Heller
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I didn't build the installer, someone else did. I did get the source > and installed cygwin to see if I could recreate it; at least build the > library, but when I tried to do a build_ext I got a message saying I > needed to have the .NET SDK insta

Re: identifying 64-bit Windows from 2.3.5?

2005-06-09 Thread Thomas Heller
Steven Knight <[EMAIL PROTECTED]> writes: > Hi Ivan-- > >>> If I have installed 2.3.5 from the python.org Windows installer, can >>> any one point me to a run-time way to identify whether I'm running on >>> a 32-bit vs. 64-bit version of Windows XP, given that Python itself was >>> built on/for a

Re: PEP 304 "Controlling Generation of Bytecode Files" - patch updated

2005-06-17 Thread Thomas Heller
Skip Montanaro <[EMAIL PROTECTED]> writes: > I updated the patch that supports PEP 304, "Controlling Generation of > Bytecode Files" to apply cleanly against current CVS. I've tested it on Mac > OS X (straight Unix build only). I'd appreciate it if some Linux, Windows > and Mac framework folks c

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: 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: 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: 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: "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: 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: 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: 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: 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: 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: 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: 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

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,

<    1   2   3   4   5   >