Re: what's wrong with this if statement?

2006-07-21 Thread Philippe Martin
John Salerno wrote: > Here's the full code, but you can probably safely ignore most of it, > especially the wxPython stuff: > > --- > > import wx > > > class MyFrame(wx.Frame): > > def __init__(self): > wx.Frame.__init__(self, parent=None, id=wx.I

Re: About Embedding PyWin or wxPython

2006-07-25 Thread Philippe Martin
Mr. Roboto wrote: > > Folks: I want to embark on a project to add Python (actually, wxPython > or PythonWin) to a new Windows app I want to start writing soon. > Essentially, I want to take VB6 (or pos Delphi) and construct the app > framework/core functionality using one of those languages, the

Re: About Embedding PyWin or wxPython

2006-07-25 Thread Philippe Martin
yet another story, for another day. > > Making XRC into a more fully-featured tool (more on par w/ the > aforementioned) is a way nice project unto itself, but not right now. > However, the desk accessory I've mentioned is an excellent 1st step > towards *possibly* doing somet

Re: simple question

2006-07-26 Thread Philippe Martin
Maxine Weill wrote: > I need to install Python Imaging Library (PIL) - imaging-1.1.5.tar.gz > (source ) onto Suse Linux 10.1 system in order for (latest) Scribus > 1.3.3.2 to install and work. > > Plesae indicate how I perform PIL install (exact commands/procedures) in > manner where files are "

Re: how to make python socket server work with the app.MainLoop() in wxpython?

2006-07-30 Thread Philippe Martin
zxo102 wrote: > Hi everyone, > I am using a python socket server to collect data from a socket > client and then control a image location ( wxpython) with the data, > i.e. moving the image around in the wxpython frame. >But the "app.MainLoop()" in wxpython looks like conflicting with > th

Re: how to make python socket server work with the app.MainLoop() in wxpython?

2006-07-30 Thread Philippe Martin
Philippe Martin wrote: > zxo102 wrote: > >> Hi everyone, >> I am using a python socket server to collect data from a socket >> client and then control a image location ( wxpython) with the data, >> i.e. moving the image around in the wxpython frame. >

BCD List to HEX List

2006-07-30 Thread Philippe Martin
Hi, I'm looking for an algo that would convert a list such as: I'm using python to prototype the algo: this will move to C in an embedded system where an int has 16 bits - I do not wish to use any python library. l1 = [1,2,3,4,6,7,8] #represents the decimal number 12345678 l2 = func (l1) # l2 =

Re: how to make python socket server work with the app.MainLoop() in wxpython?

2006-07-30 Thread Philippe Martin
Grant Edwards wrote: > On 2006-07-30, Philippe Martin <[EMAIL PROTECTED]> wrote: > >> If you get rid of app.MaiLoop(), you basically get rid of all GUI events. >> You need to have you server in a separate thread. > > Isn't there any way to use wxW

Re: BCD List to HEX List

2006-07-30 Thread Philippe Martin
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Philippe Martin wrote: > >> I'm looking for an algo that would convert a list such as: >> >> I'm using python to prototype the algo: this will move to C in an >> embedded sy

Re: BCD List to HEX List

2006-07-30 Thread Philippe Martin
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Philippe Martin wrote: > >> Marc 'BlackJack' Rintsch wrote: >> >>> And now please describe you problem a little better. ;-) >> >> I'll try. >> >> first

Re: BCD List to HEX List

2006-07-30 Thread Philippe Martin
John Machin wrote: > Philippe Martin wrote: >> Hi, >> >> I'm looking for an algo that would convert a list such as: > > Such as what? > >> >> I'm using python to prototype the algo: this will move to C in an >> embedded system whe

Re: BCD List to HEX List

2006-07-30 Thread Philippe Martin
Paul Rubin wrote: > Philippe Martin <[EMAIL PROTECTED]> writes: >> I'm using python to prototype the algo: this will move to C in an >> embedded system where an int has 16 bits - I do not wish to use any >> python library. >> >> l1 = [1,2,3,4,6,

Re: BCD List to HEX List

2006-07-30 Thread Philippe Martin
John Machin wrote: > Philippe Martin wrote: >> John Machin wrote: >> >> > Philippe Martin wrote: >> >> Hi, >> >> >> >> I'm looking for an algo that would convert a list such as: >> > >> > Such as what?

