Re: How to determine if a line of python code is a continuation of the line above it

2006-04-08 Thread Michael Spencer
Sandra-24 wrote: > No it's not an academic excercise, but your right, the situation is > more complex than I originally thought. I've got a minor bug in my > template code, but it'd cause more trouble to fix than to leave in for > the moment. > > Thanks for your input! > -Sandra > Take a look at

Re: Do I Need This?

2006-04-08 Thread Stephen Prinster
Terry Reedy wrote: There > may be a page at python.com that explains more. > I think you meant python.org. -- http://mail.python.org/mailman/listinfo/python-list

Re: how relevant is C today?

2006-04-08 Thread Jorge Godoy
"Daniel Nogradi" <[EMAIL PROTECTED]> writes: > Can anyone shed some light on the secret of Java? How is it that they > are so high on this list? Marketing? Hype? :-) -- Jorge Godoy <[EMAIL PROTECTED]> "Quidquid latine dictum sit, altum sonatur." - Qualquer coisa dita em latim soa profund

Re: how relevant is C today?

2006-04-08 Thread Jorge Godoy
Mirco Wahab <[EMAIL PROTECTED]> writes: > "The Dice" (find tech jobs) has offerings > (last 7 days, U.S. + unrestricted) for: > *SQL 14,322 > C/C++11,968 > Java 10,143 > ... > Perl 3,332 > PHP 730 > *Python* 503 > Fortran 119 > Ruby108 >

Re: Python 2.5 licensing: stop this change

2006-04-08 Thread Francisco Reyes
Shane Hathaway writes: > I must saay that i am fully in favor of this change. The ppython > developerrs need to eat too. Iis no one ellse aware off the perils oof > ooutright open source llicenssing? I disagree with the change. I think Steve Holden is right. 1- How do you enforce this? 2- Th

Re: how to make a generator use the last yielded value when it regains control

2006-04-08 Thread Michael Spencer
John Salerno wrote: > Ben Cartwright wrote: > >> Definitely go for (1). The Morris sequence is a great candidate to >> implement as a generator. As a generator, it will be more flexible and >> efficient than (2). > > Actually I was just thinking about this and it seems like, at least for > my

Re: how to make a generator use the last yielded value when it regains control

2006-04-08 Thread John Salerno
Michael Spencer wrote: > itertools.groupby makes this very straightforward: I was considering this function, but then it seemed like it was only used for determing consecutive numbers like 1, 2, 3 -- not consecutive equivalent numbers like 1, 1, 1. But is that not right? -- http://mail.python.

Re: programming puzzles?

2006-04-08 Thread John Salerno
[EMAIL PROTECTED] wrote: > Personally, I am an avid reader of rec.puzzles. Not because > I like doing stupid puzzles per se, but I look at them from the > viewpoint "how would I write a program to solve this?" > Even simple word problems sometimes involves more trouble than > the puzzle is worth,

Re: how relevant is C today?

2006-04-08 Thread David Reed
On Apr 8, 2006, at 6:35 PM, Jorge Godoy wrote: > Mirco Wahab <[EMAIL PROTECTED]> writes: > >> "The Dice" (find tech jobs) has offerings >> (last 7 days, U.S. + unrestricted) for: >> *SQL 14,322 >> C/C++11,968 >> Java 10,143 >> ... >> Perl 3,332 >> PHP 730 >>

Re: mod_python + apache + winxp => nogo

2006-04-08 Thread Damjan
> to apache's httpd.conf, apache refuses to start, saying: > "cannot load c://mod_python.so into server: the specified module > could not be found" which probably means that mod_python.so is not in that directory? -- http://mail.python.org/mailman/listinfo/python-list

Re: Insertion (sql) bug in Py2.4 pySQLite 2.2

2006-04-08 Thread Roger Binns
"DurumDara" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have this code in my program. Before this I use APSW, but that project's > connection object doesn't have close method... The connection object is released when there are no more references to it, and there are no outsta

Tkinter

2006-04-08 Thread Jay
Cold somebody please enlighten me at why code 1 works perfectly and yet code to will not display the gif file. code 1 ---START- from Tkinter import * root = Tk() MainFrame = Canvas(root) MainFrame.pack() BackgroundFile = PhotoImage(file="Background.GIF") Background = MainFrame.

Re: how to make a generator use the last yielded value when it regains control

2006-04-08 Thread Gerard Flanagan
John Salerno wrote: > Michael Spencer wrote: > > > itertools.groupby makes this very straightforward: > > I was considering this function, but then it seemed like it was only > used for determing consecutive numbers like 1, 2, 3 -- not consecutive > equivalent numbers like 1, 1, 1. But is that not

