Re: [Tutor] quick question

2012-09-28 Thread Mark Lawrence
On 28/09/2012 06:18, jh wrote: [snip] The subtotal of your items is: 26010.8502 The total amount of your items plus tax is: 27,571.50 My question here is, why does my subtotal have so many decimals when I never went above 2 in my input? Thanks in advance, J Brett Ritter has already

Re: [Tutor] OT: Netiquette

2012-09-28 Thread Bod Soutar
On Sep 28, 2012 4:47 AM, "Dwight Hutto" wrote: > > On Wed, Sep 26, 2012 at 6:59 AM, Walter Prins wrote: > > Dwight, > > > > On 26 September 2012 09:26, Dwight Hutto wrote: > >> The only face I personally want to see of him > >>> because of this is his back. > >>> > >> > >> You wanna see my ass,

[Tutor] lazily decorated sort

2012-09-28 Thread Chris Smith
Hi all, I'm wondering if anyone has seen or knows of a good way to do a lazily decorated sort. I was reading about how good the DSU (decorate, sort, undecorate) approach is but the problem that we are running into in SymPy is that we want to get by with a fast hash sort if possible, and only decor

Re: [Tutor] how to print array without adding newline

2012-09-28 Thread vicki
Thank you for your reply. I understand that it is odd, but my program is being called from a hubot and returning data to it as well. I have figured out how to make the changes to get it to output the correct data in the correct format, but now I am getting a "Premature end of script headers" err

[Tutor] python new window

2012-09-28 Thread zack dunphey
I have used python a lot at school and am relatively good with it. I just tried to get it on my mac and i try to open a "new window" and every time I do it freezes and i have to either do a forced quit or unplug the whole computer. I have been able to get into a "new window" through programs

[Tutor] Writing a function to examine a directory and testing with unittest

2012-09-28 Thread Sukhvinder Singh
Hi. I have an assigment where I'm need to write a module containing a function to examine the contents of the current working directory and print out a count of how many files have each extension (".txt", ".doc", etc.) I am a beginner in Python. This is the code of the function module: --- impo

[Tutor] new student

2012-09-28 Thread james gillis
I am looking for some recommendations books to read.websites,links,any information would be appreciated. Thanks, jmslgil...@gmail.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org

[Tutor] list all links with certain extension in an html file python

2012-09-28 Thread Santosh Kumar
I want to extract (no I don't want to download) all links that end in a certain extension. Suppose there is a webpage, and in the head of that webpage there are 4 different CSS files linked to external server. Let the head look like this: http://foo.bar/part1.css";> http://foo.bar/part2.c

[Tutor] Storing information as attributes or as a dictionary

2012-09-28 Thread Michiel de Hoon
Dear all, Suppose I have a parser that parses information stored in e.g. an XML file. I would like to store the information contained in this XML file as a Python object. One option is to create a class like this: class Record(object): pass and store the information in the XML file as att

[Tutor] how to save text or dat file using python

2012-09-28 Thread Preeti Gaikwad
Hello I am new user of python pls let me know how to save dat or txt file using python? what is the basic cmd for this? thanks a lot in advance ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org

[Tutor] floating point rounding inconsistency

2012-09-28 Thread Andrew Tritt
Hello, I am new to python, and I was experimenting with the round function, and came across what appears to be a bug in floating point rounding. I am guessing there is a valid explanation for it. When I round the floating points 10.6[0-9]5 to two decimal places, it rounds as expected for 6 of the

[Tutor] Fwd: regarding saving data in ASCII format

2012-09-28 Thread Preeti Gaikwad
Hello i am new user of python pls let me know how to save the data in ascii formate Suppose I hv two column data in x and y like x(:,-1) and y(:,0) then how to save this in [x(:,-1), y(:,0)]; and then save this in ascii or dat file? thanks a lot in advance -- preeti gaikwad

[Tutor] (no subject)

2012-09-28 Thread CHERRY PHOUTHAVONG
I would like tutorial ? Thank You ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] assembly language and boot loader

2012-09-28 Thread Fit Wii
Hi there,   Is there any IDE or Python interpreter that can show the assembly language generated by each line of python code?  Is there any popular boot loader written in Python (plus some assembly code)?   Thanks, Jerry___ Tutor maillist - Tutor@pytho

[Tutor] Python for Absolute Beginners

