On Thu, Apr 25, 2013 at 9:45 AM, Marc Tompkins wrote:
>
> If you put quotes around your input, Python recognizes it as a string
> literal. Python "executes" string literals by simply printing them to
> standard output - try it at a Python prompt sometime - which is probably not
> the behavior you
On Thu, Apr 25, 2013 at 8:45 AM, Marc Tompkins wrote:
> On Thu, Apr 25, 2013 at 5:40 AM, boB Stepp wrote:
> Remember that input(), in Python 2, executes what's passed to it. If your
> input is boB, then Python tries to execute the statement boB - and unless
> you've previously defined boB, Pyth
On Thu, Apr 25, 2013 at 5:40 AM, boB Stepp wrote:
> One thing that no one has addressed so far is why when I put quotes
> around my input, as in 'boB', the program does run in the command
> prompt.
>
Remember that input(), in Python 2, executes what's passed to it. If your
input is boB, then Py
Hi Steve,
>
>> E:\Programs\Python\IYOCGwPy\Ch4>guess.py
>
> Here you are telling Windows to look up the file association for .py files.
> It locates some program, and runs it with guess.py as the argument. Looking
> at the result:
>
>> Hello! What is your name?
>> boB
>> Traceback (most recent cal
Hi Danny,
>
> [The following note is Python 2.0 specific. In Python 3, input() is
> semantically different, and safe.]
>
> If you are using Python 2.0, don't use the input() function here to
> read strings. It is not safe: backing it is an implicit eval(), and
> eval() is dangerous, especially f
On Thu, Apr 25, 2013 at 12:51 AM, eryksun wrote:
> On Thu, Apr 25, 2013 at 3:41 AM, Marc Tompkins
> wrote:
> > On Wed, Apr 24, 2013 at 9:36 PM, eryksun wrote:
> >>
> >> .py files need to be associated with %windir%\py.exe.
> >
> >
> > NO!
> >
> > %windir% means "the directory where Windows is i
On Thu, Apr 25, 2013 at 3:41 AM, Marc Tompkins wrote:
> On Wed, Apr 24, 2013 at 9:36 PM, eryksun wrote:
>>
>> .py files need to be associated with %windir%\py.exe.
>
>
> NO!
>
> %windir% means "the directory where Windows is installed", usually (but not
> always) C:\Windows. You're saying that t
On Wed, Apr 24, 2013 at 9:36 PM, eryksun wrote:
> .py files need to be associated with %windir%\py.exe.
NO!
%windir% means "the directory where Windows is installed", usually (but not
always) C:\Windows. You're saying that there needs to be a py.exe in the
Windows directory - this is absolute
On Wed, Apr 24, 2013 at 10:11 PM, boB Stepp wrote:
> In my on again, off again studies of Python I am stumped on something
> that ought to be trivial, but I am not seeing it. When I run this
> program (only the part up to where the error occurs is shown):
>
> import random
>
> numberToGuess = ran
On Thu, Apr 25, 2013 at 12:11 AM, boB Stepp wrote:
> NameError: name 'boB' is not defined
>
> E:\Programs\Python\IYOCGwPy\Ch4>
>
> This has me totally puzzled. I thought it might have something to do
> with the fact that I also have Python 2.7 installed, so I removed it
> from the path variable an
On 25/04/13 14:11, boB Stepp wrote:
In my on again, off again studies of Python I am stumped on something
that ought to be trivial, but I am not seeing it. When I run this
program (only the part up to where the error occurs is shown):
import random
numberToGuess = random.randint(1, 20)
numberO
In my on again, off again studies of Python I am stumped on something
that ought to be trivial, but I am not seeing it. When I run this
program (only the part up to where the error occurs is shown):
import random
numberToGuess = random.randint(1, 20)
numberOfGuesses = 0
print("Hello! What is yo
12 matches
Mail list logo