A while back I made a big fuss about how IDLE indenting works. Kent was
finally able to use language simple enough for me to understand. So I
kept working IDLE. Today I got an error message. Somebody fixed it! It
now indents just like all the other Python windows. Great going, Snake.
And thank
Allen G.asked me how I made IDLE work. I did nothing on purpose. One can
open Python into the IDLE window or into the program window. I recently
changed from the program window to the IDLE window. IDLE now works
exactly right. As a bonus my DOS-oidle window which used to produce
error messages
At one time I could not run a skit in IDLE nor with the command line.
IDLE gave error messages because (Alan G. says) of the 3 chevrons.
The command opened into a wee square & issued only error messages.
Then the command line opened into a 4x7 box and worked perfectly.
IDLE also now works perfectl
Traceback (most recent call last):
File "C:\Python26\TicTacToeD.py", line 165, in
main()
File "C:\Python26\TicTacToeD.py", line 150, in main
DisplayBoard(board)
File "C:\Python26\TicTacToeD.py", line 68, in DisplayBoard
print "\n\t", board[1], "|", board[2], "|", board[3]
TypeEr
ly tells python that newname is also functionname.
variable = functionReturningValue() //and here, the function's return
value is obviously being assigned to the variable
Disclaimer: My naming scheme sucks, I know this :)
Cheers
--Brett
John Fouhy wrote:
2009/3/9 WM. :
File "C:
I am using Python 26 on a Windows XP
OK, here are the three lines mentioned following the error message.
Traceback (most recent call last):
File "C:\Python26\TicTacToeD.py", line 165, in
main()
File "C:\Python26\TicTacToeD.py", line 150, in main
DisplayBoard(board)
File "C:\Python
Well, Mr. Wilkins takes the biscuit. He found where I did not enter a
pair of parens.()
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
???
-- next part --
An HTML attachment was scrubbed...
URL:
<http://mail.python.org/pipermail/tutor/attachments/20090309/54781b33/attachment-0001.htm>
------
Message: 4
Date: Mon, 9 Mar 2009 08:39:44 -
From: "Alan
Using Windows XP, Python 2.6 & Al Sweigart's "Invent Your Own...", I
keyed in the Hangman Program. So far as I can tell it is totally proofed
out. Still, I get an error message which makes no sense to me.
Herewith, the program, followed by the error message.
# CONSTANTS are all CAPS.
# vari
Kent Johnson wrote:
On Wed, Apr 22, 2009 at 2:57 PM, WM. wrote:
Using Windows XP, Python 2.6 & Al Sweigart's "Invent Your Own...", I keyed
in the Hangman Program. So far as I can tell it is totally proofed out.
Still, I get an error message which makes no sense to
Well, Kent was right, it was an indent error, but 'way high in the
program. I was so catching commas that I got sloppy at an indent
change. sorry guys.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
I used to do Basic and enjoyed it. Someone said Python was a vastly
better language than Visual Basic, which I considered playing with. So
I sought to give it a go but struck a sticking point very early.
I am now going through the Python tutorial. All went well until I came
to IF. The code b
TO THIS ORIGINAL POST I GOT SIX REPLIES.
WM wrote:
> > I used to do Basic and enjoyed it. Someone said Python was a vastly
> > better language than Visual Basic, which I considered playing with. So
> > I sought to give it a go but struck a sticking point very early.
> >
Hey, guys, forgive me; I can't help being a fool. Just now I READ the
program and it worked perfectly! 42 is more than 1 so it printed
"More". My error was that I imagined there was a loop where no loop
could be. Oh, me; oh, my.
___
Tutor maillist
I wrote this two liner. I wanted to save it and then to bring it back
as program.
IDLE 2.6
>>> brain = 'life'
>>> print brain
life
I saved it as brain.py,
IDLE 2.6
>>> brain = 'life'
>>> print brain
life
>>>
python/brain.py
Traceback (most recent call last):
File "", line 2,
a = "Futzenburgerstein"
b = ( 7 + 2 ) / 3
c = b / 2
print a, b, c
The above text was copied from a window named
"??futz.py-C:\Python26\futz.py" The ?? is two red
script characters which I cannot read. When I go
'F5' or Run > Run Module I get kicked back into IDLE.
Shouldn't 'F5' get me a window
Some say that Python programs run better on DOS. I cannot find a way to
do that. I can go 'Python Command Line' to wind up on a black screen
version of IDLE but I can't get from the interactive to executive mode.
Is there any advantage to running .py on DOS?
__
I keep getting the error message & must re-boot to enable IDLE work. Is
there some rule about 'saving' or about having too many windows open?
It seems to happen if I am doing a lot of saving & re-saving.
___
Tutor maillist - Tutor@python.org
http://
I asked tutor how to get to the black screen to run Python programs. I
got a three step answer but could not get step 1. to work;
1.
XP: Start > Run > type "cmd" > OK
C:\Documents and Settings
The above line is where I wind up & I cannot get out of it. I can get
into it with Start > Programs
Stooges.py
i,j,k = 3,3,3
while i != 1:
print 'Larry, Moe & Curly Joe!'
i -= 1
while j != 1:
print 'Go Mad!!'
j -= 1
while k != 1:
print 'Go-go bad-bad!!'
k -= 1
print '\nBye-bye.'
I am trying to learn loops. These nested 'whiles' work OK but I would
like to
I recently asked a question about 'for' loops, expecting them to be
similar to 'for-next' loops. I have looked at several on-line tutors but
am still in the dark about what 'for' loops do.
Does anyone have a plain English about the use of 'for' loops?
Are 'while' loops the only way Python runs
and your response was most gratifying. I think that I now have a handle
on the subject and want to say, "Thanks to you all." WM
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
As a BASIC, hobby programmer, (long since), I get so jargonized here
that I seldom ask about anything any more. The only useful bit I have
gleaned from reading many, many posts is the URL for projecteuler.
Maybe, after I get past the baby steps and start using the libraries, I
will benefit mor
One of the replies to my post explained how difficult it is to address
an audience composed of several levels of skill. I understand that, nor
was I condemning anyone who has a better command of jargon than I have.
Jargon is essential to any trade. What I wanted to do was give Wayne the
POV of
>>> i = 5
>>> j = 7
>>> if i <= j:
print 'nudge, nudge'
else:
File "", line 3
else:
^
IndentationError: unexpected indent
Running in IDLE, all is well until "else:". IDLE seems perplexed about
the >>>s. I try to de-dent else via the backspace key, aft
Norman Khine wrote:
>>> i = 5
>>> j = 7
>>> if i <= j:
... print 'nudge', 'nudge'
... else:
... print 'whatever'
...
nudge nudge
>>>
WM. wrote:
>>> i = 5
>>> j = 7
>>> if i <= j
IDLE 2.6
>>> i = 1
>>> j = 11
>>> if j > 1:
print j
else:
SyntaxError: invalid syntax
>>>
I am getting a little dizzy here.
I know about text editor, code, save, F5.
Many tutorials say that it is funner and faster to test an idea
'interactively', using IDLE.
Norman Khine wrote:
>>> i = 5
>>> j = 7
>>> if i <= j:
... print 'nudge', 'nudge'
... else:
... print 'whatever'
...
nudge nudge
The above is just what the tutorials said would happen.
Can anyone give me a step-by-step in IDLE 2.6 that would make this happen?
__
IDLE 2.6
>>> i = 1
>>> if i > 1:
print 'x'
else:
print 'y'
y
>>>
Last post on this topic, I guess.
I think that the script looks pretty lame, though.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinf
I felt such a monkey until Kent convinced me that the 'else' only
appeared to be un-indented.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
# The natural numbers(natnum), under 1000, divisible by 3 or by 5 are to
be added together.
natnum = 0
num3 = 0
num5 = 0
cume = 0
# The 'and' is the 15 filter; the 'or' is the 3 or 5 filter.
while natnum <= 999:
num3 = natnum/3
num5 = natnum/5
if natnum - (num3 * 3) == 0 and natnum -
# program to find square root
square = input ('Please enter a number to be rooted, ')
square = square * 1.0
guess = input('Please guess at the root, ')
guess = guess * 1.0
newguess = 0.
while guess**2 != square:
# Newton's formula
newguess = guess - (guess * guess - square) / (gue
# program to find square root
square = float(raw_input ("Please enter a number to be rooted, "))
guess = input("Please guess at the root, ")
i = 0
while guess**2 != square:
i+=1
# Newton's formula
guess = guess - (guess * guess - square) / (guess * 2)
print i
print
33 matches
Mail list logo