Re: output of top on a linux box

2007-04-13 Thread Pradnyesh Sawant
> Can you pull the same information from /proc/stat as opposed to using > a pipe to top? The first line(s) should contain (at least): > > cpu usermode, lowprio, system, idle, hz. Thanks a lot for the help. I finally decided to go with your suggestion. -- warm regards, Pradnyesh Sawant -- Be yoursel

Re: doubt with importing module, given module name

2007-04-13 Thread Pradnyesh Sawant
> module_name = "module" > mod = __import__(module_name) > class_name = module_name.capitalize() > cls = getattr(mod, class_name) > inst = cls() > Worked like a magic charm :) Also helped me understand the concept of getattr :D Thanks a million! -- warm regards, Pradnyesh Sawant -- Be yourself.

help

2007-04-13 Thread pierre-yves guido
hello (I hope my english is not so bad), I'm doing a training course and I'm a newbie in Python. My problem : I have a form, and when I click, I make an update. But all the parameters are all required to make the update. So I'd like to put in my code something like [optional]... My code (simply

Re: Problem with algorithm

2007-04-13 Thread Jia Lu
> for m in test: > for n in test: > for o in test: > for p in test: > print m+n+o+p Thanx for your anwser. But if I consider about a combination of over 26 letter's list just like: "abcdefssdzxcvzxcvzcv" "asllxcvxcbbedfgdfgdg" . Need I write 26 for loo

Re: Calling private base methods

2007-04-13 Thread Duncan Booth
"7stud" <[EMAIL PROTECTED]> wrote: >> Really, it does work (probably). There are other ways to get at private >> members in C++ but this is the easiest. > > I can also access private methods of a class if my sister backspaces > over "private" and types "public" instead. > > In your example, no p

Re: Calling private base methods

2007-04-13 Thread Duncan Booth
"Dan Bishop" <[EMAIL PROTECTED]> wrote: > I have a job as a C++ programmer and once tried this trick in order to > get at a private member function I needed. Didn't work: Apparently, VC > ++ includes the access level in its name mangling, so you get linker > errors. > I don't have a copy of VC t

Re: tuples, index method, Python's design

2007-04-13 Thread Antoon Pardon
On 2007-04-12, Carsten Haese <[EMAIL PROTECTED]> wrote: > 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 "inconsisten

Re: Databases with python

2007-04-13 Thread WEINHANDL Herbert
Anthony Irwin wrote: > Hi All, > > I am interested in playing with python some more and am looking at > writing an app with data stored in a database. I have experience with > mysql but thought that their may be other better databases that can be > more easily distributed with the program does

Re: Python and JMS?

2007-04-13 Thread Jarek Zgoda
Leonard J. Reder napisał(a): > I would like to write some Python to monitor a JMS middleware software bus. > JMS being Java Messaging Service. Can anyone recommend a Python > wrapper to JMS for this? My goal is to listen for XML being transfered > over > a JMS implementation. All the applicat

Re: tuples, index method, Python's design

2007-04-13 Thread Antoon Pardon
On 2007-04-12, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Thu, 12 Apr 2007 07:37:38 +, Antoon Pardon wrote: > >> I once had a problem I like to solve by having a dictionary >> where the keys were multidimensional points on an integer grid. >> For a number of reasons I thought it would be e

which version libpcap

2007-04-13 Thread eight02645999
hi from the web, i found 2 kinds of wrappers for libpcap, one is pylibpcap, the other is pcapy. may i know which is more popularly used? thanks -- http://mail.python.org/mailman/listinfo/python-list

split and regexp on textfile

2007-04-13 Thread Flyzone
Hi, i have a problem with the split function and regexp. I have a file that i want to split using the date as token. Here a sample: - Mon Apr 9 22:30:18 2007 text text Mon Apr 9 22:31:10 2007 text text I'm trying to put all the lines in a one string and then to separate it (could be bet

Re: Databases with python

2007-04-13 Thread hugonz
On Apr 13, 1:02 am, Anthony Irwin <[EMAIL PROTECTED]> wrote: > Hi All, > > I am interested in playing with python some more and am looking at > writing an app with data stored in a database. I have experience with > mysql but thought that their may be other better databases that can be > more eas

Re: Any Pythonistas in Mexico?

2007-04-13 Thread hugonz
On Apr 12, 8:56 am, "Marcpp" <[EMAIL PROTECTED]> wrote: > Yo vivo en España. > Usas el pyqt? Hola! no, no lo he usado, aunque ahorita estoy más bien haciendo mis experimentos con wxPython... Hugo -- http://mail.python.org/mailman/listinfo/python-list

HELP PARAMETERS IN SQL QUERY

2007-04-13 Thread pierre-yves guido
hello, I'm doing a training course and I'm a newbie in Python. My problem : I have a form, and when I click, I make an update. But all the parameters are all required to make the update. So I'd like to put in my code something like [optional]... My code (simplyfied) : prg.ev_ind_update(wf_pk_ev_

Re: Problem with algorithm

2007-04-13 Thread azrael
I think that this would be very silly to do. bad kung foo. The recoursion technique would be more satisfying. You sholud consider that this would take about 4 lines to write. Also be avare of the default recoursion depth in python wich is 1000. you can get and set the recoursion limit hrough impor

Re: split and regexp on textfile

2007-04-13 Thread mik3l3374
On Apr 13, 3:59 pm, "Flyzone" <[EMAIL PROTECTED]> wrote: > Hi, > i have a problem with the split function and regexp. > I have a file that i want to split using the date as token. > Here a sample: > - > Mon Apr 9 22:30:18 2007 > text > text > Mon Apr 9 22:31:10 2007 > text > text > > > I

Re: split and regexp on textfile

2007-04-13 Thread Flyzone
On 13 Apr, 10:40, [EMAIL PROTECTED] wrote: > you trying to match the date part right? if re is what you desire, > here's one example: Amm..not! I need to get the text-block between the two data, not the data! :) -- http://mail.python.org/mailman/listinfo/python-list

Re: reading from sys.stdin

2007-04-13 Thread 7stud
Hi, Thanks for the responses. My book, Beginning Python: From Novice to Professional(p. 266) says that "sys.stdin is iterable, just like other files", so I thought I would test it out. However, I don't see how it is acting similar to a file in my example. I assume all input is buffered by defa

Try problem

2007-04-13 Thread SamG
import sys try: s=1 if s==1: sys.exit(0) else: sys.exit(1) except SystemExit,s: if (s==0): print s else: print "Hello" How come i always end up getting the "Hello" printed on the screen as logically i should a '0' printed? -- http:

Re: reading from sys.stdin

2007-04-13 Thread Michael Hoffman
7stud wrote: > I assume all input is buffered by default, so I'm not sure how it > explains things to say that input from sys.stdin is buffered. The difference with sys.stdin is that it has indeterminate length until you signal EOF. I believe you'd get the same problem reading from, say, a name

Re: split and regexp on textfile

2007-04-13 Thread mik3l3374
On Apr 13, 4:55 pm, "Flyzone" <[EMAIL PROTECTED]> wrote: > On 13 Apr, 10:40, [EMAIL PROTECTED] wrote: > > > you trying to match the date part right? if re is what you desire, > > here's one example: > > Amm..not! I need to get the text-block between the two data, not the > data! :) change to pat.s

Re: Try problem

2007-04-13 Thread Michael Hoffman
SamG wrote: > import sys > try: > s=1 > if s==1: > sys.exit(0) > else: > sys.exit(1) > except SystemExit,s: > if (s==0): > print s > else: > print "Hello" > > How come i always end up getting the "Hello" printed on the screen as > lo

Re: Try problem

2007-04-13 Thread mik3l3374
On Apr 13, 5:14 pm, "SamG" <[EMAIL PROTECTED]> wrote: > import sys > try: > s=1 > if s==1: > sys.exit(0) > else: > sys.exit(1) > except SystemExit,s: > if (s==0): > print s > else: > print "Hello" > > How come i always end up getting

Re: split and regexp on textfile

