Re: adding a new line of text in Tk

2006-03-26 Thread Ben Cartwright
nigel wrote: > w =Label(root, text="Congratulations you have made it this far,just a few more > questions then i will be asking you some") > > The problem i have is where i have started to write some text"Congratulations > you have made it this far,just a few more questions then i will be asking yo

Re: SSH, remote login, and command output

2006-03-26 Thread Spire 01
Greetings! I'm working on a Python program for a small LAN of Linux systems running Gentoo, and I need a little help figuring out what I need to do it. So what I'd like to do is, from any given computer, log on to every other computer, run a certain command (which normally outputs text to the

Re: detecting drives for windows and linux

2006-03-26 Thread Fulvio
Alle 03:17, domenica 26 marzo 2006, BWill ha scritto: > Hi, I'm writing a file browser, but I'm not sure how I could go about > detecting the drives available I was just asking a similar question some days back. I'm planning to try a file catalogger. I just remember something about Win32API, but

Re: Comparisons and singletons

2006-03-26 Thread David Isaac
Alan asked: > > 2. If I really want a value True will I ever go astray with the test: > > if a is True: > > >>> a = True > > >>> b = 1. > > >>> c = 1 > > >>> a is True, b is True, c is True > > (True, False, False) "Ziga Seilnacht" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I th

Re: Extending Methods Vs Delegates

2006-03-26 Thread vbgunz
I am sorry I couldn't reply sooner! Alex, Python in a nutshell is my bible and I take it virtually everywhere! Seriously, I would highly recommend it to anyone with a little to a lot of Python experience. I apologize for misinterpreting your passage on page 80. I will look much closer at your exam

Re: Extending Methods Vs Delegates

2006-03-26 Thread Sybren Stuvel
vbgunz enlightened us with: > I hope I've made some sense with this question. I ultimately wish to > know just one real thing. Regardless of the name of the second > example above, what is the purpose of calling a sub class method > from a super class instance? What is the application to such a > d

Re: SSH, remote login, and command output

2006-03-26 Thread Sybren Stuvel
Spire 01 enlightened us with: > So what I'd like to do is, from any given computer, log on to every > other computer, run a certain command (which normally outputs text > to the terminal), and store the output so I can use the aggregate > statistics later in the program. I'd go for SSH indeed. >

Re: SSH, remote login, and command output

2006-03-26 Thread Rob Williscroft
Spire 01 wrote in news:[EMAIL PROTECTED] in comp.lang.python: > Greetings! > > I'm working on a Python program for a small LAN of Linux systems > running Gentoo, and I need a little help figuring out what I need to > do it. So what I'd like to do is, from any given computer, log on to > every o

Re: pondering about the essence of types in python

2006-03-26 Thread gangesmaster
i dont think it's possible, to create proxy classes, but even if i did, calling remote methods with a `self` that is not an instance of the remote class would blow up. -tomer -- http://mail.python.org/mailman/listinfo/python-list

Slogan

2006-03-26 Thread Paddy
In the style of the Pepsi 'Lip smakin' add of the 70's... In-dentin easy-readin object-orientin motivatin good buzzin literate programmin' abstractin fast runnin ever givin dynamic PYTHON! - I know, too much free time can be harmful ;-) - Pad. -- http://mail.python.org/ma

Re: detecting drives for windows and linux

2006-03-26 Thread Max
BWill wrote: > oh, I wasn't expecting a single solution for both platforms, just some > good solutions > > thanks Are you aware that this idea is somewhat foreign to Linux? (Maybe you are and want to do it anyway?) Linux puts the whole file system (including mounted iPods, ISOs and NTFS drive

Re:using "else: interactive programme

2006-03-26 Thread nigel
Hello i will show you a short example of my programme. s = raw_input ("ok lets see about doing some mathematics would you like to try some?") if s=='no': print "Well you aint no fun sling your hook" print "END OF PROGRAMME" print "Go on sling your hook" print "Now let some one els

Re: using "else: interactive programme

2006-03-26 Thread nikie
I guess the indention got mixed up in your post, if I try to run it, I get error messages at each of the "else:" lines, because they're mis-indented. "else" should be indented like the "if" it belongs to, e.g (using underscores for spaces): if s=='10': print "well done" else: print "somethi

Re: image reduction script

2006-03-26 Thread Philippe Martin
Thanks, I'll give it a shot. Philippe Kamilche wrote: > > To reduce the color depth of an image in PIL: > im = im.convert(mode="P", palette=Image.ADAPTIVE) -- http://mail.python.org/mailman/listinfo/python-list

Re: What's The Best Editor for python

2006-03-26 Thread [EMAIL PROTECTED]
For myself, I use kdevelop, KDE's development environment, it handles a multitude of languages very well, and python is one of them. It has solid project management, and a slew of other features. If you are looking for something solid, I would go with kdevelop. -- http://mail.python.org/mailman

Re: pondering about the essence of types in python

2006-03-26 Thread Alan Franzoni
gangesmaster on comp.lang.python said: > TypeError: unbound method __init__() must be called with z instance as > first argument (got x instance instead) > == > > and the question is -- WHY? I think the answer would be: because it's an instance method. Its 'contract' it's to be bound to

wired md5 hashing problem

2006-03-26 Thread Matthias Güntert
Hello list-members i am in the process of writing a python script to backup my data. Now I would like to implement md5/sha1 hashes. # do md5 fingerprinting if config.get("global", "crc") == "md5": m = md5.new() # open the file f = open(fname, "rb") whil

Re: wired md5 hashing problem

2006-03-26 Thread Felipe Almeida Lessa
Em Dom, 2006-03-26 às 16:56 +0200, Matthias Güntert escreveu: > so the format should be okay, but whats wrong with my piece of code?! It looks ok for me. What does md5sum gives as the sum? -- Felipe. -- http://mail.python.org/mailman/listinfo/python-list

Module documentation

2006-03-26 Thread Tony Burrows
Just getting to grips with Python, a great language BUT With something like Java I can find the syntax of a method call with no problems, how do I do the same with Python? For example, using MySQLdb or SGMLParser I can see what the available methods are with dir, but how do I find out what paramet

Re: Module documentation

2006-03-26 Thread Rene Pijlman
Tony Burrows: >With something like Java I can find the syntax of a method call with no >problems, how do I do the same with Python? The basic syntax is just the name, with parameters in brakcets: object.method(par1, par2, ...) This is explained in the documentation, of course. >how do I find

Re: SSH, remote login, and command output

2006-03-26 Thread Alex Martelli
Spire 01 <[EMAIL PROTECTED]> wrote: > Greetings! > > I'm working on a Python program for a small LAN of Linux systems running > Gentoo, and I need a little help figuring out what I need to do it. So what > I'd like to do is, from any given computer, log on to every other computer, > run a certai

Re: Extending Methods Vs Delegates

2006-03-26 Thread Alex Martelli
vbgunz <[EMAIL PROTECTED]> wrote: > I am sorry I couldn't reply sooner! Alex, Python in a nutshell is my > bible and I take it virtually everywhere! Seriously, I would highly > recommend it to anyone with a little to a lot of Python experience. > > I apologize for misinterpreting your passage on

Re: detecting drives for windows and linux

2006-03-26 Thread Alex Martelli
Max <[EMAIL PROTECTED]> wrote: > BWill wrote: > > > oh, I wasn't expecting a single solution for both platforms, just some > > good solutions > > > > thanks > > Are you aware that this idea is somewhat foreign to Linux? (Maybe you > are and want to do it anyway?) Linux puts the whole file syste

Re: Module documentation

2006-03-26 Thread Paul Boddie
Tony Burrows wrote: > Just getting to grips with Python, a great language BUT > With something like Java I can find the syntax of a method call with no > problems, how do I do the same with Python? > > For example, using MySQLdb or SGMLParser I can see what the available > methods are with dir, but

Re: Module documentation

