Re: Converstion

2006-04-27 Thread Paddy
Something like (untested): out = [] for ch in instring: if ch==backspace: if out: out = out[:-1] else: out.append(ch) outstring = ''.join(out) - Pad. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyrex installation on windows XP: step-by-step guide

2006-04-27 Thread Julien Fiore
sturlamolden wrote: > edit the text file "c:\mingw\lib\gcc\mingw32\3.2.4\specs" > and change "-lmsvcrt" to "-lmsvcr71". Thank you very much sturlamolden, This procedure should be added to the "step-by-step" guide (see 1st message of this thread) as "step A.5". For ignorant people like me, CRT =

Re: can i set up a mysql db connection as a class ?

2006-04-27 Thread *binarystar*
I suppose that is possible because you are calling the one instance of a cursor object ... maybe you have to create a copy of the cursor object, rather than passing a reference to the one object? or set up the db_connection objects inside each of the threads? .. Winfried Tilanus wrote: > On 0

Re: append function problem?

2006-04-27 Thread *binarystar*
# Try This seed = [2, 3, 4, 5] next = [7] seed1 = seed + next [EMAIL PROTECTED] wrote: > hello, recently i tried to use list.append() function in seemingly > logical ways, however, i cannot get it to work, here is the test code: > seed = [2, 3, 4, 5] next = 7 seed1 = seed.append(

Re: can i set up a mysql db connection as a class ?

2006-04-27 Thread Winfried Tilanus
On 04/28/2006 07:54 AM, *binarystar* wrote: Just wondering: is there any risk of two threads accessing the Execute function at the same time and getting something like this on the same cursor object: thread_1: self.cursor.Execute( sql_statement ) thread_2: self.cursor.Execute( sql_statement ) thr

Re: append function problem?

2006-04-27 Thread vbgunz
seed = [1,2,3] seed.append(4) print seed # [1,2,3,4] many of the list methods are in place methods on a mutable object. In other words, doing the following results in None. seed = [1,2,3] seed = seed.append(4) print seed # None you also just wiped out your list... The append method like many o

Re: can i set up a mysql db connection as a class ?

2006-04-27 Thread *binarystar*
Oops .. slight edit now when you pass the db_connection instance to other classes, a reference will be passed automagically -- http://mail.python.org/mailman/listinfo/python-list

Re: print out each letter of a word

2006-04-27 Thread Peter Otten
Gary Wessle wrote: > I am going through this tut from > http://ibiblio.org/obp/thinkCS/python/english/chap07.htm > > I am getting errors running those 2 groups as below as is from the tut Next time, please copy and paste the complete "traceback", the error messages that clutter your screen when

Re: print out each letter of a word

2006-04-27 Thread vbgunz
what errors are you getting? Could it be an indentation error? I don't see anything wrong with the script except the value of fruit is missing. if fruit is a string, it should work like a charm. double check the length of the fruit with print len(fruit) and check fruit with print type(fruit) and ma

Re: can i set up a mysql db connection as a class ?

2006-04-27 Thread *binarystar*
your on the right track ... create something like this ( hope the formatting doesn't go to hay wire ) class DB_Connector(object): """ Humble Database Connection Class """ def __init__(self, host="localhost", user="MyUser",passwd="MyPassword", **other_db_arguments):

Re: How to import whole namespace into global symbol table? (newbie)

2006-04-27 Thread Peter Otten
Scott Simpson wrote: > Lastly, is there an equivalent of Perl's "die" function? I'm writing to > stderr and dieing above but I'm not quite sure if this is the "correct" > way. You can call sys.exit() with a string. Python will print it to stderr and terminate with a nonzero exit status. Peter --

Re: Two ElementTree questions

2006-04-27 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > 1) It appears as if the following logic works for determining whether > an element is a parent: > > # assume elem is an ElementTree element > if (elem.getchildren() == None): > print 'this element is not a parent' > else: > print 'this element is a parent' > > My

Re: Help needed on COM issue

2006-04-27 Thread Mike Howard
Thanks for the suggestions. I tried the tuple to list to tuple method with no success Its not a .Value issue either. In order to keep going I've left this code as vb for the moment -- http://mail.python.org/mailman/listinfo/python-list

print out each letter of a word

2006-04-27 Thread Gary Wessle
I am going through this tut from http://ibiblio.org/obp/thinkCS/python/english/chap07.htm I am getting errors running those 2 groups as below as is from the tut thanks index = 0 while index < len(fruit): letter = fruit[index] print letter index = index + 1 or for char in fruit:

Two ElementTree questions

2006-04-27 Thread mirandacascade
1) It appears as if the following logic works for determining whether an element is a parent: # assume elem is an ElementTree element if (elem.getchildren() == None): print 'this element is not a parent' else: print 'this element is a parent' My question is this: are there any other ways

Re: can i set up a mysql db connection as a class ?

2006-04-27 Thread nephish
This is great ! ok, i dont really have a lot of time to get into the ORMS (before your post, this is the first i have heard of it) and my stuff is due on Monday. he he. but, if i am able to make a global db connection, and multiple cursors pointing to the same connection object, how do i pull tha

Re: raw_input passing to fun

2006-04-27 Thread Gary Wessle
John Machin <[EMAIL PROTECTED]> writes: > On 28/04/2006 2:04 PM, Gary Wessle wrote: > > the output of this code below is not what one would expect, it > > outputs > > all kind of numbers and it never stops, I want to ask the user for a > > number and then print out the multiplication table up to t

Re: raw_input passing to fun

2006-04-27 Thread John Machin
On 28/04/2006 2:04 PM, Gary Wessle wrote: > > the output of this code below is not what one would expect, it outputs > all kind of numbers and it never stops, I want to ask the user for a > number and then print out the multiplication table up to that number. That's what you want, but not what yo

Re: Protocols for Python?

2006-04-27 Thread Gregor Horvath
[EMAIL PROTECTED] schrieb: > > Is there a standard way to document protocols in Python? Of should I > come up with something tailored to my needs. > Write unittests or doctest strings. -- Servus, Gregor http://www.gregor-horvath.com -- http://mail.python.org/mailman/listinfo/python-list

Re: append function problem?

2006-04-27 Thread John Machin
On 28/04/2006 1:49 PM, [EMAIL PROTECTED] wrote: > hello, recently i tried to use list.append() function in seemingly > logical ways, however, i cannot get it to work, here is the test code: > seed = [2, 3, 4, 5] next = 7 seed1 = seed.append(next) seed1 print(str(seed1)) >

raw_input passing to fun

2006-04-27 Thread Gary Wessle
the output of this code below is not what one would expect, it outputs all kind of numbers and it never stops, I want to ask the user for a number and then print out the multiplication table up to that number. thanks import math

Re: can i set up a mysql db connection as a class ?

2006-04-27 Thread *binarystar*
that's definitely the way to go .. -create a database_object -initialise at start up -then pass the database object to other classes as needed ... If you want to get really fancy have a look at some ORM's ... I think there is a Python one called SQLObject? [EMAIL PROTECTED] wrote: > hey there,

Re: append function problem?

2006-04-27 Thread Murali
A typo here? seed v/s seed1. Instead of "print(seed.append(5))", try "seed.append(5)" followed by "print seed" -- "print(seed)" also works. The append method does not return the appended value (like many C functions). - Murali -- http://mail.python.org/mailman/listinfo/python-list

append function problem?