2012-09-28 Thread Debbie Snowdon
Help! I'm into Chapter 2 in the Book by Michael Dawson - I cannot access the Companion Guide. Do I need it? Do I have to purchase it? How do I get it? The site he sends me to is very confusing.___ Tutor maillist - Tutor@python.org To unsubscribe or ch

Re: [Tutor] (no subject)

2012-09-28 Thread vishwajeet singh
On Fri, Sep 28, 2012 at 9:44 AM, CHERRY PHOUTHAVONG wrote: > I would like tutorial ? Thank You > What tutorial ? > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tut

Re: [Tutor] lazily decorated sort

2012-09-28 Thread Mark Lawrence
On 11/09/2012 12:44, Chris Smith wrote: Hi all, I'm wondering if anyone has seen or knows of a good way to do a lazily decorated sort. I was reading about how good the DSU (decorate, sort, undecorate) approach is but the problem that we are running into in SymPy is that we want to get by with a

Re: [Tutor] hello

2012-09-28 Thread Mark Lawrence
On 17/09/2012 20:21, Fation Beqirllari wrote: I have a php code and I want to translate it to python..Can you help me please,or show me how to do it ? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mai

Re: [Tutor] how to save text or dat file using python

2012-09-28 Thread Mark Lawrence
On 20/09/2012 17:14, Preeti Gaikwad wrote: Hello I am new user of python pls let me know how to save dat or txt file using python? what is the basic cmd for this? thanks a lot in advance ___ Tutor maillist - Tutor@python.org To unsubscribe or ch

Re: [Tutor] (no subject)

2012-09-28 Thread Mark Lawrence
On 28/09/2012 05:14, CHERRY PHOUTHAVONG wrote: I would like tutorial ? Thank You ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor Given that your subject is specif

Re: [Tutor] python new window

2012-09-28 Thread Oscar Benjamin
Hi Zack, On 11 September 2012 22:18, zack dunphey wrote: > I have used python a lot at school and am relatively good with it. I just > tried to get it on my mac and i try to open a "new window" and every time I > do it freezes and i have to either do a forced quit or unplug the whole > compute

Re: [Tutor] floating point rounding inconsistency

