Re: interpretation of special characters in Python

2008-07-07 Thread Ben Finney
TP <[EMAIL PROTECTED]> writes: > Peter Pearson wrote: > > > When you tell python "print '\033[30;44m foo \033[0m'", python > > interprets the "\033" as a single character. > > So, the python print command *can* interpret these 4-character as a > single character. Not "interpret", no. It's more

Re: Python with Ecmascript

2008-07-07 Thread [EMAIL PROTECTED]
On 7 Čec, 08:21, alex23 <[EMAIL PROTECTED]> wrote: > On Jul 7, 12:31 am, "[EMAIL PROTECTED]" > > <[EMAIL PROTECTED]> wrote: > > I personally does not like COM solution. I prefer some simple library > > but may be it is just a hope. > > Have you looked at the module 'python-spidermonkey'? It appare

How to bypass Windows 'cooking' the I/O? (One more time, please) II

2008-07-07 Thread norseman
I know I saw the answer recently, as in since February '08, but I can't re-find it. :( I tried the mail archives and such and my own collections but the piece I saw still eludes me. Problem: (sos=same old s...) Microsoft insists the world work it's way even when the Microsoft way was pro

Re: interpretation of special characters in Python

2008-07-07 Thread TP
TP wrote: > So, the python print command *can* interpret these 4-character as a single > character. It would be odd if there were no possibility to do the same > thing when the characters are (i) stored in a python variable Sorry, it works when using variables. Try for example: col="[0;31m" esc=

Re: interpretation of special characters in Python

2008-07-07 Thread Peter Otten
Peter Pearson wrote: > On Sun, 06 Jul 2008 23:42:26 +0200, TP <[EMAIL PROTECTED]> > wrote: >> >> $ python -c "print '\033[30;44m foo \033[0m'" > [writes an escape sequence to stdout] > >> $ echo -e $esc$ColorBlackOnDarkblue foo $esc$ColorReset > [also writes an escape sequence to stdout] > >> $

Re: mirroring files and data via http

2008-07-07 Thread Matt Nordhoff
Steve Potter wrote: > On Jul 6, 8:19 pm, Matt Nordhoff <[EMAIL PROTECTED]> wrote: >> Steve Potter wrote: >>> I'm working on a project to create a central administration interface >>> for several websites located on different physical servers. >>> You can think of the websites as a blog type applica

Cross Compiler for Python?

2008-07-07 Thread Hendrik van Rooyen
Up to now, I have been innocently using the vanilla python that comes with the Linux distribution (Suse in my case). For the past few days, I have been playing with a little device called an eBox - it is basically a 486 with 128Mb memory, and a 1Gig pcmcia flash drive. We want to try to use this

Re: Validation in plone

2008-07-07 Thread Bruno Desthuilliers
Sallu a écrit : Hi all and one, How to do server side validation in plone? Wrong place for Plone related questions. Try the Plone mailing list. -- http://mail.python.org/mailman/listinfo/python-list

python beginner

2008-07-07 Thread cna
Hi all and one, how may i learn python. is there any other website except python.org -- http://mail.python.org/mailman/listinfo/python-list

yo...

2008-07-07 Thread abhishek
hey guys...me nu 2 python yo...help me...by da way...jus joined inthanks -- http://mail.python.org/mailman/listinfo/python-list

Re: interpretation of special characters in Python

2008-07-07 Thread TP
Peter Otten wrote: esc = os.environ["esc"].decode("string-escape") esc > '\x1b' print "%s[30;44malles so schoen bunt hier%s[0m" % (esc, esc) > alles so schoen bunt hier Thanks a lot for your help. It works perfectly. Indeed, one can read in the documentation concerning encodings:

Is there a good way to implement file updating? such as lock, update, reload...

2008-07-07 Thread Evan
Hello - My script use a DB file which is written by XML, and the user load this DB file (XML tree in memory), and then do some updating about this tree, such as delete element, generate new element or move element. The thing is, my script is a cmd based program (based on module "cmd"), and there

Re: python beginner

2008-07-07 Thread A.T.Hofkamp
On 2008-07-07, cna <[EMAIL PROTECTED]> wrote: > Hi all and one, > how may i learn python. is there any other website except python.org Yes, there are several millions web-sites, all across the world. They cover every possible topic you may and may not imagine. If you mean a website that tries to

Re: yo...

2008-07-07 Thread A.T.Hofkamp
On 2008-07-07, abhishek <[EMAIL PROTECTED]> wrote: > hey guys...me nu 2 python yo...help me...by da way...jus joined > inthanks Ask a specific question and you may get an answer. If you want an answer from me, it helps *a lot* if you write full english sentences (starting with a capital lette

Re: How to bypass Windows 'cooking' the I/O? (One more time, please) II

2008-07-07 Thread Iain King
On Jul 7, 10:18 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Mon, 07 Jul 2008 01:03:10 -0700, norseman <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > > >  > Normal file I/O sequence: > > >  > fp = open(target, 'wb') > > >  > fp.seek(-1, 2) > > >  > fp.write(record

Re: yo...

2008-07-07 Thread cokofreedom
On Jul 7, 11:55 am, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > On 2008-07-07, abhishek <[EMAIL PROTECTED]> wrote: > > > hey guys...me nu 2 python yo...help me...by da way...jus joined > > inthanks > > Ask a specific question and you may get an answer. > > If you want an answer from me, it helps

Re: How to bypass Windows 'cooking' the I/O? (One more time, please)

2008-07-07 Thread Ulrich Eckhardt
norseman wrote: > In this case it's [MS Windows] (still) 'cooking' the writes even > with 'rwb' and O_RDWR|O_BINARY in (proper respective) use. > > Specific: python created and inspected binary file ends: > 00460: 0D 1A(this is correct) I'm not actually sure what the 0x1a is supposed to

Re: python beginner

2008-07-07 Thread Ken Starks
cna wrote: Hi all and one, how may i learn python. is there any other website except python.org For several video series, follow the link from python.org to the ShowMeDo site. http://www.python.org/doc/av/5minutes/ -- http://mail.python.org/mailman/listinfo/python-list

Confused yet again: Very Newbie Question

2008-07-07 Thread mcl
Why can I not the change the value of a variable in another class, when I have passed it via a parameter list. I am sure I am being stupid, but I thought passed objects were Read/ Write eg #!/usr/bin/python class one(): #my Global Var

Re: Is there a good way to implement file updating? such as lock, update, reload...

2008-07-07 Thread Diez B. Roggisch
Evan wrote: > Hello - > > My script use a DB file which is written by XML, and the user load > this DB file (XML tree in memory), and then do some updating about > this tree, such as delete element, generate new element or move > element. > > The thing is, my script is a cmd based program (base

Re: Cross Compiler for Python?

2008-07-07 Thread Diez B. Roggisch
Hendrik van Rooyen wrote: > Up to now, I have been innocently using the vanilla python > that comes with the Linux distribution (Suse in my case). > > For the past few days, I have been playing with a little > device called an eBox - it is basically a 486 with 128Mb > memory, and a 1Gig pcmcia fl

Re: Cross Compiler for Python?

2008-07-07 Thread Dan Upton
On Mon, Jul 7, 2008 at 4:15 AM, Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > Up to now, I have been innocently using the vanilla python > that comes with the Linux distribution (Suse in my case). > > For the past few days, I have been playing with a little > device called an eBox - it is basical

Re: Confused yet again: Very Newbie Question

2008-07-07 Thread Matt Nordhoff
mcl wrote: > Why can I not the change the value of a variable in another class, > when I have passed it via a parameter list. > > I am sure I am being stupid, but I thought passed objects were Read/ > Write In Python, there are names which are bound to objects. Doing "foo = bar" and then "foo = s

Re: Confused yet again: Very Newbie Question

2008-07-07 Thread Jeff
When you call c3.createJoe(c1.fred), you are passing a copy of the value stored in c1.fred to your function. Python passes function parameters by value. The function will not destructively modify its arguments; you must expliticly state your intention to modify an object: class one(): fred =

Re: Python with Ecmascript

2008-07-07 Thread sysprv
On Jul 7, 9:23 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On 7 Èec, 08:21, alex23 <[EMAIL PROTECTED]> wrote: > > > On Jul 7, 12:31 am, "[EMAIL PROTECTED]" > > > <[EMAIL PROTECTED]> wrote: > > > I personally does not like COM solution. I prefer some simple library > > > but may be it is

Re: Confused yet again: Very Newbie Question

2008-07-07 Thread mcl
On 7 Jul, 13:09, Jeff <[EMAIL PROTECTED]> wrote: > When you call c3.createJoe(c1.fred), you are passing a copy of the > value stored in c1.fred to your function.  Python passes function > parameters by value.  The function will not destructively modify its > arguments; you must expliticly state you

I am looking for svn library(module)

2008-07-07 Thread sniipe
Hi, I am looking fo svn library(module) which is used in the svn- mailer(http://opensource.perlig.de/svnmailer/) project. Does anybody know where can I find it(download url)? This is information which I received from python error: from svn import core as svn_core ImportError: No module named svn

python mysteriously halts

2008-07-07 Thread Todd
Hello everyone, I ran a python script last night which connects to a matlab automation server via DCOM (using win32com). I expected to see the results when I came in this morning. But apparently, not long after I left, python stopped. I hit enter in the console, and it started again. I scoured

Re: Confused yet again: Very Newbie Question

2008-07-07 Thread Matt Nordhoff
mcl wrote: > On 7 Jul, 13:09, Jeff <[EMAIL PROTECTED]> wrote: >> When you call c3.createJoe(c1.fred), you are passing a copy of the >> value stored in c1.fred to your function. Python passes function >> parameters by value. The function will not destructively modify its >> arguments; you must exp

Re: GUI Programming by hand not code with Python Code

2008-07-07 Thread Mike Driscoll
On Jul 6, 9:33 pm, [EMAIL PROTECTED] wrote: > Is their a program that lets you design a GUI by hand (like gambas) > not by code (like wxpython) but the commands are in python? > > A program similar to gambas or vb > > Gambas with python code instead of gambas code would be perfect. > > Thanks in ad

Re: Problem with subprocess.Popen wget within a thread

2008-07-07 Thread Mathieu Prevot
2008/7/6 Sebastian lunar Wiesner <[EMAIL PROTECTED]>: > Mathieu Prevot <[EMAIL PROTECTED]>: > >> it seems the script (A) finishes before the downloading ends, and the >> (B) version doesn't (wanted behavior) ... this is unexpected. What >> happens ? > > "readlines" blocks, until the pipe is closed,

Re: I am looking for svn library(module)

2008-07-07 Thread Matt Nordhoff
[EMAIL PROTECTED] wrote: > Hi, > > I am looking fo svn library(module) which is used in the svn- > mailer(http://opensource.perlig.de/svnmailer/) project. Does anybody > know where can I find it(download url)? This is information which I > received from python error: > > from svn import core as s

Re: I am looking for svn library(module)

2008-07-07 Thread jay graves
On Jul 7, 7:49 am, [EMAIL PROTECTED] wrote: > Hi, > I am looking fo svn library(module) which is used in the svn- > mailer(http://opensource.perlig.de/svnmailer/) project. Does anybody > know where can I find it(download url)? This is information which I > received from python error: > from svn imp

Dynamically Changing the Base Class

2008-07-07 Thread Adam C.
We have a situation where we want a Swig-generated Python class to have a different base (not object). It doesn't appear that we can coerce Swig into generating the class we want at present (but we are still enquiring). Is it possible to dynamically change the base class to something else? Initial

Re: python mysteriously halts

2008-07-07 Thread Peter Otten
Todd wrote: > I ran a python script last night which connects to a matlab automation > server via DCOM (using win32com). I expected to see the results when > I came in this morning. But apparently, not long after I left, python > stopped. I hit enter in the console, and it started again. I sco

re: Cross Comiler for Python?

2008-07-07 Thread Hendrik van Rooyen
Diez wrote: >Look at the gumstix project, they do have a cross-compiled python in there. >You should be able to get an idea on how to do that yourself. > >It involves (or at least did back then) a bit of trickery as the >build-process of python uses the freshly created interpreter to pre-compile >

Re: Cross Compiler for Python

2008-07-07 Thread Hendrik van Rooyen
Dan Upton wrote: >If you don't have a 32 bit system to build it on, you could always set >up a VMWare machine... but that might be more effort than necessary. >You can probably just run configure on your normal machine and then >edit the makefile to add -m32 to the compiler or linker flags--that >

Re: Is there a good way to implement file updating? such as lock, update, reload...

2008-07-07 Thread Evan
If I get rid of the XML, I have to change my script more and more, it is not easy to do that. :( :( Thanks, -- http://mail.python.org/mailman/listinfo/python-list

Re: yo...

2008-07-07 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : (snip) However welcome to Python and this Google Group. This is *not* a google group. This is the usenet newsgroup comp.lang.python, made accessible TTW by google. -- http://mail.python.org/mailman/listinfo/python-list

Re: Confused yet again: Very Newbie Question

2008-07-07 Thread Jerry Hill
On Mon, Jul 7, 2008 at 7:30 AM, mcl <[EMAIL PROTECTED]> wrote: > I did not think you had to make the distinction between 'byvar' and > 'byref' as in Basic. Python does not use "call by value" or "call by reference" semantics. Instead, python's model is "call by object". See this writeup for some

Re: Freesoftware for auto/intelligent code completing in Python

2008-07-07 Thread Ivan Ven Osdel
>- Original Message - >From: "Python Nutter" <[EMAIL PROTECTED]> >To: "Ivan Ven Osdel" <[EMAIL PROTECTED]> >Cc: python-list@python.org >Sent: Thursday, July 3, 2008 5:56:32 PM GMT -06:00 US/Canada Central >Subject: Re: Freesoftware for auto/intelligent code completing in Python > >If

Re: Dynamically Changing the Base Class

2008-07-07 Thread George Sakkis
On Jul 7, 9:31 am, "Adam C." <[EMAIL PROTECTED]> wrote: > We have a situation where we want a Swig-generated Python class to > have a different base (not object). It doesn't appear that we can > coerce Swig into generating the class we want at present (but we are > still enquiring). > > Is it possi

Re: python mysteriously halts

2008-07-07 Thread Tim Golden
Todd wrote: I ran a python script last night which connects to a matlab automation server via DCOM (using win32com). I expected to see the results when I came in this morning. But apparently, not long after I left, python stopped. I hit enter in the console, and it started again. Symptomati

Re: I am looking for svn library(module)

2008-07-07 Thread A.T.Hofkamp
On 2008-07-07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > > I am looking fo svn library(module) which is used in the svn- > mailer(http://opensource.perlig.de/svnmailer/) project. Does anybody > know where can I find it(download url)? This is information which I > received from python err

Re: Hi there! I need what is probably a very basic lesson in events....

2008-07-07 Thread Mike Driscoll
On Jul 6, 8:18 am, furby <[EMAIL PROTECTED]> wrote: > I am teaching myself Python... I'm nowhere near even intermediate > level yet, so treat me like an idiot. I am using Boa Constructor on > Ubuntu 8.04 if that helps. Here is what I have right now : > > I am plying with reading a URL (An RSS feed

Re: yo...

2008-07-07 Thread cokofreedom
On Jul 7, 3:47 pm, Bruno Desthuilliers wrote: > [EMAIL PROTECTED] a écrit : > (snip) > > > However welcome to Python and this Google > > Group. > > > This is *not* a google group. This is the usenet newsgroup > comp.lang.python, made accessible TTW by google. > Touche ;) -- http://mail.python.o

Re: Can't get Python for Windows to run

2008-07-07 Thread Tim Rowe
2008/7/4 "Martin v. Löwis" <[EMAIL PROTECTED]>: > and find installers annoying that ask too many questions So do I, but not as annoying as installers that do the Wrong Thing because they didn't ask! ;-) Still, it's your call. > In any case, try installing with > > msiexec /i 'ProgramMenuFolder=C

Re: re.search much slower then grep on some regular expressions

2008-07-07 Thread Sebastian "lunar" Wiesner
Mark Wooding <[EMAIL PROTECTED]>: > Sebastian "lunar" Wiesner <[EMAIL PROTECTED]> wrote: > >> # perl -e '("a" x 10) =~ /^(ab?)*$/;' >> zsh: segmentation fault perl -e '("a" x 10) =~ /^(ab?)*$/;' > > (Did you really run that as root?) How come, that you think so? -- Freedom is always

Re: GUI Programming by hand not code with Python Code

2008-07-07 Thread Sebastian "lunar" Wiesner
Jason Scheirer <[EMAIL PROTECTED]>: > On Jul 6, 7:33 pm, [EMAIL PROTECTED] wrote: >> Is their a program that lets you design a GUI by hand (like gambas) >> not by code (like wxpython) but the commands are in python? >> >> A program similar to gambas or vb >> >> Gambas with python code instead of g

Re: re.search much slower then grep on some regular expressions

2008-07-07 Thread Marc 'BlackJack' Rintsch
On Mon, 07 Jul 2008 16:44:22 +0200, Sebastian \"lunar\" Wiesner wrote: > Mark Wooding <[EMAIL PROTECTED]>: > >> Sebastian "lunar" Wiesner <[EMAIL PROTECTED]> wrote: >> >>> # perl -e '("a" x 10) =~ /^(ab?)*$/;' >>> zsh: segmentation fault perl -e '("a" x 10) =~ /^(ab?)*$/;' >> >> (Did y

Re: python mysteriously halts

2008-07-07 Thread goldfita
On Jul 7, 10:17 am, Tim Golden <[EMAIL PROTECTED]> wrote: > Todd wrote: > > I ran a python script last night which connects to a matlab automation > > server via DCOM (using win32com).  I expected to see the results when > > I came in this morning.  But apparently, not long after I left, python > >

win32com extension documentation/API

2008-07-07 Thread korean_dave
Hi. Where can i find the API for this extension? Sourceforge only has downloads. Python has stopped supporting the upkeep of the versions. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: python mysteriously halts

2008-07-07 Thread Todd
On Jul 7, 10:17 am, Tim Golden <[EMAIL PROTECTED]> wrote: > Todd wrote: > > I ran a python script last night which connects to a matlab automation > > server via DCOM (using win32com).  I expected to see the results when > > I came in this morning.  But apparently, not long after I left, python > >

Re: Hi there! I need what is probably a very basic lesson in events....

2008-07-07 Thread furby
On Jul 7, 10:34 am, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On Jul 6, 8:18 am, furby <[EMAIL PROTECTED]> wrote: > > > > > I am teaching myself Python... I'm nowhere near even intermediate > > level yet, so treat me like an idiot. I am using Boa Constructor on > > Ubuntu 8.04 if that helps. Here

Re: Confused yet again: Very Newbie Question

2008-07-07 Thread Peter Pearson
On Mon, 7 Jul 2008 05:41:22 -0700 (PDT), mcl <[EMAIL PROTECTED]> wrote: [snip] > My use of classes is because I want two classes one for global > variables and one for global functions. One of the many lovely things about programming in the Python style is that very few things need to be global.

Re: win32com extension documentation/API

2008-07-07 Thread Mike Driscoll
On Jul 7, 10:26 am, korean_dave <[EMAIL PROTECTED]> wrote: > Hi. Where can i find the API for this extension? > > Sourceforge only has downloads. Python has stopped supporting the > upkeep of the versions. > > Thanks. I usually use ActiveState's docs: http://aspn.activestate.com/ASPN/docs/ActiveP

how to recognize IE window already opened using win32com extension

2008-07-07 Thread korean_dave
How do I use the win32com API to manipulate IE windows ALREADY open? ie = Dispatch("InternetExplorer.Application") opens a new window. But I'd like to be able to find, of windows already open, a specific window (with a specified property, matching url, etc.) -- http://mail.python.org/mailman/list

Re: how to recognize IE window already opened using win32com extension

2008-07-07 Thread Tim Golden
korean_dave wrote: How do I use the win32com API to manipulate IE windows ALREADY open? ie = Dispatch("InternetExplorer.Application") opens a new window. But I'd like to be able to find, of windows already open, a specific window (with a specified property, matching url, etc.) I have this str

Re: how to recognize IE window already opened using win32com extension

2008-07-07 Thread Mike Driscoll
On Jul 7, 11:09 am, korean_dave <[EMAIL PROTECTED]> wrote: > How do I use the win32com API to manipulate IE windows ALREADY open? > > ie = Dispatch("InternetExplorer.Application") opens a new window. > > But I'd like to be able to find, of windows already open, a specific > window (with a specified

Re: how to recognize IE window already opened using win32com extension

2008-07-07 Thread Mike Driscoll
On Jul 7, 11:16 am, Tim Golden <[EMAIL PROTECTED]> wrote: > korean_dave wrote: > > How do I use the win32com API to manipulate IE windows ALREADY open? > > > ie = Dispatch("InternetExplorer.Application") opens a new window. > > > But I'd like to be able to find, of windows already open, a specific

Re: re.search much slower then grep on some regular expressions

2008-07-07 Thread Henning Thornblad
When trying to find an alternative way of solving my problem i found that running this script: #!/usr/bin/env python import re row="" for a in range(156000): row+="a" print "How many, dude?" print re.search('/[^ "=]*',row) (the / has moved) wouldn't take even a second (The re.search part o

Re: Is there a good way to implement file updating? such as lock, update, reload...

2008-07-07 Thread Larry Bates
Evan wrote: If I get rid of the XML, I have to change my script more and more, it is not easy to do that. :( :( Thanks, It is even harder to write a multi-user XML database (which is what you are wanting). Put the data in a multi-user database and convert to XML as needed. -Larry -- http:/

Re: Confused yet again: Very Newbie Question

2008-07-07 Thread Matt Nordhoff
Jerry Hill wrote: > On Mon, Jul 7, 2008 at 7:30 AM, mcl <[EMAIL PROTECTED]> wrote: >> I did not think you had to make the distinction between 'byvar' and >> 'byref' as in Basic. > > Python does not use "call by value" or "call by reference" semantics. > Instead, python's model is "call by object".

Re: pythoncom InternetExplorer.Application don't work in vista || firefox pythoncom ?

2008-07-07 Thread gcmartijn
On 6 jul, 16:00, "Méta-MCI \(MVP\)" <[EMAIL PROTECTED]> wrote: > H...  I have a similary problem, in another circumstances. > It's often a problem of configuration of IE (for news customers).  But, > it is not easy, because IE has many parameters. > > Good luck! > > Michel Claveau IE have m

do a sed / awk filter with python tools (at least as fast)

2008-07-07 Thread Mathieu Prevot
Hi, I use in a bourne shell script the following filter: sed '/watch?v=/! d;s/.*v=//;s/\(.\{11\}\).*/\1/' \ | sort | uniq | awk 'ORS=" "{print $1}' that give me all sets of 11 characters that follows the "watch?v=" motif. I would like to do it in python on stdout from a subprocess.Popen instance

Re: VNC capture in python

2008-07-07 Thread Mike Driscoll
On Jul 6, 11:12 pm, Astan Chee <[EMAIL PROTECTED]> wrote: > Hi, > I was wondering if I can do a capture of a VNC screen in python. Kinda > like this http://search.cpan.org/~lbrocard/Net-VNC-0.35/lib/Net/VNC.pm > but without opening a VNC window or doing a screen capture. > Thanks for any suggestion

Re: Very weird bug!

2008-07-07 Thread ssecorp
i know, idid try it again and it works as expected. but how the h*** did it not work that one time? -- http://mail.python.org/mailman/listinfo/python-list

Re: Confused yet again: Very Newbie Question

2008-07-07 Thread mcl
On Jul 7, 5:07 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Mon, 7 Jul 2008 05:41:22 -0700 (PDT), mcl <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > My use of classes is because I want two classes one for  global > > variables and one for global functions. > >    

Re: The Yield statement

2008-07-07 Thread Jorgen Grahn
On Sun, 6 Jul 2008 00:29:26 -0700, Mark Tolonen <[EMAIL PROTECTED]> wrote: > > "inhahe" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] ... >> note that this won't work; >> def f(): >> for x in xrange(10): >>for y in xrange(10): >> yield (x,y) >> >> yield just doesn't work

Re: Cross Compiler for Python?

2008-07-07 Thread Jorgen Grahn
On Mon, 7 Jul 2008 10:15:59 +0200, Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > Up to now, I have been innocently using the vanilla python > that comes with the Linux distribution (Suse in my case). > > For the past few days, I have been playing with a little > device called an eBox - it is basi

Re: Dynamically Changing the Base Class

2008-07-07 Thread Adam C.
On Jul 7, 9:11 am, George Sakkis <[EMAIL PROTECTED]> wrote: > On Jul 7, 9:31 am, "Adam C." <[EMAIL PROTECTED]> wrote: > > > > > We have a situation where we want a Swig-generated Python class to > > have a different base (not object). It doesn't appear that we can > > coerce Swig into generating th

Memory error while saving dictionary of size 65000X50 using pickle

2008-07-07 Thread Nagu
I am trying to save a dictionary of size 65000X50 to a local file and I get the memory error problem. How do I go about resolving this? Is there way to partition the pickle object and combine later if this is a problem due to limited resources (memory) on the machine (it is 32 bit machine Win XP,

Re: Memory error while saving dictionary of size 65000X50 using pickle

2008-07-07 Thread Larry Bates
Nagu wrote: I am trying to save a dictionary of size 65000X50 to a local file and I get the memory error problem. How do I go about resolving this? Is there way to partition the pickle object and combine later if this is a problem due to limited resources (memory) on the machine (it is 32 bit ma

Re: re.search much slower then grep on some regular expressions

2008-07-07 Thread Kris Kennaway
Paddy wrote: On Jul 4, 1:36 pm, Peter Otten <[EMAIL PROTECTED]> wrote: Henning_Thornblad wrote: What can be the cause of the large difference between re.search and grep? grep uses a smarter algorithm ;) This script takes about 5 min to run on my computer: #!/usr/bin/env python import re ro

tale of two attachments

2008-07-07 Thread TBS
Hi, I have a script that is invoked by .forward on a Unix mailbox. It works fine parsing an attachment and saving to disk when the email is sent directly to the email address (header 1), but doesn't work when the email is sent via a majordomo mailing list (header 2). I've looked at the mime file

Re: do a sed / awk filter with python tools (at least as fast)

2008-07-07 Thread Peter Otten
Mathieu Prevot wrote: > I use in a bourne shell script the following filter: > > sed '/watch?v=/! d;s/.*v=//;s/\(.\{11\}\).*/\1/' \ > | sort | uniq | awk 'ORS=" "{print $1}' > > that give me all sets of 11 characters that follows the "watch?v=" > motif. I would like to do it in python on stdout

Trouble with Tkinter text margins

2008-07-07 Thread Alexnb
I am writing a program in which there is a textbox and in it the program auto inputs a series of words, and definitions for each word. I want to make it formatted nicely to where the word is indented, and the definitions indented even more. I don't even know how to make the margins work. I have re

Memory error while saving dictionary using pickle

2008-07-07 Thread Nagu
I am trying to save a dictionary of size 65000X50 to a local file and I get the memory error problem. How do I go about resolving this? Is there way to partition the pickle object and combine later if this is a problem due to limited resources (memory) on the machine (it is 32 bit machine Win XP,

sage vs enthought for sci computing

2008-07-07 Thread jadamwilson2
Hello, I have recently become interested in using python for scientific computing, and came across both sage and enthought. I am curious if anyone can tell me what the differences are between the two, since there seems to be a lot of overlap (from what I have seen). If my goal is to replace matlab

Re: Memory error while saving dictionary of size 65000X50 using pickle

2008-07-07 Thread Martin v. Löwis
Nagu wrote: > I am trying to save a dictionary of size 65000X50 to a local file and > I get the memory error problem. What do you mean by this size specification? When I interpreter X as multiplication, I can't see a problem: the code import pickle d = {} for i in xrange(65000*50): d[i]=i p

Re: Cross Compiler for Python?

2008-07-07 Thread norseman
I think I should have not used the 'reply' button but rather sent it back through the [EMAIL PROTECTED] So here here goes. === Hendrik van Rooyen wrote: Up to now, I have been innocently using the vanilla python that comes with the Linux distribution (Suse in my case). For the

Re: Confused yet again: Very Newbie Question

2008-07-07 Thread Terry Reedy
Jeff wrote: When you call c3.createJoe(c1.fred), you are passing a copy of the value stored in c1.fred to your function. Python passes function parameters by value. These statements are both wrong. Function argument objects or objects derived therefrom are bound to function parameter names

Re: do a sed / awk filter with python tools (at least as fast)

2008-07-07 Thread Mathieu Prevot
2008/7/7 Peter Otten <[EMAIL PROTECTED]>: > Mathieu Prevot wrote: > >> I use in a bourne shell script the following filter: >> >> sed '/watch?v=/! d;s/.*v=//;s/\(.\{11\}\).*/\1/' \ >> | sort | uniq | awk 'ORS=" "{print $1}' >> >> that give me all sets of 11 characters that follows the "watch?v=" >>

Re: caseless dict - questions

2008-07-07 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Phoe6 <[EMAIL PROTECTED]> wrote: > I have a requirement for using caseless dict. I searched the web for > many different implementations and found one snippet which was > implemented in minimal and useful way. > > # > import UserDict > > class CaseIn

Re: Dynamically Changing the Base Class

2008-07-07 Thread Carl Banks
On Jul 7, 9:31 am, "Adam C." <[EMAIL PROTECTED]> wrote: > We have a situation where we want a Swig-generated Python class to > have a different base (not object). It doesn't appear that we can > coerce Swig into generating the class we want at present (but we are > still enquiring). > > Is it possi

Re: How to bypass Windows 'cooking' the I/O? (One more time, please) II

2008-07-07 Thread norseman
Dennis Lee Bieber wrote: On Mon, 07 Jul 2008 01:03:10 -0700, norseman <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > Normal file I/O sequence: > > fp = open(target, 'wb') > > fp.seek(-1, 2) > > fp.write(record) > Except it doesn't do that in Windows. See belo

Re: How to make a function associated with a class?

2008-07-07 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Kurda Yon <[EMAIL PROTECTED]> wrote: > On Jul 1, 5:01 pm, "[EMAIL PROTECTED]" > <[EMAIL PROTECTED]> wrote: > > On 1 juil, 22:43, Kurda Yon <[EMAIL PROTECTED]> wrote: > > > > > > > > > Hi, > > > > > I have a class called "vector". And I would like to define a funct

Re: The Yield statement

2008-07-07 Thread Paul Hankin
On Jul 1, 12:45 am, Mensanator <[EMAIL PROTECTED]> wrote: > Here's an example. > ... > def partition_generator(depth,width): >   """creates all partions of a given depth,widtth (depth>=width) >   depth objects in width bins such that each bin has at least 1 object >   this function is a generator (

"in"consistency?

2008-07-07 Thread David C. Ullrich
Luckily I tried it before saying no, that's not how "in" works: >>> 'ab' in 'abc' True >>> [1,2] in [1,2,3] False Is there a reason for the inconsistency? I would have thought "in" would check for elements of a sequence, regardless of what sort of sequence it was... -- David C. Ullrich -- http:

Re: "in"consistency?

2008-07-07 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [1,2] in [1,2,3] checks to see if the list [1,2] is an item in [1,2,3]. Because the list [1,2,3] only contains the integers 1,2,3, the code returns a False. Try "[1,2] in [[1,2],[2,3]]" David C. Ullrich wrote: > Luckily I tried it before saying no, th

Re: "in"consistency?

2008-07-07 Thread Ben Finney
"David C. Ullrich" <[EMAIL PROTECTED]> writes: > >>> 'ab' in 'abc' > True > >>> [1,2] in [1,2,3] > False http://www.python.org/doc/ref/comparisons.html> > Is there a reason for the inconsistency? Probably. The special behaviour of string types was changed in Python 2.3, according to that docume

Standard Equation Description Language?

2008-07-07 Thread xkenneth
Does anyone know of a standard inter-language syntax for describing scientific/mathematical equations? Preferably something with parsers in multiple libraries. Regards, Kenneth Miller -- http://mail.python.org/mailman/listinfo/python-list

Emacs/Python Essentials?

2008-07-07 Thread xkenneth
What does everyone consider essential for emacs python dev? Regards, Ken -- http://mail.python.org/mailman/listinfo/python-list

Python Agile Software Development Tools Screencasts

2008-07-07 Thread percious
Hi All, I started a new series about python on showmedo. Please feel free to take a look. They are as follows: virtualenv pastescript nosetests coverage Here is the link: http://showmedo.com/videos/video?name=291&fromSeriesID=291 Tutorial materials can be found at http://pythontutorials.

Re: Memory error while saving dictionary of size 65000X50 using pickle

2008-07-07 Thread Nagu
I didn't have the problem with dumping as a string. When I tried to save this object to a file, memory error pops up. I am sorry for the mention of size for a dictionary. What I meant by 65000X50 is that it has 65000 keys and each key has a list of 50 tuples. I was able to save a dictionary objec

Re: Standard Equation Description Language?

2008-07-07 Thread Robert Kern
xkenneth wrote: Does anyone know of a standard inter-language syntax for describing scientific/mathematical equations? Preferably something with parsers in multiple libraries. MathML http://www.w3.org/Math/ -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless

How to make python scripts .py executable, not bring up editor

2008-07-07 Thread korean_dave
>From command Prompt, i type in a script, "tryme.py". This, instead, brings up PythonWin editor and Interactive Window. Path variable is "C:\Python24". (I need Python 2.4 installed, not 2.5) How do I make it so that the script runs? -- http://mail.python.org/mailman/listinfo/python-list

Re: "in"consistency?

2008-07-07 Thread Gary Herron
Nick Dumas wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [1,2] in [1,2,3] checks to see if the list [1,2] is an item in [1,2,3]. Because the list [1,2,3] only contains the integers 1,2,3, the code returns a False. Try "[1,2] in [[1,2],[2,3]]" The inconsistency goes deeper than that.

Re: SQLite and Python 2.4

2008-07-07 Thread Tim Grove
There is an "SQLite Manager" add-on for Firefox which is pretty neat. Have a look at https://addons.mozilla.org/en-US/firefox/search?q=sqlite&cat=all. Might be useful to you! Tim Steffen Mutter wrote: Hi Joe! Am Tue, 01 Jul 2008 17:51:35 -0700 schrieb Joe Goldthwaite: I'm confused.

numeric emulation and __pos__

2008-07-07 Thread Ethan Furman
Greetings, List! I'm working on a numeric data type for measured values that will keep track of and limit results to the number of significant digits originally defined for the values in question. I am doing this primarily because I enjoy playing with numbers, and also to get some experience

  1   2   >