Problems with subclassing enum34

2013-06-28 Thread Thomas Heller
trying out the enum34 module. What I want to create is a subclass of enum.Enum that is also based on ctypes.c_int so that I can better use enum instances in ctypes api calls. When I do this, I get a metaclass conflict: >>> class MyEnum(ctypes.c_int, enum.Enum): ...FOOBAR = 0 ... Traceback

Re: Problems with subclassing enum34

2013-06-28 Thread Thomas Heller
Am 28.06.2013 17:16, schrieb Ethan Furman: On 06/28/2013 03:48 AM, Thomas Heller wrote: trying out the enum34 module. What I want to create is a subclass of enum.Enum that is also based on ctypes.c_int so that I can better use enum instances in ctypes api calls. Have you tried using

Re: Problems with subclassing enum34

2013-06-28 Thread Thomas Heller
Am 28.06.2013 17:25, schrieb Thomas Heller: Robert Kern: enum.EnumMeta uses super() in its __new__() implementation but _ctypes.PyCSimpleType doesn't. Thus, only _ctypes.PyCSimpleType.__new__() gets a chance to run. Switching the order of the two might work. Robert found the proble

2to6 ?

2012-06-27 Thread Thomas Heller
Is there a tool, similar to 2to3, which converts python2 code to code using six.py, so that it runs unchanged with python2 *and* python 3? Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: 2to6 ?

2012-07-02 Thread Thomas Heller
Am 27.06.2012 20:06, schrieb Terry Reedy: On 6/27/2012 10:36 AM, Thomas Heller wrote: Is there a tool, similar to 2to3, which converts python2 code to code using six.py, so that it runs unchanged with python2 *and* python 3? Others have expressed a similar wish, but I do not know that anyone

Re: The best, friendly and easy use Python Editor.

2013-01-24 Thread Thomas Heller
Am 24.01.2013 16:54, schrieb rusi: [I personally use emacs. It would be sadistic to make that into a recommendation] It would be truly sadistic to force a long-time emacs user to any other editor. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Python launcher (PEP 397) and emacs python-mode.el

2013-01-31 Thread Thomas Heller
Has someone managed to patch python-mode.el to use the PEP 397 python launcher when you hit C-c C-c? It seems that emacs should parse the shebang line in the edited python script and pass the corresponding arguments to py.exe. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Python launcher (PEP 397) and emacs python-mode.el

2013-01-31 Thread Thomas Heller
Am 31.01.2013 12:05, schrieb Andreas Röhler: Am 31.01.2013 10:03, schrieb Thomas Heller: Has someone managed to patch python-mode.el to use the PEP 397 python launcher when you hit C-c C-c? It seems that emacs should parse the shebang line in the edited python script and pass the corresponding

Re: mmap and bit wise twiddling - Raspberry Pi

2012-05-02 Thread Thomas Heller
Am 02.05.2012 19:40, schrieb Petr Jakes: Hi, I am trying to work with HW peripherals on Raspberry Pi To achieve this, it is necessary read/write some values from/to the memory directly. I am looking for some wise way how to organize the bit twiddling. To set some specific bit, for example, it i

Re: mmap and bit wise twiddling - Raspberry Pi

2012-05-02 Thread Thomas Heller
Am 02.05.2012 22:05, schrieb Thomas Heller: class GPIO(BitVector): def __init__(self, address, value=0xFF, nbits=8): self.address = address super(GPIO, self).__init__(value, nbits) def _get_value(self): "read an 8-bit value from the hardware as 8-bit in

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Thomas Heller
Am 20.04.2011 00:21, schrieb Grant Edwards: I'm have problems figuring out how to receive UDP broadcast packets on Linux. [...] On the receiving machine, I've used tcpdump to verify that broadcast packets are being seen and have a destination IP of 255.255.255.255 and destination MAC of ff:ff:

Re: List of WindowsError error codes and meanings

2011-05-26 Thread Thomas Heller
Am 20.05.2011 19:56, schrieb Andrew Berg: This is probably somewhat off-topic, but where would I find a list of what each error code in WindowsError means? WindowsError is so broad that it could be difficult to decide what to do in an except clause. Fortunately, sys.exc_info()[1][0] holds the spe

Re: Open PDF

2005-09-23 Thread Thomas Heller
"Martin Miller" <[EMAIL PROTECTED]> writes: > IMHO, the fact that there is no way to wait for the application to > finish is major deficiency with os.startfile() -- and why I often > cannot use it instead of other techniques [such as the much more > involved but limited os.spawnv() function]. > >

