Re: Oserror: [Errno 20]

2006-04-03 Thread Scott David Daniels
Peter Hansen wrote: > k r fry wrote: >> Hi, I am new to this list and also programming with python. >> I have an error: oserror [errno 20] not a directory "katiescint.py" >> The piece of code causing the problem is: >> [code] >> >> for subdir in os.listdir(DATADIR): #loop through list

Re: binascii.a2b_binary

2006-04-03 Thread Serge Orlov
Ed Swarthout wrote: > Why is there no binascii.a2b_binary(bitstr) which returns the binary data > represented by the bit string? Like: > > >>> binascii.a2b_binary('0011001100110101') > '35' > > perl has pack("B*", "0011001100110101"); > > What is the python way to do this? to post a question on c

Re: can I get the index number in for x in y loop?

2006-04-03 Thread Scott David Daniels
JuHui wrote: > which one has best performance? > > a:for i in range(0,len(a)) > b:for x in a > c:for x,y in enumerate(a) Read up on the timeit module and figure it out for yourself. The answer will depend on the distribution of your data. > but, it seems I can't get index number with b format..

Re: question about nasty regex

2006-04-03 Thread Tim Chase
> What I mean is, I want to change, e.g.: > > "Doremus v. Board of Education of Hawthorne, 342 U.S. 429, 434, 72 > S. Ct. 394, 397, 96 L.Ed. 475 (1952)." > > into: > > "Doremus v. Board of Education of Hawthorne, 342 U.S. 429, 434 (1952)." > > Generally, the beginning pattern would consist of:

Re: Best IDE for Python?

2006-04-03 Thread Szabolcs Nagy
ide unification effort: http://pyxides.stani.be/ (there are some useful links and it's more recent than the python.org wiki) -- http://mail.python.org/mailman/listinfo/python-list

Merging Objects

2006-04-03 Thread Cloudthunder
Question: how do I merge two objects? I would like to be able to have an instance of Foo and an instance of Boo and then be able to add them together and create a new object that has the methods and properties of both objects. I am going to be doing a lot of this and I don't want to have to dynamic

Re: Capturing stdout without waiting for the process end

2006-04-03 Thread Luigi
I use Linux. So, if I modify my sdtout behaviour, when I execute: fin, fout = os.popen4(arg) this is executed asyncronously? And how can I intercept a fout.write() event? The question is that I have a C program (by third part) that streams the logs into the stderr and stdout devices. I need to

Re: string building

2006-04-03 Thread sturlamolden
John Salerno wrote: > Out of curiosity, is there any kind of equivalent in Python to the > StringBuilder class in C#? You can just append each string to a list and call "".join(list) on the list. Here is a mock-up StringBuilder class: class StringBuilder: def __init__(self): self.strlis

Re: Capturing stdout without waiting for the process end

2006-04-03 Thread Diez B. Roggisch
> fin, fout = os.popen4(arg) > > this is executed asyncronously? And how can I intercept a fout.write() > event? You don't intercept anything, you read from the child process stdin, which from your POV is a readable stream. Diez -- http://mail.python.org/mailman/listinfo/python-list

Registration Code

2006-04-03 Thread Math
Hello, I wonder if I can ask this particular question here... I'm writing this piece of Python Software and I'm almost done...:-) But now I want the end-user to register this software with a registration code or perhaps something like an evaluation demo version which expires after some period of

Re: String pattern matching

2006-04-03 Thread Kent Johnson
Eddie Corns wrote: > Off topic I know but I've been learning snobol pattern matching recently so I > thought I'd give this one a bash. Here is my effort: > > define('foo(str)') > &fullscan = 1 > '/abcaaab/abca/eeabcac/' '/' arb $ x arb $ y arb $ z '/' *x *y '/' > +

Re: Capturing stdout without waiting for the process end

2006-04-03 Thread [EMAIL PROTECTED]
Diez is correct, the C program is writting to stdout, you are reading from stdout. Default bahavior in most modern Unix like systems is to buffer std out. I stumbled on this a long time ago, so I am trying to remember the details. What I think is happening here, you call the child process, it do

Re: New Python Logo Revealed

2006-04-03 Thread El Loco
Alec Jang wrote: > I guess it is absolutely a joke. If not, there will be a disaster, and > that means ruby will rule the world. Yes, we'll become slaves, our leaders crucified, and our culture will vanish forever... -- http://mail.python.org/mailman/listinfo/python-list

Re: String pattern matching

