[Python编程(第4版)].(Programming.Python.4th.Edition).Mark.Lutz.文字版
>>> result = os.popen('python makewords.py').read() >>> print(result) spam eggs ham The equivalent os.spawn ca ...
executable program running a script is available as sys.executable. In general, the process mode flag is taken from these predef ...
Hello from child −583587 0 Hello from child −558199 2 Hello from child −586755 1 Hello from child −562171 3 Main process exiting ...
C:\...\PP4E\System\Media> start lp4e-preface-preview.html C:\...\PP4E\System\Media> start ora-lp4e.jpg C:\...\PP4E\System\ ...
The os.startfile call In fact, start is so useful that recent Python releases also include an os.startfile call, which is essent ...
Example 5-36 collects in a single module many of the techniques we’ve met in this chapter. It implements an abstract superclass, ...
print(text) # methods instead of if/elif logic def run(self, cmdline): assert False, 'run must be defined' class System(LaunchMo ...
for Windows or Unix; use P_NOWAIT for dos box; forward slashes are okay here """ def run(self, cmdline): os.spawnv(os.P_DETACH, ...
the instance object as though it were a function. The program is started by a call op- eration—by its call operator-overloading ...
eventually changed so as to make this fix irrelevant for its own use case (see Chap- ter 11), but other clients still acquire th ...
Last, but not necessarily least, I’d like to point out one more time that many additional tools in the Python library don’t appe ...
...
CHAPTER 6 Complete System Programs “The Greps of Wrath” This chapter wraps up our look at the system interfaces domain in Python ...
A Quick Game of “Find the Biggest Python File” Quick: what’s the biggest Python source file on your computer? This was the query ...
[(1940, '.\\bigext-tree.py'), (2547, '.\\split.py')] C:\...\PP4E\System\Filetools> bigpy-dir.py .. [(21, '..\\__init__.py'), ...
Scanning the Module Search Path Sure enough—the prior section’s script found smallest and largest files in subdirecto- ries. Whi ...
pprint.pprint(allsizes[:3]) pprint.pprint(allsizes[-3:]) When run, this script marches down the module import path and, for each ...
Again, change this script’s trace variable if you want to track its progress through the tree. As you can see, the results for l ...
fixname = os.path.normcase(thisDir) if fixname in visited: if trace: tryprint('skipping ' + thisDir) else: visited.add(fixname) ...
(28, 1, '..\\Streams\\hello-out.py')] [(2278, 67, '..\\Processes\\multi2.py'), (2547, 57, '..\\Filetools\\split.py'), (4361, 105 ...
«
11
12
13
14
15
16
17
18
19
20
»
Free download pdf