Re: [Tutor] Editing html using python

2010-02-15 Thread Stefan Behnel
Luke Paireepinart, 14.02.2010 13:12: > Also I think beautifulsoup is part of the Python standardlib now, isn't it? No, it's not. Stefan ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailma

Re: [Tutor] A Stuborn Tab Problem in IDLE

2010-02-15 Thread Alan Gauld
"Wayne Watson" wrote Thanks for the reminder on that. I haven't need the DOS box for 8 months. Just off on other non-programming efforts for the most part. Things have picked up of late. I was beginning to think for awhile that Win7 might have dropped it. I don't see any changes to it. Its

Re: [Tutor] Editing html using python

2010-02-15 Thread Alan Gauld
"Luke Paireepinart" wrote with BeautifulSoup were. Also I think beautifulsoup is part of the Python standardlib now, isn't it? Why do you think it is not maintained? I think you may be getting confused with element tree which is part of the standard lib? BS is still an add-on. Alan G.

Re: [Tutor] Getting caller name without the help of "sys._getframe(1).f_code.co_name" ?

2010-02-15 Thread patrice laporte
2010/2/14 Luke Paireepinart > I see why you would want the error messages but why is the default error > message not enough, that is why I am curious, and typically introspection on > objects is not necessary (for example, people often want to convert a string > into a variable name to store a va

Re: [Tutor] Editing html using python

2010-02-15 Thread Amit Sethi
Well ya I was kind of hoping to know about more tools and recommendations on how to edit broken html . Their were tags that I wanted to replace using beautifulSoup however i saw that the replacewith function was not available for many of the tags I wanted to replace . Also BeautifulSoup does not h

[Tutor] Problem with "input" in Python 3

2010-02-15 Thread pja
Hi! I am trying to teach myself how to program in Python using Zelle's "Python Programming: An Introduction to Computer Science" (a very good text). At the same time I have decided to start with Python 3 (3.1.1). That means that I have to convert Zelle's example code to Python 3 (which genera

[Tutor] Problem with "input" in Python 3

2010-02-15 Thread Peter Anderson
Hi! I am trying to teach myself how to program in Python using Zelle's "Python Programming: An Introduction to Computer Science" (a very good text). At the same time I have decided to start with Python 3 (3.1.1). That means that I have to convert Zelle's example code to Python 3 (which genera

Re: [Tutor] Problem with "input" in Python 3

2010-02-15 Thread Christian Witts
pja wrote: Hi! I am trying to teach myself how to program in Python using Zelle's "Python Programming: An Introduction to Computer Science" (a very good text). At the same time I have decided to start with Python 3 (3.1.1). That means that I have to convert Zelle's example code to Python 3 (

Re: [Tutor] Editing html using python

2010-02-15 Thread Stefan Behnel
Amit Sethi, 15.02.2010 13:28: > Well ya I was kind of hoping to know about more tools and recommendations on > how to edit broken html. You already found lxml, don't think you can do any better. Note that you shouldn't "edit broken html" but "fix broken HTML and then edit correct HTML". Writing ou

Re: [Tutor] Getting caller name without the help of "sys._getframe(1).f_code.co_name" ?

2010-02-15 Thread Kent Johnson
On Mon, Feb 15, 2010 at 6:07 AM, patrice laporte wrote: > My own experience is that there is too much coder that forget the app they > work on is aim to be used by "real human", not by C/C++/Python/put what ever > you want here/ guru : if your app popups to the user a message that is just > what

Re: [Tutor] Editing html using python

2010-02-15 Thread Kent Johnson
On Mon, Feb 15, 2010 at 7:28 AM, Amit Sethi wrote: > Well ya I was kind of hoping to know about more tools and recommendations on > how to edit broken html . This page lists several alternatives: html5, lxml, elementtree: http://www.crummy.com/software/BeautifulSoup/3.1-problems.html > Their wer

Re: [Tutor] Problem with "input" in Python 3

2010-02-15 Thread Kent Johnson
On Mon, Feb 15, 2010 at 7:34 AM, pja wrote: > 05 import math > 06 > 07 def main(): > 08 print("This program finds the real solutions to a quadratic\n") > 09 > 10 a, b, c = input("Please enter the coefficients (a, b, c): ") > 11 > 12 ''' > 13 a = int(input("Please enter the first coefficient: "))

Re: [Tutor] Problem with "input" in Python 3

2010-02-15 Thread Wayne Werner
On Mon, Feb 15, 2010 at 6:09 AM, Peter Anderson < peter.ander...@internode.on.net> wrote: > Hi! > > I am trying to teach myself how to program in Python using Zelle's "Python > Programming: An Introduction to Computer Science" (a very good text). At the > same time I have decided to start with Pyt

Re: [Tutor] Getting caller name without the help of "sys._getframe(1).f_code.co_name" ?

2010-02-15 Thread Dave Angel
patrice laporte wrote: 2010/2/14 Luke Paireepinart I see why you would want the error messages but why is the default error message not enough, that is why I am curious, and typically introspection on objects is not necessary (for example, people often want to convert a string into a variab

Re: [Tutor] Problem with "input" in Python 3

2010-02-15 Thread pja
Christian, You are a genius! There was one minor bug; the variable "in" needed to be changed to something like "in_value" and it works perfectly. Many thanks for that. Regards, Peter -- *Peter Anderson* There is nothing more difficult to take in hand, more perilous to conduct, or more uncert

Re: [Tutor] Problem with "input" in Python 3

2010-02-15 Thread Dave Angel
Peter Anderson wrote: Hi! I am trying to teach myself how to program in Python using Zelle's "Python Programming: An Introduction to Computer Science" (a very good text). At the same time I have decided to start with Python 3 (3.1.1). That means that I have to convert Zelle's example code to

Re: [Tutor] Getting caller name without the help of "sys._getframe(1).f_code.co_name" ?

2010-02-15 Thread patrice laporte
2010/2/15 Dave Angel > > This makes lots of sense. If the message doesn't make sense to the user, > there's no point. But why then is your thread titled "Getting caller name" > ? Why does the user care about the caller (function) name? When you > started the thread, it seemed clear that your

Re: [Tutor] Problem with "input" in Python 3

2010-02-15 Thread pja
Kent, Thanks! That works well! Regards, Peter -- *Peter Anderson* There is nothing more difficult to take in hand, more perilous to conduct, or more uncertain in its success, than to take the lead in the introduction of a new order of things—Niccolo Machiavelli, /The Prince/, ch. 6 _

Re: [Tutor] Editing html using python

2010-02-15 Thread Stefan Behnel
Kent Johnson, 15.02.2010 14:05: > On Mon, Feb 15, 2010 at 7:28 AM, Amit Sethi wrote: >> Well ya I was kind of hoping to know about more tools and recommendations on >> how to edit broken html . > > This page lists several alternatives: html5, lxml, elementtree: > http://www.crummy.com/software/Bea

[Tutor] Input() is not working as expected in Python 3.1

2010-02-15 Thread Yaraslau Shanhin
Hello All, I am working with Python tutorial in wiki and one of the exercises is as follows: Ask the user for a string, and then for a number. Print out that string, that many times. (For example, if the string is hello and the number is 3 you should print out hellohellohello.) Solution for this

Re: [Tutor] Input() is not working as expected in Python 3.1

2010-02-15 Thread Wayne Werner
On Mon, Feb 15, 2010 at 8:23 AM, Yaraslau Shanhin < yaraslau.shan...@gmail.com> wrote: > Hello All, > > I am working with Python tutorial in wiki and one of the exercises is as > follows: > > Ask the user for a string, and then for a number. Print out that string, > that many times. (For example,

Re: [Tutor] Input() is not working as expected in Python 3.1

2010-02-15 Thread Dave Angel
Yaraslau Shanhin wrote: Hello All, I am working with Python tutorial in wiki and one of the exercises is as follows: Ask the user for a string, and then for a number. Print out that string, that many times. (For example, if the string is hello and the number is 3 you should print out hellohello

Re: [Tutor] Input() is not working as expected in Python 3.1

2010-02-15 Thread bob gailer
Yaraslau Shanhin wrote: > Hello All, Hello. Suggestion for future questions - just include enough to identify the problem. We don't need to know that this is from a tutorial or what the exercise is. Also (at least I prefer) plain text without formatting or color. Sufficient therefore is:

Re: [Tutor] Input() is not working as expected in Python 3.1

2010-02-15 Thread Yaraslau Shanhin
Code: text = str(input("Type in some text: ")) number = int(input("How many times should it be printed? ")) print (text * number) Output: Type in some text: some How many times should it be printed? 5 Traceback (most recent call last): File "test4.py", line 2, in number = int(input("How ma

Re: [Tutor] Input() is not working as expected in Python 3.1

2010-02-15 Thread Rich Lovely
On 15 February 2010 15:15, Yaraslau Shanhin wrote: > Code: > text = str(input("Type in some text: ")) > number = int(input("How many times should it be printed? ")) > print (text * number) > Output: > Type in some text: some > How many times should it be printed? 5 > Traceback (most recent call la

Re: [Tutor] Editing html using python

2010-02-15 Thread Serdar Tumgoren
In the few cases I had where BeautifulSoup couldn't handle poorly formed HTML, I've found that html5lib was able to get the job done. And of course, lxml is great too, but has a bit more overhead installation-wis. ___ Tutor maillist - Tutor@python.org T

Re: [Tutor] Getting caller name without the help of "sys._getframe(1).f_code.co_name" ?

2010-02-15 Thread patrice laporte
2010/2/14 Steven D'Aprano > > > If the file do esn't exist, bing ! I got an exception "I/O Error n°2 > > : file doesn't exist". > > Are you sure? What version of Python are you using? I get a completely > different error message: > > Yes I'm not sure when I wrote : *I got an exception "I/O E

Re: [Tutor] Input() is not working as expected in Python 3.1

2010-02-15 Thread Grigor Kolev
В 10:06 -0500 на 15.02.2010 (пн), bob gailer написа: > Yaraslau Shanhin wrote: > > > Hello All, > > Hello. > > Suggestion for future questions - just include enough to identify the > problem. We don't need to know that this is from a tutorial or what the > exercise is. Also (at least I prefer

Re: [Tutor] A Stuborn Tab Problem in IDLE

2010-02-15 Thread Wayne Watson
I've found there's quite a bit of discrepancy in top vs bottom posting. It's hardly worth thinking about. I seem to navigate through top, bottom or mixed. The real problem, IMHO, is very long posts from various people. Marty Ah ha! Sorry for the noise, I should really read the whole message b

Re: [Tutor] Problem with "input" in Python 3

2010-02-15 Thread pja
Here is an interesting solution that I developed using the EasyGUI (http://easygui.sourceforge.net/) graphics library: # 7.2_quadratic2easy.py # A program that computes the real roots of a quadratic equation. # Bad version using a simple if to avoid program crash # This version uses the EasyGUI

Re: [Tutor] Problem with "input" in Python 3

2010-02-15 Thread pja
Sorry about the previous post; I didn't check the code format before I posted the reply and thus lost all the indentation. Here I go again, hopefully with the correct indentation. # 7.2_quadratic2easy.py # A program that computes the real roots of a quadratic equation. # Bad version using a si

[Tutor] Problem with "input" in Python 3

2010-02-15 Thread Peter Anderson
I seem to be having a formatting problem between Thunderbird on my PC and the mailing list; I am loosing all indentation. The Gmail account settings on Thunderbird are for plain text and I set the e-mail content to fixed width text so I'm not sure what's going wrong. I am trying one last time sendi

Re: [Tutor] Input() is not working as expected in Python 3.1

2010-02-15 Thread Yaraslau Shanhin
Thanks for try but print without () does not work at all, at least in newer version of python (3.1) Anyway source of problem is now discovered: Komodo Edit tool, in Python shell (IDLE) everything works fine. Perhaps anyone has any ideas why? On Mon, Feb 15, 2010 at 10:02 PM, Grigor Kolev wrote: