Re: Case-Insensitive Sorting of Multi-Dimensional Lists

2007-06-08 Thread Hendrik van Rooyen
"Joe" <[EMAIL PROTECTED]> wrote: > I am new to lambda and have searched for a few hours this morning, coming up > empty handed. Is this possible? Seeing as it has happened, it must be. - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-08 Thread Gabriel Genellina
En Sat, 09 Jun 2007 02:49:03 -0300, WaterWalk <[EMAIL PROTECTED]> escribió: > I've just read an article "Building Robust System" by Gerald Jay > Sussman. The article is here: > http://swiss.csail.mit.edu/classes/symbolic/spring07/readings/robust-systems.pdf > > In it there is a footprint which s

Re: VIM editor question

2007-06-08 Thread Jerry VanBrimmer
In your vim configuration file enter: colorscheme Example: colorscheme elflord Restart vim. On 6/8/07, David <[EMAIL PROTECTED]> wrote: > Is anyone in the group familiar with the VIM editor? I rather like it but > any time I right click on a file and select "Edit with Vim" It opens the >

Re: Dealing with dictionary like strings

2007-06-08 Thread Gabriel Genellina
En Fri, 08 Jun 2007 19:23:38 -0300, Mr SZ <[EMAIL PROTECTED]> escribió: > I'm using the urllib module to fetch pages from the web.The returned > response is in the structure of a dictionary .For eg: > > {"":"","label": [ > ] > ,"torrents": [ > > ["F0666BDCCBFD01A52535759C044485E2E1CCE3C3",136,

Python's "only one way to do it" philosophy isn't good?

2007-06-08 Thread WaterWalk
I've just read an article "Building Robust System" by Gerald Jay Sussman. The article is here: http://swiss.csail.mit.edu/classes/symbolic/spring07/readings/robust-systems.pdf In it there is a footprint which says: "Indeed, one often hears arguments against building exibility into an engineered sy

VIM editor question

2007-06-08 Thread David
Is anyone in the group familiar with the VIM editor? I rather like it but any time I right click on a file and select "Edit with Vim" It opens the file in a rather ugly default color scheme. I'd love to know how to make it automatically open files I select in my favorite color scheme rather t

Re: Working with fixed format text db's

2007-06-08 Thread [EMAIL PROTECTED]
On Jun 8, 6:18?pm, Ben Finney <[EMAIL PROTECTED]> wrote: > Neil Cerutti <[EMAIL PROTECTED]> writes: > > I was hoping for a module that provides a way for me to specify a > > fixed file format, along with some sort of interface for writing and > > reading files that are in said format. > > Isn't tha

Re: read xml file from compressed file using gzip

2007-06-08 Thread Gabriel Genellina
En Fri, 08 Jun 2007 10:00:58 -0300, flebber <[EMAIL PROTECTED]> escribió: >> I will, baby steps at the moment for me at the moment though as I am >> only learning and can't get gzip to work Try reading some tutorial from http://wiki.python.org/moin/BeginnersGuide -- Gabriel Genellina -- htt

Re: Gzip - gunzip using zlib

2007-06-08 Thread Paul Rubin
flebber <[EMAIL PROTECTED]> writes: > Hi Can anyone show me a working example of how to use gzip to > decompress a file. I have read the docs at python.org and had many > goes at it but just can't get it to work. Untested in this instance, but this is how I usually do it: import gzip z =

Gzip - gunzip using zlib

2007-06-08 Thread flebber
Hi Can anyone show me a working example of how to use gzip to decompress a file. I have read the docs at python.org and had many goes at it but just can't get it to work. Cheers flebber -- http://mail.python.org/mailman/listinfo/python-list

Re: The Concepts and Confusions of Prefix, Infix, Postfix and Fully Functional Notations

