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

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

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

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

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 (

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'

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

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

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: 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: 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: 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: 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: 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: 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: 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: Curses and Character Handling

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

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

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

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

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

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

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

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

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

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

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: 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: 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 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: 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: 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 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: 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: 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 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: how relevant is C today?

2006-04-08 Thread Daniel Nogradi
> "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 >open*gl 66 Can anyone she

Re: programming puzzles?

2006-04-08 Thread [EMAIL PROTECTED]
John Salerno wrote: > Similar to the Python Challenge, does anyone know of any other websites > or books that have programming puzzles to solve? I found a book called > "Puzzles for Hackers", but it seems like it might be a little advanced > for me, and I've also read that it focuses too much on en

Re: Compleated Begginers Guide. Now What?

2006-04-08 Thread James Stroud
Mirco Wahab wrote: > Jay wrote: > Malchick, you cracked your veshchs to classes, which is > not that gloopy. So rabbit on them and add class methods > that sloosh on beeing called and do the proper veshchs > to the gulliwuts of their classes. Brillig! -- James Stroud UCLA-DOE Institute for Geno

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

2006-04-08 Thread Peter Hansen
DurumDara wrote: > So: I create a table in the first, and later I want to push some > elements to it. Before this example code I use special method to create > insert sql with tuple of values. But everytime it have been failed with > this message: SQL error or inaccessible database. Then I simpl

Re: how relevant is C today?

2006-04-08 Thread Mirco Wahab
Hi John > Because of my 'novice-ness' in programming, I had always thought that C > was replaced by C++ and wasn't really used anymore today. I know that's > not the case at all now, but I'm still curious how much C is used > anymore in programming today, and what purpose it serves. There is

Re: how relevant is C today?

2006-04-08 Thread Martin v. Löwis
John Salerno wrote: > Because of my 'novice-ness' in programming, I had always thought that C > was replaced by C++ and wasn't really used anymore today. I know that's > not the case at all now, but I'm still curious how much C is used > anymore in programming today, and what purpose it serves. Is

Re: Python-list Digest, Vol 31, Issue 119

2006-04-08 Thread Jay Parlar
On Apr 8, 2006, at 1:40 PM, [EMAIL PROTECTED] wrote: > > Hi there, > > I'm new to Python, but know other scripting and programming languages. > I > want to develop a script which will receive emails with attachments > from my POP3 account, perform certain actions on it and email it back > to some

Re: Receiving emails with attachments

2006-04-08 Thread Gerard Flanagan
[EMAIL PROTECTED] wrote: > Hi there, > > I'm new to Python, but know other scripting and programming languages. > I > want to develop a script which will receive emails with attachments > from my POP3 account, perform certain actions on it and email it back > to someone else. > > However, I'm not

Re: Compleated Begginers Guide. Now What?

2006-04-08 Thread Mirco Wahab
Jay wrote: > I have compleated the beginers guide to python > http://www.freenetpages.co.uk/hp/alan.gauld/. > then i found the Toolkit Tkinter and started on that. its graight and > av made lots of apps to help me with litle things but i have a big > problem. the CLASS method. Ledds viddy, m

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

2006-04-08 Thread Sandra-24
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 -- http://mail.python.org/mailman/listinfo/pyth

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

2006-04-08 Thread ArKane
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 cookies), etc. It seems to me

programming puzzles?

2006-04-08 Thread John Salerno
Similar to the Python Challenge, does anyone know of any other websites or books that have programming puzzles to solve? I found a book called "Puzzles for Hackers", but it seems like it might be a little advanced for me, and I've also read that it focuses too much on encryption and security is

how relevant is C today?

2006-04-08 Thread John Salerno
Because of my 'novice-ness' in programming, I had always thought that C was replaced by C++ and wasn't really used anymore today. I know that's not the case at all now, but I'm still curious how much C is used anymore in programming today, and what purpose it serves. Is it used for actual appli

Receiving emails with attachments

2006-04-08 Thread tomer . ha
Hi there, I'm new to Python, but know other scripting and programming languages. I want to develop a script which will receive emails with attachments from my POP3 account, perform certain actions on it and email it back to someone else. However, I'm not familiar with any Python library which doe

Re: Programming Tutorial for absolute beginners

2006-04-08 Thread Clodoaldo Pinto
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 integers it linked to the glossar

Re: Programming Tutorial for absolute beginners

