Re: pop() clarification

2007-04-12 Thread Bruno Desthuilliers
Hamilton, William a écrit : >> -Original Message- >> From: [EMAIL PROTECTED] > [mailto:python- >> [EMAIL PROTECTED] On Behalf Of Scott >> >> I understand all that. What I don't understand is why all the >> documentation >> I see says, "When removing a specific element from a list using pop

Re: py script modify it's Modified Time?

2007-04-12 Thread est
On 4月12日, 上午2时26分, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Wed, 11 Apr 2007 10:33:57 -0300, <[EMAIL PROTECTED]> escribió: > > > On Apr 11, 6:14 am, "est" <[EMAIL PROTECTED]> wrote: > >> I guess os.stat() could retrieve information about ctime, mtime of a > >> path, but how can I change

redirecting stdout to a file as well as screen

2007-04-12 Thread SamG
How could i make, from inside the program, to have the stdout and stderr to be printed both to a file as well the terminal(as usual). -- http://mail.python.org/mailman/listinfo/python-list

Dyla 2007: 3rd Workshop on Dynamic Languages and Applications

2007-04-12 Thread alexandre . bergel
Dear colleges, You might want to consider Dyla'07 as a good venue to present your work and your favourite programming language. Regards, Alexandre ** Call for Papers Dyla 2007: 3rd Workshop on Dynamic Languages and Applicat

reaching hidden methods + casting

2007-04-12 Thread per9000
Hi, can I reach a hidden method when doing ugly inheritance in python? >>> class A: ... def spin(self, n): print "A", n ... >>> class B: ... def spin(self, m): print "B", m ... >>> class C(A,B): ... def spin(self, k): print "C", k ... >>> myC = C() >>> dir(myC) ['__doc__', '__module__'

Re: tuples, index method, Python's design

2007-04-12 Thread Antoon Pardon
On 2007-04-11, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > > So how about it? All you people who desperately want tuples to grow an > index method -- will any of you donate your time to write and maintain the > code? But as far as I understood the code is already there; the code for list.index be

sqlite3 question

2007-04-12 Thread Jorgen Bodde
Hi all, I am using sqlite3 in python, and I wonder if there is a way to know if there are valid rows returned or not. For example I have a table song with one entry in it. The ID of that entry is 1, so when I do; >>> r = c.execute('select * from song where id = 1') >>> for s in r: ... print s

Re: python regular expression help

2007-04-12 Thread 7stud
On Apr 11, 11:15 pm, [EMAIL PROTECTED] wrote: > On Apr 11, 9:50 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > lhs = re.compile(r'\s*(\b\w+\s*=)') > for s in [ "a = 4 b =3.4 5.4 c = 4.5", > "a = 4.5 b = 'h' 'd' c = 4.5 3.5"]: > tokens = lhs.split(s) > results = [tokens[_] + tokens[_+1] for

Re: tuples, index method, Python's design

2007-04-12 Thread Antoon Pardon
On 2007-04-11, Chris Mellon <[EMAIL PROTECTED]> wrote: > On 11 Apr 2007 08:37:39 -0700, Paul Boddie <[EMAIL PROTECTED]> wrote: >> On 11 Apr, 16:14, "Chris Mellon" <[EMAIL PROTECTED]> wrote: >> > >> > If you want a language that just adds whatever methods anyone thinks >> > of, along with whatever a

Any Pythonistas in Mexico?

2007-04-12 Thread Hugo González Monteverde
Hola, Leí este mail viejísimo en una lista. Yo uso Python y también quería saber quién pythoneaba en México. Todavía estás por ahí? Saludos, Hugo G. -- http://mail.python.org/mailman/listinfo/python-list

Re: reaching hidden methods + casting

2007-04-12 Thread Gabriel Genellina
En Thu, 12 Apr 2007 04:18:19 -0300, per9000 <[EMAIL PROTECTED]> escribió: > Hi, > can I reach a hidden method when doing ugly inheritance in python? > class A: > ... def spin(self, n): print "A", n > ... class B: > ... def spin(self, m): print "B", m > ... class C(A,B): > ..

Re: python regular expression help

2007-04-12 Thread Qilong Ren
Hi, Yeah, a little bit tricky. Actually it is part of some Fortran input file. Thanks for suggestion! It helps a lot! Thanks,Qilong - Original Message From: Gabriel Genellina <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Sent: Wednesday, April 11, 2007 9:50:00 PM Subject: Re: python regula

Re: redirecting stdout to a file as well as screen

2007-04-12 Thread Ant
On Apr 12, 8:14 am, "SamG" <[EMAIL PROTECTED]> wrote: > How could i make, from inside the program, to have the stdout and > stderr to be printed both to a file as well the terminal(as usual). One way would be to create a custom class which has the same methods as the file type, and held a list of

Re: Connection problems with irclib

2007-04-12 Thread Cousin Stanley
> Hi. I've written a bot in python, > using the irclib by Joel Rosdahl. > > Works fine from my linux box at home, > but when I upload it to my shell > at veritynet.net, can't seem to get it > to connect to an irc server. > > It doesn't report any errors. > > Anyone have any idea how I might go

wxPython, mac, wx.HSCROLL not working

2007-04-12 Thread 7stud
Hi, I'm trying to allow for a horizontal scrollbar on a textarea, but the scrollbar won't appear when I enter a long string of text(by leaning on one character on my keyboard): import wx app = wx.App() win = wx.Frame(None, title="Text Editor", size=(150, 150) ) tb = wx.TextCtrl(win, pos

Newbie help with array handling

2007-04-12 Thread loial
I am new to python and am converting an awk script to python I need to store some data in an array/table of some form keyvalue1, value1, value2, value3 keyvalue2, value1,value2, value3 keyvalue3, value1,value2,value3 etc I will later need to sort in keyvalue order and also need to be able to che

Re: redirecting stdout to a file as well as screen

2007-04-12 Thread Gabriel Genellina
En Thu, 12 Apr 2007 04:14:32 -0300, SamG <[EMAIL PROTECTED]> escribió: > How could i make, from inside the program, to have the stdout and > stderr to be printed both to a file as well the terminal(as usual). A very minimal example: import sys class Tee(file): others = () def write(s

Re: About Trolltech QT OpenSource license.

2007-04-12 Thread king kikapu
On Apr 12, 1:02 am, Robert Kern <[EMAIL PROTECTED]> wrote: > All parts of the software have to be licensed compatibly with the GPL. The FSF > has a fairly comprehensive list of the licenses they believe are > GPL-compatible. > The source that you provide needs to be the preferred form for making >

Re: sqlite3 question

2007-04-12 Thread Rob Wolfe
Jorgen Bodde wrote: > All I can think of is a 'crappy' construction where I use the iterator > to see if there was something in there, but surely, there must be a > better way to know? > > >>> r = c.execute('select * from song where id = 2') > >>> notfound = True > >>> for s in r: > ... notfoun

Re: Newbie help with array handling

2007-04-12 Thread rishi pathak
do something like this {keyvalue1:[ value1, value2, value3],keyvalue2:[value1,value2, value3],keyvalue3,:[value1,value2,value3]} On 12 Apr 2007 00:58:54 -0700, loial <[EMAIL PROTECTED]> wrote: I am new to python and am converting an awk script to python I need to store some data in an array/ta

Re: tuples, index method, Python's design

2007-04-12 Thread Antoon Pardon
On 2007-04-11, Terry Reedy <[EMAIL PROTECTED]> wrote: > > "BJrn Lindqvist" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > On 4/10/07, Steve Holden <[EMAIL PROTECTED]> wrote: >> One might perversely allow extension to lists and tuples to allow >> >>[3, 4] in [1, 2, 3, 4, 5, 6]

reading from sys.stdin

2007-04-12 Thread 7stud
I can't break out of the for loop in this example: -- import sys lst = [] for line in sys.stdin: lst.append(line) break print lst --- But, I can break out of the for loop when I do this: - import sys lst = [] for line in open("aaa.txt"): lst.append(line) br

Re: Newbie help with array handling

2007-04-12 Thread bruce peng
use dir with list nested for example: {key1 : [value1, value2, value3], key2 : [value1, value2, vlaue4]} "loial" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I am new to python and am converting an awk script to python > > I need to store some data in an array/table of some form

Re: sqlite3 question

2007-04-12 Thread Gabriel Genellina
En Thu, 12 Apr 2007 04:38:06 -0300, Jorgen Bodde <[EMAIL PROTECTED]> escribió: > I am using sqlite3 in python, and I wonder if there is a way to know > if there are valid rows returned or not. For example I have a table > song with one entry in it. The ID of that entry is 1, so when I do; >

Re: pop() clarification

2007-04-12 Thread Christophe
Carl Banks a écrit : > On Apr 11, 3:10 pm, "7stud" <[EMAIL PROTECTED]> wrote: >> On Apr 11, 10:44 am, "Scott" <[EMAIL PROTECTED]> wrote: >> >> >> >>> As said before I'm new to programming, and I need in depth explaination to >>> understand everything the way I want to know it, call it a personality

Re: reading from sys.stdin

2007-04-12 Thread Diez B. Roggisch
7stud schrieb: > I can't break out of the for loop in this example: > > -- > import sys > > lst = [] > for line in sys.stdin: > lst.append(line) > break > > print lst > --- Works for me. But only after the stdin is closed with a C-d. I presume this is an OS thing. The first

Re: reading from sys.stdin

2007-04-12 Thread Michael Bentley
On Apr 12, 2007, at 3:20 AM, 7stud wrote: > I can't break out of the for loop in this example: > > -- > import sys > > lst = [] > for line in sys.stdin: > lst.append(line) > break > > print lst > --- > > But, I can break out of the for loop when I do this: > > - > impo

Re: Newbie help with array handling

2007-04-12 Thread bearophileHUGS
loial: > I am new to python and am converting an awk script to python It seems there are many people trying to convert awk code to Python :-) > I need to store some data in an array/table of some form > keyvalue1, value1, value2, value3 > keyvalue2, value1,value2, value3 > keyvalue3, value1,valu

Re: Newbie help with array handling

2007-04-12 Thread Bruno Desthuilliers
loial a écrit : > I am new to python and am converting an awk script to python > > I need to store some data in an array/table of some form > > keyvalue1, value1, value2, value3 > keyvalue2, value1,value2, value3 > keyvalue3, value1,value2,value3 > etc data = dict( keyvalue1=[value11, value12

Re: reading from sys.stdin

2007-04-12 Thread Gabriel Genellina
En Thu, 12 Apr 2007 05:20:58 -0300, 7stud <[EMAIL PROTECTED]> escribió: > I can't break out of the for loop in this example: > > -- > import sys > > lst = [] > for line in sys.stdin: > lst.append(line) > break > > print lst > --- Python 2.5.1c1 (r251c1:54692, Apr 5 2007, 09

Calling private base methods

2007-04-12 Thread Jorgen Bodde
Hi All, Now that I am really diving into Python, I encounter a lot of things that us newbies find difficult to get right. I thought I understood how super() worked, but with 'private' members it does not seem to work. For example; >>> class A(object): ... def __baseMethod(self): ...

Re: reaching hidden methods + casting

2007-04-12 Thread Bruno Desthuilliers
per9000 a écrit : > Hi, > can I reach a hidden method when doing ugly inheritance in python? > class A: > ... def spin(self, n): print "A", n > ... class B: > ... def spin(self, m): print "B", m > ... class C(A,B): > ... def spin(self, k): print "C", k > ... myC = C

Re: redirecting stdout to a file as well as screen

2007-04-12 Thread SamG
On Apr 12, 1:00 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 12 Apr 2007 04:14:32 -0300, SamG <[EMAIL PROTECTED]> escribió: > > > How could i make, from inside the program, to have the stdout and > > stderr to be printed both to a file as well the terminal(as usual). > > A very mini

Re: Newbie help with array handling

2007-04-12 Thread 7stud
loial wrote: > I am new to python and am converting an awk script to python > > I need to store some data in an array/table of some form > > keyvalue1, value1, value2, value3 > keyvalue2, value1,value2, value3 > keyvalue3, value1,value2,value3 > etc > > I will later need to sort in keyvalue order

Re: About Trolltech QT OpenSource license.

2007-04-12 Thread king kikapu
I dig a little bit more on the Trolltech's site and i think that this page is telling all the truth: http://www.trolltech.com/developer/downloads/qt/faq So, this tells us all the good stuff people in this thread are talking about, i think is clear enough. -- http://mail.python.org/mailman/listi

Re: Calling private base methods

2007-04-12 Thread Enrico
"Jorgen Bodde" <[EMAIL PROTECTED]> ha scritto nel messaggio news:[EMAIL PROTECTED] > Hi All, > > Now that I am really diving into Python, I encounter a lot of things > that us newbies find difficult to get right. I thought I understood > how super() worked, but with 'private' members it does not se

Pyqt programming question

2007-04-12 Thread Marcpp
I have a program (python + pyqt), with a button I'll would to open a new dialog window to input text, when press save or ok, this text is returned to the principal program. I've seek in internet but i don't find anything. -- http://mail.python.org/mailman/listinfo/python-list

Re: About Trolltech QT OpenSource license.

2007-04-12 Thread Robert Kern
king kikapu wrote: > On Apr 12, 1:02 am, Robert Kern <[EMAIL PROTECTED]> wrote: >> All parts of the software have to be licensed compatibly with the GPL. The >> FSF >> has a fairly comprehensive list of the licenses they believe are >> GPL-compatible. >> The source that you provide needs to be th

parsing text in blocks and line too

2007-04-12 Thread flyzone
Goodmorning people :) I have just started to learn this language and i have a logical problem. I need to write a program to parse various file of text. Here two sample: --- trial text bla bla bla bla error bla bla bla bla bla bla bla bla on more lines trial text bla bla bla

Re: Newbie help with array handling

2007-04-12 Thread loial
OK, thanks for the replies One other thing...I need to update the values since they are basically totals that I am accumulating. How do I update a specific value for a specific key? -- http://mail.python.org/mailman/listinfo/python-list

Re: Get Shift + TAB in ncurses.

2007-04-12 Thread Thomas Bellman
[EMAIL PROTECTED] wrote: > Anyone can help me getting the shift + tab key combination ? > I tried with getch () but with no success. > May be using the sys.stdin ?? It's generally not possible. Most terminals I have used send the same character (ASCII code 9) when you press Shift-Tab as when you

Re: redirecting stdout to a file as well as screen

2007-04-12 Thread SamG
On Apr 12, 12:40 pm, "Ant" <[EMAIL PROTECTED]> wrote: > On Apr 12, 8:14 am, "SamG" <[EMAIL PROTECTED]> wrote: > > > How could i make, from inside the program, to have the stdout and > > stderr to be printed both to a file as well the terminal(as usual). > > One way would be to create a custom class

Re: Pyqt programming question

2007-04-12 Thread Phil Thompson
On Thursday 12 April 2007 10:23 am, Marcpp wrote: > I have a program (python + pyqt), with a button I'll would to open a > new dialog window to input text, when press save or ok, this text is > returned to the principal program. > I've seek in internet but i don't find anything. Use QInputDialog.g

Re: redirecting stdout to a file as well as screen

2007-04-12 Thread 7stud
On Apr 12, 3:35 am, "SamG" <[EMAIL PROTECTED]> wrote: > On Apr 12, 12:40 pm, "Ant" <[EMAIL PROTECTED]> wrote: > > > > > On Apr 12, 8:14 am, "SamG" <[EMAIL PROTECTED]> wrote: > > > > How could i make, from inside the program, to have the stdout and > > > stderr to be printed both to a file as well t

Re: Newbie help with array handling

2007-04-12 Thread 7stud
On Apr 12, 3:31 am, "loial" <[EMAIL PROTECTED]> wrote: > OK, thanks for the replies > > One other thing...I need to update the values since they are basically > totals that I am accumulating. > > How do I update a specific value for a specific key? mydict["keyvalue1"] returns the value, which in

SQLite problems

2007-04-12 Thread bayer . justin
Hi there, I run Python 2.5 on a Mac OS X system with SQLite 3.2.8 installed via fink. Today I stumbled over the problem, that the sqlite3 module and sqlite3 from fink do not seem to work well together. I brought it down to this: >>> from sqlite3 import Connection >>> c = Connection("foo.bar") #

Re: redirecting stdout to a file as well as screen

2007-04-12 Thread Antoon Pardon
On 2007-04-12, SamG <[EMAIL PROTECTED]> wrote: > On Apr 12, 12:40 pm, "Ant" <[EMAIL PROTECTED]> wrote: >> On Apr 12, 8:14 am, "SamG" <[EMAIL PROTECTED]> wrote: >> >> > How could i make, from inside the program, to have the stdout and >> > stderr to be printed both to a file as well the terminal(as

Re: tuples, index method, Python's design

2007-04-12 Thread Paul Boddie
On 12 Apr, 09:37, Antoon Pardon <[EMAIL PROTECTED]> wrote: > > Why then does python itself provide immutables? I find this reasoning > more than baffling. There has been all these arguments about why > it is best to use immutables as dictionary keys. You've answered your own question. If you had a

Re: Pyqt programming question

2007-04-12 Thread Marcpp
On 12 abr, 11:48, Phil Thompson <[EMAIL PROTECTED]> wrote: > On Thursday 12 April 2007 10:23 am, Marcpp wrote: > > > I have a program (python + pyqt), with a button I'll would to open a > > new dialog window to input text, when press save or ok, this text is > > returned to the principal program. >

Re: sys.excepthook and threads

2007-04-12 Thread Dr. Peer Griebel
ian schrieb: > Hi, > > sys.excepthook don't work if an exception come in a thread... > It's normal or its a bug ? There are any tip ? look here : > http://spyced.blogspot.com/2005_06_01_archive.html > > Thx I think sys.excepthook is a thread local variable. This means the variable has to b

Re: redirecting stdout to a file as well as screen

2007-04-12 Thread Gabriel Genellina
En Thu, 12 Apr 2007 06:01:18 -0300, SamG <[EMAIL PROTECTED]> escribió: > On Apr 12, 1:00 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: >> En Thu, 12 Apr 2007 04:14:32 -0300, SamG <[EMAIL PROTECTED]> escribió: >> >> > How could i make, from inside the program, to have the stdout and >> > std

Re: redirecting stdout to a file as well as screen

2007-04-12 Thread SamG
On Apr 12, 3:16 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 12 Apr 2007 06:01:18 -0300, SamG <[EMAIL PROTECTED]> escribió: > > > > > On Apr 12, 1:00 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > > wrote: > >> En Thu, 12 Apr 2007 04:14:32 -0300, SamG <[EMAIL PROTECTED]> escribió: >

Re: Calling private base methods

2007-04-12 Thread Gabriel Genellina
En Thu, 12 Apr 2007 05:47:57 -0300, Jorgen Bodde <[EMAIL PROTECTED]> escribió: > Now that I am really diving into Python, I encounter a lot of things > that us newbies find difficult to get right. I thought I understood > how super() worked, but with 'private' members it does not seem to > work.

Re: Pyqt programming question

2007-04-12 Thread Phil Thompson
On Thursday 12 April 2007 11:07 am, Marcpp wrote: > On 12 abr, 11:48, Phil Thompson <[EMAIL PROTECTED]> wrote: > > On Thursday 12 April 2007 10:23 am, Marcpp wrote: > > > I have a program (python + pyqt), with a button I'll would to open a > > > new dialog window to input text, when press save or o

Re: Pyqt programming question

2007-04-12 Thread Marcpp
On 12 abr, 12:07, "Marcpp" <[EMAIL PROTECTED]> wrote: > On 12 abr, 11:48, Phil Thompson <[EMAIL PROTECTED]> wrote: > > > On Thursday 12 April 2007 10:23 am, Marcpp wrote: > > > > I have a program (python + pyqt), with a button I'll would to open a > > > new dialog window to input text, when press s

Re: Newbie help with array handling

2007-04-12 Thread 7stud
On Apr 12, 3:50 am, "7stud" <[EMAIL PROTECTED]> wrote: > On Apr 12, 3:31 am, "loial" <[EMAIL PROTECTED]> wrote: > > lst = mydict["keyvalue1"] > lst[0] = 4 > list.append("red") Rather the last line there should read: lst.append("red") -- http://mail.python.org/mailman/listinfo/python-list

Re: tuples, index method, Python's design

2007-04-12 Thread Antoon Pardon
On 2007-04-12, Paul Boddie <[EMAIL PROTECTED]> wrote: > On 12 Apr, 09:37, Antoon Pardon <[EMAIL PROTECTED]> wrote: >> >> Why then does python itself provide immutables? I find this reasoning >> more than baffling. There has been all these arguments about why >> it is best to use immutables as dicti

Re: redirecting stdout to a file as well as screen

2007-04-12 Thread Gabriel Genellina
En Thu, 12 Apr 2007 07:23:43 -0300, SamG <[EMAIL PROTECTED]> escribió: >> >> > How could i make, from inside the program, to have the stdout and >> >> > stderr to be printed both to a file as well the terminal(as usual). >> >> >> class Tee(file): >> >> others = () >> >> >> def write(self

Re: Calling private base methods

2007-04-12 Thread 7stud
On Apr 12, 2:47 am, "Jorgen Bodde" <[EMAIL PROTECTED]> wrote: > Is it possible to call a private base method? I come from a C++ > background, and I liked this construction as my base class has helper > methods so that I do not have to duplicate code. > I'd like to see some C++ code that does that

Re: Pyqt programming question

2007-04-12 Thread Marcpp
On 12 abr, 12:34, Phil Thompson <[EMAIL PROTECTED]> wrote: > On Thursday 12 April 2007 11:07 am, Marcpp wrote: > > > On 12 abr, 11:48, Phil Thompson <[EMAIL PROTECTED]> wrote: > > > On Thursday 12 April 2007 10:23 am, Marcpp wrote: > > > > I have a program (python + pyqt), with a button I'll would

Re: Calling private base methods

2007-04-12 Thread Duncan Booth
"7stud" <[EMAIL PROTECTED]> wrote: > On Apr 12, 2:47 am, "Jorgen Bodde" <[EMAIL PROTECTED]> wrote: >> Is it possible to call a private base method? I come from a C++ >> background, and I liked this construction as my base class has helper >> methods so that I do not have to duplicate code. >> >

Re: SQLite problems

2007-04-12 Thread martin . laloux
> I run Python 2.5 on a Mac OS X system with SQLite 3.2.8 installed via > fink. Why fink ?, it is very easy to make sqlite. download the source, configure, make and install from terminal -- http://mail.python.org/mailman/listinfo/python-list

Re: parsing text in blocks and line too

2007-04-12 Thread A.T.Hofkamp
On 2007-04-12, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Goodmorning people :) > I have just started to learn this language and i have a logical > problem. > I need to write a program to parse various file of text. > Here two sample: > > --- > trial text bla bla bla bla error >

Re: NLTK, Random Sentence Generators?

2007-04-12 Thread Passer By
James Stroud <[EMAIL PROTECTED]> writes: > Passer By wrote: > > James Stroud <[EMAIL PROTECTED]> writes: > > > >>Passer By wrote: > >> > >> > >>>Has any created or not of examples of random sentence generators > >>>using n-gram models (or other models might be interesting). I > >>>know of one exa

Re: sqlite3 question

2007-04-12 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Jorgen Bodde wrote: r = c.execute('select * from song where id = 1') for s in r: > ... print s > ... > (1, u'Spikedrivers Blues', u'Mississippi John Hurt') > > That works. But when I can't restore the row by e.g. an ID that does > not exist, I cannot see any

Re: parsing text in blocks and line too

2007-04-12 Thread James Stroud
A.T.Hofkamp wrote: > On 2007-04-12, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> Goodmorning people :) >> I have just started to learn this language and i have a logical >> problem. >> I need to write a program to parse various file of text. >> Here two sample: >> >> --- >> trial tex

Re: redirecting stdout to a file as well as screen

2007-04-12 Thread SamG
On Apr 12, 3:42 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 12 Apr 2007 07:23:43 -0300, SamG <[EMAIL PROTECTED]> escribió: > > > > >> >> > How could i make, from inside the program, to have the stdout and > >> >> > stderr to be printed both to a file as well the terminal(as usual).

Re: reaching hidden methods + casting

2007-04-12 Thread per9000
On 12 Apr, 09:42, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > > > > In f.x. the C-family of languages I guess something like this would > > call B.spin: > > ((B)myC).spin("Lancelot"); // almost forgot the ';' > > Try this in Python: > B.spin(myC, "Lancelot") > > > > Thanks, that was exac

Re: Nice "bug" to loose a contest

2007-04-12 Thread aspineux
On 8 avr, 13:40, "aspineux" <[EMAIL PROTECTED]> wrote: > This code works like the python one, > I dont use buffered stdio f... functions, > but the more 'system call' read and write > > int main() > { > char buf[120]; > int len; > > while (len=read(1, buf, sizeof(buf))) { > writ

Capturing the entry point of a script

2007-04-12 Thread SamG
If a function does not have main function defined and there is only a if __name__="__main__": how do i make a call to that using profile.runcall( ...) in my profiling script. Is there a way to find the entry point of a script and indentify it with module method. -- http://mail.python.org/mail

Capturing the entry point of a script

2007-04-12 Thread SamG
If a function does not have main function defined and there is only a if __name__="__main__": how do i make a call to that using profile.runcall( ...) in my profiling script. Is there a way to find the entry point of a script and indentify it with module method. -- http://mail.python.org/mail

Re: Code Explaination: Spelling correction code

2007-04-12 Thread Drew
On Apr 11, 11:27 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > Drew wrote: > > I recently saw this website:http://www.norvig.com/spell-correct.html > > > All the code makes sense to me save one line: > > > def known_edits2(word): > > return set(e2 for e1 in edits1(word) for e2 in edits1(e1) i

Re: sqlite3 question

2007-04-12 Thread Carsten Haese
On Thu, 2007-04-12 at 13:43 +0200, Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Jorgen Bodde > wrote: > > r = c.execute('select * from song where id = 1') > for s in r: > > ... print s > > ... > > (1, u'Spikedrivers Blues', u'Mississippi John Hurt') > > > >

Re: reading from sys.stdin

2007-04-12 Thread Maric Michaud
Le jeudi 12 avril 2007 10:34, Diez B. Roggisch a écrit : > I presume this is an OS thing. The first lines aren't communicated to > the process until either the file is closed - C-d - or the buffer the OS > puts before the stream is filled. You can switch to unbuffered behviour > somehow, google for

Re: tuples, index method, Python's design

2007-04-12 Thread Steve Holden
Antoon Pardon wrote: > On 2007-04-11, Terry Reedy <[EMAIL PROTECTED]> wrote: >> "BJrn Lindqvist" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> On 4/10/07, Steve Holden <[EMAIL PROTECTED]> wrote: >>> One might perversely allow extension to lists and tuples to allow >>> >>>[3

Re: Calling private base methods

2007-04-12 Thread Maric Michaud
Le jeudi 12 avril 2007 10:47, Jorgen Bodde a écrit : > I thought I understood > how super() worked, but with 'private' members it does not seem to > work. I would add to what is already said, that you should just forget the private -public - protected concepts in Python. There is no access cont

Re: tuples, index method, Python's design

2007-04-12 Thread Steve Holden
Antoon Pardon wrote: > On 2007-04-11, Terry Reedy <[EMAIL PROTECTED]> wrote: >> "BJrn Lindqvist" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> On 4/10/07, Steve Holden <[EMAIL PROTECTED]> wrote: >>> One might perversely allow extension to lists and tuples to allow >>> >>>[3

Re: Capturing the entry point of a script

2007-04-12 Thread Steve Holden
SamG wrote: > If a function does not have main function defined and there is only a > > if __name__="__main__": > > how do i make a call to that using > > profile.runcall( ...) > > in my profiling script. Is there a way to find the entry point of a > script and indentify it with module method.

Re: wxPython, mac, wx.HSCROLL not working

2007-04-12 Thread Bjoern Schliessmann
7stud wrote: > I'm trying to allow for a horizontal scrollbar on a textarea, but > the scrollbar won't appear when I enter a long string of text(by > leaning on one character on my keyboard): Works for me (Linux, self-built Python 2.5 and wxPython 2.8.3.0). Regards, Björn -- BOFH excuse #285

Re: reading from sys.stdin

2007-04-12 Thread Steve Holden
Maric Michaud wrote: > Le jeudi 12 avril 2007 10:34, Diez B. Roggisch a écrit : >> I presume this is an OS thing. The first lines aren't communicated to >> the process until either the file is closed - C-d - or the buffer the OS >> puts before the stream is filled. You can switch to unbuffered behv

Binary To File

2007-04-12 Thread Robert Rawlins - Think Blue
Hello Guys, Is there an easy way to take binary data and build it into a file? Generally this will be BLOB data drawn from a database, the data will be for jpg images, I want to take the blob data and build it into a physical .jpg file. Is there a simple function for doing this in python? L

Pyqt calling custom dialog

2007-04-12 Thread Marcpp
I need to call a custom dialog from a program, and return parameters. Any idea or example? -- http://mail.python.org/mailman/listinfo/python-list

Re: Any Pythonistas in Mexico?

2007-04-12 Thread Marcpp
On 12 abr, 09:41, Hugo González Monteverde <[EMAIL PROTECTED]> wrote: > Hola, > > Leí este mail viejísimo en una lista. Yo uso Python y también quería > saber quién pythoneaba en México. Todavía estás por ahí? > > Saludos, > > Hugo G. Yo vivo en España. Usas el pyqt? -- http://mail.python.org/ma

Re: Creating an EXE for XLRD + WIN32COM + wxWidgets application - Help request

2007-04-12 Thread Larry Bates
BrendanC wrote: > I've started learninhg Python and have developed a small Python app > that imports Excel data into an Access mdb/jet database. This > application has dependencies on the following: > > XLRD - http://cheeseshop.python.org/pypi/xlrd/0.5.2 - (to read Excel > files) > Python window

Re: tuples, index method, Python's design

2007-04-12 Thread Antoon Pardon
On 2007-04-12, Steve Holden <[EMAIL PROTECTED]> wrote: > Antoon Pardon wrote: >> On 2007-04-11, Terry Reedy <[EMAIL PROTECTED]> wrote: >>> "BJrn Lindqvist" <[EMAIL PROTECTED]> wrote in message >>> news:[EMAIL PROTECTED] >>> On 4/10/07, Steve Holden <[EMAIL PROTECTED]> wrote: One might pervers

Re: reading from sys.stdin

2007-04-12 Thread Matimus
On Apr 12, 1:20 am, "7stud" <[EMAIL PROTECTED]> wrote: > I can't break out of the for loop in this example: > > -- > import sys > > lst = [] > for line in sys.stdin: > lst.append(line) > break > > print lst > --- > > But, I can break out of the for loop when I do this: > > -

Re: Code Explaination: Spelling correction code

2007-04-12 Thread Steven Bethard
Drew wrote: > On Apr 11, 11:27 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: >> Drew wrote: >>> def known_edits2(word): >>> return set(e2 for e1 in edits1(word) for e2 in edits1(e1) if e2 in >>> NWORDS) >> >> This is the same as: >> >> result = set() >> for e1 in edits1(word): >>

Re: tuples, index method, Python's design

2007-04-12 Thread Carsten Haese
On Thu, 2007-04-12 at 14:10 +, Antoon Pardon wrote: > People are always defending duck-typing in this news group and now python > has chosen to choose the option that makes duck-typing more difficult. Au contraire! The "inconsistent" behavior of "in" is precisely what duck-typing is all about:

Re: OT: Question about RGB color method

2007-04-12 Thread John Salerno
John Salerno wrote: > Sorry for this non-Python question, but since it's computer related I > know you guys will have an answer, and I don't really know where else to > ask. Mainly I'm just curious anyway. > > I'm wondering, why do computers use a RGB color scheme instead of the > primary color

Re: reading from sys.stdin

2007-04-12 Thread [EMAIL PROTECTED]
On Apr 12, 4:20 am, "7stud" <[EMAIL PROTECTED]> wrote: > I can't break out of the for loop in this example: > > -- > import sys > > lst = [] > for line in sys.stdin: > lst.append(line) > break > > print lst > --- You may want to look at a related issue: http://www.python.org/s

Re: reading from sys.stdin

2007-04-12 Thread [EMAIL PROTECTED]
On Apr 12, 10:25 am, "Matimus" <[EMAIL PROTECTED]> wrote: > * well, not ALL, it will read in chunks. But, I think they are 4096 > Byte chunks by default. If you are referring to the read ahead buffer size, it is 8192 bytes. Raghu. -- http://mail.python.org/mailman/listinfo/python-list

Re: SQLite problems

2007-04-12 Thread Kirk Job Sluder
[EMAIL PROTECTED] writes: > Hi there, > > I run Python 2.5 on a Mac OS X system with SQLite 3.2.8 installed via > fink. Today I stumbled over the problem, that the sqlite3 module and > sqlite3 from fink do not seem to work well together. I brought it down > to this: > > Any ideas? miss-match of v

PyX in Console and Script IDE

2007-04-12 Thread Stefan Schwärzler
Hi NG, i'm hanging with following problem in python: i have installed PyX to generate eps in python. in console-mode (call python in shell) there are no problem. calling pyx via python-script i got the following error (in a python ide f.e. wing2.0): ImportError: No module named _pykpathsea Have i

Re: reading from sys.stdin

2007-04-12 Thread Maric Michaud
Le jeudi 12 avril 2007 16:25, Matimus a écrit : > # Then you check to see if your file is interactive > if f.isatty(): >     # This is unbuffered, and will iterate the same as f >     f = iter(raw_input(),"") This should be f = iter(raw_input,"") and this will end in a EOFError and stop on blank

Omaha Python Users Group - Meeting April 12, 2007

2007-04-12 Thread dundeemt
Omaha Python Users Group http://www.OmahaPython.org When: April 12, 2007 @ 7:00pm Where: Reboot The User 13416 A Street Omaha, NE 68144 For More Information, please see http://www.omahapython.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython, mac, wx.HSCROLL not working

2007-04-12 Thread kyosohma
On Apr 12, 8:37 am, Bjoern Schliessmann wrote: > 7stud wrote: > > I'm trying to allow for a horizontal scrollbar on a textarea, but > > the scrollbar won't appear when I enter a long string of text(by > > leaning on one character on my keyboard): > > Works for me (Linux, self-built Python 2.5 and

Re: python newbie beautifulSoup question

2007-04-12 Thread Jon Crump
Justin, Wow! I thought there might be a 'simple' way! thanks so much, you've given me a lot to chew on. Jon __ J.J. Crump Dept. of History 353560 University of Washington Seattle, WA. 98195 On Wed, 11 Apr 2007, Justin Ezequiel wrote: > On Apr 12, 4:15 am, Jon Crump <[EMAIL PROTECTED]>

"Cloning" file attributes and permissions

2007-04-12 Thread Paulo da Silva
Hi! I need to process a file to produce another file that *must* have *exactly* the same attributes and permissions of the former. What is the best way to do this? The file must not exist with contents (it may exist empty) unless it has the same attributes and permissions. I know how to do this us

Re: bittorent

2007-04-12 Thread Linus Nordström
I might have been a bit unclear on what i was looking for, im not looking for a finished bitorrent client, but rather module that can parse a .torrent file, or info on how i would goabout to write something that can do that. On 4/11/07, Shane Geiger <[EMAIL PROTECTED]> wrote: > > > Jonathan Smith

Re: "Cloning" file attributes and permissions

2007-04-12 Thread Kevin Kelley
The os module has this ability: http://docs.python.org/lib/os-file-dir.html -- Kevin Kelley On 4/12/07, Paulo da Silva <[EMAIL PROTECTED]> wrote: Hi! I need to process a file to produce another file that *must* have *exactly* the same attributes and permissions of the former. What is the best

  1   2   3   >