from Blender import Camera, Object, Scene
c = Camera.New("ortho") # create new ortho camera data
c.lens = 35.0 # set lens value
cur = Scene.getCurrent() # get current scene
ob = Object.New("Camera") # make camera object
ob.link(c) # link camera data with this object
cur.link(ob) # link object into scene
cur.setCurrentCamera(ob) # make this camera the active"
from Blender import Lamp
l = Lamp.New("Spot") # create new "Spot" lamp data
l.setMode("square", "shadow") # set these two lamp mode flags
ob = Object.New("Lamp") # create new lamp object
ob.link(l) # link lamp obj with lamp data
setup (name="mymodule",
version="0.1",
py_modules=["mymodule"],
description="mymodule is a Python module to do something",
author="Fred Bloggs",
author_email="fred@no.org",
url="http://mymodule.bloggs.org",
license="GPL license",
platforms="UNIX",
)
install: force
python setup.py install
import pexpect
import sys
child = pexpect.spawn("ftp ftp.openbsd.org")
child.expect("(?i)name .*: ")
child.sendline("anonymous")
child.expect("(?i)password")
child.sendline("pexpect@sourceforge.net")
child.expect("ftp> ")
child.sendline("cd /pub/OpenBSD/3.7/packages/i386")
child.expect("ftp> ")
child.sendline("bin")
child.expect("ftp> ")
child.sendline("prompt")
child.expect("ftp> ")
child.sendline("pwd")
child.expect("ftp> ")
print("Escape character is \"^]\".\n")
sys.stdout.write (child.after)
sys.stdout.flush()
child.interact() # Escape character defaults to ^] # At this point this script blocks until the user presses # the escape character or until the child exits. # The human user and the child should be talking # to each other now. # At this point the script is running again. print "Left interactive mode."
#
# The rest is not strictly necessary. This just
# demonstrates a few functions. This makes sure the
# child is dead; although it would be killed when Python exits.
if child.isalive():
child.sendline("bye") # Try to ask ftp child to exit.
child.close()
# Print the final state of the child. Normally isalive() should
# be FALSE.
if child.isalive():
print "Child did not exit gracefully."
else:
print "Child exited gracefully."
This document was produced using groff-1.19.