[ANN] Leipzig Python User Group - Meeting, June 12, 2007, 08:00pm

2007-06-08 Thread Mike Müller
=== Leipzig Python User Group === We will meet on Tuesday, June 12 at 08:00pm at the training center of Python Academy in Leipzig, Germany ( http://www.python-academy.com/center/find.html ). Food and soft drinks are provided. Please send a short confirmation mail to [EMAIL PROTECTED], so we can

Re: Integer division

2007-06-08 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Dan Bishop wrote: On Jun 7, 8:30 pm, Some Other Guy [EMAIL PROTECTED] wrote: Since this just involves doubling you can avoid multiplying altogether and just use this: def rounddiv(a,b): return int((a+a+b)/(b+b)) That's 3 integer adds and 1 integer divide. The

Re: Bragging about Python

2007-06-08 Thread Szabolcs Nagy
Steve Howell wrote: --- Georg Brandl [EMAIL PROTECTED] wrote: 15 small programs here: http://wiki.python.org/moin/SimplePrograms IMHO a few python goodies are missing there. It's a Wiki. ;) Yes indeed. Please feel free to add to the page, or make your own fork.

Re: howto obtain directory where current (running) py-file is placed?

2007-06-08 Thread [EMAIL PROTECTED]
dmitrey wrote: Hi all, I guess this question was asked many times before, but I don't know keywords for web search. Thank you in advance, D. In the future, please ask your question in the body of your message (not just in the subject line). This question has no answer in general. There are

Re: Where can I suggest an enchantment for Python Zip lib?

2007-06-08 Thread durumdara
Hi Larry! durumdara wrote: You can easily find out roughly how many bytes are in your .ZIP archive by using following: zipbytes=Zobj.fp.tell() The main problem is not this. I want to write a backup software, and I want to: - see the progress in the processing of the actual file - abort the

Re: howto obtain directory where current (running) py-file is placed?

2007-06-08 Thread Gerard Flanagan
On Jun 8, 1:01 am, Stef Mientki [EMAIL PROTECTED] wrote: Gerard Flanagan wrote: On Jun 7, 8:39 am, dmitrey [EMAIL PROTECTED] wrote: Hi all, I guess this question was asked many times before, but I don't know keywords for web search. Thank you in advance, D. import os d1 =

Sorry for the multiple posts

2007-06-08 Thread Vinay Sajip
Sorry for the multiple posts. I kept getting network errors and it looked like the posts weren't getting through. Regards, Vinay -- http://mail.python.org/mailman/listinfo/python-list

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

2007-06-08 Thread Diez B. Roggisch
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 make it C-callable.

wxPython / Dabo demo shell ?

2007-06-08 Thread stef
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 to show (many) demos, in an organized way to newbies.

EuroPython: Draft program posted, today last day of early registration

2007-06-08 Thread GHUM
Dear Pythonistas! On www.euroypython.org the draft program and timetable has been posted! http://www.europython.org/sections/tracks_and_talks/draft-timetable Do a click and check out the fabulous talks. Then check in, best today, the 8th of June, the last day of early bird registration.

Re: howto obtain directory where current (running) py-file is placed?

2007-06-08 Thread Stebanoid
On 7, 10:39, dmitrey [EMAIL PROTECTED] wrote: Hi all, I guess this question was asked many times before, but I don't know keywords for web search. Thank you in advance, D. import sys file_name = sys.argv[0] this? -- http://mail.python.org/mailman/listinfo/python-list

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

2007-06-08 Thread Hendrik van Rooyen
dmoore [EMAIL PROTECTED] wrote: 8 --- description of full duplex problem Anybody have any thoughts on this? Do I have my story straight? (the popen variants can't handle this case and there are no other alternatives in the standard python distro) Is there some place

Minimize Bandwidth

2007-06-08 Thread Robert Rawlins - Think Blue
Hello Chaps, I have a python application that hits a web service on a regular basis to post a string of CSV log data and I'm looking to minimize the amount of bandwidth that the application uses to send the log data. Is there any way to encode the string into base64 or something, that I

Case-Insensitive Sorting of Multi-Dimensional Lists

2007-06-08 Thread Joe
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, this will be case sensitive (Apple will come before

Re: Determinant of Large Matrix

2007-06-08 Thread Hendrik van Rooyen
James Stroud j@mbia.edu wrote: James Stroud wrote: [pointless stuff] OK. Nevermind. I'm rebinding encodings and so taking a sample from the sample and thus getting the sample back. Terribly sorry. There is truly nothing to be sorry about. It takes guts to come right out and say

Re: running a random function

2007-06-08 Thread Stebanoid
On 8, 00:07, Dustan [EMAIL PROTECTED] wrote: On Jun 7, 1:30 pm, Neil Cerutti [EMAIL PROTECTED] wrote: On 2007-06-07, Stebanoid [EMAIL PROTECTED] wrote: if you have a list of functions you can try this: import random import math m[int(math.floor(len(m)*random.random()))]() #

Re: *Naming Conventions*

2007-06-08 Thread Bruno Desthuilliers
Neil Cerutti a écrit : On 2007-06-06, Bruno Desthuilliers [EMAIL PROTECTED] wrote: Neil Cerutti a écrit : On 2007-06-04, Michael Hoffman [EMAIL PROTECTED] wrote: Wildemar Wildenburger wrote: I agree with Bruno that i and j should be used only for indices, but I'm usually less terse than

Re: Bragging about Python

2007-06-08 Thread Steve Howell
--- Szabolcs Nagy [EMAIL PROTECTED] wrote: the title of a program shouldn't be part of the code (or it should at least start with #) sorry i'm too lazy now to fix it, but imho it needs nicer layout to be used as 'bragging about python' site Agreed. I just spruced up the layout a tiny

Re: Minimize Bandwidth

2007-06-08 Thread Tim Golden
Robert Rawlins - Think Blue wrote: I have a python application that hits a web service on a regular basis to post a string of CSV log data and I'm looking to minimize the amount of bandwidth that the application uses to send the log data. Is there any way to encode the string into base64 or

Re: ten small Python programs

2007-06-08 Thread Jacob Hallen
In article [EMAIL PROTECTED], Steve Howell [EMAIL PROTECTED] wrote: I've always thought that the best way to introduce new programmers to Python is to show them small code examples. Something like this: http://www.lava.se/sam/ Jacob Hallén -- --

Re: How to wrap a Japanese text in Python

2007-06-08 Thread Leo Kislov
On Jun 7, 5:12 am, [EMAIL PROTECTED] wrote: Hi All, I am trying to wrap a japanese text in Python, by the following code. if len(message) 54: message = message.decode(UTF8) strlist = textwrap.wrap(message,54) After this I am wirting it to you a CAD Software window. While

Re: How to wrap a Japanese text in Python

2007-06-08 Thread Leo Kislov
On Jun 8, 2:24 am, Leo Kislov [EMAIL PROTECTED] wrote: On Jun 7, 5:12 am, [EMAIL PROTECTED] wrote: Hi All, I am trying to wrap a japanese text in Python, by the following code. if len(message) 54: message = message.decode(UTF8) strlist = textwrap.wrap(message,54) After this

Re: Running a process every N days

2007-06-08 Thread Mark Westwood
Hi Dan FWIW I'd use logrotate for this. Regards Mark Westwood On Jun 7, 11:27 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: What's the best way to run either an entire python process or a python thread every N days. I'm running Python 2.4.3 on Fedora Core 5 Linux. My code consists of a test

Does python 2.3.3 pty module has a bug?

2007-06-08 Thread alexteo21
Hi, System: Solaris Python version: 2.3.3 For a automation job, I used pexpect module together with python for creating a ftp session automatically and downloading the file. I notice that after closing the child. The file descriptor is not closed (check /proc/process id/fd) After running the

Does python 2.3.3 pty module has a bug?

2007-06-08 Thread alexteo21
Hi, System: Solaris Python version: 2.3.3 For a automation job, I used pexpect module together with python for creating a ftp session automatically and downloading the file. I notice that after closing the child. The file descriptor is not closed (check /proc/process id/fd) After running the

soap - sessions ?

2007-06-08 Thread gcmartijn
H! When I use php code nusoap everything works but with python I get everytime Your session key does not exist or has expired I use this code below: test = SOAPpy.SOAPProxy(http://secure.easynic.com/com/iomart/ easynicWSv2.cfc?wsdl) data = test.login(_id='test',_pass='pass')

Re: wxPython / Dabo demo shell ?

2007-06-08 Thread Ed Leafe
On Jun 8, 2007, at 3:14 AM, stef wrote: 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 to show (many)

Re: *Naming Conventions*

2007-06-08 Thread Neil Cerutti
On 2007-06-08, Bruno Desthuilliers [EMAIL PROTECTED] wrote: Neil Cerutti a écrit : On 2007-06-06, Bruno Desthuilliers [EMAIL PROTECTED] wrote: Neil Cerutti a écrit : On 2007-06-04, Michael Hoffman [EMAIL PROTECTED] wrote: Wildemar Wildenburger wrote: I agree with Bruno that i and j should

Re: how to do reading of binary files?

2007-06-08 Thread Diez B. Roggisch
jvdb schrieb: Hi all, I need some help on the following issue. I can't seem to solve it. 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

Re: how to do reading of binary files?

2007-06-08 Thread jvdb
On 8 jun, 14:07, Diez B. Roggisch [EMAIL PROTECTED] wrote: jvdb schrieb: .. 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: soap - sessions ?

2007-06-08 Thread gcmartijn
When I use SOAPpy.Config.dumpSOAPOut = 1 SOAPpy.Config.dumpSOAPIn = 1 will display: *** Outgoing SOAP ** ?xml version=1.0 encoding=UTF-8? SOAP-ENV:Envelope SOAP-ENV:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/;

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

2007-06-08 Thread Szabolcs Nagy
Russ wrote: 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. Thanks. not really but you may want to look into these: http://codespeak.net/pypy http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/

how to do reading of binary files?

2007-06-08 Thread jvdb
Hi all, I need some help on the following issue. I can't seem to solve it. 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

Correct auto line break in mail headers lines (subject)?

2007-06-08 Thread robert
can anyone contribute to this question about correct auto line break in mail header lines: https://sourceforge.net/tracker/?func=detailaid=1645148group_id=5470atid=105470 -- http://mail.python.org/mailman/listinfo/python-list

MI5 Persecution: Options 21/9/95 (562)

2007-06-08 Thread MI5Victim
From: john heelan [EMAIL PROTECTED] Newsgroups: uk.misc,alt.current-events.net-abuse,alt.journalism Subject: Re: CENSORHSIP IS IMMORAL, UNJUST AND WRONG Date: Thu, 21 Sep 95 19:17:30 GMT Organization: (Private) Lines: 65 Message-ID: [EMAIL PROTECTED] References: [EMAIL PROTECTED] [EMAIL PROTECTED]

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:

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

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 There

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 that i would like

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

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

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

python-ldap for Python 2.5 on Windows?

2007-06-08 Thread Benedict Verheyen
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? Thanks, Benedict -- http://mail.python.org/mailman/listinfo/python-list

Re: How Can I Increase the Speed of a Large Number of Date Conversions

2007-06-08 Thread Eddie Corns
vdicarlo [EMAIL PROTECTED] writes: I am a programming amateur and a Python newbie who needs to convert about 100,000,000 strings of the form 1999-12-30 into ordinal dates for sorting, comparison, and calculations. Though my script does a ton of heavy calculational lifting (for which numpy and

Re: read xml file from compressed file using gzip

2007-06-08 Thread flebber
On Jun 8, 9:45 pm, flebber [EMAIL PROTECTED] wrote: On Jun 8, 3:31 pm, Stefan Behnel [EMAIL PROTECTED] wrote: flebber wrote: I was working at creating a simple program that would read the content of a playlist file( in this case *.k3b) and write it out . the compressed *.k3b file has

MI5 Persecution: Question and Answer 27/9/95 (2076)

2007-06-08 Thread MI5Victim
In article [EMAIL PROTECTED] [EMAIL PROTECTED] Mike Corley writes: ##: There were also a few other things said at the trial ##: relating to this which I won't repeat here; it was in the papers ##: at the time anyway. This quote and others said by and about this ##: witness were

Re: running a random function

2007-06-08 Thread Neil Cerutti
On 2007-06-08, Stebanoid [EMAIL PROTECTED] wrote: On 8, 00:07, Dustan [EMAIL PROTECTED] wrote: On Jun 7, 1:30 pm, Neil Cerutti [EMAIL PROTECTED] wrote: On 2007-06-07, Stebanoid [EMAIL PROTECTED] wrote: if you have a list of functions you can try this: import random import math

Re: read xml file from compressed file using gzip

2007-06-08 Thread flebber
On Jun 8, 3:31 pm, Stefan Behnel [EMAIL PROTECTED] wrote: flebber wrote: I was working at creating a simple program that would read the content of a playlist file( in this case *.k3b) and write it out . the compressed *.k3b file has two file and the one I was trying to read was

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: cdef class Foo: cdef public char attr def __init__(self): self.attr = 0 class Bar(Foo): def __init__(self): Foo.__init__(self) self.attr2 = None def

Re: how to do reading of binary files?

2007-06-08 Thread Diez B. Roggisch
jvdb schrieb: On 8 jun, 14:07, Diez B. Roggisch [EMAIL PROTECTED] wrote: jvdb schrieb: .. 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

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 to show

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, this will be

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 contains 20 0C.

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 += 1

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: 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.html

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

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 turned up

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. There

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 already

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 given. why

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) this is

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

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

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

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 --

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

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 bound to an

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 example:

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], [airplane, 2]]

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 function of

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: 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 minutes

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, Marc

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

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

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 --

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

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, as a

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: 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

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

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:

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 always

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): def

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

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

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 didn't

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 all files

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 customize the DaboDemo

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 exceptions.

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 wx

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 make it

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 --

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

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 since it is

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') Diez Better

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.

  1   2   3   >