Re: Getting tired with py2exe

2005-09-26 Thread Thomas Heller
Bugs <[EMAIL PROTECTED]> writes: > Any luck on finding anyone to take over py2exe development Thomas? > It's a GREAT project and would be a shame to see it fall into > obsolescence. No, nobody stepped up (yet). Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting tired with py2exe

2005-09-26 Thread Thomas Heller
> Thomas Heller wrote: >> Bugs <[EMAIL PROTECTED]> writes: >> >>>Any luck on finding anyone to take over py2exe development Thomas? >>>It's a GREAT project and would be a shame to see it fall into >>>obsolescence. >> No, nobody stepped up

Re: Set up Windows environment with python

2005-09-29 Thread Thomas Heller
"Jim" <[EMAIL PROTECTED]> writes: > My company resells windows machines, and we install our software, and > do a bunch of customization to make sure that all the desktop settings > are optimal... we adjust the screen resolution, color depth, and > referesh rate, remove shadows from menus and the

Re: PyWin SendMessage

2005-09-29 Thread Thomas Heller
"g.franzkowiak" <[EMAIL PROTECTED]> writes: > Hello everybody, > > I've tryed to use an interprocess communication via > SendMessage on Windows. > Unfortunately, nothing goes on > > # > #! /usr/bin/env python > > import win32a

Re: PyWin SendMessage

2005-09-29 Thread Thomas Heller
"g.franzkowiak" <[EMAIL PROTECTED]> writes: > Thomas Heller schrieb: >> "g.franzkowiak" <[EMAIL PROTECTED]> writes: >> >> >>>Hello everybody, >>> >>>I've tryed to use an interp

How to prevent logging warning?

2005-10-05 Thread Thomas Heller
I'm about to add some logging calls to a library I have. How can I prevent that the script that uses the library prints 'No handlers could be found for logger "comtypes.client"' when the script runs? I would like to setup the logging so that there is no logging when nothing is configured, and no

Re: How to prevent logging warning?

2005-10-05 Thread Thomas Heller
> Thomas Heller wrote: >> I'm about to add some logging calls to a library I have. How can I >> prevent that the script that uses the library prints >> 'No handlers could be found for logger "comtypes.client"' when the >> script runs? >

Re: py2exe has a new maintainer

2005-10-06 Thread Thomas Heller
"Jimmy Retzlaff" <[EMAIL PROTECTED]> writes: > I am taking over the maintenance and support of py2exe from Thomas > Heller. As he announced a few weeks ago he is looking to focus on other > things. py2exe has been very useful to me over the years and I look > forwar

Re: How to prevent logging warning?

2005-10-06 Thread Thomas Heller
"Vinay Sajip" <[EMAIL PROTECTED]> writes: > Thomas Heller wrote: > >> I get the behaviour that I want when I add a 'NULL' handler in the >> library, but is this really how logging is intended to be used? >> > > The reason for the one-o

Re: Absolultely confused...

2005-10-06 Thread Thomas Heller
Jeremy Moles <[EMAIL PROTECTED]> writes: > So, here is my relevant code: > > PyArg_ParseTuple(args, "O!", &PyType_vector3d, &arg1) > > And here ismy error message: > > argument 1 must be pylf.core.vector3d, not pylf.core.vector3d > > I know PyType_vector3d "works" (as I can use them in

Re: Absolultely confused...

2005-10-06 Thread Thomas Heller
and all the extension > modules I've done in the past) a static structure declared and assigned > to all at once, only once. > > Am I misunderstanding the point? :) > > /me ducks > > On Thu, 2005-10-06 at 16:26 +0200, Thomas Heller wrote: >> Jeremy Moles

Re: Moving to Win XP as a Python developer

2005-10-14 Thread Thomas Heller
Scott David Daniels <[EMAIL PROTECTED]> writes: > Christian Stapfer wrote: >> "John J. Lee" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> >>>cmd.exe can be made bearable >>> >>>0. Make a shortcut to cmd.exe, stick it somewhere get-at-able, >>> eg. quick launch toolbar > I

Re: Moving to Win XP as a Python developer

2005-10-14 Thread Thomas Heller
Trent Mick <[EMAIL PROTECTED]> writes: > [Thomas Heller wrote] >> I have an elisp function bound to a key in XEmacs that starts cmd in the >> directory where the current buffer is. IMO this is very convenient. To >> access explorer from that command prompt (in the r

__getattr__, __setattr__

2005-10-20 Thread Thomas Heller
Just wondering about this behaviour, why is it this way? Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> object.__setattr__ >>> object.__getattr__ Traceback (most recent call last): File ""

Re: __getattr__, __setattr__

2005-10-20 Thread Thomas Heller
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > for new style classes __getattribute__ is defined, see eg. > http://www.python.org/2.2.3/descrintro.html Steve Holden <[EMAIL PROTECTED]> writes: > >>> object.__getattribute__ > > > Ring any bells? Yes, of course. Thanks ;-) Thomas -- http

Re: p2exe using wine/cxoffice

2005-10-26 Thread Thomas Heller
Jon Perez <[EMAIL PROTECTED]> writes: > James Stroud wrote: > >> "better". The only reason I want this functionality is to make my software >> available to windoze users--despite their unfortunate ignorance, they are >> people too. That's what I always say. > > Actually, I think it's many unix/lin

Re: Windows vs Linux

2005-10-26 Thread Thomas Heller
"Tim Golden" <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] >> But command line in Windows is in no way in the same >> league as *nix shell. Use for command completion and up/down >> arrow or to search for history. > > [darren kirby] >> Try ctrl-r in bash, then type your first few letters... >

Re: Windows vs Linux [was: p2exe using wine/cxoffice]

2005-10-26 Thread Thomas Heller
"Tim Golden" <[EMAIL PROTECTED]> writes: > [Sybren Stuvel] >> You can't resize it horizontally > > Well, peculiarly, you can do this (as you're probably aware) from > the Properties menu and it'll work immediately, albeit without > advising the running programs that it's resized, so only new > li