2006-04-27 Thread randomtalk
hello, recently i tried to use list.append() function in seemingly logical ways, however, i cannot get it to work, here is the test code: >>> seed = [2, 3, 4, 5] >>> next = 7 >>> seed1 = seed.append(next) >>> seed1 >>> print(str(seed1)) None >>> def test(lst): ... print(str(lst)) ... >>> test(

Re: Type-Def-ing Python

2006-04-27 Thread Alex Martelli
Aahz <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Alex Martelli <[EMAIL PROTECTED]> wrote: > ><[EMAIL PROTECTED]> wrote: > > ... > >> Brett Cannon's thesis in which he tweaks the compiler and shows that > >> type-defing python would not help the compiler achieve a 5% performace

Why not BDWGC?

2006-04-27 Thread LuciferLeo
I've heard that the reason why python uses reference counting rather than tracing collector is because python cannot determine the root set for its various C extensions. But provided that BDWGC(full name: Boehm-Demers-Weiser conservative garbage collector) is conservative --- can be used for C, and

Re: Converstion

2006-04-27 Thread John Machin
On 28/04/2006 9:50 AM, Chris wrote: > In a program I'm writing I have a problem where a bit of text sent over > a network arrives at my server. If the person who sent the text made a > mistake typing the word and pressed backspace the backspace code is > included in the word for example hello is he

Re: gcc errors

2006-04-27 Thread Chris Pesarchick
Thanks for your help. That is exactly what was wrong. All I had to do was download xcode 2.2.1 and that installed the universal sdk. -Chris On Apr 27, 2006, at 12:31 PM, Simon Percivall wrote: > It doesn't think you're on an intel box, it thinks you want to compile > universal libraries, sinc

Foriegn contents in Python Packages...

2006-04-27 Thread redefined . horizons
Is it possible to store "non-python" files in a directory that serves as a Python Package? (Like an image file or an XML file.) Is this allowed for sub-directories that are not Python Packages? In other words, can I have a Python Package that contains other Python Packages and also folders that ar

Re: Converstion

2006-04-27 Thread placid
Chris wrote: > In a program I'm writing I have a problem where a bit of text sent over > a network arrives at my server. If the person who sent the text made a > mistake typing the word and pressed backspace the backspace code is > included in the word for example hello is hel\x08lo. The \x08 is t

Re: How to import whole namespace into global symbol table? (newbie)

2006-04-27 Thread Edward Elliott
Scott Simpson wrote: > def func(): > from sys import stderr, exit > try: > f = open("foo", 'r') > except IOError: > print >> stderr, "Input file foo does not exist" > exit(1) IOError can be raised when foo exists, e.g. if there's a permission problem. It'

Re: stdin: processing characters

2006-04-27 Thread Edward Elliott
Kevin Simmons wrote: > I have a python script that prompts the user for input from stdin via a > menu. I want to process that input when the user types in two characters > and not have to have the user press . As a comparison, in the bash > shell one can use (read -n 2 -p "-->" CHOICE; case $CHOICE

Re: [pygtk] Advanced Treeview Filtering Trouble

2006-04-27 Thread JUAN ERNESTO FLORES BELTRAN
Thanks a lot! it did work!! :) -- http://mail.python.org/mailman/listinfo/python-list

Re: OOP techniques in Python

2006-04-27 Thread Panos Laganakos
Thanks for all the useful answers :) Alot of stuff to take into consideration/chew on. I come up with similar drawbacks now and then, 'cause some OOP techniques can be made in Python relatively simpler or plainly different (still simpler though). Though I am hesitant on how to act on certain occas

Re: Using Parts of PEAK

2006-04-27 Thread Ben Finney
[EMAIL PROTECTED] writes: > I was intriuged by the concept of Python Eggs and some of the work > that has been done on PEAK. > > http://peak.telecommunity.com/ > > However, I think PEAK might be overkill for the particular design I > am considering. Is anyone using just part of PEAK in their Pyt

can i set up a mysql db connection as a class ?

2006-04-27 Thread nephish
hey there, i have a huge app that connects to MySQL. There are three threads that are continually connecting and disconnecting to the db. The problem is, if there is an error, it faults out sometimes without closing the connection. i connect like this. db = MySQLdb.connect(host="localhost", user="M

Re: String Exceptions (PEP 352)

2006-04-27 Thread Ben Finney
Thomas Guettler <[EMAIL PROTECTED]> writes: > I like python because it is compatible to old versions. I like it because it has a documented, manageable procedure for breaking compatibility with old versions. > if foo and bar and i>10: > raise "if foo and bar i must not be greater than 10" O

Re: Advanced Treeview Filtering Help

2006-04-27 Thread alisonken1
> Your question was answered on PyGTK mailing list. Please, don't crosspost. Where is the pygtk mailing list? -- http://mail.python.org/mailman/listinfo/python-list

Re: how to free the big list memory

2006-04-27 Thread Tim Peters
[kyo guan] > Python version 2.4.3 > > >>> l=range(50*1024*100) > > after this code, you can see the python nearly using about 80MB. > > then I do this > > >>> del l > > after this, the python still using more then 60MB, Why the python don't free > my > memory? It's that you've created 5 million i

How to import whole namespace into global symbol table? (newbie)

2006-04-27 Thread Scott Simpson
Suppose I have the following python program: def func(): from sys import stderr, exit try: f = open("foo", 'r') except IOError: print >> stderr, "Input file foo does not exist" exit(1) def main(): import sys if len(args) != 0: sys.exit

Converstion

2006-04-27 Thread Chris
In a program I'm writing I have a problem where a bit of text sent over a network arrives at my server. If the person who sent the text made a mistake typing the word and pressed backspace the backspace code is included in the word for example hello is hel\x08lo. The \x08 is the backspace key. How

Re: Simple DAV server?

2006-04-27 Thread Ivan Voras
Kyler Laird wrote: > Ivan's been working on a problem I've been experiencing with Windows XP > ("failure to launch"). He sent a new version my way today. I'm going > to test it tomorrow when I've got some XP users available. If it works > I'm going to work on putting my changes into a subclass.

stdin: processing characters

2006-04-27 Thread Kevin Simmons
I have seen this question asked a few times but have not seen a clear answer... I have a python script that prompts the user for input from stdin via a menu. I want to process that input when the user types in two characters and not have to have the user press . As a comparison, in the bash shell

Re: midipy.py on linux

2006-04-27 Thread Baptiste Carvello
Will Hurt a écrit : > Is there another module which does the same thing available for linux[ie > i can get raw midi data in as a list] and thats why no-ones bothered to > compile midipy under linux? > > Thanks > Will > I use http://www.mxm.dk/products/public/pythonmidi/ That's pure python, and

Re: C API []-style access to instance objects

2006-04-27 Thread [EMAIL PROTECTED]
That worked! Thank You! I'd also like to say this group is great at fast accurate responses! Cheers! thanks ~jason -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expression help

2006-04-27 Thread John Bokma
Edward Elliott <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: >> If you are parsing HTML, it may make more sense to use a package >> designed especially for that purpose, like Beautiful Soup. > > I don't know Beautiful Soup, but one advantage regexes have over some > parsers is handling ma

Re: Regular Expression help

2006-04-27 Thread Edward Elliott
[EMAIL PROTECTED] wrote: > If you are parsing HTML, it may make more sense to use a package > designed especially for that purpose, like Beautiful Soup. I don't know Beautiful Soup, but one advantage regexes have over some parsers is handling malformed html. Omitted closing tags can wreak havoc.

Re: inheriting type or object?

2006-04-27 Thread James Stroud
Fabiano Sidler wrote: > Hi folks! > > As stated in subject, how do I decide wether to inherit or > ? Whenever I want to intantiate my derived type, I taked > here, but inheriting from consequently would > be reasonable in cases of pure static objects (i.e. objects/types using > staticmethods ex

Re: OOP techniques in Python

2006-04-27 Thread Edward Elliott
Philippe Martin wrote: > I'm not sure I understand what you mean ... I did get a strange new > message from my email client and disabled the signature. Look again at the post I replied to (great-grandparent of this one). It's not your sig quote that was the problem. -- http://mail.python.org/ma

Re: Regular Expression help

2006-04-27 Thread RunLevelZero
Interesting... thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Xah's Edu Corner: What Languages to Hate

2006-04-27 Thread John Bokma
Alex Buell <[EMAIL PROTECTED]> wrote: > Send your complaints to: > abuse at sbcglobal dott net > abuse at dreamhost dott com Yup, done. If he's still with dreamhost he probably is in trouble now. If not, next. -- John MexIT: http://johnbokma.com/mexit/

Re: Xah's Edu Corner: What Languages to Hate

2006-04-27 Thread Roedy Green
On 27 Apr 2006 14:22:03 -0700, "Xah Lee" <[EMAIL PROTECTED]> wrote, quoted or indirectly quoted someone who said : >What Languages to Hate Come, if you are as experienced as you claim you know that comp.lang.java.advocacy is the home of language wars and commentary on them, not comp.lang.java.pro

Re: Regular Expression help

2006-04-27 Thread RunLevelZero
r']*>(.*?)' With a slight modification that did exactly what I wanted, and yes the findall was the only way to get all that I needed as I buffered all the read. Thanks a bunch. -- http://mail.python.org/mailman/listinfo/python-list

Re: Xah's Edu Corner: What Languages to Hate

2006-04-27 Thread Alex Buell
On 27 Apr 2006 14:22:03 -0700 "Xah Lee" <[EMAIL PROTECTED]> waved a wand and this message magically appeared: > What Languages to Hate Folks, this guy has moved to pacbell.net (and probably relocated his website as well). Send your complaints to: [EMAIL PROTECTED] [EMAIL PROTECTED] -- http:/

Re: Regular Expression help

2006-04-27 Thread johnzenger
If what you need is "simple," regular expressions are almost never the answer. And how simple can it be if you are posting here? :) BeautifulSoup isn't all that hard. Observe: >>> from BeautifulSoup import BeautifulSoup >>> html = '10:00am - 11:00am: >> href="/tvpdb?d=tvp&id=167540528&[snip]>T

Re: Xah's Edu Corner: What Languages to Hate

2006-04-27 Thread Xah Lee
Addendum: Recently I ran into this egregious propaganda: http://www.ibiblio.org/pub/multimedia/video/obp/IntroducingPython.mpg folks, take a look. This is a significant part how things move in the computing community. Xah [EMAIL PROTECTED] ∑ http://xahlee.org/ Xah Lee wrote: > What Langu

Re: Xah's Edu Corner: What Languages to Hate

2006-04-27 Thread Xah Lee
What Languages to Hate Xah Lee, 20020718 Dear lisp comrades and other concerned parties, First, all languages have equal rights. Do not belittle other languages just because YOUR favorite language is a bit better in this aspect or that. Different people have different ideas and manners of percep

Re: Regular Expression help

2006-04-27 Thread RunLevelZero
I considered that but what I need is simple and I don't want to use another library for something so simple but thank you. Plus I don't understand them all that well :) -- http://mail.python.org/mailman/listinfo/python-list

Re: How to align the text of a Listbox to the right

2006-04-27 Thread Jarek Zgoda
Sori Schwimmer napisał(a): > For a listbox, I would give a width and go with string > formatting. In your case, I guess that what I'll do is > to limit the width to something acceptable, and show > only the tail of the line. > > Say, your width is w, then I'll show only the last w-4 > chars, prec

Re: Advanced Treeview Filtering Help

2006-04-27 Thread Jarek Zgoda
JUAN ERNESTO FLORES BELTRAN napisał(a): > can any of you suggest a code example to follow and find out how the > treeview must be coded in order to allow "multicolumn filtering"??? > > thanks in advance for your support.. Your question was answered on PyGTK mailing list. Please, don't crosspost.

Re: Regular Expression help

2006-04-27 Thread johnzenger
If you are parsing HTML, it may make more sense to use a package designed especially for that purpose, like Beautiful Soup. -- http://mail.python.org/mailman/listinfo/python-list

inheriting type or object?

2006-04-27 Thread Fabiano Sidler
Hi folks! As stated in subject, how do I decide wether to inherit or ? Whenever I want to intantiate my derived type, I taked here, but inheriting from consequently would be reasonable in cases of pure static objects (i.e. objects/types using staticmethods exclusively), for whose I would prefer

Re: MinGW and Python

