Learning Python

2006-02-05 Thread Byte
I know this is probably a stupid question, but I'm learning Python, and am trying to get the if function to work with letters/words. Basicly, I'm trying to write a script that when run, says Please enter your name: Then, if the user types myself as the name , the output is OK. Thats all I want

Re: Learning Python

2006-02-05 Thread epost2
try: x = raw_input(Please enter your name: ) -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python

2006-02-05 Thread Xavier Morel
Byte wrote: x = input(raw_input(Please enter your name: )) if x==myself: print 'OK' It kinda works - I can get to the please enter your name bit but then it simply reprints your input as output. Someone please HELP! -- C:\python Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit

Re: Learning Python

2006-02-05 Thread Florian Nykrin
Hi Byte! Your code should look like this: x = raw_input('Please enter your name: ') if x == 'myself': print 'OK' Because myself should be a string and not a variable name, you have to put it in quotes. Regards, Florian. -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python

2006-02-05 Thread Byte
Florian Nykrin, that works! Thanks! p.s. Xavier Morel, you seem to be using Windows, not Linux, and I got the idea of stacking input on a raw_input from the official Python Tutorial. -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python

2006-02-05 Thread Ivan Shevanski
On 2/5/06, Ivan Shevanski [EMAIL PROTECTED] wrote: On 2/5/06, Florian Nykrin [EMAIL PROTECTED] wrote: Hi Byte!Your code should look like this:x = raw_input('Please enter your name: ')if x == 'myself': print 'OK' Because myself should be a string and not a variable name, you have toput it in

Re: Learning Python

2006-02-05 Thread Ivan Shevanski
On 2/5/06, Ivan Shevanski [EMAIL PROTECTED] wrote: On 2/5/06, Ivan Shevanski [EMAIL PROTECTED] wrote: On 2/5/06, Florian Nykrin [EMAIL PROTECTED] wrote: Hi Byte!Your code should look like this:x = raw_input('Please enter your name: ')if x == 'myself': print 'OK' Because myself should be

Re: Learning Python

2006-02-05 Thread Fredrik Lundh
Byte wrote: p.s. Xavier Morel, you seem to be using Windows, not Linux, and I got the idea of stacking input on a raw_input from the official Python Tutorial. link, please. /F -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python

2006-02-05 Thread Luis M. González
Use input to enter numbers, and raw_input to enter strings. For example: x = input('Enter your age: ') y = raw_input('Enter your name: ') -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python

2006-02-05 Thread Fredrik Lundh
Byte wrote: p.s. Xavier Morel, you seem to be using Windows, not Linux what makes you think that basic Python functions work in radically different ways on different platforms ? /F -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python

2006-02-05 Thread Byte
what makes you think that basic Python functions work in radically different ways on different platforms ? Assumption. Im also new to programing, so could do something stupid like think a Windows path is a command/input/etc. (really, ive done things like that before.) Now, im running this on a

Re: Learning Python

2006-02-05 Thread Byte
http://docs.python.org/tut/node6.html#SECTION00610 -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python

2006-02-05 Thread Alex Martelli
Byte [EMAIL PROTECTED] wrote: http://docs.python.org/tut/node6.html#SECTION00610 I think you're confusing the tutorial's use of: int(raw_input(... which means get a string from the user and turn it into an integer (a very common idiom), with your use of:

Re: Learning Python

2006-02-05 Thread Xavier Morel
Byte wrote: p.s. Xavier Morel, you seem to be using Windows, not Linux I don't see how this may even remotely be relevant, Python is cross platform and (mostly) works the same regardless of the OS I got the idea of stacking input on a raw_input from the official Python Tutorial.

Re: Learning Python

2006-02-05 Thread Xavier Morel
Byte wrote: http://docs.python.org/tut/node6.html#SECTION00610 -- x = int(raw_input(Please enter an integer: )) -- Unless my eyes fail me, it's written int, not input, the goal of this line is to convert the return value of raw_input (a string) into an integer. --