2006-04-03 Thread Kent Johnson
Jim Lewis wrote: > Anyone have experience with string pattern matching? > I need a fast way to match variables to strings. Example: > > string - variables > > abcaaab - xyz > abca - xy > eeabcac - vxw > > x matches abc > y matches a > z matches aab > w maches ac > v maches ee > You

Re: Merging Objects

2006-04-03 Thread Jesus Rivero - (Neurogeek)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 >>> help(getattr) help(setattr) Regards, Jesus Rivero - (Neurogeek) Cloudthunder wrote: > Question: how do I merge two objects? I would like to be able to > have an instance of Foo and an instance of Boo and then be able to > add them together an

Re: Registration Code

2006-04-03 Thread Sybren Stuvel
Math enlightened us with: > But now I want the end-user to register this software with a > registration code or perhaps something like an evaluation demo > version which expires after some period of time... Fair enough. What do you want to know from us? > Is this the right place to ask or does an

Re: Registration Code

2006-04-03 Thread Math
[EMAIL PROTECTED] OKAY Sybren.. How does one get the job done? -- > Math enlightened us with: >> But now I want the end-user to register this software with a >> registration code or perhaps something like an evaluation demo >> version which expires after some period of time... > > Fair

Re: Registration Code

2006-04-03 Thread Philippe Martin
Hi, A suggestion: I would use encryption (ex: AES): Hide a secret key in your code and generate an encrypted (readable: ex 07 7B 6F ) version of the correct info (such as full release, or demo expire in ...) with that very same key. Have your software input that encrypted info (some GUI di

Vacuum World version 1e-6alpha ;) released

2006-04-03 Thread Brian Blais
Hello, I am just learning Python, and my first somewhat significant project is now available at http://web.bryant.edu/~bblais/python/vac.tgz What is it? Vacuum World is a simple simulation environment used to introduce some concepts in Artificial Intelligence (Norvig,

Re: String pattern matching

2006-04-03 Thread Eddie Corns
Kent Johnson <[EMAIL PROTECTED]> writes: >Eddie Corns wrote: >> If I get time I'll try to get this working in Sam Wilmott's Python pattern >> matching library. >> >> What fun! >Cool! I have to get in on the fun :-) >This program uses Sam Wilmott's library to find one solution. It is a >simple

Re: can I get the index number in for x in y loop?

2006-04-03 Thread John Hunter
> "Scott" == Scott David Daniels <[EMAIL PROTECTED]> writes: Scott> I cannot find the distance in meters between Paris and Scott> London with: for i in range(10): print i Works for me def range(x): yield '332.8 km' for i in range(10): print i ...may not be considered b

Re: Registration Code

2006-04-03 Thread Math
P..Philippe.. Where can I find some sample code if any? And I'm not a professional programmer... This is going to be hard...and my native is Dutch.. Thanks anyway Hi, A suggestion: I would use encryption (ex: AES): Hide a secret key in your code and generate an encrypted (readable: ex 07 7B

Re: Registration Code

2006-04-03 Thread Philippe Martin
Hi, Use the DES example here (DES has been cracked but is definitly secure enough for your need): http://www.amk.ca/python/writing/pycrypt/pycrypt.html Can't help you with the Dutch ;-) Philippe Math wrote: > P..Philippe.. > Where can I find some sample code if any? > And I'm not

Re: Merging Objects

2006-04-03 Thread Cloudthunder
Sorry, I don't understand, how does this solve my problem?On 4/3/06, Jesus Rivero - (Neurogeek) <[EMAIL PROTECTED] > wrote:-BEGIN PGP SIGNED MESSAGE-Hash: SHA1>>> help(getattr) help(setattr) Regards,  Jesus Rivero - (Neurogeek)Cloudthunder wrote:> Question: how do I merge two objects? I wou

Re: Capturing stdout without waiting for the process end

2006-04-03 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "Luigi" <[EMAIL PROTECTED]> wrote: > The question is that I have a C program (by third part) that streams > the logs into the stderr and stdout devices. I need to create an > envelopment that captures the outputs and puts them in a file > generating log events (for

Re: Python 2.5 licensing: stop this change

2006-04-03 Thread Steve Holden
Philippe Martin wrote: > That was nasty Steve - at least I'm ready for any kind of bad new today ;-) > Sorry ;-) regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd www.holdenweb.com Love me, love my blog holdenweb.blogspot.com --

overloading constructor in python?

2006-04-03 Thread lennart
This is probably a really stupid question, but I cant seem to find a satisfying answer by myself so here it goes. In for example java we could create a class dummie with several constructors, say one that takes an int, and one that takes a String as argument. In python it doesnt seem possible to h

Re: Registration Code

2006-04-03 Thread Ken Seehart
Math wrote: > Hello, > > I wonder if I can ask this particular question here... > I'm writing this piece of Python Software and I'm almost done...:-) > But now I want the end-user to register this software with a > registration code or perhaps something like an evaluation demo version > which ex