2006-04-27 Thread Ross Ridge
sturlamolden wrote: > I seem to vaguely remember that MinGW was going to get its own CRT. And > unless it does, MinGW is a defect compiler for legal resons. It cannot > be legally used. That is simply not true. > Microsoft has designated the CRT that MinGW links a system file, > against which no

Re: Regular Expression help

2006-04-27 Thread RunLevelZero
Great I will test this out once I have the time... thanks for the quick response -- http://mail.python.org/mailman/listinfo/python-list

Re: Inherit from array

2006-04-27 Thread Scott David Daniels
bruno at modulix wrote: > TG wrote: >> Hmm ... I'm definitely not a python wizard, but it seems to be quite a >> special case that breaks the rules ... > > Yes and no. The primary use case for __new__ was to allow subclassing of > immutable types. array.array is not immutable, but it's still a sp

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) > > Yes. Other suggestions you might get are not to bottom po

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 bother to fix it.) I'm not sure I understan

Re: Protocols for Python?

2006-04-27 Thread Harold Fellermann
[EMAIL PROTECTED] wrote: > Still, I'm designing an application that I want to be extendable by > third-party developers. I'd like to have some sort of documentation > about what behavior is required by the components that can be added to > extend the application. I'd thought I might try documenting

Re: OOP techniques in Python

2006-04-27 Thread Edward Elliott
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 bother to fix it.) -- http://mail.python.org/mailman/listinfo/python-list

Re: finding IP address of computer

2006-04-27 Thread Terry Reedy
"Grant Edwards" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 2006-04-27, Gregor Horvath <[EMAIL PROTECTED]> wrote: >> Chris schrieb: >>> How do I find and print to screen the IP address of the computer my >>> python program is working on? >>> >> >> IP adresses are bound to net

Re: can this be done without eval/exec?

2006-04-27 Thread Schüle Daniel
Kent Johnson schrieb: > Schüle Daniel wrote: >> and now the obvious one (as I thought at first) >> >> >>> lst=[] >> >>> for i in range(10): >> ... lst.append(lambda:i) >> ... >> >>> lst[0]() >> 9 >> >>> i >> 9 >> >>> >> >> I think I understand where the problem comes from >> lambda:i seems

Re: OOP techniques in Python

