[Python编程(第4版)].(Programming.Python.4th.Edition).Mark.Lutz.文字版
if sec != self.lastSec: self.lastSec = sec ampm = ((hour >= 12) and 'PM') or 'AM' # 0...23 hour = (hour % 12) or 12 # 12..11 ...
class ClockWindow(Clock): def init(self, config=ClockConfig, parent=None, name=''): Clock.init(self, config, parent) self.pack(e ...
class PPClockBig(PhotoClockConfig): picture, bg, fg = gifdir + 'ora-pp.gif', 'navy', 'green' class PPClockSmall(ClockConfig): si ...
PyToe: A Tic-Tac-Toe Game Widget Finally, a bit of fun to close out this chapter. Our last example, PyToe, implements an artific ...
larger boards and more complex games, PyToe’s move selection algorithms become even more useful. PyToe Source Code (External) Py ...
If you do look, though, probably the best hint I can give you is that the data structure used to represent board state is the cr ...
def clearBoard(self): for row, col in self.label.keys(): self.board[row][col] = Empty self.label[(row, col)].config(text=' ') Si ...
def checkDraw(self, board=None): board = board or self.board for row in board: if Empty in row: return 0 return 1 # none empty: ...
studies. In the next section of this book, we’ll also learn how to build user interfaces that run in web browsers—a very differe ...
...
PART IV Internet Programming This part of the book explores Python’s role as a language for programming Internet- based applicat ...
...
CHAPTER 12 Network Scripting “Tune In, Log On, and Drop Out” Over the 15 years since this book was first published, the Internet ...
system, which is built upon Zope and delegates site content to its users. Still others use Python to script Java web application ...
represent a substantial portion of this book at large, the following sections go into a few more details about what we’ll be stu ...
scripting—programs that run on a server computer and are usually invoked by a web browser. What we won’t cover Now that I’ve tol ...
administration. In this part of the book, we will take an honest look at the Net’s trade- offs as they arise and explore example ...
We’ll discuss configuration details as we move along, but in short, when a Python script opens an Internet connection (with the ...
Python scripts can connect to all of these Internet components by simply importing the associated library module. Since Grail, a ...
API and its own server-side templating language; Google App Engine—a “cloud computing” framework that provides enterprise-level ...
«
36
37
38
39
40
41
42
43
44
45
»
Free download pdf