Re: Learning Python

2006-02-05 Thread Byte
Thanks, never knew that, but they are using raw_input as a stack, aren't they? -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python

2006-02-05 Thread Xavier Morel
Byte wrote: Assumption. Im also new to programing, so could do something stupid like think a Windows path is a command/input/etc. (really, ive done things like that before.) Don't assume anything when you have no reason to, and especially don't assume that a cross-platform programming

Re: Learning Python

2006-02-05 Thread Byte
Yes, sorry, didnt realise diffrence between int and input. Since i'm such an idiot at this, any links to sites for people who need an unessicerily gentle learning curve? -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python

2006-02-05 Thread Byte
parse the expression, extract the operands and the operation, apply the operation to the operands How? Give me some example code, but please keep it simple. are you trying to code a calculator? Not intending to, just trying to learn Python. Suppose what i'm trying to code is a but like a CLI

Re: Learning Python

2006-02-05 Thread Xavier Morel
Byte wrote: parse the expression, extract the operands and the operation, apply the operation to the operands How? Give me some example code, but please keep it simple. are you trying to code a calculator? Not intending to, just trying to learn Python. Suppose what i'm trying to code

Re: Learning Python

2006-02-05 Thread Byte
I asked to keep it simple! Anyway, ill try Dive into Python, thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python

2006-02-05 Thread Alex Martelli
Byte [EMAIL PROTECTED] wrote: Thanks, never knew that, but they are using raw_input as a stack, aren't they? No. raw_input is a function object, using it as a stack is a rather meaningless phrase. You can use a list as a stack, but that's totally and absolutely unrelated to that spot in the

Re: Learning Python

2006-02-05 Thread Blair P. Houghton
Xavier Morel wrote: Where the hell did you get the idea of stacking input on a raw_input in the first place? I'm guessing it goes something like: input is a verb, but raw_input is a noun, so raw_input looks like a cast or conversion or stream constructor, and input looks like an action...

Re: Learning Python

2006-02-05 Thread Magnus Lycka
Byte wrote: Yes, sorry, didnt realise diffrence between int and input. Since i'm such an idiot at this, any links to sites for people who need an unessicerily gentle learning curve? http://wiki.python.org/moin/BeginnersGuide http://www.honors.montana.edu/~jjc/easytut/easytut/

Re: Learning Python

2006-02-05 Thread Xavier Morel
Byte wrote: I asked to keep it simple! Anyway, ill try Dive into Python, thanks It is simple, merely explicit and with some details. -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python

2006-02-05 Thread Steve Holden
Xavier Morel wrote: Byte wrote: I asked to keep it simple! Anyway, ill try Dive into Python, thanks It is simple, merely explicit and with some details. It seemed to me a bit like an attempt to save a drowning man by opening a firehose on his mouth :-) regards Steve -- Steve Holden

Re: learning python, using string help

2006-02-03 Thread Tom Anderson
On Fri, 2 Feb 2006, [EMAIL PROTECTED] wrote: silly newbie mistake your code runs fine on my openbsd box. ( I didnt uncomment the return map(...) line My apologies - i should have made it clearer in the comment that it was hardwired to return example data! thanks for the awesome example!

learning python, using string help

2006-02-02 Thread [EMAIL PROTECTED]
hi all, I have a simple snippet I am trying to keep the format the same as plain text, though I want to embed it in html ... basically, print Content-type:text/plain\n\n; getrup = os.popen('ruptime').read() print getrup is the same format as if I ran 'ruptime' from the command line. If I

Re: learning python, using string help

2006-02-02 Thread Paul McGuire
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] hi all, I have a simple snippet I am trying to keep the format the same as plain text, though I want to embed it in html ... basically, print Content-type:text/plain\n\n; getrup = os.popen('ruptime').read() print getrup is the

Re: learning python, using string help

