[Tutor] Shuts down when asking user for info

2011-01-26 Thread Casey Key
Please help , run the script and see that once you press enter after entering name it just shuts it down, help. print(\tWelcome to Casey's magical python code!) print(\tWritten by no other than Casey Key!) print(\nWe will begin by getting some information,mmmkay?) name = input(what is your name)

Re: [Tutor] The trap of the year

2011-01-26 Thread ALAN GAULD
When I read your tutorial I was probably blind... :-D I am going to re-read it. Actually I don't think I discuss it. I only mention default arguments very briefly because they are not a standard programming feature. My tutor tries to teach general programming not Python specifics so it

Re: [Tutor] Shuts down when asking user for info

2011-01-26 Thread tee chwee liong
maybe you can use raw_input? Date: Tue, 25 Jan 2011 19:51:28 -0700 From: i.eat.brain...@gmail.com To: tutor@python.org Subject: [Tutor] Shuts down when asking user for info Please help , run the script and see that once you press enter after entering name it just shuts it down, help.

Re: [Tutor] class question

2011-01-26 Thread Alan Gauld
Karim karim.liat...@free.fr wrote Program towards interface that means you have to use inheritance. Just to be picky, you can program by interface without using inheritance. Inheritance is only needed to implement interfaces in languages like C++. In Python (and other dynamically bound

Re: [Tutor] Shuts down when asking user for info

2011-01-26 Thread Alan Gauld
Casey Key i.eat.brain...@gmail.com wrote Please help , run the script and see that once you press enter after entering name it just shuts it down, help. -- print(\tWelcome to Casey's magical python code!) print(\tWritten by no other than Casey Key!) print(\nWe will begin by

Re: [Tutor] Shuts down when asking user for info

2011-01-26 Thread Alan Gauld
tee chwee liong tc...@hotmail.com wrote maybe you can use raw_input? It looks like the OP is using Python 3 so input() is the correct function. Alan G. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

Re: [Tutor] class question

2011-01-26 Thread Karim
Sure, but I come from java world and 1 inheritance is allowed but we can implement multiple interfaces. I like to use Abstract classes in Python then inherit and implement abstract method like in java (at least that's all I remember from Java experience). Indeed I was too direct everybody has

Re: [Tutor] class question

2011-01-26 Thread Karim
I know the the law of Murphy. But this one is a must-have.:-) Regards Karim * One way to reduce coupling is with the Law of Demeter: if you want your dog to walk, don't talk to your dog's legs. You will only confuse the dog and it won't get anywhere.

Re: [Tutor] class question

2011-01-26 Thread Elwin Estle
Elwin Estle wrote: Is it better to have one large sort of do it all class, or break the larger class up into smaller classes? Yes. Or no. It's impossible to answer that question definitively without knowing more about what it all is. But I can give some general advice: * Python isn't Java.

Re: [Tutor] class question

2011-01-26 Thread Tino Dai
A raw casting comes into a factory. It is listed as such. When machined, this part number changes to a different part number. The raw casting has no quality related stuff, but the machined casting does, and it can have more than one quality related thing. ...because, the raw casting

Re: [Tutor] class question

2011-01-26 Thread Izz ad-Din Ruhulessin
class Raw --- class Processor --- class Final 2011/1/26 Tino Dai obe...@gmail.com A raw casting comes into a factory. It is listed as such. When machined, this part number changes to a different part number. The raw casting has no quality related stuff, but the machined casting does,

Re: [Tutor] Having a problem with markdown

2011-01-26 Thread Tino Dai
On Wed, Jan 26, 2011 at 2:46 AM, ian douglas ian.doug...@iandouglas.comwrote: Hey all, I followed a tutorial on creating a very simple wiki in Python, which worked fine until the example where the instructor wanted to render the output through markdown.markdown() Here's the view code:

Re: [Tutor] Having a problem with markdown

2011-01-26 Thread ian douglas
Thanks Tino, It's certainly not homework, I'm learning Python after being in the Perl/PHP world for well over a decade. Trying to teach this old dog some new tricks. On Jan 26, 2011 6:47 AM, Tino Dai obe...@gmail.com wrote: On Wed, Jan 26, 2011 at 2:46 AM, ian douglas ian.doug...@iandouglas.com

[Tutor] Print to std output with color

2011-01-26 Thread Karim
Hello all, Is there a simple way to print with color to stdout like the unix/linux example below: *print( '^[[1;31mThis is a warning!^[[0m' ) where Ctrl-Vesc = ^[ *I see thing with curses module. But is there an more simple object in other module to do the trick? Kind of

[Tutor] Is it possible to make a circle of 1 hour

2011-01-26 Thread shaheryar ali
Hi every body, I was wondering, Is it possible to generate a circle on Google maps using python, such that distance in the created circle could be travel in 1 hour. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

[Tutor] tkinter, create widgets during runtime?

2011-01-26 Thread Elwin Estle
With Tcl/Tk, you can generate widgets on the fly during program execution, without having to explicitly create them in your code.  i.e., something like: for {set i 0} {$i = 5} {incr i} {     label .myLabel_$i -text this is label myLabel_$i     pack .myLabel_$i } ...which will generate five

Re: [Tutor] Tutor Digest, Vol 83, Issue 115

2011-01-26 Thread echowit
://mail.python.org/pipermail/tutor/attachments/20110126/c747b525/attachment.html -- ___ utor maillist - Tutor@python.org ttp://mail.python.org/mailman/listinfo/tutor nd of Tutor Digest, Vol 83, Issue 115

Re: [Tutor] class question

2011-01-26 Thread Alan Gauld
Karim karim.liat...@free.fr wrote Sure, but I come from java world and 1 inheritance is allowed but we can implement multiple interfaces. I like to use Abstract classes in Python then inherit and implement abstract method like in java (at least Sure and that is the normal way of doing it.

Re: [Tutor] Is it possible to make a circle of 1 hour

2011-01-26 Thread Alan Gauld
shaheryar ali brightstaar...@yahoo.com wrote I was wondering, Is it possible to generate a circle on Google maps using python, such that distance in the created circle could be travel in 1 hour. Technically it would be possible I'm sure. The trick is determining how big the circle should

Re: [Tutor] Print to std output with color

2011-01-26 Thread Scott Nelson
Curses is one way to go. Another is to use the PyWin32 module discussed in this thread: http://thread.gmane.org/gmane.comp.python.tutor/58450/focus=58454 Basically, here's a snippet of code that can get you started. This requires that you have the PyWin32 module installed (already installed by

Re: [Tutor] class question

2011-01-26 Thread Alan Gauld
Elwin Estle chrysalis_reb...@yahoo.com wrote The class in question, does, in fact, deal with a thing. The problem is, the thing is highly mutable. You can mutate objects, that is not a problem. But you need to be sure you need to. Is this really a series of different types of casting or

Re: [Tutor] Having a problem with markdown

2011-01-26 Thread Benjamin Kircher
On Jan 26, 2011, at 4:11 PM, ian douglas wrote: Thanks Tino, It's certainly not homework, I'm learning Python after being in the Perl/PHP world for well over a decade. Trying to teach this old dog some new tricks. On Jan 26, 2011 6:47 AM, Tino Dai obe...@gmail.com wrote: On Wed, Jan

Re: [Tutor] Print to std output with color

2011-01-26 Thread Alan Gauld
Karim karim.liat...@free.fr wrote Is there a simple way to print with color to stdout like the unix/linux example below: *print( '^[[1;31mThis is a warning!^[[0m' ) Not generically since stdout is a data stream which may not be printed (it could be spoken for example - how does the

Re: [Tutor] Print to std output with color

2011-01-26 Thread Alan Gauld
Karim karim.liat...@free.fr wrote Is there a simple way to print with color to stdout like the unix/linux example below: *print( '^[[1;31mThis is a warning!^[[0m' ) I should have said the effbot solution (and WConio) are only for Windows. On Linux I think you are pretty well stuck with

Re: [Tutor] Is it possible to make a circle of 1 hour

2011-01-26 Thread C.Y. Ruhulessin
Do time machines count to? 2011/1/26 Alan Gauld alan.ga...@btinternet.com shaheryar ali brightstaar...@yahoo.com wrote I was wondering, Is it possible to generate a circle on Google maps using python, such that distance in the created circle could be travel in 1 hour. Technically it

[Tutor] Class Docs - how much is too much?

2011-01-26 Thread Tim Johnson
FYI: I'm currently using version 2.6.5 I've developed a module which necessitates a very large amount of documentation. At this point all of the documentation is in the class docstring. I'm thinking that perhaps I should pare down the docstring and deliver specific documentation topics with

Re: [Tutor] Print to std output with color

2011-01-26 Thread Tim Golden
On 26/01/2011 6:10 PM, Scott Nelson wrote: Curses is one way to go. Another is to use the PyWin32 module discussed in this thread: http://thread.gmane.org/gmane.comp.python.tutor/58450/focus=58454 Basically, here's a snippet of code that can get you started. This requires that you have the

Re: [Tutor] Print to std output with color

2011-01-26 Thread Karim
Thanks a lot Scott for the tip! Regards Karim On 01/26/2011 07:10 PM, Scott Nelson wrote: Curses is one way to go. Another is to use the PyWin32 module discussed in this thread: http://thread.gmane.org/gmane.comp.python.tutor/58450/focus=58454 Basically, here's a snippet of code that can

Re: [Tutor] Print to std output with color

2011-01-26 Thread Karim
Thanks Alan! I will go there have a look. Regards Karim On 01/26/2011 07:24 PM, Alan Gauld wrote: Karim karim.liat...@free.fr wrote Is there a simple way to print with color to stdout like the unix/linux example below: *print( '^[[1;31mThis is a warning!^[[0m' ) Not generically since

Re: [Tutor] Print to std output with color

2011-01-26 Thread Scott Nelson
Curses is one way to go. Another is to use the PyWin32 module discussed in this thread: I just realized I was assuming you were on Windows. If you are on another OS, the code I posted will obviously not work for you as it is specific to Windows.

Re: [Tutor] Print to std output with color

2011-01-26 Thread Karim
That's what I figured out at effbot website. Thanks for the additional link Alan! Regards Karim On 01/26/2011 07:27 PM, Alan Gauld wrote: Karim karim.liat...@free.fr wrote Is there a simple way to print with color to stdout like the unix/linux example below: *print( '^[[1;31mThis is a

Re: [Tutor] Is it possible to make a circle of 1 hour

2011-01-26 Thread shaheryar ali
Alan, Well its gonna be by foot (walk) and it could be any place, road, city center, countryside, preferably you can say a leisure. but how to proceed with it, any Idea? I have made some logic for it but I am more Interested to know what other ideas could be, one more thing every time a

Re: [Tutor] Having a problem with markdown

2011-01-26 Thread ian douglas
Thanks, Benjamin, I figured it was a version issue, I'm just so new to Python that I didn't know where to look. Sorry for polluting the list with Django questions, I thought it was an underlying Python issue, not the framework. -id On 01/26/2011 10:10 AM, Benjamin Kircher wrote: Hi Ian.

Re: [Tutor] class question

2011-01-26 Thread Elwin Estle
--- On Wed, 1/26/11, Alan Gauld alan.ga...@btinternet.com wrote: From: Alan Gauld alan.ga...@btinternet.com Subject: Re: [Tutor] class question To: tutor@python.org Date: Wednesday, January 26, 2011, 1:10 PM Is this really a series of different types of casting or a single Workpiece going

Re: [Tutor] Class Docs - how much is too much?

2011-01-26 Thread Emile van Sebille
On 1/26/2011 11:03 AM Tim Johnson said... FYI: I'm currently using version 2.6.5 I've developed a module which necessitates a very large amount of documentation. At this point all of the documentation is in the class docstring. I'm thinking that perhaps I should pare down the docstring and

Re: [Tutor] Is it possible to make a circle of 1 hour

2011-01-26 Thread shaheryar ali
No, From: C.Y. Ruhulessin izzaddin.ruhules...@gmail.com To: Alan Gauld alan.ga...@btinternet.com Cc: tutor@python.org Sent: Wed, January 26, 2011 8:37:45 PM Subject: Re: [Tutor] Is it possible to make a circle of 1 hour Do time machines count to? 2011/1/26

Re: [Tutor] Class Docs - how much is too much?

2011-01-26 Thread Tim Johnson
* Emile van Sebille em...@fenx.com [110126 12:30]: On 1/26/2011 11:03 AM Tim Johnson said... I've developed a module which necessitates a very large amount of documentation. At this point all of the documentation is in the class docstring. I'm thinking that perhaps I should pare down the

Re: [Tutor] Is it possible to make a circle of 1 hour

2011-01-26 Thread Alan Gauld
shaheryar ali brightstaar...@yahoo.com wrote Well its gonna be by foot (walk) and it could be any place, road, city center, countryside, preferably you can say a leisure. OK, so if we limit it to on foot by any means then the circle would be about 3 miles (5km) in radius. but how to

[Tutor] get xml for parsing?

2011-01-26 Thread Alex Hall
Hi all, How would I go about getting the xml from a website through the site's api? The url does not end in .xml since the xml is generated based on the parameters in the url. For example: https://api.website.com/user/me/count/10?api_key=MY_KEY would return ten results (the count parameter) as

Re: [Tutor] get xml for parsing?

2011-01-26 Thread Stefan Behnel
Alex Hall, 27.01.2011 05:01: How would I go about getting the xml from a website through the site's api? The url does not end in .xml since the xml is generated based on the parameters in the url. For example: https://api.website.com/user/me/count/10?api_key=MY_KEY would return ten results (the