2007-04-13 Thread Flyzone
On 13 Apr, 11:14, [EMAIL PROTECTED] wrote: > change to pat.split(data) then. next what i have tried originally..but is not working, my result is here: ["Mon Feb 26 11:25:04 2007\ntext\n text\ntext\nMon Feb 26 11:25:16 2007\ntext\n text\n text\nMon Feb 26 17:06:41 2007\ntext"] all together :(

Re: reading from sys.stdin

2007-04-13 Thread 7stud
On Apr 13, 3:13 am, Michael Hoffman <[EMAIL PROTECTED]> wrote: > 7stud wrote: > > I assume all input is buffered by default, so I'm not sure how it > > explains things to say that input from sys.stdin is buffered. > > The difference with sys.stdin is that it has indeterminate length until > you sig

Re: reading from sys.stdin

2007-04-13 Thread 7stud
On Apr 13, 3:36 am, "7stud" <[EMAIL PROTECTED]> wrote: > > > It is if the file is smaller than the buffer size. > > How is that relevant? > If I put 100 lines of text in a file with each line having 50 characters, and I run this code: import sys lst = [] for line in open("aaa.txt"): print "a

Re: split and regexp on textfile

2007-04-13 Thread bearophileHUGS
Flyzone: > i have a problem with the split function and regexp. > I have a file that i want to split using the date as token. My first try: data = """ error text Mon Apr 9 22:30:18 2007 text text Mon Apr 9 22:31:10 2007 text text Mon Apr 10 22:31:10 2007 text text """ import re date_find = re.

Re: Try problem

2007-04-13 Thread SamG
On Apr 13, 2:25 pm, [EMAIL PROTECTED] wrote: > On Apr 13, 5:14 pm, "SamG" <[EMAIL PROTECTED]> wrote: > > > import sys > > try: > > s=1 > > if s==1: > > sys.exit(0) > > else: > > sys.exit(1) > > except SystemExit,s: > > if (s==0): > > print s > >

Re: split and regexp on textfile

2007-04-13 Thread Flyzone
On 13 Apr, 11:30, "Flyzone" <[EMAIL PROTECTED]> wrote: > all together :( Damn was wrong mine regexp: pat = re.compile("[A-Z][a-z][a-z][ ][A-Z][a-z][a-z][ ][0-9| ][0-9][ ] [0-9][0-9][:][0-9][0-9]",re.M|re.DOTALL) now is working! :) Great! really thanks for the helps! A little question: the pat.s

Re: reading from sys.stdin

2007-04-13 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, 7stud wrote: > On Apr 13, 3:36 am, "7stud" <[EMAIL PROTECTED]> wrote: >> >> > It is if the file is smaller than the buffer size. >> >> How is that relevant? >> > > If I put 100 lines of text in a file with each line having 50 > characters, and I run this code: > > import

Re: Problem with algorithm

2007-04-13 Thread Paddy
On Apr 13, 8:16 am, "Jia Lu" <[EMAIL PROTECTED]> wrote: > > for m in test: > > for n in test: > > for o in test: > > for p in test: > > print m+n+o+p > > Thanx for your anwser. > But if I consider about a combination of over 26 letter's list just > like: > "a

Re: reading from sys.stdin

2007-04-13 Thread Michael Bentley
On Apr 13, 2007, at 4:47 AM, 7stud wrote: > On Apr 13, 3:36 am, "7stud" <[EMAIL PROTECTED]> wrote: >> >>> It is if the file is smaller than the buffer size. >> >> How is that relevant? >> > > If I put 100 lines of text in a file with each line having 50 > characters, and I run this code: > > impo

Re: Try problem

2007-04-13 Thread Diez B. Roggisch
SamG schrieb: > On Apr 13, 2:25 pm, [EMAIL PROTECTED] wrote: >> On Apr 13, 5:14 pm, "SamG" <[EMAIL PROTECTED]> wrote: >> >>> import sys >>> try: >>> s=1 >>> if s==1: >>> sys.exit(0) >>> else: >>> sys.exit(1) >>> except SystemExit,s: >>> if (s==0): >>>

Re: Lists and Tuples and Much More

2007-04-13 Thread Steven D'Aprano
On Thu, 12 Apr 2007 16:01:51 -0700, bearophileHUGS wrote: >> [1, 2, 3, 4, 5, 6, [7, 9, 8, 10]] > > Such sorting may be impossible in Python 3.0 (comparing the order of > lists with integers may be seen as meaningless. Otherwise you can see > single numbers as lists of len=1, like another language

Re: tuples, index method, Python's design

2007-04-13 Thread Steven D'Aprano
On Fri, 13 Apr 2007 07:46:58 +, Antoon Pardon wrote: >> So much fuss over such a little thing... yes it would be nice if tuples >> grew an index method, but it isn't hard to work around the lack. > > Yes it is a little thing. But if it is such a little thing why do > the developers don't simp

Re: Try problem

2007-04-13 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > On Apr 13, 5:14 pm, "SamG" <[EMAIL PROTECTED]> wrote: >> import sys >> try: >> s=1 >> if s==1: >> sys.exit(0) >> else: >> sys.exit(1) >> except SystemExit,s: >> if (s==0): >> print s >> else: >> print "He

Re: Shebang or Hashbang for modules or not?

2007-04-13 Thread Jorgen Grahn
On Thu, 12 Apr 2007 00:24:12 +0200, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Chris Lasher a écrit : >> Should a Python module not intended to be executed have shebang/ >> hashbang (e.g., "#!/usr/bin/env python") or not? > > The shebang is only useful for files that you want to make directl

Re: wxPython, mac, wx.HSCROLL not working

2007-04-13 Thread Bjoern Schliessmann
7stud wrote: > Thanks. It looks like someone asked the same question yesterday. No -- it looks like I was a bit stressed and the first google hit or a direct jump to wxpython.org would have provided the solution :) Regards, Björn -- BOFH excuse #14: sounds like a Windows problem, try calli

Re: Lists and Tuples and Much More

2007-04-13 Thread Scott
"7stud" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> Yes. Tuples are immutable - once created, they can't change. > > Just to explain that statement a little better. If you do this: > > > t = (1, 2, ["red", "white"]) > t[2].append("purple") > print t#(1, 2, ['red', 'white',

Re: wxPython, mac, wx.HSCROLL not working

2007-04-13 Thread 7stud
On Apr 13, 4:54 am, Bjoern Schliessmann wrote: > 7stud wrote: > > Thanks. It looks like someone asked the same question yesterday. > > No -- it looks like I was a bit stressed and the first google hit or > a direct jump to wxpython.org would have provided the solution :) > Huh? Are you saying y

Re: Shebang or Hashbang for modules or not?

2007-04-13 Thread Jorgen Grahn
On 13 Apr 2007 10:54:18 GMT, Jorgen Grahn <[EMAIL PROTECTED]> wrote: > On Thu, 12 Apr 2007 00:24:12 +0200, Bruno Desthuilliers <[EMAIL PROTECTED]> > wrote: >> Chris Lasher a écrit : >>> Should a Python module not intended to be executed have shebang/ >>> hashbang (e.g., "#!/usr/bin/env python") or

Re: Reading the first line of a file (in a zipfile)

2007-04-13 Thread mike . aldrich
On Apr 11, 4:20 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Wed, 11 Apr 2007 17:15:48 -0300, <[EMAIL PROTECTED]> escribió: > > > The file contents have leading whitespace, then a number: > > 123456 \n > > I expect to return '123456' > > And nothing following the number? > > p

Arrays, Got Me Confused

2007-04-13 Thread Robert Rawlins - Think Blue
Hello Guys, I'm struggling to get my head into arrays in python, I've used them plenty in other languages but I'm struggling to find any decent documentation for them in python. I'm looking to build a list of network MAC address's into an array, which will probably be used for logging and firew

Re: Arrays, Got Me Confused

2007-04-13 Thread Michael Bentley
On Apr 13, 2007, at 7:04 AM, Robert Rawlins - Think Blue wrote: #!/usr/bin/python # Filename: Firewall.py class Firewall: def __init__(self): Self.FireArray = array(c) p = Firewall() print p Throws: Traceback (most recent call last): File "./firewall.p

Re: Arrays, Got Me Confused

2007-04-13 Thread rishi pathak
HI, You will have to import Numeric module Add from Numeric import * to the script For the second question: Suppose you wrote the code for your class in firewall.py and your main script is main.py Put the file firewall.py in the directory where you have main.py Then in main.py do : import firewall

Re: reading from sys.stdin

2007-04-13 Thread Michael Hoffman
7stud wrote: > On Apr 13, 3:13 am, Michael Hoffman <[EMAIL PROTECTED]> wrote: >> 7stud wrote: >>> I assume all input is buffered by default, so I'm not sure how it >>> explains things to say that input from sys.stdin is buffered. >> The difference with sys.stdin is that it has indeterminate length

Re: Problem with algorithm

2007-04-13 Thread Michael Hoffman
azrael wrote: > I think that this would be very silly to do. bad kung foo. The > recoursion technique would be more satisfying. You sholud consider > that this would take about 4 lines to write. Also be avare of the > default recoursion depth in python wich is 1000. you can get and set > the recou

Re: Arrays, Got Me Confused

2007-04-13 Thread Tim Golden
Michael Bentley wrote: > > On Apr 13, 2007, at 7:04 AM, Robert Rawlins - Think Blue wrote: >> #!/usr/bin/python >> >> # Filename: Firewall.py >> class Firewall: >>def __init__(self): >> >> Self.FireArray = array(c) >> >> p = Firewall() >> >> print p >> Throws: >> >> >> >> Tra

Re: HELP PARAMETERS IN SQL QUERY

2007-04-13 Thread Colin J. Williams
pierre-yves guido wrote: > hello, > > I'm doing a training course and I'm a newbie in Python. My problem : > I have a form, and when I click, I make an update. But all the parameters > are all required to make the update. So I'd like to put in my code something > like [optional]... > > My code (s

Re: sqlite3 question

2007-04-13 Thread Jorgen Bodde
Thanks, This is how I did it in the end as well. Yes i use the connection object, abbreviated as 'c' for ease of typing. In my real app the connection is kept inside a singleton object and I use the DB like result = GuitarDB().connection.execute('select * from song where id = 1').fetchone() if r

Re: "Cloning" file attributes and permissions

2007-04-13 Thread Kevin Kelley
If you know what the permissions are going to be then you can use umask to set the default file creation permissions to match. Then any files created in that directory will have the correct permissions. I think the "pythonic" way to solve this problem would be to code up your own module which han

Function arguments [was: help]

2007-04-13 Thread Steve Holden
pierre-yves guido wrote: > hello (I hope my english is not so bad), > Your English is quite good. In future, though, please try to make your subject line say a bit more about the problem - we *all* need help! > I'm doing a training course and I'm a newbie in Python. My problem : > I have a form,

Re: treating str as unicode in legacy code?

2007-04-13 Thread Steve Holden
Ben wrote: > I'm left with some legacy code using plain old str, and I need to make > sure it works with unicode input/output. I have a simple plan to do > this: > > - Run the code with "python -U" so all the string literals become > unicode litrals. > - Add this statement > > str = unicode >

RE: Arrays, Got Me Confused

2007-04-13 Thread Robert Rawlins - Think Blue
Hello Guys, Wider fragments of code don't really exists at this moment in time :-D this is just a bit of a 'tester' class for me to get used to the methods. Basically I'm trying to create a class that contains an array of MAC address, these look something like this 'FD:E4:55:00:FG:A9. I want the c

Re: Need help with the get() method of a Text entry

2007-04-13 Thread Steve Holden
Chad wrote: > On Apr 12, 5:03 pm, James Stroud <[EMAIL PROTECTED]> wrote: >> James Stroud wrote: >>> Chad wrote: I have a simple little program that brings up asks the user to enter a note, then is supposed to place that note into a text file when the user hits the submit button. Ho

list of datasaources with pyodbc

2007-04-13 Thread timw.google
How do I get a list of datasources with pyodbc? I know that with mx.ODBC.Windows I can use the DataSources method to get a dictionay containing the datasources. Is there a similar way to do this with pyodbc? Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: VB6 To Python

2007-04-13 Thread Steve Holden
Michael Bentley wrote: > > On Apr 12, 2007, at 1:11 PM, Sampson, David wrote: > >> Any experience or insight would be great. > > It has been my experience that when migrating to a dissimilar system, > avoiding the rewrite is a mistake. And futile. > This is good advice. Since your original p

Re: Arrays, Got Me Confused

2007-04-13 Thread Tim Golden
Robert Rawlins - Think Blue wrote: > Hello Guys, > > Wider fragments of code don't really exists at this moment in time :-D this > is just a bit of a 'tester' class for me to get used to the methods. > Basically I'm trying to create a class that contains an array of MAC > address, these look somet

Re: Arrays, Got Me Confused

2007-04-13 Thread Richard Brodie
"Robert Rawlins - Think Blue" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Wider fragments of code don't really exists at this moment in time No but specifying the problem too narrowly tends to get you an unidiomatic solution. > Basically I'm trying to create a class that conta

Re: favourite IDE

2007-04-13 Thread Steve Holden
azrael wrote: > Some time ago I posted a question about the favourite IDE. I finally > found it. WING IDE i the best I've ever seen for python. Code > completition is amazing, automated help, python comand line. evrything > i need. Who didnt try, doesnt know what he is missing. > > just one word:

RE: Arrays, Got Me Confused

2007-04-13 Thread Carsten Haese
On Fri, 2007-04-13 at 13:50 +0100, Robert Rawlins - Think Blue wrote: > Hello Guys, > > Wider fragments of code don't really exists at this moment in time :-D this > is just a bit of a 'tester' class for me to get used to the methods. > Basically I'm trying to create a class that contains an array

Re: Question About Creating Lists

