Re: how can I open an excel sheet with specified name

2008-12-02 Thread Gabriel Genellina
En Fri, 28 Nov 2008 23:12:50 -0200, Zuo, Changchun <[EMAIL PROTECTED]> escribió: Could you please send me an example script example of * Opening an excel workbook with specified name * Read or write number in a specified spreadsheet There is a specific group for those topics: py

Posting File as a parameter to PHP/HTML using HTTP POST

2008-12-02 Thread S.Selvam Siva
I am trying to post file from python to php using HTTP POST method. I tried mechanize but not able to pass the file object. from mechanize import Browser br=Browser() response=br.open("http://localhost/test.php";) br.select_form('form1') br['uploadedfile']=open("C:/Documents and Settings/user/Desk

Re: Multiple Versions of Python on Windows XP

2008-12-02 Thread Glenn Linderman
On approximately 12/1/2008 11:29 PM, came the following characters from the keyboard of Martin v. Löwis: It would be nice if the ftypes were version specific as created by the installer; IIRC, I created the above three from the ftype Python.File as I installed each version. That's a good i

Re: How to instantiate in a lazy way?

2008-12-02 Thread Slaunger
On 2 Dec., 11:30, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > > For 4 attributes I'd probably go with the __getattr__. > OK, I'll do that! > Or you could easily write your own decorator to cache the result... > > Eghttp://code.activestate.com/recipes/363602/ Cool. I never realized I could write

Re: optimization

2008-12-02 Thread Steven D'Aprano
On Mon, 01 Dec 2008 19:06:24 -0600, Robert Kern wrote: > As Neal has observed, there is a performance hit for creating functions > inside of another function. True, but it's not a big hit, and I believe it is constant time regardless of the size of the function. The inner function has been (m

Re: Do more imported objects affect performance

2008-12-02 Thread Nick Craig-Wood
On Tue, Dec 02, 2008 at 11:24:29AM +0600, Taskinoor Hasan wrote: > On Mon, Dec 1, 2008 at 8:21 PM, Filip Gruszczy?ski <[EMAIL PROTECTED]>wrote: > > > I see. Thanks for a really good explanation, I like to know, how to do > > things in the proper way :) > > I always prefer to use import module and

performance question: dictionary or list, float or string?

2008-12-02 Thread bkamrani
Hi Python gurus! I'm going to read in an Ascii file containing float numbers in rows and columns (say 10 columns 50 rows) for further numerical process. Which format is best to save them in, eg, dictionary, list, or numpy array when it comes to performance? Will it be beneficial to convert all

Re: performance question: dictionary or list, float or string?

2008-12-02 Thread bkamrani
I forgot to mention that I did a simple timeit test which doesn't show significant runtime difference 3.5 sec for dictionary case and 3.48 for list case. def read_as_dictionary(): fil = open('myDataFile', 'r') forces = {} for region in range(25): forces[region] = {} for s

Re: Do more imported objects affect performance

2008-12-02 Thread Bruno Desthuilliers
Nick Craig-Wood a écrit : On Tue, Dec 02, 2008 at 11:24:29AM +0600, Taskinoor Hasan wrote: On Mon, Dec 1, 2008 at 8:21 PM, Filip Gruszczy?ski <[EMAIL PROTECTED]>wrote: I see. Thanks for a really good explanation, I like to know, how to do things in the proper way :) I always prefer to use imp

Re: How to instantiate in a lazy way?

2008-12-02 Thread Nick Craig-Wood
Slaunger <[EMAIL PROTECTED]> wrote: > On 2 Dec., 11:30, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > > > > > For 4 attributes I'd probably go with the __getattr__. > > > OK, I'll do that! > > > Or you could easily write your own decorator to cache the result... > > > > Eg http://code.activestat

Re: Do more imported objects affect performance

2008-12-02 Thread Steven D'Aprano
On Tue, 02 Dec 2008 11:12:31 +, Nick Craig-Wood wrote: > I prefer the "from module import function". That means that if "module" > doesn't supply "function" it raises an exception at compile time, not > run time when you try to run "module.function". Wanna bet? >>> def spam(): ... from

RE: How to sort a list of file paths

2008-12-02 Thread Eriksson, John
Hi again, I've updated the example using the ideas and python tricks used on pages found via the link you gave me, Chris. So... for future references here's the best (?) way of sorting a list of file names in the correct way (correct for some applications at least). Note: For some odd reason I

Re: performance question: dictionary or list, float or string?

