Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7232f73

Browse files
committed
new examples
1 parent 07522d3 commit 7232f73

File tree

4 files changed

+41
-2
lines changed

4 files changed

+41
-2
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from tkinter import *
2+
root = Tk()
3+
4+
trees = [
5+
('the larch', 'light blue'),
6+
('the pine', 'light green'),
7+
('the giant redwood', 'red')
8+
]
9+
10+
for (tree, color) in trees:
11+
win = Toplevel(root)
12+
win.title('cantando......')
13+
win.protocol('WM_DELETE_WINDOW', lambda:None)
14+
#win.iconbitmap('')
15+
16+
msg = Button(win, text=tree, command=win.destroy)
17+
msg.pack(expand=YES, fill=BOTH)
18+
msg.config(padx=10, pady=10, bd=10, relief=RAISED)
19+
msg.config(bg='green', fg=color, font=('times', 30, 'bold italic'))
20+
21+
root.title('titulo')
22+
Label(root, text='menu principal').pack()
23+
Button(root, text='sair de todos', command=root.quit).pack()
24+
root.mainloop()
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from tkinter import *
2+
from tkinter.messagebox import *
3+
4+
5+
def callback():
6+
if askyesno('verify', 'do you really want to quit?/queres sair?'):
7+
showwarning('yes/sim', 'quit not yet implemented')
8+
else:
9+
showinfo('no/nao', 'quit has been cancelled')
10+
11+
errmg = 'soory, no spam allowed'
12+
Button(text='quit/sair', command=callback).pack(fill=X)
13+
Button(text='Spam', command=(lambda: showerror('spam', errmg))).pack(fill=X)
14+
15+
mainloop()

‎1-chapter-aSneakPreview/6-addingAWebInterface-InProgress/2-runningAWebServer/cgi101.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#/home/jo/.conda/envs/env-python/bin/python
1+
#!/usr/bin/python
22

33
import cgi
44

‎1-chapter-aSneakPreview/6-addingAWebInterface-InProgress/2-runningAWebServer/webserver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from http.server import HTTPServer, CGIHTTPRequestHandler
33

44
webdir = '.' # onde html files estao
5-
port = 80
5+
port = 8888
66

77

88
os.chdir(webdir)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /