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. When I add

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

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 that would be most appropriate

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 here

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 the console

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 to launch

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.

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 Windows, at least if the file has (as it should) \r

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

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.

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 windows API,

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 be good if the script took command

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)

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 what

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 satisfaction

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 capture

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

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 use the registry

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:

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 could probably

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:

[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

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

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 libraries

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 above can be

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 get Error 404.

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 get Error 404.

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 deny your work to

ctypes-1.0.1 released

2006-10-21 Thread Thomas Heller
ctypes 1.0.1 released - October 20, 2006 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

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

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) xl.Visible

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

2006-10-16 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 compromised. It looked like a rootkit may have been

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

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 independent of

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 String(c_char_p): def __del__(self

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

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

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 create a

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. I see the

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

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

2006-09-27 Thread Thomas Heller
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 Heller to say: Generally pointer instances have a False boolean value, so 'if pv: ' should work. Except for c_void_p

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 the doc,

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 Folder

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

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.split(:,

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, Harald

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. The OS

ctypes 0.9.9.9 released

2006-07-22 Thread Thomas Heller
ctypes 0.9.9.9 released - July 21, 2006 === 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

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 resulting

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 following

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ä ä exec

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 bTestBurn;

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 run without being

Re: Making all string literals Unicode

2006-05-15 Thread Thomas Heller
Richie Hindle wrote: Hi, Am I imagining it, or is there a switch or an environment variable to make Python treat all string literals as unicode? I seem to recall seeing it mentioned somewhere, but now I can't find it anywhere. Thanks, python -U --

Re: os.startfile() - one or two arguments?

2006-04-28 Thread Thomas Heller
BartlebyScrivener wrote: Can any Windows user give a working example of adding a command verb to os.startfile()? When I try it, it squawks that it takes only one argument. os.startfile('d:/','explore') Traceback (most recent call last): File interactive input, line 1, in ? TypeError:

Re: A QFB agent: how to catch C-level crashes and last Python stack ?

2006-04-27 Thread Thomas Heller
robert wrote: When employing complex UI libs (wx, win32ui, ..) and other extension libs, nice only Python stack traces remain a myth. Currently I'm hunting again a rare C-level crash bug of a Python based Windows app with rare user reports - and still in the dark (I get snippets of

Re: win32com short path name on 2k

2006-04-26 Thread Thomas Heller
bytecolor wrote: Hi people, Using win32com on 2k SP3... import win32com.client as w32c fc = w32c.Dispatch('Featurecam.Application') fc.InstallPath u'C:\\PROGRA~1\\FEATUR~1' Using win32com on XP Professional SP2... import win32com.client as w32c fc =

Re: Importing modules through directory shortcuts on Windows

2006-04-26 Thread Thomas Heller
Brian Quinlan wrote: Recently, I became responsible for maintaining some Python code, which was organized as follows: user/pylib ui ... project2/pylib ui ... project3/pylib ui ... python-packages/user = /user/pylib

Re: 2.5a1 import of .dlls

2006-04-18 Thread Thomas Heller
[EMAIL PROTECTED] wrote: I've re-built an extension module (as a .dll) using the 2.5a1 release. Unexpectedly, I'm not able to simply import it (not the way I can when building it for 2.3). Using imp.load_dynamic() the import succeeds. import minx # Implemented in a .dll - fails

What does 'repair Python 2.5a1' do?

2006-04-07 Thread Thomas Heller
What does the repair command in the 2.5a1 msi installer do? Apparently it does not replace changed files, although it seems to replace deleted files. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: ctypes/libffi for Intel based Macintosh

2006-03-29 Thread Thomas Heller
[EMAIL PROTECTED] wrote: Can someone tell me where I can download a version of ctypes/libffi that will work on a Intel based Macintosh? I'm running Mac OS X 10.4.5 and the ActiveState Python 2.4.2 distribution. I've tried building libffi 1.20 which came with ctypes 0.9.9.3 and got a

Re: Trace dynamically compiled code?

2006-03-14 Thread Thomas Heller
Ed Leafe wrote: Hi, Thanks to the help of many on this list, I've been able to take code that is created by the user in my app and add it to an object as an instance method. The technique used is roughly: nm = myMethod code = def myMethod(self): print Line 1 print My

Re: Python and C

2006-03-11 Thread Thomas Heller
Terry Reedy wrote: P Boy [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Has anyone yet written a program to grab C struct declaration from the .h to produce code like # Overlay configuration class OverlayStoreConfig(ctypes.Structure): _fields_ = [('FormatVersion',

Re: Extending embedded Python: Adding single methods

2006-03-08 Thread Thomas Heller
Torsten Bronger wrote: Hallöchen! I'd like to script C++ funtions by an embedded Python interpreter. So far, my C++ main() function contains: Py_Initialize(); Py_InitModule(pp3, PythonMethods); PyRun_SimpleString(from pp3 import *); PyRun_AnyFile(stdin, NULL); Py_Finalize();

Re: Extending embedded Python: Adding single methods

2006-03-08 Thread Thomas Heller
Torsten Bronger wrote: Hallöchen! Thomas Heller [EMAIL PROTECTED] writes: Torsten Bronger wrote: [...] However, is there a way to avoid this dummy pp3 module and add the C++ functions directy to the main namespace in the Python script? Yes. You can import __builtin__, and add methods

Re: how about adding ping's uuid module to the standard lib ?

2006-03-06 Thread Thomas Heller
Fredrik Lundh wrote: see subject and http://python.org/sf/1368955 comments ? /F I haven't used this module, but: The wingetaddr() function doesn't work on a german version of windows (there is no line in the output that starts with 'physical address'). In getaddr(), what if windows is

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 even

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 is one

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 Python on

comtypes 0.2 released

2006-02-16 Thread Thomas Heller
comtypes is a pure Python COM package, based on the ctypes FFI library. comtypes replaces and extends the former ctypes.com package. It offers superior support for custom COM interfaces with typelib support. Requires ctypes 0.9.9.3 or later. Limitations: - inprocserver code should work,

ctypes 0.9.9.3 released

2006-02-16 Thread Thomas Heller
ctypes 0.9.9.3 released - Feb 15, 2006 == 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

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 also allows to have a separate shared library.zip

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: 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. more than

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 PythonWin it

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,macwindows

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.match(r'(xx+)\1+$',

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) ctypes.windll.user32.MessageBoxA.argtypes = (c_int, c_char_p

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

Re: Unicode style in win32/PythonWin

2006-01-12 Thread Thomas Heller
Robert [EMAIL PROTECTED] writes: Neil Hodgson wrote: Robert: After is_platform_unicode = auto, 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 the python-win32

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 and call

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 ... 1. Propose it on python-dev. 2. Commit to maintain

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 myself.

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/thread.html#41814 And Guido's last word was this (see the end

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: Win32 Binary-only for 2.3.x?

2006-01-09 Thread Thomas Heller
Trent Mick [EMAIL PROTECTED] writes: [Fuzzyman wrote] Out of interest, doesn't the Python binary use the registry (and environment variables) for building sys.path ? Yes, good point... Won't you still have conflicting path issues if you use an alternative binary with an existing

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 the code that does this? I wasn't easily

Re: Calling foreign functions from Python? ctypes?

2006-01-08 Thread Thomas Heller
=?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?= [EMAIL PROTECTED] writes: Paul Watson wrote: I need to call some Windows APIs. Is the only way to download ctypes or the win32 interfaces? That depends on the specific win32 interface you want to call. Typically, the answer is yes. Is there any plan

Re: Win32 Binary-only for 2.3.x?

2006-01-04 Thread Thomas Heller
[EMAIL PROTECTED] writes: Hi, I must be going nutty, but I can't seem to find anywhere where I can get just the binaries for, say, 2.3.5 for win32. I've googled high and low and all I come up with is installer (MSI/EXE) binaries and the source code. They have to be somewhere. I cant be

Re: python coding contest

2005-12-30 Thread Thomas Heller
Shane Hathaway [EMAIL PROTECTED] writes: Andrew Durdin wrote: On 12/28/05, Shane Hathaway [EMAIL PROTECTED] wrote: I just found a 125 character solution. It's actually faster and more readable than the 133 character solution (though it's still obscure.) Having spent a good deal of time and

Question about the 'code' module

2005-12-29 Thread Thomas Heller
I'm using the code module to implement an interactive interpreter console in a GUI application, the interpreter running in a separate thread. To provide clean shutdown of the application, I have to make sure that objects used in the interpreter thread are deleted when the thread ends. I delete

Re: Testing the availability of a module

2005-12-19 Thread Thomas Heller
Gerhard Häring [EMAIL PROTECTED] writes: Bo Peng wrote: Dear list, Is there a better way than doing try: import aModule except: has_aModule = False else: has_aModule = True The main concern here is that loading aModule is unnecessary (and may take time). No, there is not

Re: python24.dll and encodings ?

2005-12-16 Thread Thomas Heller
Bugs [EMAIL PROTECTED] writes: Thomas Heller wrote: [snip] A PEP discussing the rationales would *really* be great. My whole impetus for this thread was to minimize the size of Python executables created with py2exe. Right now they tend to be rather large, even for very small applications

<    1   2   3   4   5   6   7   8   >