2006-02-02 Thread [EMAIL PROTECTED]
Well, I did want to add some formatting for example STATUS = up getrup = os.popen('ruptime').read() show = getrup.splitlines() gethost = show[0] hostname = gethost.split() print hostname[0] getstatus = hostname[1] if getstatus.find(STATUS): print STATUS else: print font

Re: learning python, using string help

2006-02-02 Thread Tom Anderson
On Thu, 2 Feb 2006, [EMAIL PROTECTED] wrote: Well, I did want to add some formatting for example I getcha. This is really an HTML problem rather than a python problem, isn't it? What you need to do is output a table. FWIW, here's how i'd do it (assuming you've got HP-UX ruptime, since that's

Re: learning python, using string help

2006-02-02 Thread [EMAIL PROTECTED]
thanks tom, I am running OpenBSD, NetBSD as well as OS X (FreeBSD) My first python script #!/usr/local/bin/python print Content-type:text/html\n\n; import os, string getrup = os.popen('ruptime').read() show = getrup.splitlines() for line in show: if line.find(up or down):

Re: learning python, using string help

2006-02-02 Thread [EMAIL PROTECTED]
Tom, the script you referenced me errored ... But I will see if I can get it working. -- http://mail.python.org/mailman/listinfo/python-list

Re: learning python, using string help