Re: BCD List to HEX List

2006-07-30 Thread Philippe Martin
Dennis Lee Bieber wrote: > On Sun, 30 Jul 2006 16:39:47 -0500, Philippe Martin > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > >> >> My apologies, I clearly made a mistake with my calculator, yes the >> resulting array I would need is [0

Re: BCD List to HEX List

2006-07-30 Thread Philippe Martin
Paul Rubin wrote: > Philippe Martin <[EMAIL PROTECTED]> writes: >> I'm just using Python to prototype, so I cannot use any of these great >> features of the language. > > I think when writing a prototype, you should use whatever features you > want, except m

Re: BCD List to HEX List

2006-07-30 Thread Philippe Martin
John Machin wrote: > Philippe Martin wrote: > >> >> Thanks John, I do not have a long available on the device: stuck with 16 >> bits. >> > > What does "available on the device" mean? Having a "long" is a property > of a C complier, n

Re: BCD List to HEX List

2006-07-30 Thread Philippe Martin
Philippe Martin wrote: > Hi, > > I'm looking for an algo that would convert a list such as: > > I'm using python to prototype the algo: this will move to C in an embedded > system where an int has 16 bits - I do not wish to use any python library. > > l1

Re: BCD List to HEX List

2006-07-30 Thread Philippe Martin
John Machin wrote: > Have you considered asking on a newsgroup where your problem might > actually be on-topic, like: > comp.lang.c Yes, I came here for the "algorithm" question, not the code result. Regards, Philippe -- http://mail.python.org/mailman/listinfo/python-list

Re: BCD List to HEX List

2006-07-30 Thread Philippe Martin
John Machin wrote: > > Philippe Martin wrote: >> Philippe Martin wrote: >> >> > Hi, >> > >> > I'm looking for an algo that would convert a list such as: >> > >> > I'm using python to prototype the algo: this will move to

Re: BCD List to HEX List

2006-07-30 Thread Philippe Martin
John Machin wrote: > > Philippe Martin wrote: >> John Machin wrote: >> >> > Have you considered asking on a newsgroup where your problem might >> > actually be on-topic, like: >> > comp.lang.c >> >> Yes, I came here for the &

Re: BCD List to HEX List

2006-07-30 Thread Philippe Martin
Dennis Lee Bieber wrote: > On Sun, 30 Jul 2006 17:07:57 -0500, Philippe Martin > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > >> Paul Rubin wrote: >> >> > >> > If you prefer, You can do it all in one line: >> > >&g

Re: BCD List to HEX List

2006-07-30 Thread Philippe Martin
Grant Edwards wrote: > On 2006-07-31, John Machin <[EMAIL PROTECTED]> wrote: > >>> but if you >>> wish ==> >>> >>> on one device, the processor in an 8-bit arm and the X-compiler is made >>> by epson >> >> 1. You still haven't *NAMED* the CPU and the compiler!! > > He obviously doesn't want to h

Re: BCD List to HEX List

2006-07-30 Thread Philippe Martin
Philippe Martin wrote: > Grant Edwards wrote: > >> On 2006-07-31, John Machin <[EMAIL PROTECTED]> wrote: >> >>>> but if you >>>> wish ==> >>>> >>>> on one device, the processor in an 8-bit arm and the X-compiler is made

Re: BCD List to HEX List

2006-07-30 Thread Philippe Martin
John Machin wrote: > Philippe Martin wrote: >> John Machin wrote: >> >> > >> > Philippe Martin wrote: >> >> Philippe Martin wrote: >> >> >> >> > Hi, >> >> > >> >> > I'm looking for an algo t

Re: BCD List to HEX List

2006-07-31 Thread Philippe Martin
Paul Rubin wrote: > Philippe Martin <[EMAIL PROTECTED]> writes: >> > Why are you avoiding naming the chip and its compiler? >> >> I must disagree on that one: There are many threads on this site where >> people just have fun talking algorithm. I'm not an

Re: BCD List to HEX List

2006-07-31 Thread Philippe Martin
John Machin wrote: > > Philippe Martin wrote: > >> >> 3. How does the device manage to compute the 8-decimal-digit number >> >> that is your input?? >> >> What device manager ? think about it before being rude >> > > No device man

Re: BCD List to HEX List

2006-07-31 Thread Philippe Martin
John Machin wrote: > Philippe Martin wrote: > >> >> Yes I had arm in mind (for some reason) while it is the Smc8831 >> (http://www.google.com/url?sa=U&start=1&q=http://www.epsondevice.com/www/PDFS/epdoc_ic.nsf/5388db40b5eee4f949256a9c001d589f/944b7300

Re: BCD List to HEX List

2006-07-31 Thread Philippe Martin
Paul Rubin wrote: > Philippe Martin <[EMAIL PROTECTED]> writes: >> I actually need numbers much larger than 32 bits. > > What is the max size hex number you need? What is the application if > you don't mind my asking? Well I am under NDA so I cannot tell you wha

Re: BCD List to HEX List

2006-07-31 Thread Philippe Martin
Paul Rubin wrote: > Philippe Martin <[EMAIL PROTECTED]> writes: >> Well I am under NDA so I cannot tell you what the application is - I need >> numbers (dec) with up to 24 digits. > > You actually need to represent numbers up to 10**24?? > >> As I said, I w

Re: BCD List to HEX List

2006-07-31 Thread Philippe Martin
Paul Rubin wrote: > Philippe Martin <[EMAIL PROTECTED]> writes: >> Well I am under NDA so I cannot tell you what the application is - I need >> numbers (dec) with up to 24 digits. > > You actually need to represent numbers up to 10**24?? > >> As I said, I w

Re: BCD List to HEX List

2006-07-31 Thread Philippe Martin
Paul Rubin wrote: > Philippe Martin <[EMAIL PROTECTED]> writes: >> On device #1 no constraint for my purpose. On the smartcard, the tradeoff >> is between using EEPROM (plenty + slow + small life expectancy) for temp >> variables versus RAM (very little) ... but I

Re: BCD List to HEX List

2006-07-31 Thread Philippe Martin
[EMAIL PROTECTED] wrote: > > Philippe Martin wrote: >> Yes, I came here for the "algorithm" question, not the code result. > > To turn BCD x to binary integer y, > > set y to zero > for each nibble n of x: > y = (((y shifted left 2) + y) shifted

Re: BCD List to HEX List

2006-07-31 Thread Philippe Martin
John Machin wrote: > So why don't you get a freely available "bignum" package, throw away > the bits you don' t want, and just compile it and use it, instead of > writing your own bug-ridden (see below) routines? Oh yeah, the bignum > package might use "long" and you think that you don't have acce

Re: BCD List to HEX List

2006-07-31 Thread Philippe Martin
Sorry forgot a few answers/comments: John Machin wrote: > SHOULD BE >= >currently add([6, 6], [4, 4] -> [10, 10] True, thanks > *** try - 10 instead of % 10 > If the first operand is > 19, you have a bug! > This might save a few CPU cycles on your smartcard can it ? each array value will be

Re: BCD List to HEX List

2006-07-31 Thread Philippe Martin
John Machin wrote: > Have you actually tried it? Do you mean it barfs on the word "long" > [meaning that it's not an ANSI-compliant C compiler], or that "long" is > only 16 bits? :-) if the documentation tells me there is no 32 bit support, why should I not believe it ? > because (1) [like I sa

Re: BCD List to HEX List

2006-07-31 Thread Philippe Martin
John Machin wrote: > > Simon Forman wrote: >> Philippe, please! The suspense is killing me. What's the cpu!? >> >> For the love of God, what's the CPU? >> >> I-can't-take-it-anymore-it's-such-a-simple-question-ingly yours, > > Yes, please . > > I've found a C compiler manual on the web f

Re: [Linux] What toolkit for a good grid/spreadsheet widget?

2006-08-03 Thread Philippe Martin
Vincent Delporte wrote: > Hello > > I'd like to use Python under Linux to write a business application, > and I'll need a good grid/spreadsheet editable widget, maybe not on > par with eg. ComponentOne's excellent VSFlexGrid > (http://www.componentone.com/newimages/flexgrid_02_lg.gif), but > some

Re: [Linux] What toolkit for a good grid/spreadsheet widget?

2006-08-04 Thread Philippe Martin
jean-michel bain-cornu wrote: > Hi, >> Thx for the two pointers. Are those widgets more than just tables, ie. >> can I edit the contents, including displaying a combo box, can items >> be grouped or hierarchized, or are they just basic, read-only tables >> to display results? >> >> I need this ki

Re: why did wxpython MakeActiveXclass stopped working?!?!!?!?

2006-08-06 Thread Philippe Martin
jojoba wrote: > HI > I wrote a little wxpython program with an embedded windows media > player. > It worked great. Recently, I reinstalled windows and then wxpython > (most likely a newer version than i had before). Now when i run the > exact same code, i get this error: > > File "C:\Documents

Re: why did wxpython MakeActiveXclass stopped working?!?!!?!?

2006-08-06 Thread Philippe Martin
Philippe Martin wrote: > jojoba wrote: > >> HI >> I wrote a little wxpython program with an embedded windows media >> player. >> It worked great. Recently, I reinstalled windows and then wxpython >> (most likely a newer version than i had before). Now when

Re: embedding console in wxpython app

2006-08-06 Thread Philippe Martin
Janto Dreijer wrote: > I'm writing a Linux filemanager using wxPython. I'd like to embed a > bash console inside it. I have found the Logilab pyqonsole > (http://www.logilab.org/projects/pyqonsole), but it uses PyQT. > > Does anyone know how to do this from wx? > Is it possible to embed a PyQT wi

Re: why did wxpython MakeActiveXclass stopped working?!?!!?!?

2006-08-06 Thread Philippe Martin
> the embedded windows media player. But Im guessing i made that py2exe > distributable with older pywin32 and older wxpython. > This makes me think that one of the newer versions of pywin32 or > wxpython is giving me that error trouble. > > Any other ideas on how to rectify t

Re: New to Python-- Help

2006-08-08 Thread Philippe Martin
John & Mary Cook wrote: > I just installed Python on Windows XP Pro. When I enter 'python' at the > >>> prompt in Pythonwin IDE I get the following: > > Traceback (most recent call last): >File "", line 1, in ? > Name Error: name 'python' is not defined > > Can anyone help? > > Thank you,

Re: Tkinter module not found

2006-08-11 Thread Philippe Martin
Shuaib wrote: > Hey, > > Even though I freshly installed Tcl and Tk, python still seem to have > problems accessing Tkinter module. Here is what says when I do "import > Tkinter" > > == > Traceback (most recent call last): > File "", line 1, in ? > ImportError: No module named Tkinter > == >

Re: hide python code !

2006-08-11 Thread Philippe Martin
Bayazee wrote: > hi > can we hide a python code ? > if i want to write a commercial software can i hide my source code from > users access ? > we can conver it to pyc but this file can decompiled ... so ...!! > do you have any idea about this ...? > > --- > Fir

Re: hide python code !

2006-08-11 Thread Philippe Martin
Bayazee wrote: > Hi, > ThnaX for Your Answers ... > i am an open source programmer ... ! and i never like to write a closed > source app or hide my codes ! it just a question that i must > answer/solve it! > one of site ( www.python.ir ) users asked this question ! but > unfortunately i have't any

Re: Compiling wxPython app for Windows; Single EXE

2006-08-14 Thread Philippe Martin
Vincent Delporte wrote: > Hi > > I browsed the archives, but since some messages date back a bit, I > wanted to make sure that > > - py2exe is still the best tool in town to compile Python scripts to > run on a Windows host that doesn't have Python installed, including > wxWidgets/wxPython > >

Re: hide python code !

2006-08-15 Thread Philippe Martin
Bayazee wrote: > > Armin Steinhoff wrote: >> Bayazee wrote: >> > hi >> > can we hide a python code ? >> > if i want to write a commercial software can i hide my source code from >> > users access ? >> > we can conver it to pyc but this file can decompiled ... so ...!! >> > do you have any idea ab

Re: The Semicolon Wars as a software industry and human condition

2006-08-17 Thread Philippe Martin
>>It was philosophers that got us out of that Dark Ages mess, and no small >>number of them lost their lives in doing so. And today, the philosophy >>majors are the butts of the most jokes, because after the philosophers >>succeeded in opening our minds, we forgot why we needed them. Look east X

Re: How to fill a form

2006-08-17 Thread Philippe Martin
Sulsa wrote: > On Tue, 15 Aug 2006 03:37:02 - > Grant Edwards <[EMAIL PROTECTED]> wrote: > >> On 2006-08-15, Sulsa <[EMAIL PROTECTED]> wrote: >> >> > I want to fill only one smiple form so i would like not to use >> > any non standard libraries. >> >> Then just send the HTTP "POST" request

Re: How to get the ascii code of Chinese characters?

2006-08-19 Thread Philippe Martin
many_years_after wrote: > Hi,everyone: > > Have you any ideas? > > Say whatever you know about this. > > > thanks. Hi, You mean unicode I assume: http://www.rikai.com/library/kanjitables/kanji_codes.unicode.shtml Regards, Philippe -- http://mail.python.org/mailman/listinfo/pytho

Re: text editor suggestion?

2006-08-19 Thread Philippe Martin
John Salerno wrote: > Ok, I know it's been asked a million times, but I have a more specific > question so hopefully this won't be just the same old post. I've tried a > few different editors, and I really like UltraEdit, but it's > Windows-only and I'm working more on Linux nowadays. > > Here ar

Re: How to get the ascii code of Chinese characters?

2006-08-19 Thread Philippe Martin
Philippe Martin wrote: > many_years_after wrote: > >> Hi,everyone: >> >> Have you any ideas? >> >> Say whatever you know about this. >> >> >> thanks. > Hi, > > You mean unicode I assume: > http://www.ri

Re: write eof without closing

2006-08-19 Thread Philippe Martin
cage wrote: > hello > > can i write a eof to a file descriptor without closing it? > like: > fd.write(EOF) > or something > > grts, > ruben No but there is an EOF to the file anyway, even if it is open. I recall under MS-DOS, you could create a file of size N without writing to it (some INT21

Re: key not found in dictionary

2006-08-22 Thread Philippe Martin
KraftDiner wrote: > I have a dictionary and sometime the lookup fails... > it seems to raise an exception when this happens. > What should I do to fix/catch this problem? > > desc = self.numericDict[k][2] > KeyError: 589824 < This is the error that is being produced, > because there is

Re: Pycrypto

2006-06-16 Thread Philippe Martin
Hi, Look at the bin2ascii module. Philippe luca72 wrote: > > Excuse me again, > If the string is not a sting but hex number how i have to proced : > > look this page: > http://www.cs.eku.edu/faculty/styer/460/Encrypt/JS-AES.html > > Regards Luca -- http://mail.python.org/mailman/listinfo

Re: Python with Eclipse

2006-06-19 Thread Philippe Martin
Dennis Benzinger wrote: > Stan Cook wrote: >> I've been trying to use Eclipse with Python on Linux for a while and >> have noticed something odd. After running the code or debugging a few >> times, its responsiveness gets really bad. Upon checking the equivalent >> of the task manager, I find se

Re: Python with Eclipse

2006-06-20 Thread Philippe Martin
Dennis Benzinger wrote: > Philippe Martin wrote: >> Dennis Benzinger wrote: >> >>> Stan Cook wrote: >>>> I've been trying to use Eclipse with Python on Linux for a while and >>>> have noticed something odd. After running the code or debugging

USB and Python

2006-06-23 Thread Philippe Martin
Hi, I need to talk to a USB device (PC or other) from Python - I am not talking about mounting a file system but sharing information as you would though a TCP-IP socket layer or an RS232 interface. Is there such "low-level" module available for Windows / Linux ? Thanks, Philippe -- http://mai

Re: USB and Python

2006-06-25 Thread Philippe Martin
Many thanks, Philippe Philippe Martin wrote: > Hi, > > I need to talk to a USB device (PC or other) from Python - I am not > talking about mounting a file system but sharing information as you would > though a TCP-IP socket layer or an RS232 interface. > > Is there su

Web transaction server in Python

2006-06-28 Thread Philippe Martin
Hi, I know a bit Python as application programming, but very little as a web server. I need to get one server to accept connection requests from many devices (not all PC-Based) and then have a bi-lateral "conversation" with those devices prior to closing the connection. The said devices have at

Re: Icono en wxpython

2006-06-29 Thread Philippe Martin
Try Sourceforge. (si j'ai bien compris) Regards, Philippe Bruno Desthuilliers wrote: > Gabriel wrote: >> Hola: >> He echo un programa en wxpython. Se trata de un programa para >> desarrollos con microcontroladores como PIC's etc. en cuanto a >> transmisión RS232 se refiere. >> >> El program

Re: first book about python

2006-07-08 Thread Philippe Martin
I don't know, if I were the genious that made up Python I would not believe in any bible (small b) IOANNIS MANOLOUDIS wrote: > I want to learn python. > I plan to buy a book. I always find printed material more convenient than > reading on-line tutorials. > I don't know PERL or any other scri

Re: python vs java & eclipse

2006-12-02 Thread Philippe Martin
Amir Michail wrote: > Hi, > > It seems to me that measuring productivity in a programming language > must take into account available tools and libraries. > > Eclipse for example provides such an amazing IDE for java that it is no > longer obvious to me that one would be much more productive in

catching traceback.print_exc()

2006-02-23 Thread Philippe Martin
Hi, Is there a way to catch traceback.print_exc() output into a string ? Philippe -- http://mail.python.org/mailman/listinfo/python-list

Re: catching traceback.print_exc()

2006-02-23 Thread Philippe Martin
oops: """ format_exc( [limit[, file]]) This is like print_exc(limit) but returns a string instead of printing to a file. New in version 2.4. """ Philippe Martin wrote: > Hi, > > Is there a way to catch traceback.print_exc() output into a string ? >

Re: pyserial

2006-02-23 Thread Philippe Martin
Hi, I never found the need to flush anything and I always use inWaiting prior to reader. A+ Philippe Mimi wrote: > Hi, > I use the pyserial to read data from a serial port. > My code is in window Xp and python 2.4. when I use Hyperteminal I can > read data without try and try again that it i

Re: editor for Python on Linux

2006-02-23 Thread Philippe Martin
Mladen Adamovic wrote: > Hi! > > I wonder which editor or IDE you can recommend me for writing Python > programs. I tried with jEdit but it isn't perfect. Eclipse + pydev -- http://mail.python.org/mailman/listinfo/python-list

Python stdout and Win 2003

2006-02-23 Thread Philippe Martin
Hi, I have a program at a customer's site that seems to have random problem which eventually come down to not being able to read/write from serial ports. I trapped all the exceptions I could think of and all of them look like this: *** (ACCESS CONTROL)Fri, 24 Feb 2

Re: Python stdout and Win 2003

2006-02-23 Thread Philippe Martin
PS: I forgot to mention that some of the "print"s are made from wxPython timer events. Philippe Philippe Martin wrote: > Hi, > > I have a program at a customer's site that seems to have random problem > which eventually come down to not being able to read/write

datetime question

2006-04-18 Thread Philippe Martin
Hi, I need to get the date and time under Windows and Linux but need the information visible to the user (cannot find my words) not the sytem information (ex: a PC setup on greenwich but the date/time displayed are relative to some other place. Regards, Philippe -- http://mail.python.org/mailm

Re: datetime question

2006-04-18 Thread Philippe Martin
Thanks, yes, I guess the question is ... what date/time is it looking at ? and is it the same under various OSs ? Philippe Jorge Godoy wrote: > Philippe Martin wrote: > >> Hi, >> >> I need to get the date and time under Windows and Linux but need the >> i

Re: datetime question

2006-04-19 Thread Philippe Martin
:-) Thanks. Philippe Scott David Daniels wrote: > Jorge Godoy wrote: >> Philippe Martin wrote: >> >>> I need to get the date and time under Windows and Linux but need the >>> information visible to the user (cannot find my words) not the sytem >>> in

Re: Python IDE for linux

2006-04-20 Thread Philippe Martin
If your PC can handle eclipse ... memory-wise, I strongly suggest you give pydev a shot. Philippe Neil Isaac wrote: > I have been writing python my little python scripts in gedit and running > them using the command line. At this point I'm thinking that I would like > to start using a real ID

Re: Thanks from the Java Developer

2006-04-20 Thread Philippe Martin
Yes, and then you have to answer Java/C/C++ job/contracts opening knowing real well the mistake they're making ... as well as you are for answering ;-) Ant wrote: > Python ruined my life. > > I am a Java programmer by profession, and ever since learning Python, I > find it a real chore to open

Re: Tkinter hiding/showing widgets

2006-04-21 Thread Philippe Martin
Maybe like this ? http://www.faqts.com/knowledge_base/view.phtml/aid/21215/fid/264 I noticed with wxWidget, which uses the same packing principle (xlib inheritance ?) that hidding a widget can have a strange effect on the layout of the "other guys" still visible ... so I just disable them now in

Re: Can my python script return a value to the c program executing it?

2006-04-22 Thread Philippe Martin
Like this ? http://aspn.activestate.com/ASPN/Mail/Message/python-list/1304518 Philippe vduber6er wrote: > I have a C program that calls my python script by > > exec_pycode(code); > > code = "import CheckFasta\nCheckFasta.CheckFasta (\"sampledata.txt\", > %d)\n", PyNum); > > CheckFasta.p

Multiple hierarchie and method overloading

2006-04-24 Thread Philippe Martin
Hi, I have something like this: Class A: def A_Func(self, p_param): . Class B: def A_Func(self): . Class C (A,B): A.__init__(self) B.__init__(self) . self.A_Func() #HERE I GET AN EXCEPTION "... takes at least 2 arguments

Re: Multiple hierarchies and method overloading

2006-04-25 Thread Philippe Martin
alling A_Func(self) as it was checked against A_Func(self, p_param). Regards, Philippe Lawrence D'Oliveiro wrote: > In article <[EMAIL PROTECTED]>, > "Ben Cartwright" <[EMAIL PROTECTED]> wrote: > >>Philippe Martin wrote: >> >>> I

Re: Multiple hierarchie and method overloading

2006-04-25 Thread Philippe Martin
Thanks, I'll try that. Philippe Ben Cartwright wrote: > Philippe Martin wrote: >> I have something like this: >> >> Class A: >> def A_Func(self, p_param): >> . >> Class B: >> def A_Func(self): >>

Re: wxpython warnings

2006-04-26 Thread Philippe Martin
I had a similar but simple problem (the file was missing) and had to check by hand before calling wxPython. Can you check the tag by hand before calling wxPython ? Philippe Iain King wrote: > I have a wxpython program that displays TIF images. Sometimes it will > encounter a tag the tiff l

Re: Inherit from array

2006-04-26 Thread Philippe Martin
I think he did from array import * Philippe bruno at modulix wrote: > TG wrote: >> Hi there. >> >> I'm trying to create a simple class called Vector which inherit from >> array. > > Which array ? > > [EMAIL PROTECTED] ~ $ python > Python 2.4.2 (#1, Feb 9 2006, 02:40:32) > [GCC 3.4.5 (Ge

Re: Events in Python?

2006-04-26 Thread Philippe Martin
Besides the other anwsers, you might want to check the signal module. Regards, Philippe [EMAIL PROTECTED] wrote: > Here is another non-pythonic question from the Java Developer. (I beg > for forgiveness...) > > Does Python have a mechanism for events/event-driven programming? > > I'm not ne

Re: wxpython warnings

2006-04-26 Thread Philippe Martin
Hi, This is an answer I got from the wxPython NG: """ If it is a wxLog message (I think it is) then you can temporarily disable log messages by creating an instance of wx.LogNull.  Or you can do something like set the log target to some other object than the default wx.LogGui, or set the log l

Re: MinGW and Python

2006-04-26 Thread Philippe Martin
This might relevant. http://www.aceshardware.com/read.jsp?id=153 Philippe Robert Kern wrote: > Martin v. Löwis wrote: >> Srijit Kumar Bhadra wrote: >> >>>Is there any specific reason for not using MinGW to build the official >>>distribution of Python for Win32? >> >> What could be the reaso

Re: print names of dictionaries

2006-04-27 Thread Philippe Martin
Hi, I do not know if there is a way to overload the instantiation of all objects in Python but I thought of something like this to fetch any object with its name: g_dict = {} def create_object (v,s): p = v g_dict[s] = id(p) return p #ex object = create_object ([1,2,3,4], 'A LIST') Ph

Re: print names of dictionaries

2006-04-27 Thread Philippe Martin
OK, totally dumb ! g_dict[s] = p Philippe Martin wrote: > Hi, > > I do not know if there is a way to overload the instantiation of all > objects in Python but I thought of something like this to fetch any object > with its name: > > g_dict = {} > > > def c

Re: OOP techniques in Python

2006-04-27 Thread Philippe Martin
Why is that ? to me it makes sense when I see self.__m_var that I'm dealing with a member variable taht derived classes will not see/access. Philippe Steven Bethard wrote: > Panos Laganakos wrote: >> we usually define private properties and provide public functions >> to access them, in the f

Re: OOP techniques in Python

2006-04-27 Thread Philippe Martin
he implementation later if you need > > to. But python allows you to do this with properties: > [snip] > > Which should not be interpreted as saying you should start writing a > > bunch of properties now. ;) Instead, only introduce a property when > > you find that something

Re: OOP techniques in Python

2006-04-27 Thread Philippe Martin
Edward Elliott wrote: > Panos Laganakos wrote: >> i.e. we usually define private properties and provide public functions >> to access them, in the form of: >> get { ... } set { ... } >> >> Should we do the same in Python: >> Or there's no point in doing so? >> >> Some other techniques come to mi

Re: OOP techniques in Python

2006-04-27 Thread Philippe Martin
Edward Elliott wrote: > Philippe Martin wrote: > '' > > On the other hand, foo.__doc__ and foo.__name__ work fine. > > (I was going to quote your post but my reader interprets everything after > the two dashes as your sig and ignores it. And I won't

Re: OOP techniques in Python

2006-04-27 Thread Philippe Martin
Duncan Booth wrote: > Philippe Martin wrote: >> Steven Bethard wrote: >>> [Please don't top-post] >> >> OK I won't, is that a general rule? (I've been top posting for quite some >> time now and it is the first time I see that warning) > &g

Re: wxPython, wxcombobox opening

2006-04-29 Thread Philippe Martin
Hi, I do not have the answer but am very interested in the issue. I tried this: l_ev = wx.MouseEvent(wx.wxEVT_LEFT_DOWN) l_ev.SetEventObject(self.GetCombo()) self.GetEventHandler().ProcessEvent(l_ev) Which did send the event to the combo (which is in a pannel in my case) .. but that is apparentl

Re: OOP techniques in Python

2006-05-01 Thread Philippe Martin
Thanks, Did not know that. Philippe Dennis Lee Bieber wrote: > On Thu, 27 Apr 2006 14:32:15 -0500, Philippe Martin > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > >> >> What then is the point of the double underscore (if any) ?: > >

Re: wxPython, wxcombobox opening

2006-05-02 Thread Philippe Martin
Hi, >From the wxPython list: > Hi, > > Which event must I catch to be called when the user clicks on the combo > "button" to make the drop down list to appear ? No, there isn't a specific event for the opening of the drop-down box. Regards, Philippe

Re: Gettings subdirectories

2006-05-04 Thread Philippe Martin
Hi, The second edition of "Programming Python - O'REILLY - Mark Lutz" shows how to do that using "os.path.walk" Philippe Florian Lindner wrote: > Hello, > how can I get all subdirectories of a given directories? os.listdir() > gives me all entries and I've found no way to tell if an object

Re: Progamming python without a keyboard

2006-05-04 Thread Philippe Martin
That reminds me a session in an R&D lab a long time ago One of the guys kept talking to himself, commenting code, bugs . he drove me nuts Eventually (weeks later) another guy silently stood up, went to the first guy, and without a word attempted to strangle him. He got stopped ... but did no

Is this a legal / acceptable statement ?

2006-05-05 Thread Philippe Martin
Hi, This code works, but is it "appropriate" ? l_init = False if True == l_init and 1234 = l_value: print 'l_value is initialized' I know I can do this with a try but ... Philippe -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a legal / acceptable statement ?

2006-05-05 Thread Philippe Martin
I'm sorry (typo): l_init = False if True == l_init and 1234 == l_value: print 'l_value is initialized' Note that 1234 == l_value does not get evaluated. Philippe vbgunz wrote: > you don't have to say: > > if True == l_init > > it is suggested you simply say: > > if l_init: > > Reme

Re: Is this a legal / acceptable statement ?

2006-05-05 Thread Philippe Martin
Larry Bates wrote: > Philippe Martin wrote: >> Hi, >> >> This code works, but is it "appropriate" ? >> >> l_init = False >> >> if True == l_init and 1234 = l_value: >> print 'l_value is initialized' >> >&

  1   2   >