2006-03-26 Thread Tony Burrows
On Sun, 26 Mar 2006 17:19:35 +0200, Rene Pijlman wrote: > Tony Burrows: >>With something like Java I can find the syntax of a method call with no >>problems, how do I do the same with Python? > > The basic syntax is just the name, with parameters in brakcets: > >object.method(par1, par2, ...

Cookbook for beginners?

2006-03-26 Thread Aahz
If you were going to name three or five essential recipes from the Python Cookbook suitable for beginners, what would you pick? Yes, this is for _Python for Dummies_, so idioms that aren't in the Cookbook are also fine. -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/

access mbx files?

2006-03-26 Thread David Isaac
Should I be able to access mail messages in Mahogany mail's mbx format using the Python mailbox module? If so, can someone please post a working example? If not, can you please point me to documentation of the file format or better yet Python code to parse it? Thanks, Alan Isaac -- http://

Re: Extending Methods Vs Delegates

2006-03-26 Thread Adam DePrince
On Sun, 2006-03-26 at 07:21 -0800, Alex Martelli wrote: > vbgunz <[EMAIL PROTECTED]> wrote: > > > I am sorry I couldn't reply sooner! Alex, Python in a nutshell is my > > bible and I take it virtually everywhere! Seriously, I would highly > > recommend it to anyone with a little to a lot of Python

Re: wired md5 hashing problem

2006-03-26 Thread Adam DePrince
What do you get when you type md5sum backup.tar.bz2? - Adam On Sun, 2006-03-26 at 16:56 +0200, Matthias Güntert wrote: > Hello list-members > > i am in the process of writing a python script to backup my data. Now I > would like to implement md5/sha1 hashes. > > # do md5 fingerprinting

Re: wired md5 hashing problem

2006-03-26 Thread Adam DePrince
On Sun, 2006-03-26 at 16:56 +0200, Matthias Güntert wrote: > Hello list-members > > i am in the process of writing a python script to backup my data. Now I > would like to implement md5/sha1 hashes. > > # do md5 fingerprinting > if config.get("global", "crc") == "md5": > m = md

maximum() efficency

2006-03-26 Thread Steve R. Hastings
I was looking at a Python function to find the maximum from a list. The original was more complicated; I simplified it. The built-in max() function can replace the simplified example, but not the original. def maximum(lst): maxval = lst[0] for i in xrange(1, len(lst)): v = lst[i] i

String To Dict Problem

2006-03-26 Thread Kamilche
Hi everyone. I'm trying to convert a string that looks like this: gid = 'FPS', type = 'Label', pos = [0, 20], text = 'FPS', text2 = 'more text without quotes', fmtline = "@VALUE @SIGNAL", signals = [('FPS', None), ('FPS2', 'something')] to a dict that looks like this: {'signals': [('FPS', None),

Re: pondering about the essence of types in python

2006-03-26 Thread Steven Bethard
gangesmaster wrote: > i dont think it's possible, to create proxy classes, but even if i did, > calling remote methods with a `self` that is not an instance of the > remote class would blow up. I don't understand you here. Why can't you just do something like: >>> class RemoteClass(object): ...

Re: wired md5 hashing problem

2006-03-26 Thread Matthias Güntert
On Sun, 2006-03-26 at 11:48 -0500, Adam DePrince wrote: > > What do you get when you type > > md5sum backup.tar.bz2? it is working. Don't know what went wrong. But now I have another question: How am I able to execute an external program, like mysqldump? I had a look into the mysql module it

Re: maximum() efficency

2006-03-26 Thread Steven Bethard
Steve R. Hastings wrote: > I was looking at a Python function to find the maximum from a list. > The original was more complicated; I simplified it. The built-in max() > function can replace the simplified example, but not the original. What's the original? Are you sure max can't solve it with

Re: Cookbook for beginners?

2006-03-26 Thread Rene Pijlman
Aahz: >If you were going to name three or five essential recipes from the >Python Cookbook suitable for beginners, what would you pick? >Yes, this is for _Python for Dummies_, so idioms that aren't in the >Cookbook are also fine. Constants Static methods / Class methods Bunch TaskQueue (Queue f

Re: is mysqlsb compatible with MySQL 5.0?

2006-03-26 Thread John Salerno
Dennis Lee Bieber wrote: > Check the Windows services control for MySQL and try from it... How do I do that? > > You might (since it sounds like this is a first attempt) need to > uninstall everything -- and make sure you delete the mysql database (in > case you have a garbaged root

Re: String To Dict Problem

2006-03-26 Thread Michael Spencer
Kamilche wrote: > Hi everyone. I'm trying to convert a string that looks like this: > > gid = 'FPS', type = 'Label', pos = [0, 20], text = 'FPS', text2 = 'more > text without quotes', fmtline = "@VALUE @SIGNAL", signals = [('FPS', > None), ('FPS2', 'something')] > > to a dict that looks like this

Re: image reduction script

2006-03-26 Thread Philippe Martin
Kamilche, I am posting the code in another thread but am not certain that convert does anything to the picture color depth ... still searching in the doc. Philippe Kamilche wrote: > > To reduce the color depth of an image in PIL: > im = im.convert(mode="P", palette=Image.ADAPTIV

PIL & image size reduction script

2006-03-26 Thread Philippe Martin
Hi, Thanks to the NG, I got the script hereunder working. 1) I am not certain that the call to convert does much (checking the doc) 2) Can this be improved as far as the final image size in (X,Y) ? For instance, passing a large .jpg with a target byte size of 7000, I get final (X,Y) results aro

"For" loop and list comprehension similarity

2006-03-26 Thread s . lipnevich
Hi All, I apologize if this was brought up before, I couldn't find any "prior art" :-). On more than one occasion, I found myself wanting to use a "conditional loop" like this (with "Invalid syntax" error, of course): for i in c if : print i*2 ...because it's similar to t

Re: SSH, remote login, and command output

2006-03-26 Thread Tim Parkin
Spire 01 wrote: > Greetings! > > I'm working on a Python program for a small LAN of Linux systems running > Gentoo, and I need a little help figuring out what I need to do it. So > what I'd like to do is, from any given computer, log on to every other > computer, run a certain command (which norm

Re: String To Dict Problem

2006-03-26 Thread Kamilche
Thanks! It's interesting, and nearly what I want, but not quite there. When I run my sample code through it, I get a syntax error because it's not a valid expression. If I were to put a 'dict(' in front and a ')' at the end, THEN it nearly works - but it gives me an 'Unsafe_Source_Error: Line 1.

Re: Cookbook for beginners?

2006-03-26 Thread Bruno Desthuilliers
Aahz a écrit : > If you were going to name three or five essential recipes from the > Python Cookbook suitable for beginners, what would you pick? > > Yes, this is for _Python for Dummies_, so idioms that aren't in the > Cookbook are also fine. 1/ tuple- and dict-based dispatch, ie: x = (result_

Re: maximum() efficency

2006-03-26 Thread Mitja Trampus
Steve R. Hastings wrote: > I was looking at a Python function to find the maximum from a list. > The original was more complicated; I simplified it. The built-in max() > function can replace the simplified example, but not the original. But you forgot to shuw us the original... [snip several im

Re: Module documentation

2006-03-26 Thread Bruno Desthuilliers
Tony Burrows a écrit : > Just getting to grips with Python, a great language BUT > With something like Java I can find the syntax of a method call with no > problems, how do I do the same with Python? > > For example, using MySQLdb or SGMLParser I can see what the available > methods are with dir,

Re: "For" loop and list comprehension similarity

2006-03-26 Thread Mitja Trampus
[EMAIL PROTECTED] wrote: > On more than one occasion, I found myself wanting to use a "conditional > loop" like this (with "Invalid syntax" error, of course): > > for i in c if : > print i*2 Maybe there's been a PEP, don't really know... Currently, the only sensible alternati

Re: String To Dict Problem

2006-03-26 Thread Michael Spencer
Kamilche wrote: > Thanks! It's interesting, and nearly what I want, but not quite there. > > When I run my sample code through it, I get a syntax error because it's > not a valid expression. If I were to put a 'dict(' in front and a ')' > at the end, THEN it nearly works - but it gives me an > 'Un

Re: object references

2006-03-26 Thread Mitja Trampus
DrConti wrote: > class ObjectClass: > """ Test primary Key assignment """ > > if __name__ == "__main__": > ObjectClassInstantiated=ObjectClass() > ObjectClassInstantiated.AnAttribute='First PK Elem' > ObjectClassInstantiated.AnotherOne='Second PK Elem' > ObjectClassIn

Re: Cookbook for beginners?

2006-03-26 Thread Rune Strand
Aahz wrote: > If you were going to name three or five essential recipes from the > Python Cookbook suitable for beginners, what would you pick? > > Yes, this is for _Python for Dummies_, so idioms that aren't in the > Cookbook are also fine. If it's for _beginners_ / _dummies_, I would expect thi

Re: SSH, remote login, and command output

2006-03-26 Thread Tim Parkin
Tim Parkin wrote: > Spire 01 wrote: > >>Greetings! >> ... >>Thanks a million! >>Spire > > > > I wrote a small tool to implement cron like functionality over ssh using > twisted (with public/private keys). This was written to scratch a small > itch but also to learn how twisted works with conch

Re: object references

2006-03-26 Thread Bruno Desthuilliers
DrConti a écrit : > Dear Python developer community, > I'm quite new to Python, so perhaps my question is well known and the > answer too. > > I need a variable alias ( what in other languages you would call "a > pointer" (c) or "a reference" (perl)) Well, that's the only kind of "variable"[1] i

Re: String To Dict Problem

2006-03-26 Thread Kamilche
Ah, finally, that's exactly what I need! Thanks bunches. I was attempting to modify your first code to fit my needs, but mine was much longer, and not yet working, a sure clue that yours is a better solution. :-D -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing func_name from inside a function

2006-03-26 Thread Ron Adam
Alex Martelli wrote: > Personally, I'd rather have a 3.0 keyword referring to "the current > object" (module for module toplevel code, class for classbody toplevel > code, function for code within a function) -- say for the sake of > argument the keyword is 'current'; this would allow current.__na

Re: MVC in Python for web app dev

2006-03-26 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Thanks Rune. I've already checked out Django and TG and have found both > the projects to be a little misguided. I think the one great thing they > have over Rails is the use of SQLObject Then you haven't really checked Django - it doesn't use SQLObject. > Having sa

Re: New development windows, IronPython or PythonWin

2006-03-26 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Dan wrote: > >> I realise its in beta. But long term, do you think that the win32com, >>win32gui etc... will have no support because everyone jumps on the >>Microsoft bandwagon? Aren't the windows support extensions supported >>primarily by one guy, Mark Hammond? As a

[ANN] Firedrop 0.2.0 - The Python Blog Client

2006-03-26 Thread Fuzzyman
It has finally happened, the release of `Firedrop 0.2.0 `_. The impatient can download the new release here : `Firedrop 0.2.0 (1.3mb) `_ .. note:: The first

Re: "For" loop and list comprehension similarity

2006-03-26 Thread s . lipnevich
Thank you for replying, Mitja! That *is* a nice alternative. Do you think it's a good idea to ask on comp.python.devel if they would be interested in a PEP about this (provided there is none)? Cheers, Sergey. -- http://mail.python.org/mailman/listinfo/python-list

Re: image reduction script

2006-03-26 Thread Kamilche
Be sure and use mode = P instead of RGB, like you have in your other code. P is for palettized images. Don't palettize if you're storing as JPG, only if you're storing as PNG or some other format that can handle 256 color images. -- http://mail.python.org/mailman/listinfo/python-list

Advice for Python and Web Server/Services?

2006-03-26 Thread Ron Davis
I have recently discovered Python and like it quite a bit. I would like to use it on a new project I am starting. The project will gather data from several web services and present the collected data to browser users through a web server. So basically I need a full-time web server and a separat

wildcard exclusion in cartesian products

2006-03-26 Thread [EMAIL PROTECTED]
The python code below is adapted from a Haskell program written by Tomasz Wielonka on the comp.lang.functional group. It's more verbose than his since I wanted to make sure I got it right. http://groups.google.com/group/comp.lang.functional/browse_frm/thread... Does anyone know how to turn it int

Re: Python types

2006-03-26 Thread Bruno Desthuilliers
Salvatore a écrit : > Thank's everybody :-) > > > Here is a type définition I've found on the net which I agree with : > > Attribute of a variable which determines the set of the values this > variabe can take and the > operations we can apply on it. Then - as already pointed by Alex - there is

Python multithreading problem

2006-03-26 Thread abhinav
//A CRAWLER IMPLEMENTATION please run this prog. on the shell and under the control of debugger when this prog. is run normally the prog. does not terminate .It doesn't come out of the cond. if c<5: so this prog. continues infinitely but if this prog is run under the control of debugger the prog te

Re: wired md5 hashing problem

2006-03-26 Thread Paul Rubin
Matthias Güntert <[EMAIL PROTECTED]> writes: > i am in the process of writing a python script to backup my data. Now I > would like to implement md5/sha1 hashes. Try editing as follows: change > f = open(fname, "rb") > while 1: > block = f.read(1024*1024) >

Re: Accessing func_name from inside a function

2006-03-26 Thread Bruno Desthuilliers
James Thiele a écrit : > I'd like to access the name of a function from inside the function. My > first idea didn't work. > > def foo(): > > ... print func_name > ... > foo() > > Traceback (most recent call last): > File "", line 1, in ? > File "", line 2, in foo > NameError: g

Re: image reduction script

2006-03-26 Thread Philippe Martin
Kamilche wrote: > Be sure and use mode = P instead of RGB, like you have in your other > code. P is for palettized images. Don't palettize if you're storing as > JPG, only if you're storing as PNG or some other format that can handle > 256 color images. My problem is this: 1) If I use a save to

Re: maximum() efficency

2006-03-26 Thread Paul McGuire
"Steve R. Hastings" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I was looking at a Python function to find the maximum from a list. > The original was more complicated; I simplified it. The built-in max() > function can replace the simplified example, but not the original. > > If

Re: Accessing func_name from inside a function

2006-03-26 Thread Alex Martelli
Ron Adam <[EMAIL PROTECTED]> wrote: > A "Current" key word would fix this. Or possibly "This" which would be > short for "This object". I think "This" would cause huge confusion, since in other popular language the keyword "this" means (a pointer/reference to) "the instance variable on which the

Re: "For" loop and list comprehension similarity

2006-03-26 Thread Grant Edwards
On 2006-03-26, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi All, > > I apologize if this was brought up before, I couldn't find any "prior > art" :-). > On more than one occasion, I found myself wanting to use a "conditional > loop" like this (with "Invalid syntax" error, of course): > >

Re: Accessing func_name from inside a function

2006-03-26 Thread Alex Martelli
James Thiele <[EMAIL PROTECTED]> wrote: > I'd like to access the name of a function from inside the function. My > first idea didn't work. > > >>> def foo(): > ... print func_name > ... > >>> foo() > Traceback (most recent call last): > File "", line 1, in ? > File "", line 2, in foo > Na

Re: Accessing func_name from inside a function

2006-03-26 Thread Eyal Lotem
Steven D'Aprano wrote: > On Sun, 26 Mar 2006 10:19:36 +1000, Ben Finney wrote: > >> "James Thiele" <[EMAIL PROTECTED]> writes: >> >>> I'd like to access the name of a function from inside the function. >> >> A function, like most other objects in Python, can have any number of >> names bound to

Re: wildcard exclusion in cartesian products

2006-03-26 Thread Michael Spencer
[EMAIL PROTECTED] wrote: > The python code below is adapted from a Haskell program written by > Tomasz > Wielonka on the comp.lang.functional group. It's more verbose than his > since I wanted to make sure I got it right. > > http://groups.google.com/group/comp.lang.functional/browse_frm/thread...

Re: Python types

2006-03-26 Thread Salvatore
Thank's Bruno. -- http://mail.python.org/mailman/listinfo/python-list

Re: wildcard exclusion in cartesian products

2006-03-26 Thread [EMAIL PROTECTED]
Michael, Yes! That is precisely what I had in mind! Thanks, Walter Kehowski -- http://mail.python.org/mailman/listinfo/python-list

Re: MVC in Python for web app dev

2006-03-26 Thread Robert Hicks
http://www.myghty.org/ That one is excellent. Robert -- http://mail.python.org/mailman/listinfo/python-list

regimes

2006-03-26 Thread magaznan
Collecter rapidement les informations nécessaires pour travailler de chez soi avec son ordinateur et de ce fait amasser rapidement des rentrées d'argents plus qu'honorables To collect the necessary information quickly for to work of at

Re: What's The Best Editor for python

2006-03-26 Thread Charles Krug
On 2006-03-26, Andrew Gwozdziewycz <[EMAIL PROTECTED]> wrote: > If you want something that won't get in your way, you should really > use /bin/ed. It's probably simpler to use then searching the archives. > /bin/ed will also run in cygwin for windows. > >>> Can one of you say to me what's the bes

Re: New development windows, IronPython or PythonWin

2006-03-26 Thread Fuzzyman
[EMAIL PROTECTED] wrote: > IronPython is currently nowhere near production quality. I would not > recommend it. I know at least one firm developing production quality software using IronPython, so your statement 'nowhere near' is a bit off. They're pretty close to a full Python 2.4 implementatio

Re: "For" loop and list comprehension similarity

2006-03-26 Thread Ben Finney
[EMAIL PROTECTED] writes: > On more than one occasion, I found myself wanting to use a "conditional > loop" like this (with "Invalid syntax" error, of course): > > for i in c if : > print i*2 > > ...because it's similar to the list comprehension construct: > > [i*2 for i

interactive programme (add a new line in Tk)

2006-03-26 Thread nigel
somebody recently showed me how to create a new line using \n which was great.The thing is when i am creating the programme the text i wish to add is quite long.and it ends up stretching the width of several pages,which i think looks quite messy.Would it be possible for some one to show me how

Re: Accessing func_name from inside a function

2006-03-26 Thread Ron Adam
Alex Martelli wrote: > Ron Adam <[EMAIL PROTECTED]> wrote: > >> A "Current" key word would fix this. Or possibly "This" which would be >> short for "This object". > > I think "This" would cause huge confusion, since in other popular > language the keyword "this" means (a pointer/reference to) "t

work at home

2006-03-26 Thread magaznan
Collecter rapidement les informations nécessaires pour travailler de chez soi avec son ordinateur et de ce fait amasser rapidement des rentrées d'argents plus qu'honorables To collect the necessary information quickly for to work of at

Re: Bitwise OR?

2006-03-26 Thread Clemens Hepper
Adam DePrince wrote: >> BTW: Is there something like a sizeof() method for int numbers? > > import struct > help( strict.calcsize ) Mh, that doesn't do what i want. I'd like to have something like: def size(number): return sizeof(number) > Why one bit at a time? Good question... Here my new

PyPy is now able to compile efficient extension modules!

2006-03-26 Thread Luis M. González
"PyPy is now able to compile efficient extension modules!". This was recently announced by Christian Tismer on Pypy's mailing list. To learn more: http://codespeak.net/pipermail/pypy-dev/2006q1/002911.html -- http://mail.python.org/mailman/listinfo/python-list

Re: "For" loop and list comprehension similarity

2006-03-26 Thread s . lipnevich
> Why not combine the two: I guess because (at least in source code) you're doing a loop twice :-). I don't know what a compiler would do. I think though that the "for i in c if test:" construct is more readable and maybe can even be better optimized. Thanks! Sergey. -- http://mail.python.org/m

Re: "For" loop and list comprehension similarity

2006-03-26 Thread John Zenger
Rather than a list comprehension, it would be faster and more memory-efficient to use a generator comprehension. Just change the square brackets to parentheses: for j in (i*2 for i in c if ): print j Grant Edwards wrote: > On 2006-03-26, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrot

Re: Python multithreading problem

2006-03-26 Thread Serge Orlov
abhinav wrote: > //A CRAWLER IMPLEMENTATION > please run this prog. on the shell and under the control of debugger > when this prog. is run normally the prog. does not terminate .It > doesn't come out of the cond. if c<5: so this prog. continues > infinitely How do you know? Have you waited *infin

Re: py web-app-frameworks without a rdbms...

2006-03-26 Thread Michael Goettsche
On Wednesday 22 March 2006 02:06, [EMAIL PROTECTED] wrote: > Hi folks, > > Of TurboGers & Django WAF candidates, which one would be easier to use > in an environment where the data/content doesn't come an RDBMS, but > from other server-side apps... If these are not good candidates, could > you sugg

Re: maximum() efficency

2006-03-26 Thread Steve R. Hastings
On Sun, 26 Mar 2006 20:34:28 +0200, Mitja Trampus wrote: > I would have done it in the same way, but probably without the iterators. > I.e., like this: > > def maximum(lst): > try: m = lst[0] > except (TypeError, IndexError): raise Exception "Non-sequence or empty > sequence given to

Python float representation error?

2006-03-26 Thread [EMAIL PROTECTED]
try running this in python: print [39.95] the output i get is: [39.953] what's up with that? -- http://mail.python.org/mailman/listinfo/python-list

Re: [ANN] Firedrop 0.2.0 - The Python Blog Client

2006-03-26 Thread Kent Johnson
Fuzzyman wrote: > It has finally happened, the release of `Firedrop 0.2.0 > * `ConfigObj `_ is > now used to edit all the config files. You should add this to the dependency list in the install page, it tripped me up. Kent -- http://mail.pytho

Re: maximum() efficency

2006-03-26 Thread Steve R. Hastings
On Sun, 26 Mar 2006 10:34:16 -0700, Steven Bethard wrote: > What's the original? def minimum(cmp, lst): """minimum(cmp, lst) Returns the minimal element in non-empty list LST with elements compared via CMP() which should return values with the same semantics as Python's cmp(). If there

Re: What's the best way to learn perl for a python programmer?

2006-03-26 Thread john_sips_tea
The online docs are very good. Just run "perldoc perl", and then go through the various tutorial pages (starting with "perldoc perlintro"). You can also read them online here: http://perldoc.perl.org/perl.html . Then go to http://www.perlmonks.org . They have many tutorial-style articles there, as

Re: Python float representation error?

2006-03-26 Thread James Stroud
[EMAIL PROTECTED] wrote: > try running this in python: > > print [39.95] > > the output i get is: > [39.953] > > what's up with that? > This comes from the imprecision in representing base-10 fractions as binary. Try "print [str(39.95)]". If you want to print a list, maybe: prin

Re: interactive programme (add a new line in Tk)

2006-03-26 Thread James Stroud
nigel wrote: > somebody recently showed me how to create a new line using \n which was > great.The thing is when i am creating the programme the text i wish to add is > quite long.and it ends up stretching the width of several pages,which i think > looks quite messy.Would it be possible for som

Re: maximum() efficency

2006-03-26 Thread Steve R. Hastings
Actually, now that I think about it, the version using iter() has one advantage over your version: it will work correctly if passed either a list or an iterator. So, for versions of Python that have iterators, I'd use the iter() version, but for older versions of Python, I'd use your version. P.S

Re: maximum() efficency

2006-03-26 Thread Paul McGuire
"Steve R. Hastings" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sun, 26 Mar 2006 10:34:16 -0700, Steven Bethard wrote: > > What's the original? > > > > def minimum(cmp, lst): > """minimum(cmp, lst) > > Returns the minimal element in non-empty list LST with elements > comp

Re: Python float representation error?

2006-03-26 Thread nikie
> try running this in python: > > print [39.95] > > the output i get is: > [39.953] > > what's up with that? That's perfectly normal - some numbers aren't exactly expressible as binary floating points, just like 1/3 isn't expressible as a decimal floating point number. Here's a good l

Re: New-style Python icons

2006-03-26 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > Personally, I *like* the new website look, and I'm glad to see Python > having a proper logo at last! > > I've taken the opportunity to knock up some icons using it, finally > banishing the poor old standard-VGA-palette snake from my desktop. If > you like, you can grab

determine file type

2006-03-26 Thread Mark Gibson
Is there an equivalent to the unix 'file' command? [mark tmp]$ file min.txt min.txt: ASCII text [mark tmp]$ file trunk trunk: directory [mark tmp]$ file compliance.tgz compliance.tgz: gzip compressed data, from Unix What I really want to do is determine if a file is 1) a directory, 2) a text fil

  1   2   >