Re: Tkinter

2006-04-08 Thread baalbek
Excuse me for being slightly off-topic, but why not using wxPython (www.wxpython.org)? Baalbek -- http://mail.python.org/mailman/listinfo/python-list

Re: how to make a generator use the last yielded value when it regains control

2006-04-08 Thread Michael Spencer
John Salerno wrote: > Michael Spencer wrote: > >> itertools.groupby makes this very straightforward: > > I was considering this function, but then it seemed like it was only > used for determing consecutive numbers like 1, 2, 3 -- not consecutive > equivalent numbers like 1, 1, 1. But is that n

Re: how relevant is C today?

2006-04-08 Thread Sybren Stuvel
John Salerno enlightened us with: > Because of my 'novice-ness' in programming, I had always thought that C > was replaced by C++ and wasn't really used anymore today. C is used in many, many programs. The Linux kernel is perhaps one of the best known. IIRC Apache is written inC too. The default

Re: Python 2.5 licensing: stop this change

2006-04-08 Thread Robert Kern
Francisco Reyes wrote: > Shane Hathaway writes: > >>I must saay that i am fully in favor of this change. The ppython >>developerrs need to eat too. Iis no one ellse aware off the perils oof >>ooutright open source llicenssing? > > I disagree with the change. I think Steve Holden is right. >

Python based 'Toaster' animation like Gaim or MSN Messenger?

2006-04-08 Thread Enigma Curry
I'm looking for something that can display a pop-up "toaster" like animation like Gaim or MSN messenger does to notify of incoming messages. There's JToaster ( http://jtoaster.sourceforge.net/ ) for Java... anything similar for Python? Thanks! Ryan McGuire -- http://mail.python.org/mailman/lis

Re: Python based 'Toaster' animation like Gaim or MSN Messenger?

2006-04-08 Thread Enigma Curry
Ok, cool! There's one for wxPython called ToasterBox ( http://wiki.wxpython.org/index.cgi/ToasterBox ) I'm more familiar with pyGTK.. so if anyone knows one based on pyGTK, please let me know! :) Ryan McGuire -- http://mail.python.org/mailman/listinfo/python-list

Re: Do I Need This?

2006-04-08 Thread sdavies6
"Paul Boddie" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > sdavies6 wrote: >> I have no idea how this got onto my month old HP computer; I must have >> downloaded something which uses it. It seems I have a folder and >> subfolders >> equaling about 29 MB, called PYTHON 22. The

Re: how relevant is C today?

2006-04-08 Thread Sandra-24
C/C++ is used for a lot of things and not going anywhere. I recommend you learn it not because you should create applications in C or C++, but because it will increase your skills and value as a programmer. I recommend you even spend a few weeks with an assembly language, for the same reason. How

Re: How's python's web scraping capabilities (vs LWP) ...

2006-04-08 Thread Enigma Curry
I don't know much about LWP.. but Beautiful Soup is grand! http://www.crummy.com/software/BeautifulSoup/ Ryan McGuire -- http://mail.python.org/mailman/listinfo/python-list

Re: programming puzzles?