Re: How can I package a python script and modules into a single script?

2005-11-03 Thread Thomas Heller
"Noah" <[EMAIL PROTECTED]> writes: > I would like to package my main script and all the > modules it imports into a single script that will > run just as the collection would. It should not > need to package standard Python lib modules -- just > my local modules. This is not the same question > th

Re: Can bdist_wininst built installer require minimum python version?

2005-11-23 Thread Thomas Heller
"SPE - Stani's Python Editor" <[EMAIL PROTECTED]> writes: > A SPE user reported this: > > http://developer.berlios.de/bugs/?func=detailbug&bug_id=4878&group_id=4161 >>SPE Installer gives option for installing for python22 (i have >>python22, 23, and 24 installed) I thought that spe requried 2.3+ (

Re: Reading binary data

2005-11-23 Thread Thomas Heller
"David M" <[EMAIL PROTECTED]> writes: > Thanks but the C Struct describing the data doesn't match up with the > list on the module-struct page. > > this is the acct.h file [...] Tooting my ctypes horn (sorry for that): [EMAIL PROTECTED]:~/ctypes> locate acct.h /usr/include/linux/acct.h /usr/incl

Re: Distutils postinstall script: useless?

2005-11-30 Thread Thomas Heller
Mardy <[EMAIL PROTECTED]> writes: > Le die Wed, 30 Nov 2005 15:46:43 +, Mardy ha scribite: >> the bdist_wininst command of distutils allows me to specify a script to >> be executed at the end of the installation. That's great, but how can I >> know the installation path from inside the scrip

Re: ANN: Louie-1.0b2 - Signal dispatching mechanism

2005-12-01 Thread Thomas Heller
[EMAIL PROTECTED] writes: > Louie 1.0b2 is available: > > > > Louie provides Python programmers with a straightforward way to > dispatch signals between objects in a wide variety of contexts. It is > based on PyDispatcher_, which in turn was based on a hig

Re: ANN: Louie-1.0b2 - Signal dispatching mechanism

2005-12-02 Thread Thomas Heller
"Pat" <[EMAIL PROTECTED]> writes: > Thomas Heller wrote: >> >> What is the difference between PyDispatcher and Louie? >> (I'm still using a hacked version of the original cookbook recipe...) > > Not too much at this point, but the general

Re: How to wake up the jython list moderator

2005-12-06 Thread Thomas Heller
"Anton Vredegoor" <[EMAIL PROTECTED]> writes: > I'm trying to post messages to the jython mailing list via gmane. I > this possible? I've got all kinds of messages confirming that I exist > and that my message has arrived and will be either approved or rejected > with an explanation, but since the

Re: Proposal: Inline Import

2005-12-10 Thread Thomas Heller
Shane Hathaway <[EMAIL PROTECTED]> writes: > Xavier Morel wrote: >> Shane Hathaway wrote: >> >>>Thoughts? >> >>> import re; name_expr = re.compile('[a-zA-Z]+') >> >>> name_expr >> <_sre.SRE_Pattern object at 0x00F9D338> >> >>> >> the import statement can be called anywhere in the code, why woul

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 30)

2005-01-04 Thread Thomas Heller
Skip Montanaro <[EMAIL PROTECTED]> writes: > michele> BTW what's the difference between .encode and .decode ? > > I started to answer, then got confused when I read the docstrings for > unicode.encode and unicode.decode: > > >>> help(u"\xe4".decode) > Help on built-in function decode:

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 30)

2005-01-04 Thread Thomas Heller
Max M <[EMAIL PROTECTED]> writes: > Thomas Heller wrote: > >> It seems also the error messages aren't too helpful: >> >>>>>"ä".encode("latin-1") >> Traceback (most recent call last): >> File "", line 1, in ?

Re: [Hack] Import binary extensions from zipfiles, windows only

2005-01-04 Thread Thomas Heller
"PJDM" <[EMAIL PROTECTED]> writes: > I'm trying to make ZopeX3 start faster by zipping up the "zope" > directory. (Because this will be stored on a CD, having less data to > read will make it quicker to start.) > > The standard python zipimporter won't work with the ZopeX3 .pyd files, > so zipexti

Re: Is there any way/where to subscribe for automated PEP status emails?

2005-01-05 Thread Thomas Heller
[EMAIL PROTECTED] (Bengt Richter) writes: > I find that threads sometimes mention PEPs that I wasn't aware of, > or that an interesting one has been updated without my noticing. > > I should perhaps check the PEP site more regularly, but ISTM it shouldn't > be that hard to implement an automated n

Re: Is there any way/where to subscribe for automated PEP status emails?

2005-01-06 Thread Thomas Heller
Nick Coghlan <[EMAIL PROTECTED]> writes: > Thomas Heller wrote: >> You could probably subscribe to python-checkins, and filter it. >> Or read it via gmane. > > Hmm - can SF be used to setup a mailing list just for checkins to a > single directory in the source tree?

appending data to an xml file

2005-01-11 Thread Thomas Heller
I want to append/insert additional data to an xml file. Context: I use gccxml to parse C header files. gccxml creates an xml file containing all the definitions from the header files. The xml files may be somewhat largish, for 'windows.h' it has more than 5 MB. Since the xml does not contain #de

Re: Windows GUIs from Python

2005-01-11 Thread Thomas Heller
Luke Skywalker <[EMAIL PROTECTED]> writes: > On Tue, 11 Jan 2005 12:55:42 -0600, Doug Holton <[EMAIL PROTECTED]> wrote: >>You might also be interested in PyGUI although it doesn't have a native >>Windows implementation yet: >>http://nz.cosc.canterbury.ac.nz/~greg/python_gui/ > > Generally speaki

Re: from __future__ import decorators

2005-01-13 Thread Thomas Heller
Jacek Generowicz <[EMAIL PROTECTED]> writes: > I have some code, which makes copious use of the @decorator syntax > which was introduced in Python2.4. Now I find myself in a situation > where I have to run the code under Python 2.3. However, I would like > to keep developing the code with the new

Re: MemoryError with parser.suite and wrong encoding declaration

2005-01-18 Thread Thomas Heller
Sylvain Thenault <[EMAIL PROTECTED]> writes: > Hi there ! > I've noticed the following problem with python >= 2.3 (actually 2.3.4 and > 2.4): > > [EMAIL PROTECTED]:test$ python > Python 2.3.4 (#2, Sep 24 2004, 08:39:09) > [GCC 3.3.4 (Debian 1:3.3.4-12)] on linux2 > Type "help", "copyright", "credi

Re: Installer made with bdist_wininst segfaulting...

2005-01-25 Thread Thomas Heller
Fernando Perez <[EMAIL PROTECTED]> writes: > Hi all, > > I am seeking advice/help from those with more win32 experience than myself. I > am trying to build a proper win32 installer for IPython, after a user did most > of the hard work. For the most part, it's working very well, but I am running

Re: py2exe problem

2005-01-26 Thread Thomas Heller
Harald Massa <[EMAIL PROTECTED]> writes: > Grant Edwards > >> LookupError: no codec search functions registered: can't find encoding >> Googling for the error message will find you the answer. > > http://starship.python.net/crew/theller/moin.cgi/Py2Exe > > carries within "encodings" and "encodi

Re: py2exe problem

2005-01-26 Thread Thomas Heller
Harald Massa <[EMAIL PROTECTED]> writes: > Thomas Heller <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > >>> >>> A software development system which REALLY solves the encodings >>> problem WITHOUT creating a swarm of new ones could w

Re: Forcing interactive interpreter without (-i)

2005-02-01 Thread Thomas Heller
Miki Tebeka <[EMAIL PROTECTED]> writes: > Hello All, > > If there a way a script can tell Python to enter interactive mode even if > the -i command line switch was not given? > > I want py2exe to create an interactive session, without writing my own > REPL. IIRC, in newer Python versions, you can

Re: Where are list methods documented?

2005-02-01 Thread Thomas Heller
Grant Edwards <[EMAIL PROTECTED]> writes: > On 2005-02-01, Brian van den Broek <[EMAIL PROTECTED]> wrote: > >> I'm not positive I understand what you are looking for, but do these >> help?: >> >> >>

Re: Python for S60 mentioned in a mainstream Finnish e-news website

2005-02-02 Thread Thomas Heller
Ville Vainio <[EMAIL PROTECTED]> writes: > Of course there is the whole hog and more in the official Nokia press > release, this time in English: > > http://press.nokia.com/PR/200501/978226_5.html > > It also paints an accurate and quite positive picture of Python. Now > we just need ctypes or Sym

Re: pyFMOD problem

2005-02-03 Thread Thomas Heller
[EMAIL PROTECTED] (Tian) writes: > I am trying to use pyfmod in python to manipulate sound. > i have installed pyfmod, ctype, numarray (if they are necessary), i > also copied fmod.dll to python/DLLs as well as windows/system32, but First, you should copy fmod.dll to a directory somewhere where L

Re: Where is WSAEnumNetworkEvents???

2005-02-03 Thread Thomas Heller
Dave Brueck <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: >> I was trying to write an asyncronous TCP server for win32 using >> WSAEventSelect (which lives if win32file). Such events require >> WaitForMultipleObjects (which lives if win32event) and >> WSAEnumNetworkEvents WHICH IS NOT EXP

Re: Python API to manipulate CAB files.

2005-06-23 Thread Thomas Heller
Konstantin Veretennicov <[EMAIL PROTECTED]> writes: > On 6/22/05, Peter Maas <[EMAIL PROTECTED]> wrote: >> Isaac Rodriguez schrieb: >> > Does anyone know of a Python API to manipulate CAB files? > > I guess you'll have to interface with setupapi.dll > (SetupIterateCabinet) via ctypes, or with Micr

Re: List of all installed applications (XP)?

2005-06-23 Thread Thomas Heller
"Guy Lateur" <[EMAIL PROTECTED]> writes: > | What -- from your point of view -- is an "application"? > > Good question. Let me try to elaborate: I would like to know if people in > our company (building techniques) are using non-licensed software (eg > Photoshop, Office, AutoCad). So I guess by

Re: PEP 304 - is anyone really interested?

2005-06-23 Thread Thomas Heller
Thomas Guettler <[EMAIL PROTECTED]> writes: > Am Wed, 22 Jun 2005 18:01:51 -0500 schrieb Skip Montanaro: > >> >> I wrote PEP 304, "Controlling Generation of Bytecode Files": >> >> http://www.python.org/peps/pep-0304.html >> > > ... > > Hi, > > I am interested in a small subset: I want to im

Re: Modules for inclusion in standard library?

2005-06-27 Thread Thomas Heller
Reinhold Birkenfeld <[EMAIL PROTECTED]> writes: > Hello, > > at the moment python-dev is discussing including Jason Orendorff's path module > into the standard library. I have never used the path module before, although I've heard good things about it. But, it seems to have problems with unicode

Re: whois like functionality on Windows?

2005-06-28 Thread Thomas Heller
Gerrit Muller <[EMAIL PROTECTED]> writes: > I am migrating a website from a UNIX based machine to an Windows > machine. In the logfiles I got from the old machine I mostly got > domain names and sometimes only IP addresses. The Windows machine > seems to produce only IP addresses. > > Somehow I ca

Re: COM problem .py versus .exe

2005-06-29 Thread Thomas Heller
"Tim Golden" <[EMAIL PROTECTED]> writes: > [Greg Miller] > | Hello again, I put the executable on the "virgin" PC today. > | I am using > | the wmi(b) that you gave me. The error that I am receiving now is: > | > | File "autoStart.pyc", line 241, in test > | File "wmib.pyc", line 157, in ? > |

Re: Modules for inclusion in standard library?