2007-06-08 Thread Twisted
On Jun 8, 7:30 pm, "Jürgen Exner" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > [nothing relevant to Perl] Perl?? Perl is even less relevant to Java than the original post, which admittedly has some connection to pretty much all programming languages. (Perl, on the other hand, has no c

PythonS?

2007-06-08 Thread Michel Claveau
Hi! Python, Iron-Python, Jython, StackLess-Python, Monty-Python, Movable-Python, etc. Shouldn't add a "S" to the end of "Python"? See: http://www.jfwilliam.com/Sites/1473/Python.jpg The fact of adding a "S" could constitute a PEP. for classification, I propose: PEP'S -- @-salutatio

Re: Could someone show me a sample how to flush the socket sending buffer? Thanks a lot.

2007-06-08 Thread Jean-Paul Calderone
On Fri, 08 Jun 2007 15:36:30 -0700, mike <[EMAIL PROTECTED]> wrote: >I have called the setsockopt() to set no delay after connecting like >this way: > >s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) >s.connect(('192.168.10.1', 21980)) >s.setsockopt(socket.SOL_TCP, soc

Re: Working with fixed format text db's

2007-06-08 Thread Frank Swarbrick
Neil Cerutti wrote: > The underlying problem, of course, is the archaic flat-file > format with fixed-width data fields. Even the Department of > Education has moved on to XML for most of it's data files, which > are much simpler for me to parse. XML easier to parse than fixed position file. Wow!

Re: Working with fixed format text db's

2007-06-08 Thread John Machin
On Jun 9, 7:55 am, Jeremy C B Nicoll <[EMAIL PROTECTED]> wrote: > Neil Cerutti <[EMAIL PROTECTED]> wrote: > > On 2007-06-08, Jeremy C B Nicoll <[EMAIL PROTECTED]> wrote: > > > Neil Cerutti <[EMAIL PROTECTED]> wrote: > > >> Luckily, the output format has not changed yet, so issues with > > >> mainta

Re: DAO and Access97 WHERE clause fails

2007-06-08 Thread John Machin
On Jun 9, 10:17 am, "v.davis2" <[EMAIL PROTECTED]> wrote: > Hi all, > > I am attempting to use Access97 as the database to hold the results of a > python script. I seem to be able to make simple SELECT clauses work (like > SELECT * FROM TableName), but have not been able to figure out how to add a

RE: Obtaining hte currently running script under windows

2007-06-08 Thread Ryan Ginstrom
> On Behalf Of Sean Farrow > Is there any way to obtain the full path to the currently > running script under win32? > I am using the pythonw.exe file is that helps. > Sean. Current working directory is not always reliable. There is a __file__ variable set if python.exe runs your script. import

DAO and Access97 WHERE clause fails

2007-06-08 Thread v.davis2
Hi all, I am attempting to use Access97 as the database to hold the results of a python script. I seem to be able to make simple SELECT clauses work (like SELECT * FROM TableName), but have not been able to figure out how to add a WHERE clause to that (e.g., SELECT * FROM TableName WHERE myFiel

Re: Working with fixed format text db's

2007-06-08 Thread Jeremy C B Nicoll
Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-06-08, Jeremy C B Nicoll <[EMAIL PROTECTED]> wrote: > > Neil Cerutti <[EMAIL PROTECTED]> wrote: > >> Luckily, the output format has not changed yet, so issues with > >> maintaining the above haven't arisen. > > > > The problem surely is that when y

Re: Bragging about Python

2007-06-08 Thread Richard Jones
Steve Howell wrote: > --- Szabolcs Nagy <[EMAIL PROTECTED]> wrote: >> >> actually i don't like when a tutorial uses over >> complicated cute names >> if the context is obvious (fibonacci) then we don't >> need to add >> 'parent_rabbits' and such identifiers > > I still prefer the use of "rabbits,

Re: interating over single element array

2007-06-08 Thread Basilisk96
On Jun 8, 11:54 am, "T. Crane" <[EMAIL PROTECTED]> wrote: > >> any suggestions are appreciated, > > > Yes, don't try iterating over objects that are not iterable. ;-) > > Ah, yes... I hadn't thought of that :) > > thanks, > trevis > > > > > What you *can* do is iterating over lists, tuples or othe

Re: The Concepts and Confusions of Prefix, Infix, Postfix and Fully Functional Notations

2007-06-08 Thread J�rgen Exner
[EMAIL PROTECTED] wrote: [nothing relevant to Perl] Oh no, it is back. Did your ISP finally cancel your old account or why are you switching to a new address? Don't try to disguise yourself. Your 'contributions' can easily be identified no matter what pseudonym you are using. ***PLONK AGAIN***

Re: Working with fixed format text db's

2007-06-08 Thread Ben Finney
Neil Cerutti <[EMAIL PROTECTED]> writes: > I was hoping for a module that provides a way for me to specify a > fixed file format, along with some sort of interface for writing and > reading files that are in said format. Isn't that done by the 'struct' module http://www.python.org/doc/lib/module-

Re: Tkinter custom drawing

2007-06-08 Thread James Stroud
Xavier Bérard wrote: >>>Now, the problem, is that I have already plenty of widgets on my >>>screen. I just want to draw over them, which is a bit difficult in my >>>comprehension of things. >> >>What are you trying to achieve by "drawing over" widgets? > > > > Want I want to do is a sort of GUI

Re: Case-Insensitive Sorting of Multi-Dimensional Lists

2007-06-08 Thread Ben Finney
mosscliffe <[EMAIL PROTECTED]> writes: > I have tried the following, for a one dimensional list and it works, > but I can not get my head around this lambda. How would this be > written, without the lamda ? > > mylist = ['Fred','bill','PAUL','albert'] > > mylist.sort(key=lambda el: el.lower()) He

Could someone show me a sample how to flush the socket sending buffer? Thanks a lot.

2007-06-08 Thread mike
I have called the setsockopt() to set no delay after connecting like this way: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(('192.168.10.1', 21980)) s.setsockopt(socket.SOL_TCP, socket.TCP_NODELAY, 0) s.send("[EMAIL PROTECTED]") s.send("[E

Re: Splitting SAX results

2007-06-08 Thread Jerry Hill
On 6/8/07, IamIan <[EMAIL PROTECTED]> wrote: > Well SAX isn't the problem... maybe I should repost this with a > different title. The SAX part works just as I want, but the results I > get back need to be manipulated. No matter what I try I can't split a > result like 'Title 1:Description' on the c

Dealing with dictionary like strings

2007-06-08 Thread Mr SZ
Hello all, I'm using the urllib module to fetch pages from the web.The returned response is in the structure of a dictionary .For eg: {"":"","label": [ ] ,"torrents": [ ["F0666BDCCBFD01A52535759C044485E2E1CCE3C3",136,"AAA",1250164864,651,646185088,606208,0,0,0,-1,"",0,0,0,0,33564,7,342884352], [

Re: converting an int to a string

2007-06-08 Thread John Machin
On Jun 9, 1:40 am, Sean Farrow <[EMAIL PROTECTED]> wrote: > Hi: > I have the folling code: > def parseTime(self, time): > minutes =int(float(time)/60) > seconds =int(float(time)-minutes*60) > minutes =str(minutes) > seconds =st

Re: Bragging about Python (8 queens)

2007-06-08 Thread Steve Howell
--- Paul McGuire <[EMAIL PROTECTED]> wrote: > > > > So I'm throwing down the gauntlet--can somebody > write > > a short program (maybe 10 to 20 lines) where you > solve > > a problem more simply than a similar > > non-generator-using solution would solve it? > Maybe > > something like Eight Queen

Re: Case-Insensitive Sorting of Multi-Dimensional Lists

2007-06-08 Thread mosscliffe
On 8 Jun, 16:39, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, mosscliffe > wrote: > > > I have tried the following, for a one dimensional list and it works, > > but I can not get my head around this lambda. How would this be > > written, without the lamda ? > > Well

Re: How to use TLS lite

2007-06-08 Thread Jean-Paul Calderone
On Sat, 9 Jun 2007 05:58:41 +1000 (EST), Mr SZ <[EMAIL PROTECTED]> wrote: >I'm using tls lite to send mail using gmail's smtp.This is what I've done: > >from tlslite.api import * >import tlslite.integration.SMTP_TLS >connection= tlslite.integration.SMTP_TLS.SMTP_TLS('smtp.gmail.com',587) >connecti

Re: Tkinter custom drawing

2007-06-08 Thread James Stroud
Xavier Bérard wrote: >>from Tkinter import Invisiblecanvas > > > ? > > The whole web never mentions this Invisiblecanvas. > Do you have anything alike to share ? ;) > > Xavier > I figured that if you were sincere, you'd call me on this one. -- http://mail.python.org/mailman/listinfo/python-

Re: Splitting SAX results

2007-06-08 Thread IamIan
Well SAX isn't the problem... maybe I should repost this with a different title. The SAX part works just as I want, but the results I get back need to be manipulated. No matter what I try I can't split a result like 'Title 1:Description' on the colon without getting an IndexError. Ideas anyone? --

Re: launching default browser

2007-06-08 Thread half . italian
On Jun 8, 8:41 am, alf <[EMAIL PROTECTED]> wrote: > Hi, > > I wonder how to launch from python default Windows browser? In fact I > have the same question for Linux. > > thx in advancve, > -- > alf For posterity... On a mac [sean:~] sean% open http://www.google.com ~Sean -- http://mail.python.

Re: The Concepts and Confusions of Prefix, Infix, Postfix and Fully Functional Notations

2007-06-08 Thread [EMAIL PROTECTED]
How Purely Nested Notation Limits The Language's Utility [The full HTML formatted article is available at: http://xahlee.org/UnixResource_dir/writ/notations.html ] 2007-05-03 There is a common complain by programers about lisp's notation, of nested parenthesis, being unnatural or difficult to re

RE: Case-Insensitive Sorting of Multi-Dimensional Lists

2007-06-08 Thread Joe
> > Now, I would like to be able to specify which index to sort by. I am > not > > able to pass in external variables like: > > > > List.sort(key=lambda el: el[indexNumber].lower()) > > Why ever not? Sorry, I should have written back with my findings. I had run into the problem described in thi

Re: Case-Insensitive Sorting of Multi-Dimensional Lists

2007-06-08 Thread Simon Brunning
On 6/8/07, Joe <[EMAIL PROTECTED]> wrote: > Now, I would like to be able to specify which index to sort by. I am not > able to pass in external variables like: > > List.sort(key=lambda el: el[indexNumber].lower()) Why ever not? -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net

Re: Binary / SOAPpy

2007-06-08 Thread Tim Golden
Robert Rawlins - Think Blue wrote: > I have a WebService call which returns an array, the first element in > that array is the binary for a zip file, however I’m having trouble > writing that binary string into an actual file when it arrives, I’ve > tried the following method. > > Result = call

Re: python integration

2007-06-08 Thread Bjoern Schliessmann
Dee Asbury wrote: > I am looking for a method to integrate in Python, my problem is > that I do not want the summed up result. I need the result in the > form of a list (or array) with the x-values (or ranges) and the > volume beneath that section of the curve only. Why don't you then split up y

Re: FTP/SSL

2007-06-08 Thread billiejoex
On 8 Giu, 16:54, "Dave Borne" <[EMAIL PROTECTED]> wrote: > > I'm trying to figure out how to use FTP/SSL (FTPS) - just as a client. Can I > > do this in Python? Is everything I need in ftplib? Where else do I look? And > > - any good newbie references on using FTPS? > > Hi, Nancy, > I'm not sure i

How to use TLS lite

2007-06-08 Thread Mr SZ
I'm using tls lite to send mail using gmail's smtp.This is what I've done: from tlslite.api import * import tlslite.integration.SMTP_TLS connection= tlslite.integration.SMTP_TLS.SMTP_TLS('smtp.gmail.com',587) connection.set_debuglevel(1) msg = "Subject:Testing \n Hello" connection.starttls('[EMAIL

Re: how to do reading of binary files?

2007-06-08 Thread Roger Miller
On Jun 8, 2:07 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> ... > > What has the searching to do with the reading? 10MB easily fit into the > main memory of a decent PC, so just do > > contents = open("file").read() # yes I know I should close the file... > > print contents.find('\x0c') >

Re: Binary

2007-06-08 Thread Jerry Hill
Brian, I'm including the list back in on this reply, so that more than just me can see your message and potentially help out. On 6/8/07, Brain Murphy <[EMAIL PROTECTED]> wrote: > > this is what i have so far. > x= 100 > b=2 > while x > 0: > print x > x=divmod(x,b) > > the problem is that s

Re: Working with fixed format text db's

2007-06-08 Thread Mark Carter
Neil Cerutti wrote: > The underlying problem, of course, is the archaic flat-file > format with fixed-width data fields. Even the Department of > Education has moved on to XML for most of it's data files, :( I'm writing a small app, and was wondering the best way to store data. Currently the fi

Re: Verify server certificate in HTTPS transaction

2007-06-08 Thread John Nagle
I struggled with that months ago. The SSL library that ships with Python is primitive, but M2Crypto can do that. M2Crypto will actually verify the certificate chain. The documentation is weak, it's hard to build, and there are bugs, but it's the best Python has right now.

Repository - file scanner

2007-06-08 Thread HMS Surprise
Greetings, Could someone point my muddled head at a/the python repository. I know that one exists but cannot find it again. In particular I am looking for a standalone search tool that given a path searches files for a text string. Thanks, jvh -- http://mail.python.org/mailman/listinfo/python

Re: compiling python and calling it from C/C++

2007-06-08 Thread Russ
Diez B. Roggisch wrote: > Russ schrieb: > > Is it possible to compile python code into a library (on unix), then > > link to it and call it from C/C++? If so, where can I learn how. > > You can't compile python, but what you can do is create a > library-wrapping around it using elmer which will ma

Re: Working with fixed format text db's

2007-06-08 Thread Neil Cerutti
On 2007-06-08, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, Neil Cerutti wrote: > >> new = file("new.dat", "w") >> if not new: >> print "Error. Could not open file new.dat for writing." >> raw_input("Press Return To Exit.") >> sys.exit(1) > > Hey, Python

Re: Bug/Weak Implementation? popen* routines can't handle simultaneous read/write?

2007-06-08 Thread dmoore
On Jun 8, 12:30 pm, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > Windows has a really strange idea of non-blocking IO - it uses > something called overlapped io. You or in the FILE_FLAG_OVERLAPPED > flag when you create the file/pipe. You then pass in overlap buffers > for reading writing. > the

Re: Working with fixed format text db's

2007-06-08 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Neil Cerutti wrote: > new = file("new.dat", "w") > if not new: > print "Error. Could not open file new.dat for writing." > raw_input("Press Return To Exit.") > sys.exit(1) Hey, Python is not C. File objects should *always* be "true". An error is handled via e

Re: wxPython / Dabo demo shell ?

2007-06-08 Thread Stef Mientki
Ed Leafe wrote: > On Jun 8, 2007, at 10:01 AM, stef wrote: > >> I'm interested in the overall demo setup, >> really beautiful and powerful, just one thing missing (user configurable >> tree). >> >> And if you can copy it, >> I'm allowed to do so also ;-) > > You can certainly copy and customi

Re: Working with fixed format text db's

2007-06-08 Thread Neil Cerutti
On 2007-06-08, Jeremy C B Nicoll <[EMAIL PROTECTED]> wrote: > Neil Cerutti <[EMAIL PROTECTED]> wrote: >> Luckily, the output format has not changed yet, so issues with >> maintaining the above haven't arisen. > > The problem surely is that when you want to change the format > you have to do so in a

Re: Working with fixed format text db's

2007-06-08 Thread Jeremy C B Nicoll
Neil Cerutti <[EMAIL PROTECTED]> wrote: > Luckily, the output format has not changed yet, so issues with > maintaining the above haven't arisen. The problem surely is that when you want to change the format you have to do so in all files (and what about the backups then?) and all programs simulta

Re: Pyrex problem with cdef'd attribute

2007-06-08 Thread skip
>> I'm using Pyrex 0.9.5.1a. I have this simple Pyrex module: Klaas> You might get more help on the pyrex list. Thanks. On the Pyrex website it says that questions are welcome here as well. I was hoping to avoid yet another mailing list subscription. ;-) Klaas> Yes, since you did

Re: Obtaining hte currently running script under windows

2007-06-08 Thread kyosohma
On Jun 8, 8:45 am, Sean Farrow <[EMAIL PROTECTED]> wrote: > Hi: > Is there any way to obtain the full path to the currently running script > under win32? > I am using the pythonw.exe file is that helps. > Sean. Check out Google! I found the following link by typing "python os cwd" http://aspn.act

Re: Pyrex problem with cdef'd attribute

2007-06-08 Thread Klaas
On Jun 8, 6:00 am, [EMAIL PROTECTED] wrote: > I'm using Pyrex 0.9.5.1a. I have this simple Pyrex module: You might get more help on the pyrex list. > cdef class Foo: > cdef public char attr > > def __init__(self): > self.attr = 0 > > class Bar(Foo): >

Re: Tkinter - Force toplevel window to stay on top of Tk() window

2007-06-08 Thread kyosohma
On Jun 8, 11:48 am, [EMAIL PROTECTED] wrote: > Hi, > I have a Tk() window "base_win = Tk()" with multiple frames on it > having a combination of widgets. If I click on say a button widget > which launches a new top level window "new_win = TopLevel()", I was > looking for a way for this "new_win" to

Re: python-ldap for Python 2.5 on Windows?

2007-06-08 Thread Waldemar Osuch
On Jun 8, 6:36 am, Benedict Verheyen <[EMAIL PROTECTED]> wrote: > Hi, > > i found python-ldap for version Python 2.4. > Is there i place i can find a version for 2.5? > > If not, how can i build it myself for Windows? > I have managed to build it for myself using MinGW: http://www.osuch.org-a.goog

Re: converting an int to a string

2007-06-08 Thread Paul McGuire
On Jun 8, 10:40 am, Sean Farrow <[EMAIL PROTECTED]> wrote: > Hi: > I have the folling code: > def parseTime(self, time): > minutes =int(float(time)/60) > seconds =int(float(time)-minutes*60) > minutes =str(minutes) > seconds =s

Re: python integration

2007-06-08 Thread Terry Reedy
"Dee Asbury" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |I am looking for a method to integrate in Python, my problem is that I | do not want the summed up result. I need the result in the form of a | list (or array) with the x-values (or ranges) and the volume beneath | that se

Tkinter - Force toplevel window to stay on top of Tk() window

2007-06-08 Thread rahulnag22
Hi, I have a Tk() window "base_win = Tk()" with multiple frames on it having a combination of widgets. If I click on say a button widget which launches a new top level window "new_win = TopLevel()", I was looking for a way for this "new_win" to always stay on top of "base_win" till I close "new_win

Re: launching default browser

2007-06-08 Thread Laurent Pointal
alf wrote: > Hi, > > I wonder how to launch from python default Windows browser? In fact I > have the same question for Linux. > > thx in advancve, Via webbrowser module http://docs.python.org/lib/module-webbrowser.html (note: its in top five in google search for Python + launch + browser...)

Re: Bug/Weak Implementation? popen* routines can't handle simultaneous read/write?

2007-06-08 Thread Nick Craig-Wood
Noah <[EMAIL PROTECTED]> wrote: > On Jun 7, 9:01 am, dmoore <[EMAIL PROTECTED]> wrote: > > popen and friends will never do what you want it to do. Down that path > lies bitter disappointment. > You need pseduo-ttys and non-blocking IO. I don't know how to do this > on Windows, but I know it's

python integration

2007-06-08 Thread Dee Asbury
I am looking for a method to integrate in Python, my problem is that I do not want the summed up result. I need the result in the form of a list (or array) with the x-values (or ranges) and the volume beneath that section of the curve only. Thanks in advance Dee -- http://mail.python.org/mai

RE: Case-Insensitive Sorting of Multi-Dimensional Lists

2007-06-08 Thread Joe
> Try: > > list.sort(key=lambda el: el[0].lower()) Now, I would like to be able to specify which index to sort by. I am not able to pass in external variables like: List.sort(key=lambda el: el[indexNumber].lower()) I am new to lambda and have searched for a few hours this morning, coming up em

Re: interating over single element array

2007-06-08 Thread T. Crane
> >> any suggestions are appreciated, > > Yes, don't try iterating over objects that are not iterable. ;-) Ah, yes... I hadn't thought of that :) thanks, trevis > > What you *can* do is iterating over lists, tuples or other iterables with > just one element in them. Try ``a = [1]``. > > Ciao,

Working with fixed format text db's

2007-06-08 Thread Neil Cerutti
Many of the file formats I have to work with are so-called fixed-format records, where every line in the file is a record, and every field in a record takes up a specific amount of space. For example, one of my older Python programs contains the following to create a fixed-format text record for a

Re: converting an int to a string

2007-06-08 Thread Diez B. Roggisch
Sean Farrow schrieb: > Hi: > I have the folling code: > def parseTime(self, time): > minutes =int(float(time)/60) > seconds =int(float(time)-minutes*60) > minutes =str(minutes) > seconds =str(minutes) > the statements that convert the m

launching default browser

2007-06-08 Thread alf
Hi, I wonder how to launch from python default Windows browser? In fact I have the same question for Linux. thx in advancve, -- alf -- http://mail.python.org/mailman/listinfo/python-list

Re: Case-Insensitive Sorting of Multi-Dimensional Lists

2007-06-08 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, mosscliffe wrote: > I have tried the following, for a one dimensional list and it works, > but I can not get my head around this lambda. How would this be > written, without the lamda ? Well ``lambda``\s are just anonymous functions so you can write it with a named functio

converting an int to a string

2007-06-08 Thread Sean Farrow
Hi: I have the folling code: def parseTime(self, time): minutes =int(float(time)/60) seconds =int(float(time)-minutes*60) minutes =str(minutes) seconds =str(minutes) the statements that convert the minutes and seconds variable