2012-09-28 Thread Oscar Benjamin
On 19 September 2012 19:27, Andrew Tritt wrote: > Hello, > > I am new to python, and I was experimenting with the round function, and > came across what appears to be a bug in floating point rounding. I am > guessing there is a valid explanation for it. > > When I round the floating points 10.6[0

Re: [Tutor] Fwd: regarding saving data in ASCII format

2012-09-28 Thread Mark Lawrence
On 21/09/2012 14:20, Preeti Gaikwad wrote: Hello i am new user of python pls let me know how to save the data in ascii formate Suppose I hv two column data in x and y like x(:,-1) and y(:,0) then how to save this in [x(:,-1), y(:,0)]; and then save this in ascii or dat file? thanks a lot in ad

Re: [Tutor] assembly language and boot loader

2012-09-28 Thread Oscar Benjamin
On 23 September 2012 05:46, Fit Wii wrote: > Is there any IDE or Python interpreter that can show the assembly language > generated by each line of python code? Is there any popular boot loader > written in Python (plus some assembly code)? > Python doesn't generate assembly language code. It d

Re: [Tutor] assembly language and boot loader

2012-09-28 Thread Mark Lawrence
On 23/09/2012 05:46, Fit Wii wrote: Hi there, Is there any IDE or Python interpreter that can show the assembly language generated by each line of python code? Is there any popular boot loader written in Python (plus some assembly code)? Thanks, Jerry __

Re: [Tutor] new student

2012-09-28 Thread Joel Goldstick
On Sat, Sep 8, 2012 at 12:08 PM, james gillis wrote: > I am looking for some recommendations books to > read.websites,links,any information would be appreciated. Thanks, > jmslgil...@gmail.com > http://python.org/doc/ is a nice place to start. -- Joel Goldstick _

Re: [Tutor] list all links with certain extension in an html file python

2012-09-28 Thread Oscar Benjamin
On 16 September 2012 08:20, Santosh Kumar wrote: > I want to extract (no I don't want to download) all links that end in > a certain extension. > > Suppose there is a webpage, and in the head of that webpage there are > 4 different CSS files linked to external server. Let the head look > like thi

Re: [Tutor] floating point rounding inconsistency

2012-09-28 Thread Mark Lawrence
On 28/09/2012 12:56, Oscar Benjamin wrote: On 19 September 2012 19:27, Andrew Tritt wrote: Hello, I am new to python, and I was experimenting with the round function, and came across what appears to be a bug in floating point rounding. I am guessing there is a valid explanation for it. When

Re: [Tutor] lazily decorated sort

2012-09-28 Thread Steven D'Aprano
On 11/09/12 21:44, Chris Smith wrote: Hi all, I'm wondering if anyone has seen or knows of a good way to do a lazily decorated sort. I was reading about how good the DSU (decorate, sort, undecorate) approach is but the problem that we are running into in SymPy is that we want to get by with a fa

Re: [Tutor] floating point rounding inconsistency

2012-09-28 Thread Dave Angel
On 09/19/2012 02:27 PM, Andrew Tritt wrote: > Hello, > > I am new to python, and I was experimenting with the round function, and > came across what appears to be a bug in floating point rounding. I am > guessing there is a valid explanation for it. Welcome to the Python tutor; hope you enjoy lea

Re: [Tutor] lazily decorated sort

2012-09-28 Thread Peter Otten
Chris Smith wrote: > I'm wondering if anyone has seen or knows of a good way to do a lazily > decorated sort. I was reading about how good the DSU (decorate, sort, > undecorate) approach is but the problem that we are running into in > SymPy is that we want to get by with a fast hash sort if possi

Re: [Tutor] how to save text or dat file using python

2012-09-28 Thread Dave Angel
On 09/20/2012 12:14 PM, Preeti Gaikwad wrote: > Hello I am new user of python pls let me know how to save dat or txt file > using python? what is the basic cmd for this? thanks a lot in advance > > Have you written any code that READs files? Check out the open() function, in particular the "w"

Re: [Tutor] assembly language and boot loader

2012-09-28 Thread Steven D'Aprano
On 28/09/12 21:59, Oscar Benjamin wrote: On 23 September 2012 05:46, Fit Wii wrote: Is there any IDE or Python interpreter that can show the assembly language generated by each line of python code? Is there any popular boot loader written in Python (plus some assembly code)? That's two unju

Re: [Tutor] floating point rounding inconsistency

2012-09-28 Thread Steven D'Aprano
On 28/09/12 22:15, Mark Lawrence wrote: The Python round function is itself problematic. The idea of deprecating it is currently being discussed on Python ideas. This quote from Calvin Spealman is typical "Also, I'd be completely in support of dropping round() and agree it gets misused and leads

Re: [Tutor] quick question

2012-09-28 Thread Steven D'Aprano
On 28/09/12 19:03, Mark Lawrence wrote: On 28/09/2012 06:18, jh wrote: [snip] The subtotal of your items is: 26010.8502 The total amount of your items plus tax is: 27,571.50 My question here is, why does my subtotal have so many decimals when I never went above 2 in my input? Thanks

Re: [Tutor] OT: Netiquette

2012-09-28 Thread Wayne Werner
On Fri, 28 Sep 2012, Bod Soutar wrote: On Sep 28, 2012 4:47 AM, "Dwight Hutto" wrote: > Yeah, all up in my fucking cranium with nothing but me and God to hold > on  to one another. > > -- > Best Regards, > David Hutto > CEO: http://www.hitwebdevelopment.com Probably not a good idea to advertis

Re: [Tutor] floating point rounding inconsistency

2012-09-28 Thread Mark Lawrence
On 28/09/2012 13:37, Steven D'Aprano wrote: On 28/09/12 22:15, Mark Lawrence wrote: Deprecating and dropping features causes pain to developers who are already using them correctly. There is strong opposition on deprecating round. And there is strong support for deprecating round. Personall

Re: [Tutor] list all links with certain extension in an html file

2012-09-28 Thread M Hussain
On Fri, Sep 28, 2012 at 1:10 PM, wrote: > Date: Sun, 16 Sep 2012 12:50:09 +0530 > From: Santosh Kumar > To: tutor@python.org > Subject: [Tutor] list all links with certain extension in an html file > python > Message-ID: > < > cae7maqa53x8pav96q2ka0vajhnjtrz_rgzcmh_cbsaqdiz5...@m

Re: [Tutor] how to print array without adding newline

2012-09-28 Thread wrw
On Sep 6, 2012, at 9:49 AM, vi...@thepenguin.org wrote: > Thank you for your reply. I understand that it is odd, but my program is > being called from a hubot and returning data to it as well. I have figured > out how to make the changes to get it to output the correct data in the > correct for

Re: [Tutor] list all links with certain extension in an html file python

2012-09-28 Thread Stefan Behnel
Santosh Kumar, 16.09.2012 09:20: > I want to extract (no I don't want to download) all links that end in > a certain extension. > > Suppose there is a webpage, and in the head of that webpage there are > 4 different CSS files linked to external server. Let the head look > like this: > > http:

Re: [Tutor] lazily decorated sort

2012-09-28 Thread eryksun
On Fri, Sep 28, 2012 at 8:17 AM, Peter Otten <__pete...@web.de> wrote: > > def make_key(keys): > @total_ordering > class Key(object): > def __init__(self, value): > self._keys = keys(value) > self._cached = [] Using a generator/iterator to pump the key valu

Re: [Tutor] how to save text or dat file using python

2012-09-28 Thread Prasad, Ramit
Preeti Gaikwad wrote: >   Hello I am new user of python pls let me know how to save dat or txt file > using python? what is the basic cmd for this? thanks a lot in advance Try reading: http://docs.python.org/tutorial/inputoutput.html#reading-and-writing-files This email is confidential and subje

Re: [Tutor] Python for Absolute Beginners

2012-09-28 Thread Emile van Sebille
On 9/27/2012 9:42 AM Debbie Snowdon said... Help! I'm into Chapter 2 in the Book by Michael Dawson - I cannot access the Companion Guide. Do I need it? Do I have to purchase it? How do I get it? The site he sends me to is very confusing. I'd ask your instructor or look in the book to see if the

[Tutor] Translate PHP to Python

2012-09-28 Thread bob gailer
As Mark pointed out - a better subject would help. I have changed it this time. On 9/17/2012 3:21 PM, Fation Beqirllari wrote: I have a php code and I want to translate it to python..Can you help me > please,or show me how to do it ? In what context do you run the PHP? A web server responding

Re: [Tutor] python new window

2012-09-28 Thread Alan Gauld
On 11/09/12 22:18, zack dunphey wrote: I have used python a lot at school and am relatively good with it. > I just tried to get it on my mac and i try to open a "new window" OK, Python doesn't have any windows so you must be talking about some kind of add-on tool - like IDLE maybe? If so please

[Tutor] Just flushed the moderation queue

2012-09-28 Thread Alan Gauld
I'm just back from 2 weeks vacation and catching up on mail etc. I flushed the python tutor mail queue earlier hence the proliferation of messages some of which may be duplicates of stuff already seen... enjoy, -- Alan G List moderator. ___ Tutor m

Re: [Tutor] python new window

2012-09-28 Thread Tahir Hafiz
On Tue, Sep 11, 2012 at 10:18 PM, zack dunphey wrote: > I have used python a lot at school and am relatively good with it. I just > tried to get it on my mac and i try to open a "new window" and every time I > do it freezes and i have to either do a forced quit or unplug the whole > computer. I

Re: [Tutor] Python for Absolute Beginners

2012-09-28 Thread Nathan
Which edition do you have? My copy mentions nothing about a companion guide, so my guess is that you don't need it. That said, my copy also doesn't send me to any sites for the exercises. Everything I need is right in the book. On Sep 28, 2012 7:30 AM, "Debbie Snowdon" wrote: > ** > Help! I'm int

Re: [Tutor] lazily decorated sort

2012-09-28 Thread Peter Otten
eryksun wrote: > On Fri, Sep 28, 2012 at 8:17 AM, Peter Otten <__pete...@web.de> wrote: >> >> def make_key(keys): >> @total_ordering >> class Key(object): >> def __init__(self, value): >> self._keys = keys(value) >> self._cached = [] > > > Using a generato

[Tutor] Lotka-Volterra Model Simulation Questions

2012-09-28 Thread Jim Apto
Hello folks, I'm relatively new to python, and was asked to program a lotka-volterra model (predator and prey relation) simulator. The program basically will basically have a menu that takes user input, collect data, and then create a graph. Currently i've been working on the simulator section;

Re: [Tutor] lazily decorated sort

2012-09-28 Thread eryksun
On Fri, Sep 28, 2012 at 3:34 PM, Peter Otten <__pete...@web.de> wrote: > >> Also, as far as I can see in the code, implementing "total_ordering" >> is unnecessary for sorting. One only needs to implement __lt__. It's >> used by binarysort() to test the pivot via the IFLT/ISLT macros: >> >> http://h

Re: [Tutor] Lotka-Volterra Model Simulation Questions

2012-09-28 Thread Prasad, Ramit
Jim Apto wrote > Hello folks, > > I'm relatively new to python, and was asked to program a lotka-volterra model > (predator and prey relation) > simulator.  The program basically will basically have a menu that takes user > input, collect data, and then > create a graph.  Currently i've been wor

Re: [Tutor] Lotka-Volterra Model Simulation Questions

2012-09-28 Thread Wayne Werner
On Fri, 28 Sep 2012, Jim Apto wrote: Hello folks, I'm relatively new to python, and was asked to program a lotka-volterra model (predator and prey relation) simulator.  The program basically will basically have a menu that takes user input, collect data, and then create a graph.  Currently i'v

Re: [Tutor] floating point rounding inconsistency

2012-09-28 Thread eryksun
On Fri, Sep 28, 2012 at 9:17 AM, Mark Lawrence wrote: > On 28/09/2012 13:37, Steven D'Aprano wrote: > >> Deprecating and dropping features causes pain to developers who are >> already using them correctly. There is strong opposition on deprecating >> round. > > And there is strong support for depr

Re: [Tutor] floating point rounding inconsistency

2012-09-28 Thread Devin Jeanpierre
On Fri, Sep 28, 2012 at 8:37 AM, Steven D'Aprano wrote: > On 28/09/12 22:15, Mark Lawrence wrote: > >> The Python round function is itself problematic. The idea of deprecating >> it is currently being discussed on Python ideas. This quote from Calvin >> Spealman is typical "Also, I'd be completely

Re: [Tutor] Lotka-Volterra Model Simulation Questions

2012-09-28 Thread Oscar Benjamin
On 28 September 2012 21:32, Jim Apto wrote: > Hello folks, > > I'm relatively new to python, and was asked to program a lotka-volterra > model (predator and prey relation) simulator. The program basically will > basically have a menu that takes user input, collect data, and then create > a graph

Re: [Tutor] Lotka-Volterra Model Simulation Questions

2012-09-28 Thread Alan Gauld
On 28/09/12 21:32, Jim Apto wrote: I'm relatively new to python, and was asked to program a lotka-volterra model (predator and prey relation) simulator. No idea what that means in practice but commenting purely on the code provided... x represents prey population y represents predator popu

Re: [Tutor] floating point rounding inconsistency

2012-09-28 Thread Mark Lawrence
On 28/09/2012 22:07, eryksun wrote: On Fri, Sep 28, 2012 at 9:17 AM, Mark Lawrence wrote: On 28/09/2012 13:37, Steven D'Aprano wrote: Deprecating and dropping features causes pain to developers who are already using them correctly. There is strong opposition on deprecating round. And there

Re: [Tutor] floating point rounding inconsistency

2012-09-28 Thread Alan Gauld
On 28/09/12 13:15, Mark Lawrence wrote: from Calvin Spealman is typical "Also, I'd be completely in support of dropping round() and agree it gets misused and leads to too much confusion. We should promote the right ways, and sometimes to show the right path you need to lock another door and thro

Re: [Tutor] Translate PHP to Python

2012-09-28 Thread bob gailer
On 9/28/2012 12:52 PM, Fation Beqirllari wrote: This php is for map cache,it reads cache file created,but im creating all the web server to python because it works faster..I use this for openlayers web server. I run Python 3.2.if you want to help me..i will send te php code..thank you!

Re: [Tutor] floating point rounding inconsistency

2012-09-28 Thread Steven D'Aprano
On 29/09/12 11:30, Alan Gauld wrote: On 28/09/12 13:15, Mark Lawrence wrote: from Calvin Spealman is typical "Also, I'd be completely in support of dropping round() and agree it gets misused and leads to too much confusion. We should promote the right ways, and sometimes to show the right path

Re: [Tutor] floating point rounding inconsistency

2012-09-28 Thread Steven D'Aprano
On 29/09/12 07:27, Devin Jeanpierre wrote: On Fri, Sep 28, 2012 at 8:37 AM, Steven D'Aprano wrote: [...] I'm not impressed. He sprouts off about how you can't use Python on mobile devices, when you can. What makes you think his opinions on breaking working code just because he thinks he knows