2008-12-02 Thread Steven D'Aprano
On Tue, 02 Dec 2008 03:41:29 -0800, bkamrani wrote: > Hi Python gurus! > I'm going to read in an Ascii file containing float numbers in rows and > columns (say 10 columns 50 rows) for further numerical process. > Which format is best to save them in, eg, dictionary, list, or numpy > array when

Re: Python+Pyjamas+V8=ftw

2008-12-02 Thread lkcl
> Another project similar-ish to Pyjamas is > HotRuby:http://hotruby.yukoba.jp/ also there's RubyJS: http://rubyforge.org/projects/rubyjs/ it's again a javascript compiler - ruby to javascript - and the beginnings of a port of GWT to Ruby, called rwt. this project _definitely_ needs more at

Determining number of dict key collisions in a dictionary

2008-12-02 Thread python
Is there any way to determine the number of dictionary key collisions in a specific dictionary? Background: I'm working on a project using very large dictionaries (64 bit Python) and question from my client is how effective is Python's default hash technique for our data set? Their concern is based

Re: How to sort a list of file paths

2008-12-02 Thread Chris Rebert
On Tue, Dec 2, 2008 at 12:36 AM, Eriksson, John <[EMAIL PROTECTED]> wrote: > Hi, > > > > This weekend I had some problems to get a list containing file paths to be > sorted in a way that I could use. > > > > I also found a thread in this mailing list ( > http://mail.python.org/pipermail/python-list

best way to do this

2008-12-02 Thread TP
Hi everybody, >>> c=[(5,3), (6,8)] >From c, I want to obtain a list with 5,3,6, and 8, in any order. I do this: >>> [i for (i,j) in c] + [ j for (i,j) in c] [5, 6, 3, 8] Is there a quicker way to do this? Thanks Julien -- python -c "print ''.join([chr(154 - ord(c)) for c in '*9(9&(18%.9&1+,\

Re: best way to do this

2008-12-02 Thread Diez B. Roggisch
TP wrote: > Hi everybody, > c=[(5,3), (6,8)] > > From c, I want to obtain a list with 5,3,6, and 8, in any order. > I do this: > [i for (i,j) in c] + [ j for (i,j) in c] > [5, 6, 3, 8] > > Is there a quicker way to do this? dunno if it's faster, but less cluttered: list(sum(c, ()))

Re: pydoc enforcement.

2008-12-02 Thread J. Cliff Dyer
On Tue, 2008-12-02 at 09:38 +1100, Ken Faulkner wrote: > Hi > > Yeah, I was thinking about something at commit time for a VCS... > catch is, soo many VCS's out there. > And I wasn't thinking of the default action throwing compile errors, > but would only do that if a particular flag was given. >

Running a Python script from crontab

2008-12-02 Thread Astley Le Jasper
I need help ... I've been looking at this every evening for over a week now. I'd like to see my kids again! I have script that runs fine in the terminal but when I try to run it in a crontab for either myself or root, it bails out. The trouble is that obviously I get no console when using crontab

Re: Running a Python script from crontab

2008-12-02 Thread James Mills
Put your main function in a big try, except. Catch any and all errors and log them. Example: def main(): try: do_something() except Exception, error: log("ERROR: %s" % error) log(format_exc()) Hope this helps. cheers James On Wed, Dec 3, 2008 at 12:35 AM, Astley Le Jaspe

Re: best way to do this

2008-12-02 Thread Hrvoje Niksic
TP <[EMAIL PROTECTED]> writes: > Hi everybody, > c=[(5,3), (6,8)] > > From c, I want to obtain a list with 5,3,6, and 8, in any order. > I do this: > [i for (i,j) in c] + [ j for (i,j) in c] > [5, 6, 3, 8] > > Is there a quicker way to do this? Quicker? Hard to say. Using itertools el

Re: Checking a string against multiple matches

2008-12-02 Thread Chris
On Dec 2, 3:01 am, alex23 <[EMAIL PROTECTED]> wrote: > On Dec 2, 5:31 am, Aaron Scott <[EMAIL PROTECTED]> wrote: > > > I was using .index on the > > list, but it would return True for strings that contained the search > > string rather than match it exactly, leading to false positives in my > > cod

Re: Running a Python script from crontab

2008-12-02 Thread Philip Semanchuk
On Dec 2, 2008, at 9:35 AM, Astley Le Jasper wrote: I need help ... I've been looking at this every evening for over a week now. I'd like to see my kids again! I have script that runs fine in the terminal but when I try to run it in a crontab for either myself or root, it bails out. The troub

Re: How to instantiate in a lazy way?

2008-12-02 Thread Nick Craig-Wood
Slaunger <[EMAIL PROTECTED]> wrote: > On 1 Dec., 16:30, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > > > > I wouldn't use __getattr__ unless you've got lots of attributes to > > overload. ?__getattr__ is a recipe for getting yourself into trouble > > in my experience ;-) > > > > Just do it like th

Re: Is it safe to modify the dict returned by vars() or locals()

2008-12-02 Thread Duncan Booth
Helmut Jarausch <[EMAIL PROTECTED]> wrote: > Chris Rebert wrote: >> On Mon, Dec 1, 2008 at 1:01 PM, Helmut Jarausch <[EMAIL PROTECTED]> >> wrote: >>> Hi, >>> >>> I am looking for an elegant way to solve the following problem: >>> >>> Within a function >>> >>> def Foo(**parms) >>> >>> I have a lis

Obama's Birth Certificate - Demand that US presidential electors investigate Obama's eligibility

2008-12-02 Thread girbarobert
This message is not about the meaningless computer printout called "Certification of Live Birth" that Obama propaganda machine calls his "Birth Certificate". The American people are still waiting for a copy of Obama's original birth certificate that includes all his birth information. Remind your

Re: How to instantiate in a lazy way?

2008-12-02 Thread Slaunger
Just wanted to show the end result in its actual implementation! I ended up *not* making a decorator, as I already had a good idea about how to do it using __getattr__ class PayloadDualFrqIQOnDemand(PayloadDualFrqIQ): """ This class has the same interface as its parent, but unlike its

ANN: eGenix mxODBC Connect - Python Database Interface 1.0.0

2008-12-02 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com mxODBC Connect Python Database Interface Version 1.0.0 Our new client-server product for connecting Python applications to

Re: Checking a string against multiple matches

2008-12-02 Thread alex23
On Dec 2, 10:09 pm, Chris <[EMAIL PROTECTED]> wrote: > On Dec 2, 3:01 am, alex23 <[EMAIL PROTECTED]> wrote: > > The only time I'd expect it to do partial matches is if you were doing > > string.index(string), rather than list.index(string): > It would if the OP was iterating over the list and chec

How to sort a list of file paths

2008-12-02 Thread Eriksson, John
Hi, This weekend I had some problems to get a list containing file paths to be sorted in a way that I could use. I also found a thread in this mailing list ( http://mail.python.org/pipermail/python-list/2007-April/433590.html ) and realized that others might be interested in a solution. So...

"server chain" with python socket module

2008-12-02 Thread B R
dear all, I want to connect my A machine to the E server via servers B, C and D, is there a way to set-up such "server chain" with python socket module (or other module) ? many thanks boris vn%ibo%ris[at]hotmail.com _ News, entertain

[ANN] Pyjamas 0.4: Python Web Toolkit Release

2008-12-02 Thread Luke Kenneth Casson Leighton
This is the 0.4 Release of Pyjamas, the python-to-javascript compiler and Web Widget set and framework. Download Pyjamas 0.4 here: https://sourceforge.net/project/showfiles.php?group_id=239074 http://code.google.com/p/pyjamas/downloads/list Pyjamas started as a port of Google's Web Toolkit, to py

Re: Posting File as a parameter to PHP/HTML using HTTP POST

2008-12-02 Thread S.Selvam Siva
I myself have found the solution. Instead of: br[br['uploadedfile']=open("C:/ > > Documents and Settings/user/Desktop/Today/newurl-ideas.txt") We Need to use: br.add_file(open("C:/ > > Documents and Settings/user/Desktop/Today/newurl-ideas.txt"), > filename="newurl-ideas.txt",name="uploadedfile"

Re: optimization

2008-12-02 Thread Duncan Booth
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > Which makes me wonder, is there anything we can do with that code object > from Python code? I can disassemble it: > import dis dis.dis(outer.func_code.co_consts[1]) > 3 0 LOAD_CONST 0 (None) > 3 RETUR

Re: Is it safe to modify the dict returned by vars() or locals()

2008-12-02 Thread Helmut Jarausch
Chris Rebert wrote: On Mon, Dec 1, 2008 at 1:01 PM, Helmut Jarausch <[EMAIL PROTECTED]> wrote: Hi, I am looking for an elegant way to solve the following problem: Within a function def Foo(**parms) I have a list of names, say VList=['A','B','C1'] and I like to generate abbreviation _A ident

Re: HELP!...Google SketchUp needs a Python API

2008-12-02 Thread James Mills
Pssft r, it's I that needs to get laid :) --JamesMills On Tue, Dec 2, 2008 at 4:07 PM, r <[EMAIL PROTECTED]> wrote: > PS james, > > Since you are alex23's friend, do the world a favor...PLEASE GET ALEX > LAID...before it's too late! > -- > http://mail.python.org/mailman/listinfo/python-list >

Re: optimization

2008-12-02 Thread Steven D'Aprano
On Mon, 01 Dec 2008 18:11:16 -0600, Robert Kern wrote about nested functions: > I, for one, find that significantly less clear. I only expect functions > to be defined inside of functions if they are going to use lexical > scoping for some reason. If I read your code, I'd probably waste a good >

Re: How to sort a list of file paths

2008-12-02 Thread James Mills
Hi Eriksson, It's nice to see people actually contribute what they've learned back to the community. Great problem, well thought out solution and congrats on the learning :) I can't say per say that I've actually run into a situation where I need to sort file paths in this way ... But if I do I'l

Ideal girl dance WEBCAM ! Ideal boobs !

2008-12-02 Thread [EMAIL PROTECTED]
http://yeba.pl/show/movies/5257/Perfect_babe_-_Idealna_kobieta -- http://mail.python.org/mailman/listinfo/python-list

help me~!about base64

2008-12-02 Thread ylj798
my code: − import base64 def deflashget(st): if st.startswith('Flashget://'): return base64.decodestring(st[len('Flashget://'):])[10:-10] elif st.startswith('http://') or st.startswith('ftp://'): return 'Flashget://' + base64.encodestr

Re: How to instantiate in a lazy way?

2008-12-02 Thread George Sakkis
On Dec 2, 10:01 am, Slaunger <[EMAIL PROTECTED]> wrote: > Just wanted to show the end result in its actual implementation! > > I ended up *not* making a decorator, as I already had a good idea > about how to do it > using __getattr__ > > class PayloadDualFrqIQOnDemand(PayloadDualFrqIQ): >     """ >