Re: interating over single element array

2007-06-08 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, T. Crane wrote: > Can someone please explain to me why I can't do something like this: > > a = 1 > > for value in a: > print str(value) > > If I run this I get the error: > > 'int' object is not iterable Well the message explains why you can't do this. `a` is boun

RE: Case-Insensitive Sorting of Multi-Dimensional Lists

2007-06-08 Thread Joe
> Try: > > list.sort(key=lambda el: el[0].lower()) Thanks! Worked like a charm :) > BUT - it's not a good idea to use list as a name, 'cos list is a > built-in, and you're obscuring it. Oh, don't worry. That was strictly my portrayal of the problem. Thanks again! Jough -- http://mail.pyth

knowledge management in OSS communities

2007-06-08 Thread Zilia
Dear All, I am a PhD student in e-Business in Durham University (UK). My research topic is "Knowledge management and innovation in virtual organisations". The aim of my thesis is to assess how and to what extent knowledge is created, shared, and circulated in open source software communities. In

interating over single element array

2007-06-08 Thread T. Crane
Hi all, Can someone please explain to me why I can't do something like this: a = 1 for value in a: print str(value) If I run this I get the error: 'int' object is not iterable Obivously this is an absurd example that I would never do, but in my application the length of 'a' can be anythi

Re: Binary