2007-04-13 Thread Steve Holden
Scott wrote: > >> Please forgo the psychological self analysis from your future posts. > > Unfortunately I can't, that's how I am, love it or leave it. But if your > going to be condescending about it, please leave your future replies in your > outbox. Now don't take that as I don't appreciat

Re: where to report bug/get help for wxpython

2007-04-13 Thread kyosohma
On Apr 12, 9:35 pm, alf <[EMAIL PROTECTED]> wrote: > Hi, > > I have another problem with wxpython - that is the best place to report > bug - evident memory leak on Linux and win32. > > -- > alf You'll need to go to the official wxPython website, here: http://wxpython.org/ There's a link to the ma

Re: where to report bug/get help for wxpython

2007-04-13 Thread Steve Holden
alf wrote: > Hi, > > I have another problem with wxpython - that is the best place to report > bug - evident memory leak on Linux and win32. > Google for wxpython mailing list and see if you still need help after that. Bug reports on c.l.py will almost certainly go unregarded. regards

Re: "Cloning" file attributes and permissions

2007-04-13 Thread Kevin Kelley
This is what I (just now) put together as an example: from os import stat,mknod,chown def match_perms(org_fname,new_fname): # Get information on old file st = stat(org_fname) st_mode = st.st_mode st_uid = st.st_uid st_gid = st.st_gid # Create the new file mknod(new_fname,st

RE: Arrays, Got Me Confused

2007-04-13 Thread Robert Rawlins - Think Blue
Thanks for that Tim and Steve, greatly appreciated. I know that the class method is just a wrapper and it seems a little silly, but it is partly for the exercise. I'm pretty well savvy with the OOP stuff but its something my business partner is yet to venture into, so by working like this it helps

Re: Getting Stack Trace on segfault

2007-04-13 Thread [EMAIL PROTECTED]
GDB would could work. Here's how I use it to track down problems in a C ++ program controlled by python. $ gdb python GDB starts up, now at the gdb prompt, set the program args (gdb) set arg testscript.py (gdb) run ... program running until crash (gdb) where gives you the backtrace if you compile

Re: mx.ODBC minor problem

2007-04-13 Thread Steve Holden
Greg Corradini wrote: > Hello all, > In a script i just wrote, my code calls a function createTables(), which > checks for an existing table and then creates it, and then immediately calls > selectSQL(), which selects from a different table and inserts on the table I > just created (see below). >

Re: tuples, index method, Python's design

2007-04-13 Thread Steve Holden
Antoon Pardon wrote: > On 2007-04-12, Carsten Haese <[EMAIL PROTECTED]> wrote: >> 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 co

Re: Problem with algorithm

2007-04-13 Thread azrael
sorry for the bad grammar. I didn't investigate the StackLess Python, but as I have been reading about it (so if it was correct), the recursionlimit should not be the problem using StackLess Python. >From my expirience with python and recursions, it works well to the depth of about 200 to 500 (depe

Re: split and regexp on textfile

2007-04-13 Thread mik3l3374
On Apr 13, 6:08 pm, "Flyzone" <[EMAIL PROTECTED]> wrote: > On 13 Apr, 11:30, "Flyzone" <[EMAIL PROTECTED]> wrote: > > > all together :( > > Damn was wrong mine regexp: > pat = re.compile("[A-Z][a-z][a-z][ ][A-Z][a-z][a-z][ ][0-9| ][0-9][ ] > [0-9][0-9][:][0-9][0-9]",re.M|re.DOTALL) > > now is worki

Re: Problem with algorithm

2007-04-13 Thread Steve Holden
Jia Lu wrote: >> for m in test: >> for n in test: >> for o in test: >> for p in test: >> print m+n+o+p > > Thanx for your anwser. > But if I consider about a combination of over 26 letter's list just > like: > "abcdefssdzxcvzxcvzcv" > "asllxcvxcbbedfgdfgdg"

Re: Problem with algorithm

2007-04-13 Thread Paul McGuire
On Apr 13, 8:53 am, Steve Holden <[EMAIL PROTECTED]> wrote: > Jia Lu wrote: > >> for m in test: > >> for n in test: > >> for o in test: > >> for p in test: > >> print m+n+o+p > > > Thanx for your anwser. > > But if I consider about a combination of over 26 le

Re: Using python to delta-load files into a central DB

2007-04-13 Thread Chris Nethery
Gabriel, I think that would work well. Also, thank you for suggesting the use of filecmp. I have never used this module, but it looks like a much better solution than what I had been doing previously--using os.stat and performing a DB lookup in order to verify that the filename and timestamp

Re: Problem with algorithm

2007-04-13 Thread Jia Lu
> If you just expand the length to five million* or so, one of those > strings will contain all the works of Shakespeare. Oops, you have this formula in math? Actually I want to scan a range of network for some certain files. -- http://mail.python.org/mailman/listinfo/python-list

Re: tuples, index method, Python's design

2007-04-13 Thread Antoon Pardon
On 2007-04-13, Steve Holden <[EMAIL PROTECTED]> wrote: > Antoon Pardon wrote: >> On 2007-04-12, Carsten Haese <[EMAIL PROTECTED]> wrote: >>> 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 choo

Pydoc Rewrite Discussion at doc-sig list.

2007-04-13 Thread Ron Adam
If anyone is interested in participating in discussing the details of the PyDoc rewrite/refactoring I've been working on, a discussion is being started on the doc-sig list. [EMAIL PROTECTED] The goal of this discussion will be to get it to a final finished form so a patch can be submi

Re: tuples, index method, Python's design

2007-04-13 Thread Steve Holden
Antoon Pardon wrote: > On 2007-04-13, Steve Holden <[EMAIL PROTECTED]> wrote: >> Antoon Pardon wrote: >>> On 2007-04-12, Carsten Haese <[EMAIL PROTECTED]> wrote: On Thu, 2007-04-12 at 14:10 +, Antoon Pardon wrote: > People are always defending duck-typing in this news group and now pyt

Re: Problem with algorithm

2007-04-13 Thread Paul McGuire
On Apr 13, 9:27 am, "Jia Lu" <[EMAIL PROTECTED]> wrote: > > If you just expand the length to five million* or so, one of those > > strings will contain all the works of Shakespeare. > > Oops, you have this formula in math? > > Actually I want to scan a range of network for some certain files. Sorr

Re: tuples, index method, Python's design

2007-04-13 Thread Brian van den Broek
Antoon Pardon said unto the world upon 04/13/2007 02:46 AM: > On 2007-04-12, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >> So much fuss over such a little thing... yes it would be nice if tuples >> grew an index method, but it isn't hard to work around the lack. > > Yes it is a little thing. Bu

Re: Problem with algorithm

2007-04-13 Thread Michael Bentley
On Apr 13, 2007, at 9:19 AM, Paul McGuire wrote: > If you just expand the length to five million* or so, one of those > strings will contain all the works of Shakespeare. Not likely, even with a tiny sampling of the works of Shakespeare: # :-) import string import random def main(bardText, ma

Re: Databases with python

2007-04-13 Thread John Salerno
Anthony Irwin wrote: > Also is wxpython the best cross platform gui library it seems to be the > best I have seen so far. IMO, it's an extremely mature and well-supported library. I have no experience with others (except a brief stint with Tkinter) but the consensus I hear seems to be that wxP

Re: Problem with algorithm

2007-04-13 Thread Paul McGuire
On Apr 13, 10:22 am, Michael Bentley <[EMAIL PROTECTED]> wrote: > On Apr 13, 2007, at 9:19 AM, Paul McGuire wrote: > > > If you just expand the length to five million* or so, one of those > > strings will contain all the works of Shakespeare. > > Not likely, even with a tiny sampling of the works o

Re: tuples, index method, Python's design

2007-04-13 Thread Steve Holden
Brian van den Broek wrote: > Antoon Pardon said unto the world upon 04/13/2007 02:46 AM: >> On 2007-04-12, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > > > >>> So much fuss over such a little thing... yes it would be nice if tuples >>> grew an index method, but it isn't hard to work around the l

Re: Problem with algorithm

2007-04-13 Thread Carsten Haese
On Fri, 2007-04-13 at 10:22 -0500, Michael Bentley wrote: > On Apr 13, 2007, at 9:19 AM, Paul McGuire wrote: > > > If you just expand the length to five million* or so, one of those > > strings will contain all the works of Shakespeare. > > Not likely, even with a tiny sampling of the works of Sh

Class Dependancy Injection

2007-04-13 Thread Robert Rawlins - Think Blue
Hey again guys, I'm looking to get an answer about dependency injection in python classes, what is the best way to deal with this? For instance, in my application I have a configuration bean which contains all the applications configuration information. Now in one of other classes I need ac

function/method assigment

2007-04-13 Thread viscroad
I have a confusion when I do some practice, the code and output are as following, >>> def fun(): print 'In fun()' >>> testfun = fun() In fun() >>> print testfun None >>> testfun2 = fun >>> print testfun2 >>> print testfun2() In fun() None >>> what is 'testfun'? Why it is 'N

Re: mac IDLE problems

2007-04-13 Thread Kevin Walzer
7stud wrote: > Hi, > > In the IDLE, I can't get most shortcut keys that are listed next to > the menu items to work. For instance, under the Format menu item only > the shortcuts for "indent region" and "undent region" work. If I > highlight some text and use Shift+3 to comment out the region I

Re: Class Dependancy Injection

2007-04-13 Thread Steve Holden
Robert Rawlins - Think Blue wrote: > Hey again guys, > > > > I’m looking to get an answer about dependency injection in python > classes, what is the best way to deal with this? > > > > For instance, in my application I have a configuration bean which > contains all the applications confi

Re: function/method assigment

2007-04-13 Thread Steve Holden
[EMAIL PROTECTED] wrote: > I have a confusion when I do some practice, the code and output are as > following, > def fun(): > print 'In fun()' > > testfun = fun() > In fun() print testfun > None testfun2 = fun print testfun2 > print testfun2() > In fu

RE: Class Dependancy Injection

2007-04-13 Thread Robert Rawlins - Think Blue
Thanks Steve that's good to here. I'll give it a shot this evening and if I have any problems then 'I'll be back';-) Rawlins -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steve Holden Sent: 13 April 2007 17:32 To: [EMAIL PROTECTED] Subject: Re: Class De

Re: Problem with algorithm

2007-04-13 Thread Paul McGuire
On Apr 13, 10:49 am, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Fri, 2007-04-13 at 10:22 -0500, Michael Bentley wrote: > > On Apr 13, 2007, at 9:19 AM, Paul McGuire wrote: > > > > If you just expand the length to five million* or so, one of those > > > strings will contain all the works of Shake

Re: function/method assigment

2007-04-13 Thread Jakub Stolarski
On Apr 13, 6:14 pm, [EMAIL PROTECTED] wrote: > I have a confusion when I do some practice, the code and output are as > following, > > >>> def fun(): > > print 'In fun()' > > >>> testfun = fun() > In fun() > >>> print testfun > None > >>> testfun2 = fun > >>> print testfun2 > > > >

Re: function/method assigment

2007-04-13 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > I have a confusion when I do some practice, the code and output are as > following, > def fun(): > print 'In fun()' Function fun doesn't explicitelly return something, so it's return value defaults to None (nb: None is a builtin object representing 'no

Re: Problem with algorithm

2007-04-13 Thread Paul McGuire
On Apr 13, 8:53 am, Steve Holden <[EMAIL PROTECTED]> wrote: > > I'm pretty sure you could give a separate name to each atom ont he known > universe with a scheme like this. Do you really need 20-byte strings? > Steve, Based on the Wikipedia article's estimate of 10**79 atoms in the observable un

Re: Class Dependancy Injection

2007-04-13 Thread Steven Bethard
Robert Rawlins - Think Blue wrote: > For instance, in my application I have a configuration bean which > contains all the applications configuration information. Now in one of > other classes I need access to those configuration settings. What I > would have done in my ColdFusion/JAVA type appli

Re: Problem with algorithm

2007-04-13 Thread Paul McGuire
On Apr 13, 10:41 am, "Paul McGuire" <[EMAIL PROTECTED]> wrote: > On Apr 13, 10:22 am, Michael Bentley <[EMAIL PROTECTED]> > wrote: > > > > > > > On Apr 13, 2007, at 9:19 AM, Paul McGuire wrote: > > > > If you just expand the length to five million* or so, one of those > > > strings will contain all

Re: Inconsistent result from urllib.urlopen

2007-04-13 Thread junkdump2861
Laszlo Nagy wrote: > > Any ideas why I don't get the same result from the python script as I > > do from a web browser? This problem seems to be a recent > > development. The scripts I wrote like this worked fine for a while > > and then stopped working within the past couple of weeks. > > > May

Re: Problem with algorithm

2007-04-13 Thread Steve Holden
Paul McGuire wrote: > On Apr 13, 8:53 am, Steve Holden <[EMAIL PROTECTED]> wrote: >> I'm pretty sure you could give a separate name to each atom ont he known >> universe with a scheme like this. Do you really need 20-byte strings? >> > > Steve, > > Based on the Wikipedia article's estimate of 10

  1   2   >