Baby Steps, optionDB

W

W. Watson

I'm just playing with Python. It's my first outing. The program is below. I
thought I'd fuss with numbers, and then get bold and try some Tkinter stuff.
I copied the root stuff from a book (Grayson), and get stopped at the
optionDB statement. What's wrong? I get
clError: couldn't open "optionDB": no such file or directory
from Idle. Does the Tk code need to be up higher? The book is dated 2000, so
maybe that item no longer exists.

----------------------
#!/usr/bin/python

from Numeric import *
from Tkinter import *

a=3.14
d=cos(a)
b=2
c=a+b
print "sum is = ",c, "and cos = ", d
print "arcos is ", arccos(d)
print "sqrt of d is ", sqrt(-d+3)


root = Tk()
root.option_readfile('optionDB')
root.title('TopLevel')
print "Onward"

Label(root, text='Very Top').pack(pady=10)

t1 = Toplevel(root)
Label(t1, text='A little Math').pack(padx=10, pady=10 )
print "Of to the races!"
t2 = Toplevel(root)
# t2.transient(root)
print "here we go"
t3=Toplevel(root, borderwidth=5, bg='blue')
t3.orverrideredredirect(1)
t3.geometry('200x70+15+150')

root.mainloop()
 
W

W. Watson

Don't even know what the file is. I figured the book would have included it
in the example. I see no mention of it in the index. Does it go by another name?
 
D

Dennis Lee Bieber

I'm just playing with Python. It's my first outing. The program is below. I
thought I'd fuss with numbers, and then get bold and try some Tkinter stuff.
I copied the root stuff from a book (Grayson), and get stopped at the
optionDB statement. What's wrong? I get
clError: couldn't open "optionDB": no such file or directory
from Idle. Does the Tk code need to be up higher? The book is dated 2000, so
maybe that item no longer exists.
More likely, you need to create a file with standard Tk
configuration options in the directory you are running from...

A google search on "tk optiondb" brings up a page full of RUBY
stuff...


{That wasn't the easiest book to understand either... It seems to have
been written on the basis that one already knew tcl/tk, and how it
linked together}
--
Wulfraed Dennis Lee Bieber KD6MOG
(e-mail address removed) (e-mail address removed)
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: (e-mail address removed))
HTTP://www.bestiaria.com/
 
W

W. Watson

That got things moving. Thanks. It looks like I have some typos to deal with
now. I used to program in C++, and there's one thing I've never liked about
OOP. Too much typing!
 
W

W. Watson

Thanks. I think I agree about the book comment. I used to dabble with Tcl/Tk
many years ago. About a year ago, I sold my only book on it. I thought I'd
never need it again! I wonder if Grayson's (e-book on his site) has improved.

After spending about 90 minutes with IDLE, I'm not real impressed. Is there
something better?
 
C

Carsten Haese

I used to program in C++, and there's one thing I've never liked about
OOP. Too much typing!

Blame C++, not OOP. In time, you will find that Python's approach to OOP
in particular and to programming in general allows you to express your
ideas more concisely than you could in other programming languages.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top