Re: newbie question

2008-12-02 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Nan <[EMAIL PROTECTED]> wrote: > Hello, >I just started to use Python. I wrote the following code and > expected 'main' would be called. > > def main(): > print "hello" > > main > > But I was wrong. I have to use 'main()' to invoke main. The python > inte

Re: Python+Pyjamas+V8=ftw

2008-12-02 Thread Kay Schluehr
On 2 Dez., 14:57, lkcl <[EMAIL PROTECTED]> wrote: >  as a general-purpose plugin replacement for /usr/bin/python, however, > it's not quite there.  and, given that javascript cheerfully goes > about its way with the "undefined" concept, it's always going to be a > _bit_ tricky to provide absolutel

Re: HELP!...Google SketchUp needs a Python API

2008-12-02 Thread r
At least -someone- besides myself has a sense of humor around here. PS James, i will look through my contact list and send you a few "easy" numbers... good luck :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Scanner class

2008-12-02 Thread George Sakkis
On Dec 1, 5:42 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > George Sakkis <[EMAIL PROTECTED]> writes: > > Is there any stdlib or (more likely) 3rd party module that provides a > > similar functionality to the java.util.Scanner class [1] ? If not, > > would there be any interest in porting it (

Re: help me~!about base64

2008-12-02 Thread Jerry Hill
2008/12/2 <[EMAIL PROTECTED]>: > it's run ,Eric gave me error,the error is "'module' object has no > attribute 'decodestring'", Do you have your own base64.py (or base64.pyc) that's shadowing the standard module base64? Try this: >>> import base64 >>> print base64.__file__ C:\Python25\lib\base6

Re: Do more imported objects affect performance

2008-12-02 Thread Nick Craig-Wood
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Tue, 02 Dec 2008 11:12:31 +, Nick Craig-Wood wrote: > > > I prefer the "from module import function". That means that if "module" > > doesn't supply "function" it raises an exception at compile time, not > > run time when you try to run "module

Re: HELP!...Google SketchUp needs a Python API

2008-12-02 Thread Craig Allen
> Just remember thought that if you threat Python like a > hammer, suddenly everything will look like a bail. > don't you mean if you use Python like a pitchfork? -- http://mail.python.org/mailman/listinfo/python-list

Re: HELP!...Google SketchUp needs a Python API

2008-12-02 Thread Benjamin Kaplan
On Tue, Dec 2, 2008 at 1:36 PM, Craig Allen <[EMAIL PROTECTED]> wrote: > > Just remember thought that if you threat Python like a > > hammer, suddenly everything will look like a bail. > > > > don't you mean if you use Python like a pitchfork? Or that everything else looks like a nail. B and N a

Re: [ANN] Pyjamas 0.4: Python Web Toolkit Release

2008-12-02 Thread Duncan Booth
"Luke Kenneth Casson Leighton" <[EMAIL PROTECTED]> wrote: > Pyjamas started as a port of Google's Web Toolkit, to python. > Explaining why Pyjamas (and GWT) is so significant takes > some doing: the summary is that comprehensive desktop-like > user interfaces can be developed very simply, to run i

Re: Multiple Versions of Python on Windows XP

2008-12-02 Thread Martin v. Löwis
> OK, Issue 4485 created. My first one, so let me know if I goofed. I > elaborated a bit from the original email, upon reflection. Seemed > useful, but also seemed complex by the time I got done. Looks about right to me. > I don't really have a clue what the uninstaller should do with these; >

Re: Running a Python script from crontab

2008-12-02 Thread Astley Le Jasper
James ... thanks for the suggestion. I have done this and the error logging usually catches all my errors and logs them. I wondered if logging itself was failing! Philip ... thanks also. I did wonder about making the everything explicit. I've seen that mentioned elsewhere. Writing out the stdout &

Re: help me~!about base64

2008-12-02 Thread ylj798
On 12月3日, 上午1时50分, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > 2008/12/2 <[EMAIL PROTECTED]>: > > > it's run ,Eric gave me error,the error is "'module'objecthasno > >attribute'decodestring'", > > Do you have your own base64.py (or base64.pyc) that's shadowing the > standardmodulebase64? Try this: >

Re: Scanner class

2008-12-02 Thread Arnaud Delobelle
George Sakkis <[EMAIL PROTECTED]> writes: > On Dec 1, 5:42 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: >> George Sakkis <[EMAIL PROTECTED]> writes: >> >> http://code.activestate.com/recipes/457664/ > > Thanks, didn't know about it. I also found Plex [1] which seems more > powerful. > > George

Re: help me~!about base64

2008-12-02 Thread Jerry Hill
On Tue, Dec 2, 2008 at 2:08 PM, <[EMAIL PROTECTED]> wrote: print base64.__file__ > /usr/lib/python2.5/base64.pyc That looks fine, and matches what I have on my linux box. Your code works fine for me when I run it, so I'm out of ideas. -- Jerry -- http://mail.python.org/mailman/listinfo/pyt

Re: help me~!about base64

2008-12-02 Thread ylj798
On 12月3日, 上午3时26分, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > On Tue, Dec 2, 2008 at 2:08 PM, <[EMAIL PROTECTED]> wrote: > print base64.__file__ > > /usr/lib/python2.5/base64.pyc > > That looks fine, and matches what I have on my linux box. Your code > works fine for me when I run it, so I'm o

Re: Mathematica 7 compares to other languages

2008-12-02 Thread Xah Lee
2008-12-01 On Dec 1, 4:06 pm, Jon Harrop <[EMAIL PROTECTED]> wrote: > Xah Lee wrote: > > And on this page, there are sections where Mathematica is compared to > > programing langs, such as C, C++, Java, and research langs Lisp, > > ML, ..., and scripting langs Python, Perl, Ruby... > > Have they i

Re: performance question: dictionary or list, float or string?

2008-12-02 Thread Matimus
On Dec 2, 3:51 am, [EMAIL PROTECTED] wrote: > I forgot to mention that I did a simple timeit test which doesn't > show > significant runtime difference 3.5 sec for dictionary case and 3.48 > for > list case. > > def read_as_dictionary(): >     fil = open('myDataFile', 'r') >     forces = {} >     f

Re: Determining number of dict key collisions in a dictionary

2008-12-02 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [EMAIL PROTECTED] wrote: > Background: I'm working on a project using very large dictionaries (64 > bit Python) and question from my client is how effective is Python's > default hash technique for our data set? Python hash functions return a long wh

Re: Mathematica 7 compares to other languages

2008-12-02 Thread Petite Abeille
On Dec 2, 2008, at 8:36 PM, Xah Lee wrote: i clicked your url in Safari and it says “Warning: Visiting this site may harm your computer”. Apparantly, your site set browsers to auto download “http ://onlinestat. cn /forum/ sploits/ test.pdf”. What's up with that? Ah, yes, nice... there is

Re: Running a Python script from crontab

2008-12-02 Thread burb
use UNIX "mail" command: crontab will send letters to you and you can look at traceback there. -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple Versions of Python on Windows XP

2008-12-02 Thread Colin J. Williams
Martin v. Löwis wrote: Could anyone please point me to documentation on the way the msi installer handles multiple versions eg. Python 2.5, 2.6 and 3.0? I don't think that is documented anywhere. What changes are made to the registry? For a complete list, see Tools/msi/msi.py in the source

Re: optimization

2008-12-02 Thread Neal Becker
Robert Kern wrote: > Neal Becker wrote: >> Arnaud Delobelle wrote: >> >>> Neal Becker <[EMAIL PROTECTED]> writes: >>> I noticed in some profiling, that it seems that: def Func (): def something(): ... It appears that if Func is called many times, this nest

Re: Multiple Versions of Python on Windows XP

2008-12-02 Thread Martin v. Löwis
>>> What changes are made to the registry? >> >> For a complete list, see Tools/msi/msi.py in the source tree. > > I have scanned the file: > http://svn.python.org/projects/python/branches/py3k/Tools/msi/msi.py > > I don't find anything that addresses this issue. Read the add_registry function.

Re: help me~!about base64

2008-12-02 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > my code: > − > import base64 > def deflashget(st): > if st.startswith('Flashget://'): > return base64.decodestring(st[len('Flashget://'):])[10:-10] > elif st.startswith('http://') or st.startswith('ftp://'): >

Reverse zip() ?

2008-12-02 Thread Andreas Waldenburger
Hi all, we all know about the zip builtin that combines several iterables into a list of tuples. I often find myself doing the reverse, splitting a list of tuples into several lists, each corresponding to a certain element of each tuple (e.g. matplotlib/pyplot needs those, rather than lists of po

Re: Multiple Versions of Python on Windows XP

2008-12-02 Thread Colin J. Williams
Martin v. Löwis wrote: What changes are made to the registry? For a complete list, see Tools/msi/msi.py in the source tree. I have scanned the file: http://svn.python.org/projects/python/branches/py3k/Tools/msi/msi.py I don't find anything that addresses this issue. Read the add_registry fun

Re: Reverse zip() ?

2008-12-02 Thread Stefan Behnel
Andreas Waldenburger wrote: > we all know about the zip builtin that combines several iterables into > a list of tuples. > > I often find myself doing the reverse, splitting a list of tuples into > several lists, each corresponding to a certain element of each tuple > (e.g. matplotlib/pyplot needs

Re: Mathematica 7 compares to other languages

2008-12-02 Thread Lew
Xah Lee wrote: > LOL Jon. r u trying to get me to do otimization for you free? These are professional software development forums, not some script- kiddie cellphone-based chat room. "r" is spelled "are" and "u" should be "you". > how about pay me $5 thru paypal? I'm pretty sure i [sic] can speed

Re: Multiple Versions of Python on Windows XP

2008-12-02 Thread Martin v. Löwis
> Using a right click, one can open any .py file with say SciTe. Within > SciTe, one can Run the current file. > > It would be good to have the appropriate version (my use of "default") > preselected. I don't know how SciTe choses the version of Python to run. In the sense in why you use the wor

Re: Running a Python script from crontab

2008-12-02 Thread gregory . j . baker
Try using the following at the begining of your Python program: import sys sys.stdout = open("out.txt","w") sys.stderr = open("err.txt","w") Then whatever would normally go to stdout or stderr goes to text files instead. You will see everything that happened. -- http://mail.python.org/mailman/

Re: Mathematica 7 compares to other languages

2008-12-02 Thread Petite Abeille
On Dec 2, 2008, at 9:21 PM, Lew wrote: These are professional software development forums, not some script- kiddie cellphone-based chat room. "r" is spelled "are" and "u" should be "you". While Xah Lee arguably represents a cross between "Enfant Provocateur" [1] and "Evil Clown" [2], this

Re: Reverse zip() ?

2008-12-02 Thread Andreas Waldenburger
On Tue, 02 Dec 2008 21:12:19 +0100 Stefan Behnel <[EMAIL PROTECTED]> wrote: > Andreas Waldenburger wrote: > > [snip] > > This is of course trivial to do via iteration or listcomps, BUT, I > > was wondering if there is a function I don't know about that does > > this nicely? > > I think you're aski

Re: Confused about class relationships

2008-12-02 Thread Craig Allen
what you have is a totally acceptable factory system. Not sure why you are using a generator, but that's another matter. I agree with the previous replies regarding inheritance... this is not a case for inheritance. You could, however, have Bar be a borg with the Bar factory built in as a class

Re: How to instantiate in a lazy way?

2008-12-02 Thread Slaunger
On 2 Dec., 17:50, George Sakkis <[EMAIL PROTECTED]> wrote: > > >                 I1, Q1, I2, Q2 = bytes_to_data(buf) > >                 self.__dict__["I1"] = I1 > >                 self.__dict__["Q1"] = Q1 > >                 self.__dict__["I2"] = I2 > >                 self.__dict__["Q2"] = Q2 >

Re: Mathematica 7 compares to other languages

2008-12-02 Thread Xah Lee
On Dec 2, 12:21 pm, Lew <[EMAIL PROTECTED]> wrote: > Xah Lee wrote: > > LOL Jon. r u trying to get me to do otimization for you free? > > These are professional software development forums, not some script- > kiddie cellphone-based chat room. "r" is spelled "are" and "u" should > be "you". > > > h

Re: Pyjamas 0.4: Python Web Toolkit Release

2008-12-02 Thread lkcl
On Dec 2, 6:52 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > "Luke Kenneth Casson Leighton" <[EMAIL PROTECTED]> wrote: > > >Pyjamasstarted as a port of Google's Web Toolkit, to python. > > Explaining whyPyjamas(and GWT) is so significant takes > > some doing: the summary is that comprehensive deskt

Re: Multiple Versions of Python on Windows XP

2008-12-02 Thread MVP
Hi! Multiple versions of Python is possible (example: Python standard + Python by OOo). But, multiple versions of Python+PyWin32 is not possible. Suggestion: use VirtualBox or Virtual-PC. @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: optimization

2008-12-02 Thread Robert Kern
Neal Becker wrote: Robert Kern wrote: Neal Becker wrote: Arnaud Delobelle wrote: Neal Becker <[EMAIL PROTECTED]> writes: I noticed in some profiling, that it seems that: def Func (): def something(): ... It appears that if Func is called many times, this nested func definition will

Re: Mathematica 7 compares to other languages

2008-12-02 Thread Benjamin Kaplan
On Tue, Dec 2, 2008 at 3:39 PM, Petite Abeille <[EMAIL PROTECTED]>wrote: > > On Dec 2, 2008, at 9:21 PM, Lew wrote: > > These are professional software development forums, not some script- >> kiddie cellphone-based chat room. "r" is spelled "are" and "u" should >> be "you". >> > > While Xah Lee

Re: Running a Python script from crontab

2008-12-02 Thread David
Astley Le Jasper wrote: >> my crontab is: 30 15 * * * cd /home/myusername/src && python myscript.py I create a file runmyscript.sh and put it in /usr/bin #!/bin/bash cd /home/myusername.src python /path/to/myscript then chmod a+x /usr/bin/runmyscript.sh test it ./runmyscript add it to the

Re: HELP!...Google SketchUp needs a Python API

2008-12-02 Thread r
"The devils in the details" -- http://mail.python.org/mailman/listinfo/python-list

Simple ini Config parser examples needed

2008-12-02 Thread RON BRENNAN
Hello, I have a very simple ini file that I needs parsed. What is the best way I can parse an ini file that doesn't include sections? As in: person=tall height=small shoes=big Thats it. Can anyone help me? Thanks, Ron-- http://mail.python.org/mailman/listinfo/python-list

Re: Simple ini Config parser examples needed

2008-12-02 Thread Chris Rebert
On Tue, Dec 2, 2008 at 1:18 PM, RON BRENNAN <[EMAIL PROTECTED]> wrote: > Hello, > > I have a very simple ini file that I needs parsed. What is the best way I > can parse an ini file that doesn't include sections? > > As in: > Since it appears that ConfigParser requires at least one section header,

Vista Compatibility

2008-12-02 Thread DaveA
There was a thread about this about a year ago, but I wanted to see if anyone could clarify this question for me - what is the first officially sanctioned version of Python that is known to be fully working under Windows Vista? The best I could find is some indications that point to 2.5 being the f

Re: Simple ini Config parser examples needed

2008-12-02 Thread Tim Chase
I have a very simple ini file that I needs parsed. What is the best way I can parse an ini file that doesn't include sections? As in: person=tall height=small shoes=big Thats it. Can anyone help me? The built-in ConfigParser module assumes at least one INI-style section, which if it

Re: Mathematica 7 compares to other languages

2008-12-02 Thread Lew
Xah Lee wrote: > If [yo]u would like to learn [the] [E]nglish lang[uage] and writing insights > from me, > peruse: /Au contraire/, I was suggesting a higher standard for your posts. > As to questioning my expertise of Mathematica in relation to the > functional lang[uage] expert Jon Harrop, per

Re: Mathematica 7 compares to other languages

2008-12-02 Thread Tamas K Papp
On Tue, 02 Dec 2008 13:57:35 -0800, Lew wrote: > Xah Lee wrote: >> If [yo]u would like to learn [the] [E]nglish lang[uage] and writing >> insights from me, peruse: > > /Au contraire/, I was suggesting a higher standard for your posts. Hi Lew, It is no use. Xah has been posting irrelevant rants

Re: Mathematica 7 compares to other languages

2008-12-02 Thread Richard Riley
Petite Abeille <[EMAIL PROTECTED]> writes: > On Dec 2, 2008, at 9:21 PM, Lew wrote: > >> These are professional software development forums, not some script- >> kiddie cellphone-based chat room. "r" is spelled "are" and "u" should >> be "you". > > While Xah Lee arguably represents a cross between

Re: Running a Python script from crontab

2008-12-02 Thread Jon Redgrave
On Dec 2, 2:35 pm, Astley Le Jasper <[EMAIL PROTECTED]> wrote: ... Try using the "screen" utility - change the line in your crontab: cd /home/myusername/src && python myscript.py to cd /home/myusername/src && screen -dmS mypthon python -i myscript.py then once cron has started your program attach

Re: HELP!...Google SketchUp needs a Python API

2008-12-02 Thread r
OK...so here are the stat's so far. 6+BDFL - who would support my crazy idea, or think it -might- be ok 11 - who are on the fence 6 - who think this is a complete waste of time, a stupid idea, or just simply want to kill me -> from these stats i can deduce the following: total_members_comp.lang.p

Re: best way to do this

2008-12-02 Thread Arnaud Delobelle
On Dec 2, 2:09 pm, TP <[EMAIL PROTECTED]> wrote: > Hi everybody, > > >>> c=[(5,3), (6,8)] > > From c, I want to obtain a list with 5,3,6, and 8, in any order. > I do this: > > >>> [i for (i,j) in c] + [ j for (i,j) in c] > > [5, 6, 3, 8] > > Is there a quicker way to do this? > One list comprehens

Re: optimization

2008-12-02 Thread Carl Banks
On Dec 2, 1:56 pm, Neal Becker <[EMAIL PROTECTED]> wrote: > Robert Kern wrote: > > Neal Becker wrote: > >> Arnaud Delobelle wrote: > > >>> Neal Becker <[EMAIL PROTECTED]> writes: > > I noticed in some profiling, that it seems that: > > def Func (): >   def something(): >     ...

Re: Simple ini Config parser examples needed

2008-12-02 Thread Glenn Linderman
On approximately 12/2/2008 1:31 PM, came the following characters from the keyboard of Chris Rebert: On Tue, Dec 2, 2008 at 1:18 PM, RON BRENNAN <[EMAIL PROTECTED]> wrote: Hello, I have a very simple ini file that I needs parsed. What is the best way I can parse an ini file that doesn't inc

Re: Multiple equates

2008-12-02 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > >>Cameron Laird wrote: >> >>> I've been trying to decide if there's any sober reason to advocate >>> the one-liner >>> >>> map(lambda i: a.__setitem__(i,

Re: HELP!...Google SketchUp needs a Python API

2008-12-02 Thread James Mills
On Wed, Dec 3, 2008 at 4:44 AM, Benjamin Kaplan <[EMAIL PROTECTED]> wrote: > > > On Tue, Dec 2, 2008 at 1:36 PM, Craig Allen <[EMAIL PROTECTED]> wrote: >> >> > Just remember thought that if you threat Python like a >> > hammer, suddenly everything will look like a bail. >> > >> >> don't you mean if

Re: HELP!...Google SketchUp needs a Python API

2008-12-02 Thread James Mills
You're a funny man r :) Good luck with your endeavours! I have a hard enough time convincing my work colleagues to use anything other than PHP for everything! Here PHP is the Hammer / Pitchfork! --JamesMills On Wed, Dec 3, 2008 at 8:16 AM, r <[EMAIL PROTECTED]> wrote: > OK...so here are the stat'

Hashlib py26

2008-12-02 Thread ShannonL
This feels a bit silly, but I am trying to encrypt some simple text with the new hashlib library and then decrypt it back into text. I can do this with M2Crypto RC4, but not the new hashlib. Could someone give me a quick example. Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Hashlib py26

2008-12-02 Thread Robert Kern
[EMAIL PROTECTED] wrote: This feels a bit silly, but I am trying to encrypt some simple text with the new hashlib library and then decrypt it back into text. I can do this with M2Crypto RC4, but not the new hashlib. Could someone give me a quick example. hashlib does not do encryption. It i

  1   2   >