Re: overloading constructor in python?

2006-04-03 Thread Larry Bates
[EMAIL PROTECTED] wrote: > This is probably a really stupid question, but I cant seem to find a > satisfying answer by myself so here it goes. In for example java we > could create a class dummie with several constructors, say one that > takes an int, and one that takes a String as argument. In pyt

Re: Merging Objects

2006-04-03 Thread Michael Spencer
Cloudthunder wrote: > Sorry, I don't understand, how does this solve my problem? > __getattr__ and __setattr__ allow you to set up dynamic delegation e.g., class Foo(object): def __init__(self, **kw): self.__dict__.update(kw) def methFoo(self, x): return "Foo.methFoo(%

Re: overloading constructor in python?

2006-04-03 Thread lennart
Larry Bates wrote: [...] > In python it is called duck typing but you don't need separate > constructors: > > def __init__(self, c): > if isinstance(c, int): ...do stuff... > elif isinstance(c, list): ...do stuff... > elif isinstance(c, tuple): ...do stuff... > else: > . >

Re: overloading constructor in python?

2006-04-03 Thread Jarek Zgoda
Larry Bates napisał(a): > In python it is called duck typing but you don't need separate > constructors: > > def __init__(self, c): > if isinstance(c, int): ...do stuff... > elif isinstance(c, list): ...do stuff... > elif isinstance(c, tuple): ...do stuff... > else: > . >

MOO meets Python

2006-04-03 Thread Aahz
http://playsh.org/ http://sourceforge.net/projects/playsh -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ "Look, it's your affair if you want to play with five people, but don't go calling it doubles." --John Cleese anticipates Usenet -- http://mail.python.org/mail

Re: MOO meets Python

2006-04-03 Thread Istvan Albert
Quote from the webpage: "It's a buggy bundle of Python code that, by default, opens interfaces to your computer and makes it insecure." ... just what I was looking for ... -- http://mail.python.org/mailman/listinfo/python-list

Re: MOO meets Python

2006-04-03 Thread Jonathan Ellis
Aahz wrote: > http://playsh.org/ > http://sourceforge.net/projects/playsh Damn, I thought you meant MOO as in Master of Orion. -Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Re: Registration Code

2006-04-03 Thread Dave Mandelin
Ken Seehart wrote: > Math wrote: > > Hello, > I encypted the bytecode of a few important functions with a key based on > information required from the user. Without the key, these functions > can't be decrypted. This is somewhat more secure than just testing the > key with an "if" statement since

Re: COM Server & wxPython

2006-04-03 Thread Dave Mandelin
nelson wrote: > Hi all, > i'm doing a COM server that have to expose some graphics (panels and > configuration controls), that would be embedded in an application through > OLE. I was wondering if I can do this using wxPython. Another question is > if my COM server would inherits from one of the w

readline support

2006-04-03 Thread Rares Vernica
Hi, I am trying to get readline support in python. I am working on Linux and I have the latest version from svn. After I ./configure and make I can run python, but the readline support is not there. If I do: %./configure >& out.txt %grep readline out.txt checking for readline in -lreadline...

Re: overloading constructor in python?

2006-04-03 Thread Paddy
I guess in python we use two idioms to cover most of the uses of mulltiple constructors: 1) Duck typing were for example if you do: class C1(object): def __init__(self, n): n = float(n) n could be an integer, a floating point number,, or a string representing a float. 2) Default values to

Re: Registration Code

2006-04-03 Thread Fuzzyman
Math wrote: > P..Philippe.. > Where can I find some sample code if any? > And I'm not a professional programmer... > This is going to be hard...and my native is Dutch.. > Thanks anyway Distributing your project using py2exe probably removes the need for bytecode encryption - unless you figure

Re: Registration Code

2006-04-03 Thread Fuzzyman
Dave Mandelin wrote: > Ken Seehart wrote: > > Math wrote: > > > Hello, > > I encypted the bytecode of a few important functions with a key based on > > information required from the user. Without the key, these functions > > can't be decrypted. This is somewhat more secure than just testing the

Re: can I get the index number in for x in y loop?

