When I run a dir(_builtins_) I get the error message that the name
_builtins_ is not defined. I haven't tried the dir function on other
functions, but can someone tell me why I am getting this message? Thanks,
Ray
--
http://mail.python.org/mailman/listinfo/python-list
Why am I getting an invalid syntax error on the following:
os.chdir(c:\\Python_Modules). The error message says the colon after c is
invalid syntax. Why is it saying this when I am trying to change directory
to c:\Python_Modules. Thanks, Ray
--
http://mail.python.org/mailman/listinfo/python-list
e 5, in
fileobject = open("E:\\Ray Holts Documents\Word Documents\\1850 Warren
MS Jenkins", 'r')
IOError: [Errno 2] No such file or directory: 'E:\\Ray Holts Documents\\Word
Documents\\1850 Warren MS Jenkins'
I know the file exists because I opened i
Why am I getting an invalid systax on the first except in the following
code. It was copid from the python tutorial for beginners. Thanks, Ray
import sys
try:
#open file stream
file = open(file_name, "w"
except IOError:
print "There was an error writing to", file_name
sys.exit()
pri
Why am I getting the following error message. Area has been declared as an
attribute of Circle. Thanks, Ray
class Circle:
def __init__(self):
self.radius = 1
def area(self):
return self.radius * self.radius * 3.14159
c = Circle()
c.radius = 3
print c.area()
Traceback (most rece
I am taking the MIT online course Introduction to Computer Science and
Programming. I have a assignment to write a program to compute and print the
1000th. prime number. Can someone give me some leads on the correct code?
Thanks, Ray
--
http://mail.python.org/mailman/listinfo/python-list
I am having problems with indentation some times. When I hit the enter key
after if statements or while statemt there are times when the indentation is
too much and other times too little. When I try to manually make sure the
indentation is correct and try to print, I ge the error message of invali
Can you comment and uncomment code from the shell. I know that the format
meny only shows in the edit window. I tried crtl + 3, which is what it said
in the configuration window to use, and nothing happens. Also can you write
executable code from the edit window. I can't see to get code that I writ
I have an assigment to find the 1000th. prime using python. What's wrong
with the following code:
PrimeCount = 0
PrimeCandidate = 1
while PrimeCount < 2000:
IsPrime = True
PrimeCandidate = PrimeCandidate + 2
for x in range(2, PrimeCandidate):
if PrimeCandidate % x == 0:
##
Is there a way to make python point to a different directory for modules. I
don't like to keep my modules in the program directory, but I can't figure
out from the shell how to get the program to look in another directory. I am
using XP Pro as an operating system and python2.6
--
http://mail.pytho
Why am I getting the error that test is not defined. Thanks, Ray
class SpecialFile:
def __init__(self, fileName):
self.__file = open(fileName, 'W')
self.__file.write('* Start Special File *\n\n')
def write(self, str):
self.__file.write(str)
def writeline
Guys, I apologize for the last email asking for help I am going to have to
remember to check my indentation. Ray
--
http://mail.python.org/mailman/listinfo/python-list
12 matches
Mail list logo