2005-06-29 Thread Thomas Heller
Simon Brunning <[EMAIL PROTECTED]> writes: > On 6/28/05, John Roth <[EMAIL PROTECTED]> wrote: >> I'd definitely like to see ctypes. I can agree with the segfault >> issue, but I think that some design work would eliminate that. > > I'm not sure that it would. Ctypes allows you, as one colleague >

Re: Controlling WinAMP (WM_COPYDATA problem)

2005-06-30 Thread Thomas Heller
"The Collector" <[EMAIL PROTECTED]> writes: > Hi, > > I've been looking for almost two full days now to get full control of > WinAMP using python. Simple play/stop functions are no problem. It's > the WM_COPYDATA that's used by IPC_PLAYFILE (=add a file to the > playlist) that's giving me troubles

Re:

2005-07-01 Thread Thomas Heller
"Adriaan Renting" <[EMAIL PROTECTED]> writes: > I'm not a very experienced Python programmer yet, so I might be > mistaken, but there are a few things that would make me prefer C++ over > Python for large (over 500.000 LOC) projects. > - namespaces > - templates > - strong type checking > - data h

Re:

2005-07-01 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> writes: > "Adriaan Renting" <[EMAIL PROTECTED]> writes: > >> I'm not a very experienced Python programmer yet, so I might be >> mistaken, but there are a few things that would make me prefer C++ over &g

Re: importing pyc from memory?

2005-07-04 Thread Thomas Heller
"Derek van Vliet" <[EMAIL PROTECTED]> writes: > The second method you describe sounds like it is along the lines of > what I need to do. Is there a way to do this using the Python/C API? > > For instance, if I have the contents of a pyc file loaded entirely into > memory, and I have a pointer to t

Re: Py2Exe and the log file...

2005-07-05 Thread Thomas Heller
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Hi ! > > 1. Thanx for your answer in the theme of Unicode, and other things. > 2. The problem: > I need to create an application that not need Python libs to install. > Py2Exe is good for that, but I need to copy the "dist" to the network > drive w

Re: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code

2005-07-05 Thread Thomas Heller
[EMAIL PROTECTED] writes: > Ralf W. Grosse-Kunstleve wrote: >> I often find myself writing:: >> >> class grouping: >> >> def __init__(self, x, y, z): >> self.x = x >> self.y = y >> self.z = z >> # real code, finally >> >> This becomes a s

Re: Favorite non-python language trick?

2005-07-06 Thread Thomas Heller
Edvard Majakari <[EMAIL PROTECTED]> writes: > (sorry, my NUA had lost the original article) >> >>> I'm curious -- what is everyone's favorite trick from a non-python >>> language? And -- why isn't it in Python? > > Ability to tag some methods 'deprecated' as in Java (from 1.5 > onwards?). However,

Conditionally implementing __iter__ in new style classes

2005-07-06 Thread Thomas Heller
I'm trying to implement __iter__ on an abstract base class while I don't know whether subclasses support that or not. Hope that makes sense, if not, this code should be clearer: class Base: def __getattr__(self, name): if name == "__iter__" and hasattr(self, "Iterator"): re

Re: Conditionally implementing __iter__ in new style classes

2005-07-06 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> writes: > I'm trying to implement __iter__ on an abstract base class while I don't > know whether subclasses support that or not. > Hope that makes sense, if not, this code should be clearer: > > class Base: > def __getatt

Re: The GIL, callbacks, and GPFs

2005-07-06 Thread Thomas Heller
Francois De Serres <[EMAIL PROTECTED]> writes: > Hello, > > I'm chasing a GPF in the interpreter when running my extension module. > It's not very elaborated, but uses a system (threaded) callback, and > therefore the GIL. > Help would be mucho appreciated. Here's the rough picture: > > static vo

Re: Conditionally implementing __iter__ in new style classes

2005-07-07 Thread Thomas Heller
[EMAIL PROTECTED] (Bengt Richter) writes: > On Wed, 06 Jul 2005 17:57:42 +0200, Thomas Heller <[EMAIL PROTECTED]> wrote: > >>I'm trying to implement __iter__ on an abstract base class while I don't >>know whether subclasses support that or not. > Will a prop

Re: Windows Cmd.exe Window

2005-07-07 Thread Thomas Heller
"Giles Brown" <[EMAIL PROTECTED]> writes: > Nah. You're missing my point. I only want the command window not to > be closed if there is an *exception*. Picky I know, but there you go. I find it useful to set an sys.excepthook which calls the debugger pdb.pm(). This way I not only see the trac

Re: Conditionally implementing __iter__ in new style classes

2005-07-07 Thread Thomas Heller
[EMAIL PROTECTED] (Bengt Richter) writes: > On Thu, 07 Jul 2005 09:51:42 +0200, Thomas Heller <[EMAIL PROTECTED]> wrote: > >>[EMAIL PROTECTED] (Bengt Richter) writes: >> >>> On Wed, 06 Jul 2005 17:57:42 +0200, Thomas Heller <[EMAIL PROTECTED]> wrote: >>

Re: PEP on path module for standard library

2005-07-22 Thread Thomas Heller
[EMAIL PROTECTED] writes: > I really love Jason's 'path' module. Sadly, I've encountered a serious > problem with using it. When you try to 'freeze' an application module, > and Jason's 'path' module is present in any of the directories that are > looked at by freeze's module finder (your app do

Re: showing help(M) when running module M standalone

2005-07-30 Thread Thomas Heller
Chris <[EMAIL PROTECTED]> writes: > hello, > I have a small module which only contains some utility functions. when > running this standalone I would like to show the module docs and each > function docs, as if doing > > import M > help(M) > > I came up with the following but I reckon

Re: Metaclasses and class variables

2005-08-04 Thread Thomas Heller
Jan-Ole Esleben <[EMAIL PROTECTED]> writes: > Hi! > > I am new to this list, and maybe this is a stupid question, but I > can't seem to find _any_ kind of answer anywhere. > > What I want to do is the following: > I want to insert a class variable into a class upon definition and > actually use it

Re: Do I need to have site.py available or not ?

2005-08-06 Thread Thomas Heller
Reinhold Birkenfeld <[EMAIL PROTECTED]> writes: > Terry Reedy wrote: >> <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >>> Hi, >>> on startup my embedded python comes up with "import site failed use >>> -v". Later python crashes on Pyrun_file(). This is the first time I >>> have u

Re: Determining win32 dll dependency

2005-08-15 Thread Thomas Heller
Robin Becker <[EMAIL PROTECTED]> writes: > A client requested that I send MSVCR71.DLL along with the rest of an > application as it wasn't present on his machine. > > That is allowed as > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_c_run.2d.time_libraries.asp

Re: Database of non standard library modules...

2005-08-19 Thread Thomas Heller
Steve Holden <[EMAIL PROTECTED]> writes: > Robert Kern wrote: >> Jon Hewer wrote: >> >>>Is there an online database of non standard library modules for Python? >> http://cheeseshop.python.org/pypi >> > While cheeseshop might resonate with the Monty Python fans I have to > say I think the name suck

Re: pythonXX.dll size: please split CJK codecs out

2005-08-21 Thread Thomas Heller
"Martin v. Löwis" <[EMAIL PROTECTED]> writes: > Ron Adam wrote: >> I would put the starting minimum boundary as: >> >>1. "The minimum required to start the python interpreter with no >> additional required files." >> >> Currently python 2.4 (on windows) does not yet meet that guideline, so >

Re: Revised PEP 349: Allow str() to return unicode strings

2005-08-23 Thread Thomas Heller
Neil Schemenauer <[EMAIL PROTECTED]> writes: > [Please mail followups to [EMAIL PROTECTED] > > The PEP has been rewritten based on a suggestion by Guido to change > str() rather than adding a new built-in function. Based on my > testing, I believe the idea is feasible. It would be helpful if > p

Re: Unix diff command under Window.

2005-08-24 Thread Thomas Heller
"TonyHa" <[EMAIL PROTECTED]> writes: > Hello, > > Does any one have using Python to write a Unix "diff" command for > Window? > > Tony Ha. Yes. There's a script in your Python distribution: Tools/scripts/diff.py See also the docs for the 'difflib' standard library module. I do not know whether

Re: Unix diff command under Window.

2005-08-25 Thread Thomas Heller
Trent Mick <[EMAIL PROTECTED]> writes: > [Neil Hodgson wrote] >> Thomas Heller: >> >> > Yes. There's a script in your Python distribution: >> > Tools/scripts/diff.py >> > >> > See also the docs for the 'difflib' standard

Re: py2exe and output executable name

2005-09-01 Thread Thomas Heller
Miki Tebeka <[EMAIL PROTECTED]> writes: > Hello All, > > Is there a way to tell py2exe to create an executable with arbirary name? > Currently the executable name is the script name with .exe suffix. See the advanced sample in lib/site-packages/py2exe/samples/advanced. The executable name is defi

Re: Python C module questions

2005-09-01 Thread Thomas Heller
Robert Kern <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: >> Hi, >> >> I'm rather new to Python, and I've just written my first Python C >> module. I was wondering if some more experience Pythonista would look >> over what I've written and given me some pointers (or find some bugs). >>

Re: Python C module questions

2005-09-01 Thread Thomas Heller
[EMAIL PROTECTED] writes: [...] > /* convert sequences to tuples if necessary */ > ra1 = PySequence_Fast(ra1, "ra1 must be iterable"); > if (ra1 == NULL) { > return NULL; > } > > dec1 = PySequence_Fast(dec1, "dec1 must be iterable"); > if (dec1 == NULL) { >

py2exe 0.6.1 released

2005-09-05 Thread Thomas Heller
py2exe 0.6.1 released = py2exe is a Python distutils extension which converts python scripts into executable windows programs, able to run without requiring a python installation. Console and Windows (GUI) applications, windows NT services, exe and dll COM servers are support

Re: py2exe 0.6.1 released

2005-09-05 Thread Thomas Heller
[EMAIL PROTECTED] (Bengt Richter) writes: > On Mon, 05 Sep 2005 21:55:19 +0200, Thomas Heller <[EMAIL PROTECTED]> wrote: > >>* py2exe can now bundle binary extensions and dlls into the >> library-archive or the executable itself. This allows to >>

Re: py2exe 0.6.1 released

2005-09-05 Thread Thomas Heller
Bugs <[EMAIL PROTECTED]> writes: > Thomas Heller wrote: >> Changes in this release: >> * py2exe can now bundle binary extensions and dlls into the >> library-archive or the executable itself. This allows to >> finally build real single-file execu

Re: py2exe 0.6.1 released

2005-09-06 Thread Thomas Heller
"Giovanni Bajo" <[EMAIL PROTECTED]> writes: > Thomas Heller wrote: > >> * py2exe can now bundle binary extensions and dlls into the >> library-archive or the executable itself. This allows to >> finally build real single-file executables. &

Re: py2exe 0.6.1 released

2005-09-06 Thread Thomas Heller
[EMAIL PROTECTED] writes: > First: Thank you Thomas for the good work with py2exe. The single-file > option is something I have been waiting for :-) > Will it also be possible to build independent files (such as > my_app_data.zip) into the executable? Depends on how you want to access them at run

Re: py2exe 0.6.1 released

2005-09-06 Thread Thomas Heller
"cmkl" <[EMAIL PROTECTED]> writes: > Hi, > > I didnt succeed to bundle vpython-3.2.3 with py2exe-0.6.1 - regardless > if its build as single file or not: > > "This application has requested the Runtime to terminate it in an > unusual way" and so on... > > This error message seems not generated by

Re: py2exe uses __init__ for class names when logging

2005-09-06 Thread Thomas Heller
flupke <[EMAIL PROTECTED]> writes: > Hi, > > when i run my program and use the logging component, i see this: > > 2005-09-02 17:07:48,193 INFO windowmain 97 Main window created > 2005-09-02 17:07:49,020 DEBUG windowmain 103 Frame proxy of C++ wxFrame instance at _b8dd9401_p_wxFrame> > 2005-09-02

py2exe 0.6.2 released

2005-09-07 Thread Thomas Heller
This is a bugfix release for py2exe 0.6.1. py2exe 0.6.2 released = py2exe is a Python distutils extension which converts python scripts into executable windows programs, able to run without requiring a python installation. Console and Windows (GUI) applications, windows NT se

Re: py2exe 0.6.1 released

2005-09-07 Thread Thomas Heller
"Giovanni Bajo" <[EMAIL PROTECTED]> writes: > Thomas Heller wrote: > >>> I tried it using the wx singlefile example, but unfortunately the >>> resulting executable segfaults at startup (using Python 2.3.3 on >>> Windows 2000, with latest wxWind

Re: py2exe 0.6.1 released

2005-09-07 Thread Thomas Heller
[EMAIL PROTECTED] (Bengt Richter) writes: > If you have a place in the program where output should never happen > except when you would want a console window to see it in, you can > call AllocConsole [1] safely even in multiple such places, just before > the printing, and the first such call will

Re: Using Python with COM to communicate with proprietary Windows software

2005-09-08 Thread Thomas Heller
Joakim Persson <[EMAIL PROTECTED]> writes: [...] > This means that I must come up with a way to interface Python with > this log tool. After some investigations, I have run inte problems -- > my inital approach was to use Python + win32com to communicate with > the COM interface. Unfortunately, it

  1   2   3   4   5   >