2006-04-03 Thread Fuzzyman
JuHui wrote: > >>> a='String' > >>> for x in a: > ... print x > ... > S > t > r > i > n > g > >>> > > can I get the index number of a in the upon loop within for x in a > loop? Although enumerate is the 'right' answer, I personally prefer : i = 0 while i < len(some_sequence): val = som

Using Python to validate XML against an XSD schema

2006-04-03 Thread ric_deez
Hi there, I have just started looking into using Python to perform some XML processing and I need to ensure that it is capable of validating against a schema file (XSD not DTD!). The research done so far seems to indicate that it has native support for validating XML against DTDs but not against

Re: MOO meets Python

2006-04-03 Thread Peter Hansen
Istvan Albert wrote: > Quote from the webpage: "It's a buggy bundle of Python code that, by > default, opens interfaces to your computer and makes it insecure." So it's a way of using Python to emulate the Windows operating system, for people stuck using Linux? > ... just what I was looking for

Re: COM Server & wxPython

2006-04-03 Thread Philippe Martin
Hi, I do not know what your constraints are ... but, having been through the same thought process (because there is not VB6 _free_ calendar) ... I feel that getting to that stage _might_ justify rewriting the application in Python/wxPython (and potentially gain cross-platform compatibility in the

[ANN] markup.py - 1.2 - an HTML/XML generator

2006-04-03 Thread Daniel Nogradi
A new release of markup.py is available at the sourceforge project page: http://sourceforge.net/projects/markup/ Markup.py is a set of classes that attempts to make it easier to generate HTML/XML from a Python program in an intuitive, light-weight, customizable and pythonic way. Full documentatio

Re: [ANN] markup.py - 1.2 - an HTML/XML generator

2006-04-03 Thread Felipe Almeida Lessa
Em Ter, 2006-04-04 às 00:09 +0200, Daniel Nogradi escreveu: [snip] > page.ul.open( klass='mylist' ) > page.li( items, klass='myitem' ) [/snip] "klass"? Why not "cls" or "class_"? -- Felipe. -- http://mail.python.org/mailman/listinfo/python-list

Re: MOO meets Python

2006-04-03 Thread Robert Kern
Jonathan Ellis wrote: > Aahz wrote: > >>http://playsh.org/ >>http://sourceforge.net/projects/playsh > > Damn, I thought you meant MOO as in Master of Orion. http://www.ospace.net -- Robert Kern [EMAIL PROTECTED] "I have come to believe that the whole world is an enigma, a harmless enigma tha

Re: string building

2006-04-03 Thread John Salerno
John Salerno wrote: > Out of curiosity, is there any kind of equivalent in Python to the > StringBuilder class in C#? Here's a quick description from the .NET > documentation: > > "This class represents a string-like object whose value is a mutable > sequence of characters. The value is said to

Re: [ANN] markup.py - 1.2 - an HTML/XML generator

2006-04-03 Thread Robert Kern
Felipe Almeida Lessa wrote: > Em Ter, 2006-04-04 às 00:09 +0200, Daniel Nogradi escreveu: > [snip] > >>page.ul.open( klass='mylist' ) >>page.li( items, klass='myitem' ) > > [/snip] > > "klass"? Why not "cls" or "class_"? Why not "klass"? -- Robert Kern [EMAIL PROTECTED] "I have come to belie

Re: question about nasty regex

2006-04-03 Thread Peter
Tim Chase wrote: >> What I mean is, I want to change, e.g.: [snip regular expressions lesson] > Whoa. That is super-duper extra cool. Thank you *very* much. -- http://mail.python.org/mailman/listinfo/python-list

Re: [ANN] markup.py - 1.2 - an HTML/XML generator

2006-04-03 Thread Jorge Godoy
Robert Kern <[EMAIL PROTECTED]> writes: > Why not "klass"? I was going to ask the same thing but I thought it was just me being too tired to find it "ugly" or "bad choice"... :-) -- Jorge Godoy <[EMAIL PROTECTED]> "Quidquid latine dictum sit, altum sonatur." - Qualquer coisa dita em latim

Re: question about nasty regex

2006-04-03 Thread Paul Rubin
Peter <[EMAIL PROTECTED]> writes: > >> What I mean is, I want to change, e.g.: > [snip regular expressions lesson] > > > > Whoa. That is super-duper extra cool. Thank you *very* much. "Some people, when confronted with a problem, think ``I know, I'll use regular expressions.'' Now they have two p

Re: Registration Code

