Re: Is it better to use class variables or pass parameters?

2006-03-02 Thread Duncan Booth
Derek Basch wrote: > This one has always bugged me. Is it better to just slap a "self" in > front of any variable that will be used by more than one class method > or should I pass around variable between the methods? Try to distinguish the state of the object from the parameters to methods. An

Re: Runtime Error when loading ".pyd" module

2006-03-02 Thread Fredrik Lundh
Terry Tang wrote: > it hits a "Runtime Error" (which is shown in a message box saying "abnormal > program termination") and a message like the following is printed in the > console: > Fatal Python error: Interpreter not initialized (version mismatch?) both the main executable (e.g. python.exe or

Re: Rapid web app development tool for database

2006-03-02 Thread bruno at modulix
George Sakkis wrote: > Is there any tool in python (or with python bindings) like Oracle > Application Express, former HTML DB > (http://www.oracle.com/technology/products/database/application_express/index.html) > ? Ideally it should be dbms-agnostic, e.g. by using SQLObject to talk > to the datab

compare classes and not class instances

2006-03-02 Thread [EMAIL PROTECTED]
I not only want to compare class *instances* but also the classes themselves. Something like: class T(object): @classmethod def __cmp__(cls, other): return cmp(cls.__name__, other.__name__) @instancemethod def __cmp__(self, other): return cmp(self.x, other.x) class

Re: PythonWin: any way to delete all objects without exiting and without doing it with "del"?

2006-03-02 Thread dananrg
> PythonWin is just an IDE. For what reason you have to delete all objects by > yourself? Garbage collector is there for that :) I think the garbage collector is on strike. :-) Example: # 1st execution a = [1,2,3] print a >>> [1,2.3] program ends. Then I comment out a = [1,2,3] and run the pr

read sys.stdin, then raw_input

2006-03-02 Thread Rory Campbell-Lange
I'm stumped. I'm piping some content to a python program, but then want the python program to prompt me for an answer. It goes on reading the pipe and gives a "EOFError: EOF when reading a line". eg: #!/usr/bin/python import sys text = sys.stdin.read() sel = raw_input('Selection?

Re: Best python module for Oracle, but portable to other RDBMSes

2006-03-02 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > This is from a database I didn't design and can't change. The problem > is that the ODBC module suffixes an "L" to any integer returned that > was defined as data type number(p). For example, an integer stored as: > 56 will be returned as 56L. Numbers that were specifie

Re: Best python module for Oracle, but portable to other RDBMSes

2006-03-02 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > The other thing I didn't do a good job of explaining is that I want to > have a layer of abstraction between the underlying RDBMS and the > business logic. It's the business logic I want to use Python for, so > that would stay roughly the same between RDBMS changes, if we

Re: compare classes and not class instances

2006-03-02 Thread Peter Otten
[EMAIL PROTECTED] wrote: > I not only want to compare class *instances* but also the classes > themselves. Something like: > sorted([B, A]) => [A, B] > > My motivation for doing so is simply to sort classes based on their > names and not (as it seems is the default behaviour) on the order in >

Problem with dbi, odbc module and Oracle 9.2 - suffixed "L" with number data type

2006-03-02 Thread dananrg
I was messing around with the native ODBC module (I am using Python in a Win32 environment), e.g: import dbi, odbc ...and it seems to meet my needs. I'd rather use a module that comes natively with Python if it works (don't care about performance in this particular use case; just that it works).

ODBC module and strange date reference <...>

2006-03-02 Thread dananrg
Been using the ODBC module for Python 2.1 (Win32) and had another question. When I return data from date columns, it's in a strange object form, e.g. (don't have the output in front of me>. What's an easy way to convert date objects into a human-readable string? I'm using this module to extract d

Re: read sys.stdin, then raw_input

2006-03-02 Thread Rory Campbell-Lange
To clarify, how can I get a normal terminal prompt for raw_input to enable me to insert a value into variable 'sel'? The program wants to keep reading from the piped file, it seems. Rory On 01/03/06, Rory Campbell-Lange ([EMAIL PROTECTED]) wrote: > I'm stumped. I'm piping some content to a pytho

Re: Problem with dbi, odbc module and Oracle 9.2 - suffixed "L" with number data type

2006-03-02 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > I was messing around with the native ODBC module (I am using Python in > a Win32 environment), e.g: > > import dbi, odbc > > ...and it seems to meet my needs. I'd rather use a module that comes > natively with Python if it works (don't care about performance in this >

Re: spaces at ends of filenames or directory names on Win32

2006-03-02 Thread Christos Georgiou
On Thu, 23 Feb 2006 17:49:31 -0600, rumours say that Larry Bates <[EMAIL PROTECTED]> might have written: >IMHO leading and/or trailing spaces in filenames is asking for >incompatibilities with cross-platform file access. Much like >using single-quote in filenames which are perfectly legal in >DOS

Re: Newbie in python

2006-03-02 Thread Simon Brunning
On 3/2/06, - C Saha - <[EMAIL PROTECTED]> wrote: > > Hello Python Experts > > I am Chirantan, a beginner in python programming world. I have some > programming knowledge in SHELL, BATCH and little bit PERL. I subscribed to > this list with the hope that I will get support and help from all of you.

Re: Proper class initialization

2006-03-02 Thread Christoph Zwerschke
Steven Bethard wrote: > I assume the intention was to indicate that the initialization required > multiple statements. I just couldn't bring myself to write that > horrible for-loop when the sum() function is builtin. ;) Yes, this was just dummy code standing for something that really requires

Re: Proper class initialization

2006-03-02 Thread Christoph Zwerschke
Steven Bethard wrote: > I don't run into this often, but when I do, I usually go Jack > Diederich's route:: > > class A(object): > class __metaclass__(type): > def __init__(cls, name, bases, classdict): > cls.sum = sum(xrange(10)) Good idea, that is really