2006-04-08 Thread Michael Tobis
The first piece of code that I ever voluntarily wrote was intended to solve this puzzle: Assign the number 2 to 'a', 3 to 'b' ... 27 to 'z'. To each word assign the value of the product of its characters. Find the English (or language of your choice) word whose product is closest to a million (or

More pythonic circle?

2006-04-08 Thread Pythor
I wrote the following code for a personal project. I need a function that will plot a filled circle in a two dimensional array. I found Bresenham's algorithm, and produced this code. Please tell me there's a better way to do this. import numpy def circle(field=None,radius,center=(0,0),value=25

Re: How's python's web scraping capabilities (vs LWP) ...

2006-04-08 Thread Kent Johnson
ArKane wrote: > Hello all, > > I've been hacking away at perl for a few months now, mainly using the > LWP module, used for web scraping. Amoung its capabilities include > support for HTTPS and proxies, authentication, cookies (including the > ability to automatically import Internet Explorer cook

Name of the calling method

2006-04-08 Thread Saptarshi Guha
Hello, Say Boo is a class with a method called x. In the body of x i wish to know from which method x was called. How would i do this? Thanks in advance Saptarshi -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter

2006-04-08 Thread Robert Hicks
Maybe because Tkinter comes *with* Python? It is sometimes easier to understand the way things work in Tkinter vs wxPython as well. Though I will add that Manning has just published "wxPython in Action" so that should help newbies out as well. Robert -- http://mail.python.org/mailman/listinfo/py

Re: how relevant is C today?

2006-04-08 Thread John Zenger
Martin v. Löwis wrote: > As for *learning* the languages: never learn a language without a > specific inducement. If you know you are going to write a Python > extension, an Apache module, or a Linux kernel module in the > near future, start learning C today. If you don't know what you > want to u

Re: Programming Tutorial for absolute beginners

2006-04-08 Thread Duncan Smith
Clodoaldo Pinto wrote: > Duncan Smith wrote: > >>James wrote: >> >>>Perhaps use the phrase "whole number" there and mention that in >>>programming they're called integers. Having a glossary with >>>definitions for things like integer, float etc etc. would be good if >>>when you talked about intege

Re: programming puzzles?

2006-04-08 Thread [EMAIL PROTECTED]
Michael Tobis wrote: > The first piece of code that I ever voluntarily wrote was intended to > solve this puzzle: > > Assign the number 2 to 'a', 3 to 'b' ... 27 to 'z'. To each word assign > the value of the product of its characters. Find the English (or > language of your choice) word whose pro

Curses and Character Handling

2006-04-08 Thread stormandstress
Hi. I'm writing a program that is dependent on the curses library and functions for python, and I'm a little puzzled by the way characters are handled. The basics of the program are that a character is taken from input and put into a certain position within a list (There's more to it than that, bu

Re: Curses and Character Handling

2006-04-08 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > Hi. > > I'm writing a program that is dependent on the curses library and > functions for python, and I'm a little puzzled by the way characters > are handled. The basics of the program are that a character is taken > from input and put into a certain position within a l

Automated Graph Plotting in Python

2006-04-08 Thread diffuser78
My python program spits lot of data. I take that data and plot graphs using OfficeOrg spredsheet. I want to automate this task as this takes so much of time. I have some questions. 1. Which is the best graph plotting utility in python or linux. Can I write a code in such a way that my python code

Re: Curses and Character Handling

2006-04-08 Thread stormandstress
Thank you very much. -- http://mail.python.org/mailman/listinfo/python-list

Re: programming puzzles?

2006-04-08 Thread Michael Tobis
Yeah, this was *much* easier than I expected. My candidate was in second place according to /usr/share/dict/words which has ixodid but not dioxid; I'm really not confident that dioxid is a word. I recall that I had also found the third place word now that I look at it. What I had to do was print

Re: programming puzzles?

2006-04-08 Thread Michael Tobis
Yeah, this was *much* easier than I expected. My candidate was in second place according to /usr/share/dict/words which has ixodid but not dioxid; I'm really not confident that dioxid is a word. I recall that I had also found the third place word now that I look at it. What I had to do was print

Re: how relevant is C today?

2006-04-08 Thread Grant Edwards
On 2006-04-08, Martin v. Löwis <[EMAIL PROTECTED]> wrote: > As for *learning* the languages: never learn a language > without a specific inducement. That's silly. Learning (weather a computer language, a natural language, or anything else) is never a bad thing. The more languages you know, the

Re: Automated Graph Plotting in Python

2006-04-08 Thread Felipe Almeida Lessa
Em Sáb, 2006-04-08 às 20:08 -0700, [EMAIL PROTECTED] escreveu: > My python program spits lot of data. I take that data and plot graphs > using OfficeOrg spredsheet. I want to automate this task as this takes > so much of time. I have some questions. You can try ReportLab (www.reportlab.org). Great

Re: programming puzzles?

2006-04-08 Thread Paul Rubin
"Michael Tobis" <[EMAIL PROTECTED]> writes: > The first piece of code that I ever voluntarily wrote was intended to > solve this puzzle: > > Assign the number 2 to 'a', 3 to 'b' ... 27 to 'z'. To each word assign > the value of the product of its characters. Find the English (or > language of your

Re: More pythonic circle?

2006-04-08 Thread John Machin
OTTOMH, in a rush to go out: never mind Pythonic, following apply to any language: (1) accuracy: (a) sue me if I'm wrong, but I think you need range(dx+1) so that the dx pixel is filled in (b) a few more digits after 0.71 might be useful (2) efficiency: seems that range(dy, dx+1) would save some we

Re: Name of the calling method

2006-04-08 Thread Kent Johnson
Saptarshi Guha wrote: > Hello, > Say Boo is a class with a method called x. In the body of x i wish to > know from which method x was called. How would i do this? > Thanks in advance > Saptarshi > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66062 Kent -- http://mail.python.org/mai

Re: programming puzzles?

2006-04-08 Thread [EMAIL PROTECTED]
Paul Rubin wrote: > "Michael Tobis" <[EMAIL PROTECTED]> writes: > > The first piece of code that I ever voluntarily wrote was intended to > > solve this puzzle: > > > > Assign the number 2 to 'a', 3 to 'b' ... 27 to 'z'. To each word assign > > the value of the product of its characters. Find the

Re: programming puzzles?

2006-04-08 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > The trouble with word lists is when you run across something > you don't recognize, like "ixodid", you can't tell if it's a word or > an acronym or an abbreviation. Well, once they told us the winner was "ixodid", we found that word quickly in a di

Re: More pythonic circle?

2006-04-08 Thread Pythor
John Machin wrote: > OTTOMH, in a rush to go out: never mind Pythonic, following apply to > any language: > (1) accuracy: (a) sue me if I'm wrong, but I think you need range(dx+1) > so that the dx pixel is filled in Hmm. I think you're right. Thanks. > (b) a few more digits after 0.71 > might be

Confused by "format requires a mapping"

2006-04-08 Thread contact . morrison
Hello, I'm very new to Python, and unsure how to handle this runtime error below. Pointers in the right direction (RTFM here ... etc) most appreciated. I have an object, called article, that when printed has the following structure: {'title': 'wbk', 'entries': [('http://wbk.opendarwin.org/blog/?

Re: How's python's web scraping capabilities (vs LWP) ...

2006-04-08 Thread Grig Gheorghiu
Check out twill , which is based on mechanize (). Grig -- http://mail.python.org/mailman/listinfo/python-list

Re: More pythonic circle?

2006-04-08 Thread Felipe Almeida Lessa
Em Sáb, 2006-04-08 às 21:17 -0700, Pythor escreveu: > John Machin wrote: > > (3) legibility: there's no prize for the script with the absolutely > > minimum number of space characters :-) > True. I assume your saying I should make cx,cy,dx, and dy better > names. I probably will. Up to now I was

Re: how to make a generator use the last yielded value when it regains control

2006-04-08 Thread John Salerno
Gerard Flanagan wrote: > John Salerno wrote: > >> Michael Spencer wrote: >> >>> itertools.groupby makes this very straightforward: >> I was considering this function, but then it seemed like it was only >> used for determing consecutive numbers like 1, 2, 3 -- not consecutive >> equivalent numbers

Re: More pythonic circle?

2006-04-08 Thread Michael Tobis
Proving yet again that it's possible to write Fortran in any language. You aren't getting any benefit from numpy or python here. Are you aiming for speed or legibility? Also, with this code, you are using radius for the dimensions of the enclosing box, as well as the radius of the circle, so it'

fnmatch on filename (without specific extension)

2006-04-08 Thread kepioo
Hi, I have some files in a directory : Results Log, 11;21AM, Apr 09 2006.txt Results Log, 11;21AM, Apr 08 2006.txt Results Log, 03;59AM, Apr 07 2006.txt otherfile1.txt otherfile2.txt ... I'd like to copy all the Results Log file, whatever the hour but with a specific day. For instance, today (

how to print without blank?

2006-04-08 Thread Ju Hui
I want to print 3 numbers without blank. >>> for x in range(3): ... print x ... 0 1 2 >>> for x in range(3): ... print x, ... 0 1 2 how to print 012 ? thanks. -- http://mail.python.org/mailman/listinfo/python-list

Mysterious EOFError

2006-04-08 Thread Rex Eastbourne
Hi, I'm executing a python script as a cron job. When I run it myself from the command line it works, but when cron executes it I get an EOFError: File "/home/rex/cronscript.py", line 6, in ? level = int(raw_input("hello?")) EOFError: EOF when reading a line It's not the last line of the fil

Re: how to print without blank?

2006-04-08 Thread Ivan Herman
Ju Hui wrote: > I want to print 3 numbers without blank. for x in range(3): > ... print x > ... > 0 > 1 > 2 for x in range(3): > ... print x, > ... > 0 1 2 > > how to print > 012 > ? > > thanks. > You may want to use the write command with stdout: sys.stdout.write("%s

Re: Tkinter

2006-04-08 Thread Fredrik Lundh
"Jay" <[EMAIL PROTECTED]> wrote: > Cold somebody please enlighten me at why code 1 works perfectly and yet > code to will not display the gif file. > code 2 > ---START- > > from Tkinter import * > > class App: > def __init__(self, root): > self.MainFrame = Canvas(root)

Re: More pythonic circle?

2006-04-08 Thread Steven D'Aprano
On Sat, 08 Apr 2006 21:17:32 -0700, Pythor wrote: >> (3) legibility: there's no prize for the script with the absolutely >> minimum number of space characters :-) > True. I assume your saying I should make cx,cy,dx, and dy better > names. I probably will. Up to now I was just playing around wit

<    1   2