2006-04-03 Thread Steven D'Aprano
On Mon, 03 Apr 2006 19:29:14 +0200, Math wrote: > Hello, > > I wonder if I can ask this particular question here... > I'm writing this piece of Python Software and I'm almost done...:-) > But now I want the end-user to register this software with a registration > code or perhaps something like a

Re: wxpython in action book

2006-04-03 Thread Butternut squash
Tim Roberts wrote: > Dabo Thanks for the info. I'll check out dabo. I understand that web is easier to distribute and more likely easier to program. I loath CSS and HTML though and that's why I want a fat client program. We'll see -- http://mail.python.org/mailman/listinfo/python-list

Re: How to debug python code?

2006-04-03 Thread james . wondrasek
I don't have an example, but what I do is insert: import pdb pdb.set_trace() before the code that I think is causing the problem (or that the traceback barfed at). Then hit 'l' (lowercase L) to get a list of the code which is being executed. Use 'p' to look at variables. eg p some_local Use 'n

Re: [ANN] markup.py - 1.2 - an HTML/XML generator

2006-04-03 Thread Felipe Almeida Lessa
Em Seg, 2006-04-03 às 17:57 -0500, Robert Kern escreveu: > Felipe Almeida Lessa wrote: > > Em Ter, 2006-04-04 às 00:09 +0200, Daniel Nogradi escreveu: > > [snip] > > > >>page.ul.open( klass='mylist' ) > >>page.li( items, klass='myitem' ) > > > > [/snip] > > > > "klass"? Why not "cls" or "class_"

Re: Is pwm Python MegaWidgets viable?

2006-04-03 Thread James Stroud
Paul Watson wrote: > gregarican wrote: > >> Paul Watson wrote: >> >> >>> Does pwm run well on Python 2.4? The last release appears to be in >>> 2003. The Manning discussion forum is dead. >>> >>> Is there a better path to learning and producing tkInter apps? >>> >>> >>> Has there been any discus

Re: [ANN] markup.py - 1.2 - an HTML/XML generator

2006-04-03 Thread Erik Max Francis
Felipe Almeida Lessa wrote: > IMHO, it's strange and ugly. Besides, AFAIK everybody uses "cls" or > "class_", this is the first place I see "klass", so this breaks > consistency, too. But that's just my opinion... A quick Google Groups search indicates that `klass` is more commonly mentioned tha

Re: [ANN] markup.py - 1.2 - an HTML/XML generator