Newbie errors :-( Need help

2006-03-02 Thread - C Saha -
Hi All   I am getting the result but along with this error, any idea what could be the reason?     fibo.fib(1000) 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987Traceback (most recent call last):  File "", line 1, in ?  File "fibo.py", line 8, in fib    return resultNameError: global name 'res

Re: Printing a file

2006-03-02 Thread Jeremy Sanders
David Boddie wrote: > That's where QPrintDialog comes in: > > http://doc.trolltech.com/4.1/qprintdialog.html > > It's also secretly available in Qt 3 via the QPrinter.setup() method: > > printer = QPrinter() > printer.setup() > # Now, paint onto the printer as usual. No - that was in m

Re: Newbie errors :-( Need help

2006-03-02 Thread Rory Campbell-Lange
There is no variable called result in your function or, presumably, in the global scope of the programme. As you aren't returning anything you may as well omit that line. On 02/03/06, - C Saha - ([EMAIL PROTECTED]) wrote: > I am getting the result but along with this error, any idea what could

Re: Newbie errors :-( Need help

2006-03-02 Thread Simon Brunning
On 3/2/06, - C Saha - <[EMAIL PROTECTED]> wrote: > I am getting the result but along with this error, any idea what could be > the reason? > > fibo.fib(1000) > 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987Traceback (most recent call > last): > File "", line 1, in ? > File "fibo.py", line 8, i

puzzled by ImageDraw line

2006-03-02 Thread alexandre_irrthum
Hi there, I am puzzled by the comportment of the line function from the ImageDraw module with regard to the way it draws or does not draw the last pixel of a line. Below I test this function on a 3x3 image and show schematic representations of obtained images (where o means a drawn pixel) import

Re: Printing a file

2006-03-02 Thread David Boddie
Sorry about that. I must have just skipped over the setup() call in your code. If you're creating highly customized content then I think you'll always need to think about getting the pages to the printer in the right order. For rich text documents, there's code that does this in the Qt 3 text draw

Shell Navigation

2006-03-02 Thread William Meyer
I am having trouble with the python interactive shell. The arrow keys render as ^[[D, ^[[A, etc making line editing impossible. The arrow keys (and function keys) work fine in bash, but in the python shell they are printed. Any ideas what is going on? -- http://mail.python.org/mailman/listinfo/py

Re: Shell Navigation

2006-03-02 Thread Simon Brunning
On 3/2/06, William Meyer <[EMAIL PROTECTED]> wrote: > I am having trouble with the python interactive shell. The arrow keys render > as > ^[[D, ^[[A, etc making line editing impossible. The arrow keys (and function > keys) work fine in bash, but in the python shell they are printed. Any ideas > wh

Re: telnetlib problems

2006-03-02 Thread Eddie Corns
[EMAIL PROTECTED] writes: >Thanks for the reply. I've replaced the call to read_very_eager() with >read_until() and enabled debugging messages. My script now looks like >this... ># >import telnetlib >tn = telnetlib.Telnet('192.168.100.11') >tn.set_debuglevel(9) >tn

Re: in need of some sorting help

2006-03-02 Thread Kent Johnson
ianaré wrote: > Hey all, > > if i use a os.walk() to append files to a list like so... > > files = [] > root = self.path.GetValue() # wx.TextCtrl input > filter = self.fileType.GetValue().lower() # wx.TextCtrl input > not_type = self.not_type.GetValue() # wx.CheckBox input > > for base, dirs,

Re: Shell Navigation

2006-03-02 Thread William Meyer
Simon Brunning brunningonline.net> writes: > Sounds like a readline problem. Your OS? How did you install Python? Yea, that was it. I just had to copy readline.so from another installation. Thanks for the quick reply -- http://mail.python.org/mailman/listinfo/python-list

logging to a text widget

2006-03-02 Thread Alexandre Guimond
Hi. I'm using the logging package. I would like to send my log messages to a Text widget creating using Tkinter. I was wondering if there was a logging handler class that would do this. It seems that the standard handlers do not support this. Has anyone tried to do this? Thx for any help, alex -

Re: why? [win32com/WMI]

2006-03-02 Thread Sergey
"Tim Golden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] [Sergey] >import wmi >c = wmi.WMI (computer="srv", user="[EMAIL PROTECTED]", password="") >pid, retval = c.Win32_Process.Create (CommandLine="notepad.exe") Wonderful... It works. But I tryed the module, by the sample f

Re: read sys.stdin, then raw_input

2006-03-02 Thread Fredrik Lundh
Rory Campbell-Lange wrote: > To clarify, how can I get a normal terminal prompt for raw_input to > enable me to insert a value into variable 'sel'? > > The program wants to keep reading from the piped file, it seems. > > Rory > > On 01/03/06, Rory Campbell-Lange ([EMAIL PROTECTED]) wrote: > > I'm

Re: Suggestions for documentation generation?

2006-03-02 Thread kpd
Thanks - I took at both. Also at 'percepts', which I used a long time ago (had forgotten about it). Percepts has a great little java applet for viewing the class hierarchy. I don't think it works for python, just C++ though. Looks like doxygen will fit the bill. -- http://mail.python.org/mailm

Re: Proper class initialization

2006-03-02 Thread Kent Johnson
Steven Bethard wrote: > I don't run into this often, but when I do, I usually go Jack > Diederich's route:: > > class A(object): > class __metaclass__(type): > def __init__(cls, name, bases, classdict): > cls.sum = sum(xrange(10)) I think you should call t

RE: why? [win32com/WMI]

2006-03-02 Thread Tim Golden
[Sergey] | "Tim Golden" <[EMAIL PROTECTED]> wrote in | message news:[EMAIL PROTECTED] | [Sergey] | | >import wmi | >c = wmi.WMI (computer="srv", user="[EMAIL PROTECTED]", password="") | >pid, retval = c.Win32_Process.Create (CommandLine="notepad.exe") | | Wonderful... It works. | | But I t

Re: read sys.stdin, then raw_input

2006-03-02 Thread Rory Campbell-Lange
That works great for me on my unixoid system. Thanks, Fredrik. On 02/03/06, Fredrik Lundh ([EMAIL PROTECTED]) wrote: > since there's only one input channel for a program (stdin), and raw_input > reads from that channel, I don't think there's a portable way to do this. > ... > # rebind sys.st

Re: ODBC module and strange date reference <...>

2006-03-02 Thread Frank Millman
[EMAIL PROTECTED] wrote: > Been using the ODBC module for Python 2.1 (Win32) and had another > question. When I return data from date columns, it's in a strange > object form, e.g. (don't have the output in front > of me>. > > What's an easy way to convert date objects into a human-readable > str

Re: in need of some sorting help

2006-03-02 Thread Peter Otten
Kent Johnson wrote: > dirs.sort(key=str.lower) # note no need for lambda However, this will raise a TypeError for unicode directory names while the lambda continues to work. Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with dbi, odbc module and Oracle 9.2 - suffixed "L" with number data type

2006-03-02 Thread dananrg
Great, thanks Diez! Should I just use str(n) to convert it to a format I can write out to a flat file? I'm also struggling with the strange date object format that the ODBC module returns when I fetch rows. I need to convert that to a text string in a format that a mainframe flatfile database requi

Re: ODBC module and strange date reference <...>

2006-03-02 Thread dananrg
Thanks Frank. Much appreciated. I will give it a go. -- http://mail.python.org/mailman/listinfo/python-list

Re: ODBC module and strange date reference <...>

2006-03-02 Thread dananrg
Thanks Frank. Much appreciated. I will give it a go. -- http://mail.python.org/mailman/listinfo/python-list

RE: why? [win32com/WMI]

2006-03-02 Thread Tim Golden
[Sergey] | "Tim Golden" <[EMAIL PROTECTED]> wrote in | message news:[EMAIL PROTECTED] | [Sergey] | | >import wmi | >c = wmi.WMI (computer="srv", user="[EMAIL PROTECTED]", password="") | >pid, retval = c.Win32_Process.Create (CommandLine="notepad.exe") | | Wonderful... It works. Also, in ca

Re: Problem with dbi, odbc module and Oracle 9.2 - suffixed "L" with number data type

2006-03-02 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Great, thanks Diez! Should I just use str(n) to convert it to a format > I can write out to a flat file? I'm also struggling with the strange I guess so, yes. > date object format that the ODBC module returns when I fetch rows. I > need to convert that to a text string

Re: logging to a text widget

2006-03-02 Thread Martin Franklin
Alexandre Guimond wrote: > Hi. I'm using the logging package. I would like to send my log messages > to a Text widget creating using Tkinter. I was wondering if there was a > logging handler class that would do this. It seems that the standard > handlers do not support this. Has anyone tried to do

Re: Removing .DS_Store files from mac folders

2006-03-02 Thread David Pratt
Hi Ben. I hadn't realize that walk was just giving the file name so the join did the job just great. Many thanks for helping me out with this. Regards, David Ben Cartwright wrote: > David Pratt wrote: > >>OSError: [Errno 2] No such file or directory: '.DS_Store' > > > > Ah. You didn't menti

Re: why? [win32com/WMI]

2006-03-02 Thread Sergey
"Tim Golden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] [Sergey] >| >import wmi >| >c = wmi.WMI (computer="srv", user="[EMAIL PROTECTED]", password="") >| >pid, retval = c.Win32_Process.Create (CommandLine="notepad.exe") >| >| Wonderful... It works. >Also, in case you haven't

RE: why? [win32com/WMI]

2006-03-02 Thread Tim Golden
[Sergey] | Yes, I had run it. | | And, just now I updated python, pythonwin and wmi.py to | latest version. And got: | | >>> a=wmi.WMI() | >>> a.Win32_Process.Create(CommandLine="notepad.exe")# | --- it works | >>> a.Win32_Process.new().Create(CommandLine="notepad.exe") | # it still fail

Re: Is it better to use class variables or pass parameters?

2006-03-02 Thread bruno at modulix
Derek Basch wrote: > This one has always bugged me. Is it better to just slap a "self" in > front of any variable that will be used by more than one class method s/class method/method/ In Python, a "class method" is a method working on the class itself (not on a given instance). > or should I pa

Re: ODBC module and strange date reference <...>

2006-03-02 Thread dananrg
Sorry for the double-thanks Frank. I'm using Python 2.1 for Win32 and import datetime fails. Does the datetime module come standard with later releases of Python? If so, which release? If not, will datetime with with Python 2.1, if it will, where can I get it? I'm still such a newbie with Python

XSLT and gettext?

2006-03-02 Thread KW
I'm looking for a nice way to do i18n with XSLT, preferably using the gettext framework. Currently I'm using 4Suite for XSLT processing. Do you know of any solutions to this problem? If no solutions currently exist, I'll try to write something myself. Any ideas on how to do this properly? Any exis

How to find cause for Python/Pythonwin crash only on Dual Core Machines ?

2006-03-02 Thread robert
There is a strange freeze/crash only on dual core machines: I have a python app (Python 2.3.5 /Pythonwin build 203 / Windows) running with no stability problems on normal machines (Or a crash is so rare, that absolutely nobody obverses it, though the overall majority of users uses single core m

Creating a text adventure

2006-03-02 Thread DannyB
I am in the process of learning Python. I have the basics down and I now want to test my abilitiy to use them in a (very) small project. I have the idea for a (very) small text based game mapped out in my head. It will include two rooms, random creatures (amounts and type) in each room and rando

Re: ODBC module and strange date reference <...>

2006-03-02 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Sorry for the double-thanks Frank. > > I'm using Python 2.1 for Win32 and import datetime fails. > > Does the datetime module come standard with later releases of Python? > If so, which release? If not, will datetime with with Python 2.1, if it > will, where can I get

Re: Creating a text adventure

2006-03-02 Thread [EMAIL PROTECTED]
This (unabashed plug) might help. Most of the tutorial is about networking, but just skip that stuff. Hopefully the architecture section helps. But it sounds like you're pretty much on your way already. Just read through your first paragraph, circle every noun, and determine whether that noun

filename variables

2006-03-02 Thread cyborg4
If in Windows XP I use: openstring= "test.py >foo.txt" os.system(openstring) it works. But if I use: file1='foo.txt' openstring= "test.py >"+file1 It gives an IOError about no such file or directory as \\mydidr\\foo.txt What does it mean ? -- http://mail.python.org/mailman/listinfo/pyth

Re: in need of some sorting help

2006-03-02 Thread ianaré
thank you for the help, i didn't know you could sort in place like that. definitly will come in handy. However, i need the sorting done after the walk, due to the way the application works... should have specified that, sorry. TIA -- http://mail.python.org/mailman/listinfo/python-list

Re: filename variables

2006-03-02 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > If in Windows XP I use: > > openstring= "test.py >foo.txt" > os.system(openstring) > > it works. > > > But if I use: > > file1='foo.txt' > openstring= "test.py >"+file1 > > It gives an IOError about no such file or directory as > \\mydidr\\foo.txt > > What does

Re: Proper class initialization

2006-03-02 Thread gry
Christoph Zwerschke wrote: > Usually, you initialize class variables like that: > > class A: > sum = 45 > > But what is the proper way to initialize class variables if they are the > result of some computation or processing as in the following silly > example (representative for more: > > class

Write a GUI for a python script?

2006-03-02 Thread Glurt Wuntal
I am a newbie with Python. It's a great language, but I would like to be able to present a simple gui menu for some of my scripts; something better than using 'raw_input' prompts. Any recommendations for a program that will allow me to create the gui screens? Something useable in Linux. thanks.

Re: Pyserial never read

2006-03-02 Thread luca72
Hello i how can set with pyserial the following data? > byte delay= 4 > serial control line: > dtr = high > rts= low Thanks Luca -- http://mail.python.org/mailman/listinfo/python-list

Re: Write a GUI for a python script?

2006-03-02 Thread Michele Simionato
Tkinter is the GUI toolkit that comes with Python and is available on all platform without any installation effort. It is quite OK for simple things and I would recommend it for any beginner. Google for "An Introduction to Tkinter" by F. Lund. Michele Simionato -- http://mail.python.org/mai

Re: Stopping Windows Service

2006-03-02 Thread D
I must be missing something..in my SvcDoRun function, first line is "self.timeout=1" , followed by my "while 1:" loop which listens for the connection, processes the data, etc. Where should I place the "rc=win32event.." and "if rc" lines? I have a feeling I'm pretty close here.. :) Thanks ve

import, from and reload

2006-03-02 Thread John Salerno
I understand that after you import something once, you can reload it to pick up new changes. But does reload work with from statements? I tried this: from X import * and then did my testing. I changed X and tried to reload it, but that didn't seem to work. I figure the reason is because the mo

white space in expressions and argument lists

2006-03-02 Thread John Salerno
A minor concern, but I'm curious if there is any kind of best practice for using whitespace within expressions and argument lists in the Python world. For example: 1 + 2 or 1+2 func(1,2) or func(1, 2) To me, the space makes it nicer and more readable, but I was surprised to read in Guido's

Re: white space in expressions and argument lists

2006-03-02 Thread Lawrence Oluyede
John Salerno <[EMAIL PROTECTED]> writes: > 1 + 2 or 1+2 > > func(1,2) or func(1, 2) I prefer and use 1 + 2 and func(1, 2) I don't do whitespaces only in argument defaults like func(foo=baz) -- Lawrence - http://www.oluyede.org/blog "Anyone can freely use whatever he wants but the light at

Re: white space in expressions and argument lists

2006-03-02 Thread rtilley
John Salerno wrote: > A minor concern, but I'm curious if there is any kind of best practice > for using whitespace within expressions and argument lists in the Python > world. For example: > > 1 + 2 or 1+2 IMO, good style calls for spaces. Most companies have style guides for programmers t

_tkinter.TclError: can't set "PY_VAR0": invalid command name "-1210125972check"

2006-03-02 Thread Gregor Horvath
Hi, I searched the web and docs but cannot figure out whats wrong with this code: #!/usr/bin/python import Tkinter as Tk class testtk(Tk.Frame): def __init__(self): self.root = Tk.Tk() Tk.Frame.__init__(self,self.root) self.frame = Tk.Frame(self.root) self.var = Tk.Stri

Re: white space in expressions and argument lists

2006-03-02 Thread Sybren Stuvel
John Salerno enlightened us with: > To me, the space makes it nicer and more readable, but I was > surprised to read in Guido's blog that he thinks 1+2 should be the > normal way to write it. What does everyone else think? I usually write 1 + 2 and func(a, b). Sometimes I even use more spaces to a

Re: ODBC module and strange date reference <...>

2006-03-02 Thread Frank Millman
Diez B. Roggisch wrote: > [EMAIL PROTECTED] wrote: > > > Sorry for the double-thanks Frank. > > > > I'm using Python 2.1 for Win32 and import datetime fails. > > > > Does the datetime module come standard with later releases of Python? > > If so, which release? If not, will datetime with with Pyth

os.popen3 delivers no error exist status ?

2006-03-02 Thread robert
os.popen3 delivers no error exit status on .close() - while os.popen does Is this intended or a bug? How do I get the status? Robert Python 2.4.1 (#2, May 5 2005, 11:32:06) [GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> imp

Exception not raised - May be the end

2006-03-02 Thread Michele Petrazzo
Hi group, some days ago I posted here and say that python "forgot" to raise an exception, but my code was too long for make some tries possible. But now I can reproduce the problem into another, little, project: (Need wx 2.6) Here is the code: www.unipex.it/vario/wxFrameSchedule.py www.unipex.it

Re: white space in expressions and argument lists

2006-03-02 Thread John Salerno
Sybren Stuvel wrote: > John Salerno enlightened us with: >> To me, the space makes it nicer and more readable, but I was >> surprised to read in Guido's blog that he thinks 1+2 should be the >> normal way to write it. What does everyone else think? > > I usually write 1 + 2 and func(a, b). Sometim

Re: Write a GUI for a python script?

2006-03-02 Thread ianaré
wxPython is another good option, especially since there is boa-constructor, which is a great GUI builder, almost makes it too easy to make a nice looking app in no time at all. http://www.wxpython.org/download.php http://boa-constructor.sourceforge.net/ if you decide to give wxPython a go, make

Simple System Tray Icon

2006-03-02 Thread 3c273
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 getting one to show

Re: white space in expressions and argument lists

2006-03-02 Thread Fredrik Lundh
John Salerno wrote: > Guido listed a few rules that he'd like to see implemented in 2.5, and > one of them was no more than one consecutive white space. I don't know > how realistic some of those suggestions are, but they seem to be getting > a little to restrictive. in his april 1st, 2005 paper

Re: Suggestions for documentation generation?

2006-03-02 Thread Michael Ekstrand
On 2 Mar 2006 04:06:17 -0800 "kpd" <[EMAIL PROTECTED]> wrote: > Thanks - I took at both. Also at 'percepts', which I used a long time > ago (had forgotten about it). Percepts has a great little java applet > for viewing the class hierarchy. I don't think it works for python, > just C++ though. L

Re: Stopping Windows Service

2006-03-02 Thread D
Sorry for the many messages, but I've been looking into it further - since I have the server services listening and waiting for incoming connections, how would I interrupt it to let the program know that a stop request has been issued? For example, if I put the stop check before it listens, I woul

Re: Simple System Tray Icon

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

Re: looking for help about python-sane

2006-03-02 Thread JW
Sorry, I can't help much with the issue. You are getting a low-level hardware fault, and not much information is being propagated up throught the system. It's not a Python problem, but something with SANE, and the Python wrapper is just propagating the SANE error to you. I have a few suggestions

setattr question

2006-03-02 Thread Gerard Flanagan
Hello I have the following code: builder.py # class HtmlBuilder(object): @staticmethod def page(title=''): return HtmlPage(title) @staticmethod def element(tag, text=None, **attribs): return HtmlElement(tag, text, **attribs) @staticmethod de

Re: white space in expressions and argument lists

2006-03-02 Thread Sybren Stuvel
John Salerno enlightened us with: > Guido listed a few rules that he'd like to see implemented in 2.5, > and one of them was no more than one consecutive white space. I > don't know how realistic some of those suggestions are, but they > seem to be getting a little to restrictive. I just read the

Re: white space in expressions and argument lists

2006-03-02 Thread rtilley
Fredrik Lundh wrote: > in his april 1st, 2005 paper ? > > http://www.artima.com/weblogs/viewpost.jsp?thread=101968 That was an April's Fools joke, right? I like it though :) Maybe it'll happen! -- http://mail.python.org/mailman/listinfo/python-list

Re: white space in expressions and argument lists

2006-03-02 Thread John Salerno
Fredrik Lundh wrote: > John Salerno wrote: > >> Guido listed a few rules that he'd like to see implemented in 2.5, and >> one of them was no more than one consecutive white space. I don't know >> how realistic some of those suggestions are, but they seem to be getting >> a little to restrictive. >

Re: Simple System Tray Icon

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

Re: os.popen3 delivers no error exist status ?

2006-03-02 Thread Donn Cave
In article <[EMAIL PROTECTED]>, robert <[EMAIL PROTECTED]> wrote: > os.popen3 delivers no error exit status on .close() - while os.popen does > > Is this intended or a bug? How do I get the status? http://docs.python.org/lib/popen3-objects.html Worth reading the rest of the documentation abo

Re: white space in expressions and argument lists

2006-03-02 Thread John Salerno
rtilley wrote: > John Salerno wrote: >> A minor concern, but I'm curious if there is any kind of best practice >> for using whitespace within expressions and argument lists in the >> Python world. For example: >> >> 1 + 2 or 1+2 > > IMO, good style calls for spaces. Most companies have style

Re: white space in expressions and argument lists

2006-03-02 Thread John Salerno
rtilley wrote: > Fredrik Lundh wrote: >> in his april 1st, 2005 paper ? >> >> http://www.artima.com/weblogs/viewpost.jsp?thread=101968 > > That was an April's Fools joke, right? I like it though :) > Maybe it'll happen! All of it was a joke? -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple System Tray Icon

2006-03-02 Thread 3c273
"Michele Petrazzo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > wxTaskBarIcon is very, very simple! > Into the demo, inside 80 line, you can find all the taskbar work, the > menu connected with the rclick and its image change... > Where do you find this complex? I guess since it

Re: Simple System Tray Icon

2006-03-02 Thread 3c273
"Thomas Heller" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 3c273 wrote: > > Can someone point me to a simple example that just shows an icon? I don't > > need it to anything but show up. Any help is appreciated. > > Louis > > > > > Simon Bruning has made something that should yo

Re: os.popen3 delivers no error exist status ?

2006-03-02 Thread [EMAIL PROTECTED]
As allternative you might want to try the commands.getstatusoutput() method, it returns a tuple with the exit code and output of the command you run, see http://docs.python.org/lib/module-commands.html -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question

2006-03-02 Thread orangeDinosaur
Thanks!! This makes sense. And you were right about my misunderstanding. Michael Tobis wrote: > I think the answers so far are unnecessarily confusing and off the > mark. > > Here is what I think you think you want to know: > > 1) import only works once. If you try import again, it will see the

Re: _tkinter.TclError: can't set "PY_VAR0": invalid command name "-1210125972check"

2006-03-02 Thread Gregor Horvath
Gregor Horvath schrieb: > if __name__ == "__main__": > t = testtk() > t.var.set("TEST") > > Result: > > _tkinter.TclError: can't set "PY_VAR0": invalid command name > "-1210125972check" > > > Any ideas, why I cant set the variable var? Ok. The problem is that the program enters the mainl

Re: import, from and reload

2006-03-02 Thread Dave Benjamin
On Thu, 2 Mar 2006, John Salerno wrote: > I understand that after you import something once, you can reload it to pick > up new changes. But does reload work with from statements? I tried this: > > from X import * > > and then did my testing. I changed X and tried to reload it, but that didn't >

Re: Rapid web app development tool for database

2006-03-02 Thread petrov
TurboGears has Catwalk. Have a look at that. It is a web UI that let's you manipulate the db. Have a look at the the TG Toolbox. -- http://mail.python.org/mailman/listinfo/python-list

Re: setattr question

2006-03-02 Thread bruno at modulix
Gerard Flanagan wrote: > Hello > > I have the following code: > > builder.py # > class HtmlBuilder(object): > > @staticmethod > def page(title=''): > return HtmlPage(title) > > @staticmethod > def element(tag, text=None, **attribs): > return HtmlElem

Re: asynchat network send problems

2006-03-02 Thread Scott David Daniels
Andreas R. wrote: > 4. In the found_terminator() method, the data is attempted to be > uncompressed, but it failes, since the received data does not have the > same size as the data which is sent. Sometimes, the difference in size > is often 512 between client and server, when running len(packet

Re: Proper class initialization

2006-03-02 Thread Steven Bethard
Kent Johnson wrote: > Steven Bethard wrote: >> I don't run into this often, but when I do, I usually go Jack >> Diederich's route:: >> >> class A(object): >> class __metaclass__(type): >> def __init__(cls, name, bases, classdict): >> cls.sum = sum(xrange(10)

Shared memory

2006-03-02 Thread Sebastjan Trepca
Hey! Are there any "live" modules for working with shared memory in Python? I found some but they are all dead(posh,shm)... Thanks, Sebastjan -- http://mail.python.org/mailman/listinfo/python-list

Re: import, from and reload

2006-03-02 Thread John Salerno
Dave Benjamin wrote: > In general, "from X import *" should be avoided anyway, for reasons that > have been discussed many times in the past. The annoyance with reloading > is just one more reason. Better to just use "import X" in the first place. > Thanks. I kind of figured it's better to use

instances from bound methods

2006-03-02 Thread Nick Craig-Wood
I needed to find the instance from a bound method. Eg >>> class C(object): ... def fn(self): print "hello" ... >>> c=C() >>> fn=c.fn >>> fn > >>> fn.im_self <__main__.C object at 0xb7dd2acc> >>> fn.__self__ Traceback (most recent call last): File "", line 1, in ?

how do you move to a new line in your text editor?

2006-03-02 Thread John Salerno
This is a real small point, but I'd like to hear what others do in this case. It's more an 'administrative' type question than Python code question, but it still involves a bit of syntax. One thing I like to do is use tabs for my indentation, because this makes it easy to outdent when I need to

  1   2   3   >