2007-06-08 Thread Jerry Hill
On 6/8/07, Brain Murphy <[EMAIL PROTECTED]> wrote: > I need it to show the remainder. like remainder 1 or 0 the put all of them > in a list that is backwards. Take a look at the divmod() function. It take the numerator and denominator and returns a tuple of the quotient and remainder. For exampl

Re: Case-Insensitive Sorting of Multi-Dimensional Lists

2007-06-08 Thread mosscliffe
On 8 Jun, 14:18, "Simon Brunning" <[EMAIL PROTECTED]> wrote: > On 6/7/07, Joe <[EMAIL PROTECTED]> wrote: > > > > > I have a list of lists that I would like to sort utilizing a certain index > > of the nested list. I am able to successfully use: > > > Import operator > > list = [["Apple", 1], ["air

Binary

2007-06-08 Thread Brain Murphy
I am trying to make a programm that converts a decimal number like 79 to a binary number. where it asks you for a number then produces the binary. so far I have this: x = (input("Enter number: ")) b = 2.0 while x > 0: print x x = x/b I need it to show the remainder. like remainder 1 or 0

Re: FTP/SSL

2007-06-08 Thread Dave Borne
> I'm trying to figure out how to use FTP/SSL (FTPS) - just as a client. Can I > do this in Python? Is everything I need in ftplib? Where else do I look? And > - any good newbie references on using FTPS? Hi, Nancy, I'm not sure if ftplib can handle ssh or not, but googling for "python sftp" turne

Using doctest with simple text files ?

2007-06-08 Thread Andy Dingley
I have a problem involving lots of simple text files (Java properties files), for which I'm building Python tools to manage their contents. I'm also writing lots of Python modules and using doctest to embed unit tests within them. Maintenance and shhared code ownership is an issue here. What's th

Re: how to do reading of binary files?

2007-06-08 Thread Grant Edwards
On 2007-06-08, jvdb <[EMAIL PROTECTED]> wrote: > I have a binary (pcl) file. > In this file i want to search for specific codes (like <0C>). I have > tried to solve it by reading the file character by character, but this > is very slow. Especially when it comes to files which are large > (>10MB) t

Re: wxPython / Dabo demo shell ?

2007-06-08 Thread Ed Leafe
On Jun 8, 2007, at 10:01 AM, stef wrote: > I'm interested in the overall demo setup, > really beautiful and powerful, just one thing missing (user > configurable > tree). > > And if you can copy it, > I'm allowed to do so also ;-) You can certainly copy and customize the DaboDemo code.

Re: Tkinter custom drawing

2007-06-08 Thread Xavier Bérard
> from Tkinter import Invisiblecanvas ? The whole web never mentions this Invisiblecanvas. Do you have anything alike to share ? ;) Xavier -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter custom drawing

2007-06-08 Thread Xavier Bérard
> > > Now, the problem, is that I have already plenty of widgets on my > > screen. I just want to draw over them, which is a bit difficult in my > > comprehension of things. > > What are you trying to achieve by "drawing over" widgets? Want I want to do is a sort of GUI builder for Tkinter. I al

Re: wxPython / Dabo demo shell ?

2007-06-08 Thread stef
Ed Leafe wrote: > On Jun 8, 2007, at 8:59 AM, Chris Mellon wrote: > >> The shell in the wxPython demo (but apparently not in the dabo demo, >> as per Ed's email) is from the wx.py package. It's quite trivial to >> add to your own applications, documentation is at >> http://www.wxpython.org/PyManual

Re: error when calling method of class

2007-06-08 Thread Andre Engels
2007/6/8, Sean Farrow <[EMAIL PROTECTED]>: > Hi: > I have defined a class in that class is a method defined as follows: > def splitTime(n): > seconds =float(n) > I call the method in another procedure as follows: > sefl.splitTime(200) > the traceback states that splitTime takes one argument two giv

MI5 Persecution: Goldfish and Piranha 29/9/95 (5104)

2007-06-08 Thread MI5Victim
I just thought I'd let you know what I've been reading into the "Crusader" spam. I don't want to post this to usenet because somebody might try to tie that in to my posts in some way (someone already has, in uk.misc). First of all, I'd like to ask you to believe that my phone line in my apartment

error when calling method of class

2007-06-08 Thread Sean Farrow
Hi: I have defined a class in that class is a method defined as follows: def splitTime(n): seconds =float(n) I call the method in another procedure as follows: sefl.splitTime(200) the traceback states that splitTime takes one argument two given. why is this occuring? if I try calling it like: spl

Re: python-ldap for Python 2.5 on Windows?

2007-06-08 Thread Michael Ströder
Benedict Verheyen wrote: > > i found python-ldap for version Python 2.4. > Is there i place i can find a version for 2.5? > > If not, how can i build it myself for Windows? Depending on what you need you might want to dive into OpenLDAP's FAQ: http://www.openldap.org/faq/data/cache/300.html Th

Obtaining hte currently running script under windows

2007-06-08 Thread Sean Farrow
Hi: Is there any way to obtain the full path to the currently running script under win32? I am using the pythonw.exe file is that helps. Sean. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to do reading of binary files?

2007-06-08 Thread jvdb
On 8 jun, 15:19, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, Diez B. Roggisch wrote: > > > > > jvdb schrieb: > >> True. But there is another issue attached to the one i wrote. > >> When i know how much this occurs, i know the amount of pages in the > >> file. After

Binary / SOAPpy

2007-06-08 Thread Robert Rawlins - Think Blue
Hello Guys, I have a WebService call which returns an array, the first element in that array is the binary for a zip file, however I'm having trouble writing that binary string into an actual file when it arrives, I've tried the following method. Result = call to the webservice that returns

Re: wxPython / Dabo demo shell ?

2007-06-08 Thread Ed Leafe
On Jun 8, 2007, at 8:59 AM, Chris Mellon wrote: > The shell in the wxPython demo (but apparently not in the dabo demo, > as per Ed's email) is from the wx.py package. It's quite trivial to > add to your own applications, documentation is at > http://www.wxpython.org/PyManual.html I may be

Re: Bragging about Python

2007-06-08 Thread Paul McGuire
On Jun 7, 6:15 pm, Steve Howell <[EMAIL PROTECTED]> wrote: > Programs like this were posted on this thread: > > > > > > >def fib(): > >generation, parent_rabbits, baby_rabbits = 1, > > 1, 1 > >while True: > >yield generation, baby_rabbits > >generation +=

Re: ftplib error- Large file

2007-06-08 Thread Facundo Batista
[EMAIL PROTECTED] wrote: > Ok. I guess that makes sense. But what about the other > questions...mainly: Why would it throw an exception even though the > file was properly transferred? Je, well, I answered the one I knew about, :) Regarding the error... es hard to say. What happens if you tr

MI5 Persecution: Watch Out, Forger About 27/9/95 (3590)

2007-06-08 Thread MI5Victim
From: [EMAIL PROTECTED] (Ray Dunn) Newsgroups: uk.misc,soc.culture.british Subject: Re: An apology from Mike Corley Date: Wed Sep 27 14:20:36 1995 In referenced article, David Wooding says... >Well, Mike Corley might or might not have written the apologies, but I >think not. I thought the followi

Re: how to do reading of binary files?

2007-06-08 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Diez B. Roggisch wrote: > jvdb schrieb: >> True. But there is another issue attached to the one i wrote. >> When i know how much this occurs, i know the amount of pages in the >> file. After that i would like to be able to extract a given amount of >> data: >> file x contai

Re: Case-Insensitive Sorting of Multi-Dimensional Lists

2007-06-08 Thread Simon Brunning
On 6/7/07, Joe <[EMAIL PROTECTED]> wrote: > > I have a list of lists that I would like to sort utilizing a certain index > of the nested list. I am able to successfully use: > > Import operator > list = [["Apple", 1], ["airplane", 2]] > list.sort(key=operator.itemgetter(0)) > > But, unfortunately,

Re: wxPython / Dabo demo shell ?

2007-06-08 Thread Chris Mellon
On 6/8/07, stef <[EMAIL PROTECTED]> wrote: > hello, > > I was impressed by the demo shell of wxPython, > and a few days ago (finally getting Dabo to work), > I saw Dabo uses the same demo shell. > > Is there any more information available about this shell, > because it seems a very nice / good way

  1   2   >