SQLObject 0.8.2

2007-04-12 Thread Oleg Broytmann
Hello! I'm pleased to announce the 0.8.2 release of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to use and quick to get started

[ANN] mlabwrap-1.0final

2007-04-12 Thread Alexander Schmolck
I'm pleased to finally announce mlabwrap-1.0: Project website --- http://mlabwrap.sourceforge.net/ Description --- Mlabwrap-1.0 is a high-level python to matlab(tm) bridge that makes calling matlab functions from python almost as convenient as using a normal python library.

Python-URL! - weekly Python news and links (Apr 11)

2007-04-12 Thread Cameron Laird
QOTW: Dictionaries are one of the most useful things in Python. Make sure you know how to take adavantage of them... - Jeremy Sanders Python has consistently failed to disappoint me. - Tal Einat super() only works on new-style classes ... and has its own set of gotchas:

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-announce-list Support the Python

Re: __file__

2007-04-12 Thread 7stud
On Apr 11, 6:55 am, John Machin [EMAIL PROTECTED] wrote: On Apr 11, 8:03 pm, 7stud [EMAIL PROTECTED] wrote: Hi, Thanks for the response. On Apr 11, 12:49 am, Gabriel Genellina [EMAIL PROTECTED] wrote: __file__ corresponds to the filename used to locate and load the module,

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() it must be

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 them? Is it

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

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__', 'spin'] In f.x.

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 being

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 _ in

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 aliases for it any

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): ... def spin(self, k):

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 regular

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 about

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,

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

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

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: ... notfound = False ...

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

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] to succeed, but

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)

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; r =

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 quirk ;p. With

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 lines

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: - import sys lst =

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,

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:19:18) [MSC

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() dir(myC) ['__doc__',

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 minimal example:

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 and also

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. --

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 seem to

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 the preferred

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

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 which has the

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

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 the terminal(as usual).

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 this case

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) # does

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 usual). One way

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. I've

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 be set

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 stderr to be printed

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ó: How could i make,

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. For

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 ok, this

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 save or ok, this

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 dictionary keys.

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, data):

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 to open a

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. I'd like to see

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 bla bla

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 example from a course at MIT,

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 method in 'r'

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 text bla bla bla bla

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). class Tee(file):

Re: reaching hidden methods + casting

2007-04-12 Thread per9000
On 12 Apr, 09:42, Gabriel Genellina [EMAIL PROTECTED] wrote: snip 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) snip Thanks, that was exactly the insight

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))) { write(1, buf,

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. --

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. --

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) if e2 in

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') That works. But when I

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, 4] in [1, 2, 3, 4, 5,

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

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, 4] in [1, 2, 3, 4, 5,

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. There is

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 behviour

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?

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? --

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 windows

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 perversely allow extension to

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: - import sys

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): for e2 in

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 colors? Is

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/sf/1633941

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 versions

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 line.

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

  1   2   3   >