2006-04-27 Thread Duncan Booth
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) Yes. Other suggestions you might get are not to bottom post, and certainly not (as you d

Re: midipy.py on linux

2006-04-27 Thread Jesse Hager
Will Hurt wrote: > Hi > Ive been using midipy in my blender3d python scripts on windowsXP, now > im trying to run them from ubuntu and i cant find the midipy.py module > compiled for linux anywhere. > Is it possible to complie it under linux and how would i go about doing > it --or-- > Is there an

Re: Protocols for Python?

2006-04-27 Thread Jay Parlar
On Apr 27, 2006, at 3:26 PM, [EMAIL PROTECTED] wrote: > I think I have reached an important moment in my growth as a Python > Developer. I realize now why interfaces aren't really necessary in > Python. :] > > Still, I'm designing an application that I want to be extendable by > third-party devel

Re: Twisted and Tkinter

2006-04-27 Thread Chris
There is no manual that's the problem. The sendLine method is part of LineReceiver which is part of twisted. It's used to send a message over the transport link. I can get it working by overriding twisted's methods for example linereceived() or connectionmade(). But how do I get it to send a messag

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

Using Parts of PEAK

2006-04-27 Thread redefined . horizons
I was intriuged by the concept of Python Eggs and some of the work that has been done on PEAK. http://peak.telecommunity.com/ However, I think PEAK might be overkill for the particular design I am considering. Is anyone using just part of PEAK in their Python development. Are there alternative di

Protocols for Python?

2006-04-27 Thread redefined . horizons
I think I have reached an important moment in my growth as a Python Developer. I realize now why interfaces aren't really necessary in Python. :] Still, I'm designing an application that I want to be extendable by third-party developers. I'd like to have some sort of documentation about what behav

Re: What do you use __init__.py for?

2006-04-27 Thread alisonken1
[EMAIL PROTECTED] wrote: > But what other uses does the '__init__.py' script have? What do you > use it for? __init__.py is used for initialization of the package - similar to __init__() in a function or class declaration. One example would be if you create a package with generic database met

Re: MinGW and Python

2006-04-27 Thread sturlamolden
I seem to vaguely remember that MinGW was going to get its own CRT. And unless it does, MinGW is a defect compiler for legal resons. It cannot be legally used. Microsoft has designated the CRT that MinGW links a system file, against which no application should link. Insted they have asked that a C

Re: os.system call problem

2006-04-27 Thread questions?
Fredrik Lundh wrote: > "questions?" <[EMAIL PROTECTED]> wrote: > > > I use os.system to call a display program, e.g. > > > > os.system(displayblah blah) to call display. the program starts and > > display things I wanted. When I kill display, somehow the python > > program don't understand I want

Re: OOP techniques in Python

2006-04-27 Thread Edward Elliott
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 mind, but I think that Python tends

Re: OOP techniques in Python

2006-04-27 Thread Philippe Martin
Steven Bethard wrote: > [Please don't top-post] > > Steven Bethard wrote: > > Panos Laganakos wrote: > >> 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: > >> > >

What do you use __init__.py for?

2006-04-27 Thread redefined . horizons
I have just started learning about Python Packages. I know that a directory must contains the '__init__.py' script to be considered a Python package, and that this script is executed when the package is imported. But what other uses does the '__init__.py' script have? What do you use it for? I

Re: OOP techniques in Python

2006-04-27 Thread bruno at modulix
Panos Laganakos wrote: > I've been thinking if there's a point in applying some specific OOP > techniques in Python as we do in other languages. Yes - but some of these techniques are somewhat python-specific. > i.e. we usually define private properties and provide public functions > to access th

Re: Regular Expression help

2006-04-27 Thread Edward Elliott
RunLevelZero wrote: > 10:00am - 11:00am: > Here is the re. > > findshows = > re.compile(r'(\d\d:\d\d\D\D\s-\s\d\d:\d\d\D\D:*.*)') 1. A regex remembers everything it matches -- no need to wrap the entire thing in parens. Just call group() on the returned MatchObject. 2. If all you want is the

Re: MS VC++ Toolkit 2003, where?

2006-04-27 Thread sturlamolden
Alex Martelli wrote: > Provides the core msvcrt.lib for msvcr71.dll against which to link > your extensions. This is critically important, as without it you are > going to wind up linking against the wrong run-time and will see crashes > whenever a core object such as a file is shared acro

fwd: Advanced Treeview Filtering Help

2006-04-27 Thread JUAN ERNESTO FLORES BELTRAN
by the way, iam using pygtk to develop the GUI Regards.- -- http://mail.python.org/mailman/listinfo/python-list

Re: finding IP address of computer

2006-04-27 Thread Grant Edwards
On 2006-04-27, Gregor Horvath <[EMAIL PROTECTED]> wrote: > Chris schrieb: >> How do I find and print to screen the IP address of the computer my >> python program is working on? >> > > IP adresses are bound to network interfaces not to computers. > One Computer can have multiple network interfaces

Re: Importing modules through directory shortcuts on Windows

2006-04-27 Thread Roger Upole
Warning: Ugly code ahead import win32con, winioctlcon, winnt import win32file, win32api import os, struct temp_dir=win32api.GetTempPath() temp1=win32api.GetTempFileName(temp_dir,'rpp')[0] win32file.DeleteFile(temp1) os.mkdir(temp1) temp2=win32api.GetTempFileName(temp_dir,'rpp')[0] win32file.Delet

Advanced Treeview Filtering Help

2006-04-27 Thread JUAN ERNESTO FLORES BELTRAN
Hi you all, I am developping a python application which connects to a database (postresql) and displays the query results on a treeview. In adittion to displaying the info i do need to implement filtering facility for all the columns of the treestore/liststore model in order to allow the user a

Re: os.system call problem

2006-04-27 Thread Fredrik Lundh
"questions?" <[EMAIL PROTECTED]> wrote: > I use os.system to call a display program, e.g. > > os.system(displayblah blah) to call display. the program starts and > display things I wanted. When I kill display, somehow the python > program don't understand I want to move on, keep calling > os.syste

Re: Pyrex installation on windows XP: step-by-step guide

2006-04-27 Thread sturlamolden
sturlamolden wrote: > I don't think this is safe. MinGW links with msvcrt.dll whereas the > main Python distribution links with msvcr71.dll (due to Visual C++ > 2003). In order to make minGW link with msvcr71.dll, edit the text file c:\mingw\lib\gcc\mingw32\3.2.4\specs and change "-lmsvcrt" to

Re: String Exceptions (PEP 352)

2006-04-27 Thread Terry Reedy
"Thomas Guettler" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I like python because it is compatible to old versions. Python 3 will be a new and mostly improved dialect of Python. Some 2.x code will run unchanged. Much will not. Transition tools will be written. > That's way

Re: MinGW and Python

2006-04-27 Thread Ross Ridge
sturlamolden wrote: > That is correct. And it is the reson why the MinGW team is working on > removing the dependency on this CRT. No one is working on removing MinGW's depency on MSVCRT.DLL. Ross Ridge -- http://mail.python.org/mailman/listinfo/python-list

Re: MinGW and Python

2006-04-27 Thread Ross Ridge
sturlamolden wrote: > Cygwin executables are native windows ".exe files" just like MinGW > executables. They are built by the same compiler, a port of GCC to 32 > bit Windows originally written by Mumit Khan. No, Cygwin executables are built using a different port of GCC, the Cygwin port of GCC.

Re: Twisted and Tkinter

2006-04-27 Thread Fredrik Lundh
"Chris" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] > it now comes up with the error message > > Traceback (most recent call last): > File "C:\Python24\lib\lib-tk\Tkinter.py", line 1345, in __call__ > return self.func(*args) > File "C:\Documents and Settings\chris\Desktop

Re: MS VC++ Toolkit 2003, where?

2006-04-27 Thread sturlamolden
I believe MinGW can link .lib C libraries files from Visual Studio. But there are no .a for Python24.dll as far as I can tell. -- http://mail.python.org/mailman/listinfo/python-list

twisted and tkinter chat client

2006-04-27 Thread Chris
Hi, Sorry for reposting but I changed my code and received a new error message so I thought I would try it on the group again. I have a working server and this is meant to be a chat client using tkinter that connects to the server and sends messages. However I receive this error message when I cli

os.system call problem

2006-04-27 Thread questions?
I use os.system to call a display program, e.g. os.system(displayblah blah) to call display. the program starts and display things I wanted. When I kill display, somehow the python program don't understand I want to move on, keep calling os.system(displayblah blah) again and again. I have to kill

  1   2   3   >