2006-02-02 Thread [EMAIL PROTECTED]
silly newbie mistake your code runs fine on my openbsd box. ( I didnt uncomment the return map(...) line thanks for the awesome example! --mike -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python...

2005-12-06 Thread David Van Mosselbeen
Falc wrote: Hi there... I have been looking at learning Python, so far it looks like an absolutely grat language. I am having trouble finding some free resources to learn Python from. I am on windows and the only experience I have with programming is with PHP. I have been trying to look

Learning Python...

2005-12-05 Thread Falc
Hi there... I have been looking at learning Python, so far it looks like an absolutely grat language. I am having trouble finding some free resources to learn Python from. I am on windows and the only experience I have with programming is with PHP. I have been trying to look at the free online

Re: Learning Python...

2005-12-05 Thread Klaus Alexander Seistrup
Falc wrote: So if you have any books you could reccomend me that would rock, I can't really afford a book so if online that would be excellent. Have you looked into: http://wiki.python.org/moin/BeginnersGuide http://python.org/doc/Intros.html Cheers, -- Klaus Alexander Seistrup

Re: Learning Python...

2005-12-05 Thread Laurent
Falc wrote: Hi there... I have been looking at learning Python, so far it looks like an absolutely grat language. I am having trouble finding some free resources to learn Python from. I am on windows and the only experience I have with programming is with PHP. I have been trying to look

Re: Learning Python...

2005-12-05 Thread Falc
I am going to read A Byte Of Python and possibly a few others afterwards. I sure will read Dive into Python. Thanks a lot guys, it's beed a great help. I'll buy Learning Python when I can but I'm on a *very* tight budget at the moment. Thanks again. :) -- http://mail.python.org/mailman

Re: Learning Python...

2005-12-05 Thread BartlebyScrivener
Wow, That's one I hadn't seen before. Thanks. bs -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python

2005-10-11 Thread Chris Dewin
On Mon, 10 Oct 2005 17:20:35 +, dannypatterso wrote: [snip] I'm a hobby programmer using mostly BASIC(s) and some Java. I know procedural programming and I know what encapsulation, inheritance and polymorphism are but I have very little experience in using them as I've written just a

Re: Learning Python

2005-10-11 Thread Paul Rubin
Chris Dewin [EMAIL PROTECTED] writes: There was an excellent such primer on devshed, by Icarus, but they appear to have taken it down. I saved a copy of it to my HD. Would there be anything morally, or legally wrong with me uploading it to my site? A little googling shows it's still up at:

Re: Learning Python

2005-10-11 Thread Paul DiRezze
These are all great suggestions. Thanks to all who replied. paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python

2005-10-11 Thread Steven D'Aprano
On Tue, 11 Oct 2005 18:26:58 +0900, Chris Dewin wrote: On Mon, 10 Oct 2005 17:20:35 +, dannypatterso wrote: [snip] I'm a hobby programmer using mostly BASIC(s) and some Java. I know procedural programming and I know what encapsulation, inheritance and polymorphism are but I have

Re: Learning Python

2005-10-11 Thread Markus
I do highly recommend this site, too. Listen to the python411 podcast shows. It's great. Jeff Fox wrote: Lots of links to all levels of tutorials and documentation here: http://www.awaretek.com/plf.html Python Podcast too! -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python

2005-10-11 Thread Daniel Schüle
Paul DiRezze wrote: I'm spending the next two weeks off and I'm looking to take a crack at learning how to program in Python. Here's a list of the places I've bookmarked: http://www.python.org/doc/ and more specifically http://wiki.python.org/moin/

Re: Learning Python

2005-10-11 Thread Markus Rosenstihl
On 2005-10-10 18:50:18 +0200, Paul DiRezze [EMAIL PROTECTED] said: I'm spending the next two weeks off and I'm looking to take a crack at learning how to program in Python. Here's a list of the places I've bookmarked: http://www.python.org/doc/ and more specifically

Learning Python

2005-10-10 Thread Paul DiRezze
I'm spending the next two weeks off and I'm looking to take a crack at learning how to program in Python. Here's a list of the places I've bookmarked: http://www.python.org/doc/ and more specifically http://wiki.python.org/moin/ http://wiki.python.org/moin/BeginnersGuide

Re: Learning Python

2005-10-10 Thread Matt Feinstein
On Mon, 10 Oct 2005 12:50:18 -0400, Paul DiRezze [EMAIL PROTECTED] wrote: I'm spending the next two weeks off and I'm looking to take a crack at learning how to program in Python. Here's a list of the places I've bookmarked: http://www.python.org/doc/ and more specifically

Re: Learning Python

2005-10-10 Thread dannypatterson
I would suggest buying Beginning Python: Novice to Professional, by Magnus hetland. It is IMO the best Python book written to date. This book this mailing-list and Python.org are all you should need. I'm spending the next two weeks off and I'm looking to take a crack at learning how to

Re: Learning Python

2005-10-10 Thread hrh1818
A good introduction to Python is the recently published book Beginning Python from Novice to Pro. It provides a quick introduction to Python, skips a lot of the details hard core programmers expect, and has very few samples of difficult to understand lines of code that can easily discourage the

Re: Learning Python

2005-10-10 Thread gene tani
This should be good for a couple weeks http://www.awaretek.com/tutorials.html http://www.rexx.com/~dkuhlman/python_101/python_101.html http://www.rexx.com/~dkuhlman/python_201/python_201.html http://www.ibiblio.org/obp/py4fun/ http://the.taoofmac.com/space/Python/Grimoire

Re: Learning Python

2005-10-10 Thread Terry Hancock
programmer using mostly BASIC(s) and some Java. I learned from Learning Python from O'Reilly. There's a new edition out that covers a somewhat more recent version of Python (2.3, I think). I learned BASIC as a teen -- Fortran, Pascal, C, and a bit of C++ later, so I think you probably have

Re: Learning Python

2005-10-10 Thread Jeff Fox
Lots of links to all levels of tutorials and documentation here: http://www.awaretek.com/plf.html Python Podcast too! -- http://mail.python.org/mailman/listinfo/python-list

tutorials/basic (Re: learning python)

2005-09-06 Thread adDoc's networker Phil
. on-line tutorials? hundreds of e-books sorted by subtopic http://www.awaretek.com/tutorials.html -- Python Newbies should visit our Python411 Podcast Series Page http://www.awaretek.com/python/index.html -- Python for Mobile Devices http://www.awaretek.com/pymo.html Table of Contents

tutorials / text or web processing (Re: learning python)

2005-09-06 Thread adDoc's networker Phil
. need specifics on text or web processing? dozens of tutors.py sorted by subtopic http://www.awaretek.com/tutorials.html Table of Contents [rearranged] [ beginner`s applications ]: *Text and String Processing (3)* . *Unicode (4)* *Regular Expressions(5)* *HTML and XML (14)* *Internet:

Re: learning python

2005-09-05 Thread Bugs
If you're already fluent in other programming language(s) [sounds like you are], then this is decent and available free online: http://www.diveintopython.org/ placid wrote: Sometimes when you concentrate on complicated problems your thinking of a complicated solution and not a simple one.

learning python

2005-09-04 Thread placid
Hi all, I was just wondering about good books that teach python (either with programming or no programming experience at all) ? Or some online tutorial? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: learning python

2005-09-04 Thread Christopher Culver
placid [EMAIL PROTECTED] writes: I was just wondering about good books that teach python (either with programming or no programming experience at all) ? Or some online tutorial? Did you even bother doing a web search? Learn Python or Python tutorial would be enough. Christopher --

Re: learning python

2005-09-04 Thread placid
Christopher Culver wrote: placid [EMAIL PROTECTED] writes: I was just wondering about good books that teach python (either with programming or no programming experience at all) ? Or some online tutorial? Did you even bother doing a web search? Learn Python or Python tutorial would be

Re: learning python

2005-09-04 Thread Benji York
placid wrote: Christopher Culver wrote: placid [EMAIL PROTECTED] writes: I was just wondering about good books that teach python (either with programming or no programming experience at all) ? Or some online tutorial? Did you even bother doing a web search? Learn Python or Python tutorial would

Re: learning python

2005-09-04 Thread placid
Benji York wrote: placid wrote: Christopher Culver wrote: placid [EMAIL PROTECTED] writes: I was just wondering about good books that teach python (either with programming or no programming experience at all) ? Or some online tutorial? Did you even bother doing a web search? Learn

Learning Python - IM Wiki

2005-07-08 Thread Jorge Louis De Castro
Hello, I am a Java Developer that has been learning Python by doing simple things. I am loving thisinitial vibeI'mgetting outof Python. However, because I feel programmers ofa certainlanguagesbring with them certain vices when moving to other languages, I'd like to have feedback from

Re: Learning Python - IM Wiki

2005-07-08 Thread Miki Tebeka
Hello Jorge, Is there some sort of a Wiki where I could post the code and have advice on what, how and where to improve? Or should I post the code it here? You can always get help here, the Python community is *very* helpful. If you prefer a Wiki, try www.wikispaces.org for free Wiki

Re: Learning Python - IM Wiki

2005-07-08 Thread gene tani
The python tutor good for this http://mail.python.org/mailman/listinfo/tutor Miki Tebeka wrote: Hello Jorge, Is there some sort of a Wiki where I could post the code and have advice on what, how and where to improve? Or should I post the code it here? You can always get help

Re: Good starterbook for learning Python?

2005-07-06 Thread Fuzzyman
A book that will stay useful as a referene *after* you've used it to learn is 'Programming Python'. Best Regards, Fuzzy http://www.voidspace.org.uk/python -- http://mail.python.org/mailman/listinfo/python-list

Re: Good starterbook for learning Python?

2005-07-06 Thread Renato Ramonda
Lennart ha scritto: Programming Python will I sell as a book that i read secondly, and use as a reference. I'd like to suggest also Thinking like a CS in python: a schoolbook used in real classes to teach the basis of programming. -- Renato Usi Fedora? Fai

Re: Good starterbook for learning Python?

2005-07-06 Thread Luis M. Gonzalez
, but these ones are very good. The first one is best for someone who knows nothing about programing, and the second one is probably better for you, since you already have some experience. It's good for absolute beginners though. Books: - Learning Python by Mark Lutz - Core Python by Wesley Chun

Good starterbook for learning Python?

2005-07-05 Thread Lennart
Hi everybody, Can someone advice me with the following issue: i want to learn python in my summer vacation (i try to ...:-) So, a good start is buying a good book. But wich? There are many ... I'm living in the Netherlands and I prefer a book from bol.com (see link) because i've to order more

Re: Good starterbook for learning Python?

2005-07-05 Thread TechBookReport
=BOOK_EN%2eCATEGORYSecondary=YESTemplate=BOL_subcat_BOOK_EN_1476 Two excellent books match your criteria: Dive Into Python (review: http://www.techbookreport.com/tbr0103.html) - also available as a free download. Learning Python (review: http://www.techbookreport.com/tbr0064.html) Both

Re: Good starterbook for learning Python?

2005-07-05 Thread Patrick Rutkowski
=HwqR5Kpb8AUAAADqVW6ZypJb CategoryLeftpanel=BOOK_EN%2eCATEGORYSecondary=YESTemplate=BOL_sub cat_BOOK_EN_1476 I've taken up learning python over the summer as well. http://safari.oreilly.com/ is a website which sells IT books for on-line viewing. They charge $20 per month and you get 10 slots on your

Re: Good starterbook for learning Python?

2005-07-05 Thread Lennart
: Dive Into Python (review: http://www.techbookreport.com/tbr0103.html) - also available as a free download. Learning Python (review: http://www.techbookreport.com/tbr0064.html) Both are recommended for beginners but have a reasonable level of depth. They're clear, enthusiastic and well

Re: Good starterbook for learning Python?

2005-07-05 Thread Sybren Stuvel
Lennart enlightened us with: Can someone advice me with the following issue: i want to learn python in my summer vacation (i try to ...:-) So, a good start is buying a good book. But wich? There are many ... http://www.diveintopython.org/ - I read it during the weekend, and it's a very good

Re: Good starterbook for learning Python?

2005-07-05 Thread dimitri pater
hi, although Dive into Python is a *very, very* good Python book (I own the real book) I would not recommend it as your first book to learn Python. Take a look at Practical Python by Hetland first for instance, it will teach you all the basic stuff. Then move over to Dive into Python and also

Learning Python - resources and ideas

2005-02-08 Thread [EMAIL PROTECTED] (Cody Houston)
Hi. What is the best way to learn Python? None of the local schools near me teach any courses on the topic. Thanks. -- Cody Houston [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Learning Python - resources and ideas

2005-02-08 Thread [EMAIL PROTECTED] (Cody Houston)
Hi. What is the best way to learn Python? None of the local schools near me teach any courses on the topic. Thanks. -- Cody Houston [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python - resources and ideas

2005-02-08 Thread Brian van den Broek
http://mail.python.org/mailman/listinfo/tutor. A free book that starts very slow (it is aimed at high-school students) is http://www.ibiblio.org/obp/thinkCSpy/ I started with that, until I had a bit of a sense of things (Python is my first language since some BASIC quite some time ago). The Learning

Re: Learning Python - resources and ideas

2005-02-08 Thread Luis M. Gonzalez
(google this). I learned the basics with it. Then you can try any of the other resources listed in www.python.org. If you're willing to buy a book, try Learning Python 2nd.Ed by Mark Lutz or Core Python by Wesley Chun. Regards, Luis -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning Python for a new beginner

2005-02-04 Thread Nick Coghlan
Lisa Horton wrote: I hear that Python is one of the easiest languages to learn. It is easier than PHP or Pearl? Is it as useful as those two? I am attracted to Python as a first language, but I just want to be sure I will be able to use it. Opinions, thoughts, thanks! I suggest grabbing the 2.4

Re: Learning Python for a new beginner

2005-02-04 Thread Piet
built-in tools for writing, editing and running programs, good and user-friendly documentation (which appears to be better organized than Perl´s doc), and a lot of built-in functions to handle data structures and files in an easily tractable, easily remembered way. By learning Python, you will also

<    1   2   3   4   5   6