2006-04-03 Thread Scott David Daniels
Erik Max Francis wrote: > Felipe Almeida Lessa wrote: > >> IMHO, it's strange and ugly. Besides, AFAIK everybody uses "cls" or >> "class_", this is the first place I see "klass", so this breaks >> consistency, too. But that's just my opinion... > > A quick Google Groups search indicates that `kla

Re: [ANN] markup.py - 1.2 - an HTML/XML generator

2006-04-03 Thread Felipe Almeida Lessa
Em Seg, 2006-04-03 às 17:20 -0700, Erik Max Francis escreveu: > Felipe Almeida Lessa wrote: > > > IMHO, it's strange and ugly. Besides, AFAIK everybody uses "cls" or > > "class_", this is the first place I see "klass", so this breaks > > consistency, too. But that's just my opinion... > > A quick

Sending C-c to Emacs

2006-04-03 Thread [EMAIL PROTECTED]
Hi all, I've written a Python script with functionality similar to the Unix "script" program, which keeps a record of shell commands issued (I capture some additional stuff like timestamps). The code is borrowed largely from http://groups.google.com/group/comp.lang.python/msg/de40b36c6f0c53cc Any

Re: [ANN] markup.py - 1.2 - an HTML/XML generator

2006-04-03 Thread Peter Hansen
Felipe Almeida Lessa wrote: > $ pwd > /usr/lib/python2.4/site-packages > $ grep -re klass . | wc -l > 274 > $ grep -re class_ . | wc -l > 897 How many of those "class_" instances are really just substrings of "__class__" and "class_name" and such? On my machine, I see a handful in the standard

Re: [ANN] markup.py - 1.2 - an HTML/XML generator

2006-04-03 Thread Robert Kern
Felipe Almeida Lessa wrote: > Em Seg, 2006-04-03 às 17:20 -0700, Erik Max Francis escreveu: > >>Felipe Almeida Lessa wrote: >> >> >>>IMHO, it's strange and ugly. Besides, AFAIK everybody uses "cls" or >>>"class_", this is the first place I see "klass", so this breaks >>>consistency, too. But that'

Re: MOO meets Python

2006-04-03 Thread Alex Martelli
Jonathan Ellis <[EMAIL PROTECTED]> wrote: > Aahz wrote: > > http://playsh.org/ > > http://sourceforge.net/projects/playsh > > Damn, I thought you meant MOO as in Master of Orion. Naah, "Stars!", now *that* was a worthy game! Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: overloading constructor in python?

2006-04-03 Thread Alex Martelli
Paddy <[EMAIL PROTECTED]> wrote: > I guess in python we use two idioms to cover most of the uses of > mulltiple constructors: > 1) Duck typing were for example if you do: > > class C1(object): > def __init__(self, n): > n = float(n) > > n could be an integer, a floating point number,, or

Python and microsoft outlook-using com, can I interact with msoutlook?

2006-04-03 Thread brandon.mcginty
Hi All, I know that Microsoft Exchange has a com interface, CDO, but I can't seem to find one for Microsoft outlook. does anyone have code snippets for using msoutlook and python, or suggestions? I have looked on Google, and tried some code, but nothing has worked. I'm using outlook XP, and any inf

Re: overloading constructor in python?

2006-04-03 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Alex Martelli wrote: >> I guess in python we use two idioms to cover most of the uses of >> mulltiple constructors: > > ... and classmethods. OK, _three_ idioms. Oh, and factory functions. > Among the idioms we use are the following... Nobody expects the Spanglis

Re: Sending C-c to Emacs

2006-04-03 Thread [EMAIL PROTECTED]
I figured out the problem, fix involves modifying one of the lines in the original program (from http://groups.google.com/group/comp.lang.python/msg/de40b36c6f0c53cc) to: raw_lflag = self.lflag & ~(termios.ICANON|termios.ECHO|termios.ISIG) (termios.ISIG was added) Lorin -- http://mail.python.o

what's going on here?

2006-04-03 Thread John Salerno
Ok, long story: I'm trying to solve level 4 of the Python Challenge. I hate to post here, but the hint forum over there is dead. Here's the link: http://www.pythonchallenge.com/pc/def/linkedlist.php Apparently you need to use a linked list to solve it, so I read up on them but I still don't und

Loading a default browser under Windows

2006-04-03 Thread Philippe Martin
Hi, Is there (maybe through pywin) a way to call the default browser with a url as param ? Regards, Philippe -- http://mail.python.org/mailman/listinfo/python-list

Re: what's going on here?

2006-04-03 Thread John Salerno
John Salerno wrote: > Ok, long story Ok, I guess I should have used a better title for the thread. I hope someone still sees this post! :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Loading a default browser under Windows

2006-04-03 Thread BartlebyScrivener
Philippe, import webbrowser webbrowser.open("http://groups.google.com/group/comp.lang.python";) rpd -- http://mail.python.org/mailman/listinfo/python-list

Re: question about nasty regex

2006-04-03 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: >"Some people, when confronted with a problem, think ``I know, I'll use >regular expressions.'' Now they have two problems." --JWZ Regexes are good if you need a solution quickly, and you're not processing large amoun

Best way to create a copy of a list

2006-04-03 Thread Frank Millman
Hi all Assume a 2-dimensional list called 'table' - conceptually think of it as rows and columns. Assume I want to create a temporary copy of a row called 'row', allowing me to modify the contents of 'row' without modifying the contents of 'table'. I used to fall into the newbie trap of 'row = t

Re: Best way to create a copy of a list

2006-04-03 Thread Rune Strand
Frank Millman wrote: > Hi all > > Assume a 2-dimensional list called 'table' - conceptually think of it > as rows and columns. > > Assume I want to create a temporary copy of a row called 'row', > allowing me to modify the contents of 'row' without modifying the > contents of 'table'. > > I used t

Re: Best way to create a copy of a list

2006-04-03 Thread Fredrik Lundh
Frank Millman wrote: > I have found two ways of doing it that seem to work. > > 1 - row = table[23][:] > > 2 - row = [] > row[:] = table[23] > > Are these effectively identical, or is there a subtle distinction which > I should be aware of. > > I did some timing tests, and 2 is quite a bit fa

Re: Convertion of Unicode to ASCII NIGHTMARE

2006-04-03 Thread Roger Binns
"Paul Boddie" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > It looks like you may have Unicode objects that you're presenting to > sqlite. In any case, with earlier versions of pysqlite that I've used, > you need to connect with a special unicode_results parameter, He is using apsw

<    1   2