Re: problems with logging module

2007-07-29 Thread Alia Khouri
On Jul 30, 8:01 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > To see what's going on, try using this old-fashioned debug technique: a > few print statements. My bad, problem was solved, the shortcoming was one of my variables pointing to nothingness (-; But I'm not letting the logging mod

Re: wxGlade: Who knows how to drive this application?

2007-07-29 Thread Alberto Griggio
> Here are some things I can think of, in no particular order: Thanks! I can't promise I'll take care of all of them (some are nontrivial to implement, and would probably take a lot of time), but this list is definitely valuable (e.g. I can circulate it through the other developers to see if there

How to write GUI and event separately in wxPython??

2007-07-29 Thread Jia Lu
HI all I am making an application with wxpython. But I got a problem when I want to change the display string according to process status. I passed the frame to the processing function and use the frame.txtobj to change displaying strings. I found it is a bad method to do that. Can any one

Re: Hex editor display - can this be more pythonic?

2007-07-29 Thread Marc 'BlackJack' Rintsch
On Sun, 29 Jul 2007 18:27:25 -0700, CC wrote: > Marc 'BlackJack' Rintsch wrote: >> I'd use `string.printable` and remove the "invisible" characters like '\n' >> or '\t'. > > What is `string.printable` ? There is no printable method to strings, > though I had hoped there would be. I don't yet k

Re: Installing mod_python on mac os 10.4.7

2007-07-29 Thread 7stud
On Jul 29, 5:28 pm, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Jul 30, 2:37 am, 7stud <[EMAIL PROTECTED]> wrote: > > > > > On Jul 29, 4:07 am, Graham Dumpleton <[EMAIL PROTECTED]> > > wrote: > > > > Have you got an appropriate LoadModule directive in Apache > > > configuration to load the mod

Re: making a variable available in a function from decorator

2007-07-29 Thread Marc 'BlackJack' Rintsch
On Sun, 29 Jul 2007 15:22:47 -0700, [EMAIL PROTECTED] wrote: > I create a variable in a decorator. i want to be able to access that > variable in the function to be decorated. How to do this? Pass it as argument to the function: def deco(func): eggs = 42 def decorated(*args, **kwargs):

Re: making a variable available in a function from decorator

2007-07-29 Thread Gabriel Genellina
En Sun, 29 Jul 2007 19:22:47 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: > I create a variable in a decorator. i want to be able to access that > variable in the function to be decorated. How to do this? Combining `wraps` and `partial` from the functools standard module

Re: Compiling 2.5.1 on OpenBSD 4.1

2007-07-29 Thread Martin v. Löwis
> __BSD_VISIBLE is there (it wasn't there before and that's what was causing my > original problem). > [EMAIL PROTECTED]:/bu/pkg/Python-2.5.1$ grep _BSD_SOURCE pyconfig.h > [EMAIL PROTECTED]:/bu/pkg/Python-2.5.1$ grep _BSD_VISIBLE pyconfig.h > #define __BSD_VISIBLE 1 It being in pyconfig.h is irr

Re: ctypes:passing python class instances through c and back

2007-07-29 Thread Gabriel Genellina
En Thu, 26 Jul 2007 12:18:04 -0300, m2i3k <[EMAIL PROTECTED]> escribió: > I have C code with requires me to register a python callback. I am > able to get the callback working well using ctypes if I use global > functions without any context argument for the callback. > > Now I want to register a

Re: problems with logging module

2007-07-29 Thread Gabriel Genellina
En Sun, 29 Jul 2007 18:29:58 -0300, Alia Khouri <[EMAIL PROTECTED]> escribió: > I've been struggling with the logging module in the stdlib which seems > to me rather counter-intuitive: > > For some reason it refuses to recognize configuration options when > they are set inside a class so I have

Re: Why no maintained wrapper to Win32?

2007-07-29 Thread sturlamolden
On Jul 30, 6:07 am, Gilles Ganault <[EMAIL PROTECTED]> wrote: > For people who don't konw the Win32 API and don't know C... is the > O'Reilly book above the best source of information on how to write > Win32 GUI apps in Python? Why inflict suffering on yourself with MFC when you can use wxPython

Re: Bug in cPickle with packages and 'object' inherited class

2007-07-29 Thread Gabriel Genellina
En Wed, 25 Jul 2007 17:32:46 -0300, Conrado PLG <[EMAIL PROTECTED]> escribió: > Say you have this structure: > > pna/ > __init__.py > model.py > > > __init__.py is empty. > > model.py is: > > > import cPickle as pickle > > class A(object): > pass > > def serialize(): > pickle.dum

Re: 128 or 96 bit integer types?

2007-07-29 Thread Tim Roberts
John DeRosa <[EMAIL PROTECTED]> wrote: >On Sat, 28 Jul 2007 00:19:02 -0700, "[EMAIL PROTECTED]" ><[EMAIL PROTECTED]> wrote: > >>For example, how many ways can you put 492 marbles into >>264 ordered bins such that each bin has at least 1 marble? >> >>The answer >> >>66189415264331559482776409694993

Re: 128 or 96 bit integer types?

2007-07-29 Thread Tim Roberts
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > >So I never let the age of the universe intimidate me. +1 QOTW. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why no maintained wrapper to Win32?

2007-07-29 Thread Gilles Ganault
On Sun, 29 Jul 2007 19:33:40 -0700, sturlamolden <[EMAIL PROTECTED]> wrote: >You mean 'total lack of documentation' besides Mark Hammond's O'Reilly >book on Windows programming in Python? Sorry, I thought that book was way outdated because it uses Python 1.5. >Not to mention MSDN, Charles Petzold

What is the difference about "pycap" and "pylibpcap"?

2007-07-29 Thread Evan
Hi, I'm a new hire with python program, I want to write script for changing/moniter/filter the network packet, it seems there are two extensions in python, pycap and pylibcap. I was confused, what is the difference about pycap and pylibpcap? Differnet user interface only? Thanks, -- http://mai

Important new release (was: Crunchy security advisory)

2007-07-29 Thread André
A new release (0.9.2) containing a very important security fix is available for Crunchy, at http://code.google.com/p/crunchy Anyone using Crunchy *should* download this release. Fairly detailed information about the security issue can be found on the FAQ page included in Crunchy's release (viewab

Re: Why no maintained wrapper to Win32?

2007-07-29 Thread sturlamolden
On Jul 29, 1:29 am, Gilles Ganault <[EMAIL PROTECTED]> wrote: > Besides the total lack of documentation, You mean 'total lack of documentation' besides Mark Hammond's O'Reilly book on Windows programming in Python? Not to mention MSDN, Charles Petzold's book, and other sources of Win32 API and M

Re: Hex editor display - can this be more pythonic?

2007-07-29 Thread CC
Dennis Lee Bieber wrote: > On Sun, 29 Jul 2007 12:24:56 -0700, CC <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: >>for c in ln: >> if c in printable: sys.stdout.write(c) >> else: >> sys.stdout.write('\x1B[31m.') >> sys.stdout.write('\x1B[0m') > Be a

Re: Hex editor display - can this be more pythonic?

2007-07-29 Thread CC
Marc 'BlackJack' Rintsch wrote: > On Sun, 29 Jul 2007 12:24:56 -0700, CC wrote: >>The next step consists of printing out the ASCII printable characters. >>I have devised the following silliness: >> >>printable = ' >>[EMAIL PROTECTED]&8*9(0)aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ\ >>`

Re: What does this thread have to do with classical music,

2007-07-29 Thread Art Deco
ah <[EMAIL PROTECTED]> wrote: >Art Deco wrote: >> ah <[EMAIL PROTECTED]> wrote: >>>Art Deco wrote: ah <[EMAIL PROTECTED]> wrote: >Art Deco wrote: >> Who wrote? >> >> >>>What does that have to do with classical music, snuhwolf? >> >>>What does that have to do with

Re: Installing mod_python on mac os 10.4.7

2007-07-29 Thread Graham Dumpleton
On Jul 30, 2:37 am, 7stud <[EMAIL PROTECTED]> wrote: > On Jul 29, 4:07 am, Graham Dumpleton <[EMAIL PROTECTED]> > wrote: > > > Have you got an appropriate LoadModule directive in Apache > > configuration to load the mod_python module? That you get this error > > is indicative of mod_python module n

making a variable available in a function from decorator

2007-07-29 Thread [EMAIL PROTECTED]
Hi I create a variable in a decorator. i want to be able to access that variable in the function to be decorated. How to do this? thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Understanding mxODBC Insert Error

2007-07-29 Thread Jon Clements
On 29 Jul, 17:41, Greg Corradini <[EMAIL PROTECTED]> wrote: > Hello, > I'm trying to perform a simple insert statement into a table called > Parcel_Test (see code below). Yet, I get an error message that I've never > seen before (see traceback below). I've tried to put a semicolon at the end > of t

Re: Understanding mxODBC Insert Error

2007-07-29 Thread John Machin
On Jul 30, 2:41 am, Greg Corradini <[EMAIL PROTECTED]> wrote: > Hello, > I'm trying to perform a simple insert statement into a table called > Parcel_Test (see code below). Yet, I get an error message that I've never > seen before (see traceback below). I've tried to put a semicolon at the end > of

problems with logging module

2007-07-29 Thread Alia Khouri
I've been struggling with the logging module in the stdlib which seems to me rather counter-intuitive: For some reason it refuses to recognize configuration options when they are set inside a class so I have had to initialize logging and set the configuration options in the global scope of my modu

Re: Compiling 2.5.1 on OpenBSD 4.1

2007-07-29 Thread nazgul
=?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?= <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > It may work, but I don't like it. Can you please try this one instead, > and report whether it works? > Different error: gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-protot

Re: Why no maintained wrapper to Win32?

2007-07-29 Thread Gilles Ganault
On Sun, 29 Jul 2007 06:40:35 +0200, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: >Why do you say that the Win32 API lacks documentation? I find the >documentation at msdn.microsoft.com to be quite useful. No, I meant documentation on how to write Win32 apps using PyWin. >Yes, there haven't been m

Re: 128 or 96 bit integer types?

2007-07-29 Thread David H Wild
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > To actually answer you question, there is a known loop > cycle in 3n+85085 for which p=492 and q=264. If there is > one solution, there must be at leats 263 others (the > cyclic permutations), but to brute force searc

Re: Hex editor display - can this be more pythonic?

2007-07-29 Thread Marc 'BlackJack' Rintsch
On Sun, 29 Jul 2007 12:24:56 -0700, CC wrote: > ln = '\x00\x01\xFF 456\x0889abcde~' > import sys > for c in ln: > sys.stdout.write( '%.2X ' % ord(c) ) > > or this: > > sys.stdout.write( ' '.join( ['%.2X' % ord(c) for c in ln] ) + ' ' ) > > Either of these produces the desired output: > >

Re: Events: The Python Way

2007-07-29 Thread Gianmaria
"David Wilson" <[EMAIL PROTECTED]> ha scritto nel messaggio news:[EMAIL PROTECTED] > Hi there, > > Python has no built-in way of doing this. You may consider writing > your own class if you like this pattern (I personally do): > > class Event(object): >def __init__(self): >self.subscri

Re: What does this thread have to do with classical music,

2007-07-29 Thread ah
Art Deco wrote: > ah <[EMAIL PROTECTED]> wrote: >>Art Deco wrote: >>> ah <[EMAIL PROTECTED]> wrote: Art Deco wrote: > Who wrote? > > >>What does that have to do with classical music, snuhwolf? > >>What does that have to do with classical music, snuhwolf? > >

Re: Installing mod_python on mac os 10.4.7

2007-07-29 Thread pepebuslo
www.pylonshq.com, www.pythonpaste.org you may find these easier than mod_python. -- http://mail.python.org/mailman/listinfo/python-list

Hex editor display - can this be more pythonic?

2007-07-29 Thread CC
Hi: I'm building a hex line editor as a first real Python programming exercise. Yesterday I posted about how to print the hex bytes of a string. There are two decent options: ln = '\x00\x01\xFF 456\x0889abcde~' import sys for c in ln: sys.stdout.write( '%.2X ' % ord(c) ) or this: sys.st

Re: 128 or 96 bit integer types?

2007-07-29 Thread [EMAIL PROTECTED]
On Jul 28, 3:34 am, David H Wild <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, >[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > For example, how many ways can you put 492 marbles into > > 264 ordered bins such that each bin has at least 1 marble? > > The answer > > 66189415264

Re: Understanding mxODBC Insert Error

2007-07-29 Thread Harrie Geerts
"Greg Corradini" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] > > Hello, > I'm trying to perform a simple insert statement into a table called > Parcel_Test (see code below). Yet, I get an error message that I've never > seen before (see traceback below). I've tried to put a semi

UK Ordnance survey coordinates and Geocoding anyone ?

2007-07-29 Thread Ken Starks
Has anyone written a python wrapper around the (Windows) dll for converting between OSGB36 and ETRS89 coordinates ? The dll and an application are available from http://www.qgsl.co.uk as long as you register. Information, if you don't know what I'm taking about: -

Re: Compiling 2.5.1 on OpenBSD 4.1

2007-07-29 Thread Martin v. Löwis
> Thanks Martin. Did I mention this was OpenBSD 4.1 in the original post? > Here's the patch: It may work, but I don't like it. Can you please try this one instead, and report whether it works? Thanks, Martin Index: configure ===

Understanding mxODBC Insert Error

2007-07-29 Thread Greg Corradini
Hello, I'm trying to perform a simple insert statement into a table called Parcel_Test (see code below). Yet, I get an error message that I've never seen before (see traceback below). I've tried to put a semicolon at the end of the sql statement, but with no luck. Any ideas from more experienced m

Re: Installing mod_python on mac os 10.4.7

2007-07-29 Thread 7stud
On Jul 29, 4:07 am, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > Have you got an appropriate LoadModule directive in Apache > configuration to load the mod_python module? That you get this error > is indicative of mod_python module not being loaded. You can check the > Apache error logs to see if

Re: Split a string based on change of character

2007-07-29 Thread [EMAIL PROTECTED]
On Jul 28, 11:36 pm, Andrew Savige <[EMAIL PROTECTED]> wrote: (snipped) > > Yes. Here's a simpler example without any backreferences: > > s = re.split(r'(?<=\d)(?=\D)', '1B2D3') > > That works in Perl but not in Python. > Is it that "chaining" assertions together like this is not supported in Pyt

Re: Installing mod_python on mac os 10.4.7

2007-07-29 Thread 7stud
On Jul 29, 4:07 am, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > > Any ideas what went wrong? > > Have you got an appropriate LoadModule directive in Apache > configuration to load the mod_python module? That you get this error > is indicative of mod_python module not being loaded. > I checked an

Re: Compiling 2.5.1 on OpenBSD 4.1

2007-07-29 Thread nazgul
=?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?= <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: >> I'm stumped. Any suggestions? > > You will have to find the true declaration of lstat - reading > man pages or checking that everything "looks right" won't help. > > So where is lstat declared?

Re: replacement for execfile

2007-07-29 Thread Alex Popescu
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > On Sat, 28 Jul 2007 15:17:56 +, Alex Popescu wrote: > >> Hi all! >> >> From another thread (and the pointed PEP) I have found that execfile >> will not be present in Py3k. So, I am wondering what will be its >> replace

Re: Python 2.5.1 can't find win32file?

2007-07-29 Thread Gabriel Genellina
En Sat, 28 Jul 2007 11:47:48 -0300, samwyse <[EMAIL PROTECTED]> escribió: > On Jul 28, 8:16 am, samwyse <[EMAIL PROTECTED]> wrote: >> I just upgraded from 2.4.something to 2.5.1. I get the stuff below. >> I tried easy-installing pywin32; same results. Anyone know what's >> going on? > > Interest

Re: interpreter in the background

2007-07-29 Thread Gabriel Genellina
En Sat, 28 Jul 2007 08:29:38 -0300, Andrea Tomadin <[EMAIL PROTECTED]> escribió: > I need to use the Python interpreter as if it were a Matlab or > Mathematica "kernel", i.e. running in the background while I use an > interface program to send commands and get output. Try building something aro

Re: Python 2.5.1 can't find win32file?

2007-07-29 Thread samwyse
On Jul 28, 12:14 pm, Jay Loden <[EMAIL PROTECTED]> wrote: > samwyse wrote: > > Interestingly enough, this works: > > > C:\Python25>path=%path%;C:\Python25\Lib\site-packages\pywin32-210- > > py2.5-win32.eg > > g\pywin32_system32 > > > C:\Python25>python > > Python 2.5.1 (r251:54863, Apr 18 2007, 08:

Re: Compiling python2.5.1 results in 3.5MB python lib?

2007-07-29 Thread thebjorn
On Jul 29, 12:46 pm, simonbun <[EMAIL PROTECTED]> wrote: ... > How would I go about doing this? I'm not sure what to strip nor how to > do it. man strip -- bjorn -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with change to exceptions

2007-07-29 Thread Gabriel Genellina
En Fri, 27 Jul 2007 19:49:17 -0300, Neal Becker <[EMAIL PROTECTED]> escribió: > import exceptions > > class nothing (exceptions.Exception): > def __init__ (self, args=None): > self.args = args > > if __name__ == "__main__": > raise nothing > > Traceback (most recent call last): >

Why Is This The Best Program Online ?

2007-07-29 Thread adayattheoffice
If You Want To Make Money ..This Is What You Do. I Spent 2 Years Trying To Make Money And Thankfully Now I Am No Longer Trying ,I Am Actively Doing So. This Is What It Takes.. http://trakclix.com/ct/t.php?l=353 -- http://mail.python.org/mailman/listinfo/python-list

Re: encode/decode misunderstanding

2007-07-29 Thread Diez B. Roggisch
Tim Arnold schrieb: > Hi, I'm beginning to understand the encode/decode string methods, but I'd > like confirmation that I'm still thinking in the right direction: > > I have a file of latin1 encoded text. Let's say I put one line of that file > into a string variable 'tocline', as follows: > to

Re: 128 or 96 bit integer types?

2007-07-29 Thread Carl Friedrich Bolz
Paul Rubin wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: >> has 146 digits. And that's just the begining. The above >> actually represents a polynomial with 264 terms, the >> exponents of which range from 0 to 492. One of those >> polynomials can have over 5 decimal digits when >> so

Re: Compiling python2.5.1 results in 3.5MB python lib?

2007-07-29 Thread simonbun
On Jul 28, 11:07 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > I'm compiling 2.5.1 and end up with a 3.5MB libpython2.5.so file. I > > seem to remember it should be somewhere around the 1MB mark. What > > could be causing this? > > Try stripping it. > > Regards, > Martin How would I go abou

Re: Installing mod_python on mac os 10.4.7

2007-07-29 Thread Graham Dumpleton
On Jul 29, 7:26 am, 7stud <[EMAIL PROTECTED]> wrote: > On Jul 14, 8:34 pm, Graham Dumpleton <[EMAIL PROTECTED]> > wrote: > > > > > On Jul 15, 10:06 am, Graham Dumpleton <[EMAIL PROTECTED]> > > wrote: > > > > On Jul 15, 2:47 am, 7stud <[EMAIL PROTECTED]> wrote: > > > > > Themod_pythonmanual says thi