FAQ
Hi,

I've installed python 2.3.2 on my Win 2K. I try to run a simple script, but
I keep getting this message 'Python' is not recognized as an internal or
external command, operable program or batch file'.

what do I need to do?

_________________________________________________________________
Fast. Reliable. Get MSN 9 Dial-up - 3 months for the price of 1!
(Limited-time Offer) http://click.atdmt.com/AVE/go/onm00200361ave/direct/01/

Search Discussions

  • Rodolfo Rosario at Mar 5, 2004 at 11:26 am
    hello all,

    i`m a TOTAL newbie in programming in general and in python...i`m learning
    python because it`s the easier programming language around(at least they
    told me) and that it`s easy to enter the world of programming with it...i am
    reading "INSTANT HACKING" and i`m stuck with one of the exercises, i don`t
    know how to do it, please help me with it...

    EXERCISE 1
    Write a program that continually reads in numbers from the user and adds
    them together until the sum reaches 100.

    I really don`t know how to sum what the user types...:(

    rodux

    _________________________________________________________________
    The new MSN 8: smart spam protection and 2 months FREE*
    http://join.msn.com/?page=features/junkmail
  • Michael Janssen at Mar 8, 2004 at 7:00 am

    On Fri, 5 Mar 2004, Rodolfo Rosario wrote:

    i`m a TOTAL newbie in programming in general and in python...i`m learning
    python because it`s the easier programming language around(at least they
    told me) and that it`s easy to enter the world of programming with it...i am
    reading "INSTANT HACKING" and i`m stuck with one of the exercises, i don`t
    know how to do it, please help me with it...

    EXERCISE 1
    Write a program that continually reads in numbers from the user and adds
    them together until the sum reaches 100.

    I really don`t know how to sum what the user types...:(
    Hello Rodolfo,


    given by the Instant Hacking website you know already how to get input
    from the user.


    number = input("Type in a number: ")


    BTW: it's a pity that the author of this site chooses to use input
    instead of raw_input. The function input takes the user input *and evals
    it immidiatly" - that means: use it as a command. That's not good in
    respect of security and not good in respect of usability. input is more
    a function for "writing a quick script for expert use" to state from the
    Library Reference Docs.

    It's better to use raw_input and get strings from the user back:


    number_as_string = raw_input("Type in a number: ")
    number = int(number_as_string) # turn string into integer

    From here on, all you have to do is to ask the user for that many
    numbers, until their sum reaches 100. You will have to use some kind of
    a loop (I leave decission on "for" or "while" to you - that's a main
    part of this exercise and I wouldn't help you if I solve it for you :-),
    track the current sum in a variable and break the loop when your sum is
    100 or above ('above' would be the wrong result but the only way to know
    "until 100" is reached. You will need to print out the sum as it was
    before growing larger than 100. The easy case is when your user hits
    exactly the 100).


    Michael
  • Alan Gauld at Mar 7, 2004 at 7:46 pm

    I've installed python 2.3.2 on my Win 2K. I try to run a simple
    script, but
    I keep getting this message 'Python' is not recognized as an
    internal or
    external command, operable program or batch file'.
    How are you running the script?
    1) via the Start->Run dialog
    2) via a CMD (or DOS) box
    3) via explorer - double clicking
    4) From within IDLE

    Some other way?

    Also how does the message manifest itself? As a pop up dialog or as
    a message in the terminal window?

    My initial guess is that your PATH environment variable does not
    include Python, but I can't be sure based solely on what you've
    told us.

    Alan G.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouptutor @
categoriespython
postedMar 4, '04 at 8:40p
activeMar 8, '04 at 7:00a
posts4
users4
websitepython.org

People

Translate

site design / logo © 2022 Grokbase