2006-04-08 Thread James
If you're serious about this being a real introduction for someone who knows nothing, then you might want to start off by explaining what a programming language is (and why there are more than one) and then what a standard library is - perhaps explain it in terms of a large set of tools you can use

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

2006-04-08 Thread Dan Sommers
On 8 Apr 2006 11:24:04 -0700, "Sandra-24" <[EMAIL PROTECTED]> wrote: > I'm not sure how complex this is, I've been brainstorming a little, and > I've come up with: ["This" meaning how to determine if a line of python code is a continuation of the line above it.] > If the previous line ended with

Insertion (sql) bug in Py2.4 pySQLite 2.2

2006-04-08 Thread DurumDara
Hi ! I have this code in my program. Before this I use APSW, but that project's connection object doesn't have close method... ... crs.execute(*'''create table files (*f_id integer not null primary key, f_name varchar(255), f_size long, f_attr integer, f_crtime varchar(20), f_mdtime varchar(20)

Re: recognize a drive as removable media (e.g. compact flash, sd card or usb drive)

2006-04-08 Thread Tim Golden
Mike Joyce wrote: > I am trying to write a portable script that will find removable media, > such as compact flash, sd card, usb, etc. drive and then upload files > from the media. I want this to be portable so that I can write and > maintain one program for both Linux and Windows. Each platform us

Re: Programming Tutorial for absolute beginners

2006-04-08 Thread Clodoaldo Pinto
John Salerno wrote: > Clodoaldo Pinto wrote: > > > "Python is a remarkably powerful dynamic programming language that is > > used in a wide variety of application domains. Python is often compared > > to Tcl, Perl, Ruby, Scheme or Java. Some of its key distinguishing > > features include:..." > > I

Re: Programming Tutorial for absolute beginners

2006-04-08 Thread Duncan Smith
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 integers it linked to the glossary. And > similarly use "decima

Re: scipy/numpy inverse cumulative normal

2006-04-08 Thread Robert Kern
[EMAIL PROTECTED] wrote: > I was wondering if scipy/numpy has the inverse cumulative normal > function, ie the function f in this expression > > f(scipy.stats.norm.cdf(1.2)) = 1.2 > > or more generally, a function f which fits the criteria > > f(scipy.stats.norm.cdf(x)) = x Look in the file wh

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

2006-04-08 Thread Sandra-24
I'm not sure how complex this is, I've been brainstorming a little, and I've come up with: If the previous line ended with a comma or a \ (before an optional comment) That's easy to cover with a regex But that doesn't cover everything, because this is legal: l = [ 1, 2, 3 ]

Re: best way to install python modules on linux

2006-04-08 Thread Robert Kern
Fabian Braennstroem wrote: > Hi to all, > > thanks for your ideas! I just figured out a different way > using archlinux 'pacman' (package management tool like apt). > As a former archlinux user I am more used to adjust those > PKDBUILDs (kind of ebuilds under archlinux) than adjusting > debian pac

Re: Do I Need This?

2006-04-08 Thread Terry Reedy
"sdavies6" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >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 subfolders are >"DLLs," "Li

Re: Do I Need This?

2006-04-08 Thread Paul Boddie
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 subfolders are "DLLs," "Lib," > "libs," "Scripts," and, "td." I am not a programmer,

Re: minidom + wxPython woes

2006-04-08 Thread Paul Boddie
Frank Millman wrote: > Fredrik Lundh wrote: > > > > no, it's not a bug in the pyexpat module -- the problem is that > > wxPython uses it's own incompatible version of the expat library, > > and loads it in a way that causes problems for any library that's > > tries to use its own statically linked

Do I Need This?

2006-04-08 Thread sdavies6
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 subfolders are "DLLs," "Lib," "libs," "Scripts," and, "td." I am not a programmer, so I'm wondering if

Re: recognize a drive as removable media (e.g. compact flash, sd card or usb drive)

2006-04-08 Thread Larry Bates
Mike Joyce wrote: > I am trying to write a portable script that will find removable > media, such as compact flash, sd card, usb, etc. drive and then upload > files from the media. I want this to be portable so that I can write and > maintain one program for both Linux and Windows. Each platfor

Re: Programming Tutorial for absolute beginners

2006-04-08 Thread John Salerno
Clodoaldo Pinto wrote: > "Python is a remarkably powerful dynamic programming language that is > used in a wide variety of application domains. Python is often compared > to Tcl, Perl, Ruby, Scheme or Java. Some of its key distinguishing > features include:..." I'd be careful with that definition

Re: Working with decimal points

2006-04-08 Thread Fredrik Lundh
"Byte" wrote: > That dosnt work either: > > sum = 0.1+1/4 > print sum > > Just returns 0.1 division has higher precedence than addition, so 1/4 is calculated first, and the result is then added to 0.1. and as I've already explained, 1/4 is an integer division, so the result is rounded down to th

Re: Working with decimal points

2006-04-08 Thread [EMAIL PROTECTED]
Byte wrote: > That dosnt work either: > > sum = 0.1+1/4 > print sum > > Just returns 0.1 You get precedence right? Your equation does not evaluate from left to right. 1/4 happens first, and since there are no floats you get 0. in that equation you basically are doing this: sum = 1/4 print sum 0

Re: Where python looks for path

2006-04-08 Thread Philippe Martin
Hi, I had to move the dlls from pywin32_system32 to where python.exe is. PS: if someone has a great desire to have another library included in the package, let me know. Regards, Philippe Philippe Martin wrote: > Hi, > > I am currently packaging python and a few libraries: PyWin32, PySerial

Re: advice on this little script

2006-04-08 Thread R. Bernstein
"BartlebyScrivener" <[EMAIL PROTECTED]> writes: > There are several of these writing quotes, all good in their own way, And from Hamlet: brevity is the soul of wit. -- http://mail.python.org/mailman/listinfo/python-list

Re: Documentation for Tkinter/Tix

2006-04-08 Thread [EMAIL PROTECTED]
wesley's core python programming (i m havin the old one) has a good chaper on Tkinter. -- http://mail.python.org/mailman/listinfo/python-list

Re: Programming Tutorial for absolute beginners

2006-04-08 Thread James
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 integers it linked to the glossary. And similarly use "decimals" for floats? Less su

Re: calculating system clock resolution

2006-04-08 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: > Is it mentioned somewhere that print truncates floats ? 'print' prints str(time()). On the interactive prompt, you see repr(time()). float.__str__ truncates. I don't know where it's documented, but this is the reason why you see the truncation. Sybren --

Re: debug CGI with complex forms

2006-04-08 Thread R. Bernstein
"Sullivan WxPyQtKinter" <[EMAIL PROTECTED]> writes: > When the form in one HTML is very complex with a lot of fields(input, > button,radio,checkbox etc.), setting the environment is quite > burdernsome, so I usually change the stdout and stderr of the submit > processing script to a file object to

Re: calculating system clock resolution

2006-04-08 Thread jUrner
Starts getting confusing... on linux I get print time.time() >> xxx.23 Is it mentioned somewhere that print truncates floats ? Thats new to me. Kinda surprising that is. print '%.30' % time.time() >> xxx.23456678990... I knew it must have been hiding somewhere On windows I'd expect a resolution

Re: Programming Tutorial for absolute beginners

2006-04-08 Thread Clodoaldo Pinto
James wrote: > On the calculator page you describe the difference between 3.0 / 2 and > 3 / 2, but an absolute beginner probably wouldn't know about the > difference between integers and floats, or even what the two terms > meant. If you don't know much about computers then the fact that they > are

Re: Working with decimal points

2006-04-08 Thread Steven D'Aprano
On Sat, 08 Apr 2006 08:21:06 -0700, Byte wrote: > How come: > > sum = 1/4 > print sum > > returns 0? 1/4=0.25, not 0. How do I fix this? By default, / does integer division, not floating point. In integer division, 1/4 is 0, exactly as calculated. (How many fours go into one? Zero fours go in

Re: Programming Tutorial for absolute beginners

2006-04-08 Thread Clodoaldo Pinto
Bruno Desthuilliers wrote: > Clodoaldo Pinto a écrit : > > bill pursell wrote: > > > (snip) > >>2) In the section on installing, you begin with: > >>"Python is an interpreted, interactive, object-oriented programming > >>language.". The complete novice sees those words and expects > >>them to be e

Re: download for official Python logo artwork?

2006-04-08 Thread has
That'll do nicely. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Where python looks for path

2006-04-08 Thread Philippe Martin
PS: I forgot to say that on the win32api import I get a "DLL load failed" Philippe Philippe Martin wrote: > Hi, > > I am currently packaging python and a few libraries: PyWin32, PySerial, > PIL, wxPython, HTML generator, numarray for U3 distribution. > > Basically that means that the complete

Re: Working with decimal points

2006-04-08 Thread Byte
Fredrik Lundh's way works: thank a million! -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >