| Changed: | ||||||||
| < < |
name really does live in different address spaces in the parent and child processes. Yeah, I'm a dork.
| |||||||
| > > |
name really does live in different address spaces in the parent and child processes. Yeah, I'm a dork.
| |||||||
#!/usr/bin/python | ||||||||
| Line: 17 to 17 | ||||||||
|---|---|---|---|---|---|---|---|---|
| # exclusively licensed to the authors for a period of up to eighteen # years. | ||||||||
| Changed: | ||||||||
| < < |
# $Id: baby.py,v 1.3 2003/04/06 06:12:04 kirk Exp $ | |||||||
| > > |
# $Id: BirthAnnouncement.txt,v 1.2 2003/11/22 17:24:10 KirkStrauser? Exp www $ | |||||||
| import time import os | ||||||||
| Line: 40 to 40 | ||||||||
| -- KirkStrauser - 08 Apr 2003 | ||||||||
| Added: | ||||||||
| > > |
| |||||||
| Line: 1 to 1 | ||||||||
|---|---|---|---|---|---|---|---|---|
| Added: | ||||||||
| > > |
name really does live in different address spaces in the parent and child processes. Yeah, I'm a dork.
#!/usr/bin/python
# This program forks(). That should be plenty for a few years' entertainment
# Copyright (C) 2003 Kirk & Jennifer Strauser
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# However, the output of this particular instance shall remain
# exclusively licensed to the authors for a period of up to eighteen
# years.
# $Id: baby.py,v 1.3 2003/04/06 06:12:04 kirk Exp $
import time
import os
eta = 1049547660
name = "Jennifer Strauser"
if eta > time.time():
# Not done yet
time.sleep(eta - time.time())
pid = os.fork()
if pid:
print "%s: At %s, I got my own address space back!" % (name, time.ctime(eta))
else:
length = 20.5 # inches
weight = 5.4 # pounds.ounces
name = "Ariana Nicole Strauser"
print "%s: Hello, world!" % name
-- KirkStrauser - 08 Apr 2003
| |||||||