首页 issue36 zh-CN

issue36 zh-CN

举报
开通vip

issue36 zh-CN full circle full circle vim colours !---- Terminal Colours * background: #000000 * foreground: #ffffff * color0: #000000 * color1: #9e1828 * color2: #aece92 * color3: #968a38 * color4: #414171 * color5: #963c59...

issue36 zh-CN
full circle full circle vim colours !---- Terminal Colours * background: #000000 * foreground: #ffffff * color0: #000000 * color1: #9e1828 * color2: #aece92 * color3: #968a38 * color4: #414171 * color5: #963c59 * color6: #418179 * color7: #bebebe * color8: #666666 * color9: #cf6171 * color10: #c5f779 * color11: #fff796 * color12: #4186be * color13: #cf9ebe * color14: #71bebe * color15: #ffffff urxvt*background: [70]#000000 urxvt*foreground: #ffffff urxvt*color0: #000000 urxvt*color1: #9e1828 urxvt*color2: #aece92 urxvt*color3: #968a38 urxvt*color4: #414171 urxvt*color5: #963c59 urxvt*color6: #418179 urxvt*color7: #bebebe urxvt*color8: #666666 urxvt*color9: #cf6171 urxvt*color10: #c5f779 urxvt*color11: #fff796 urxvt*color12: #4186be urxvt*color13: #cf9ebe urxvt*color14: #71bebe urxvt*color15: #ffffff GraphicsDev Internet M/media System HDDCD/DVD USB Drive Laptop Wireless Data Here Node 2data moredata Data HereNode2 datamoredata< /node3> import elementtree.ElementTre e as ET tree = ET.parse('xmls ample1.xml') ET.dump(tree) import elementtree.ElementTree as ET tree = ET.parse('xmlsample1.xml') person = tree.findall('.//person') for p in person: for dat in p: print "Element: %s - Data: %s" %(dat.tag,dat.text) Samantha Pharoh Female
123 Main St.
Denver Colorado
Steve Levon Male
332120 Arapahoe Blvd.
Denver Colorado
/usr/bin/python -u "/home/greg/Documents/articles/xml/reader1.py" Samantha Pharoh Female
123 Main St.
Denver Colorado
Steve Levon Male
332120 Arapahoe Blvd.
Denver Colorado
/usr/bin/python -u "/home/greg/Documents/articl es/xml/reader1.py" Element: firstname - Data: Samantha Element: lastname - Data: Pharoh Element: gender - Data: Female Element: address - Data: 123 Main St. Element: city - Data: Denver Element: state - Data: Colorado Element: firstname - Data: Steve Element: lastname - Data: Levon Element: gender - Data: Male Element: address - Data: 332120 Arapahoe Blvd. Element: city - Data: Denver Element: state - Data: Colorado import elementtree.ElementTre e as ET tree = ET.parse('Cach e.loc') for w1 in w: if w1.tag == "name": Geocache http://www.navicache.com/cgi-bin/db/displaycache2.pl?CacheID=11436 newstring = oldstring[startposition:endpo sition] if w1.keys(): forname,value in w1.items(): if name == 'id': CacheID = value # Get text of cache name up to the phrase "Open Cache: " CacheName = w1.text[:w1.text.find("Open Cache: ")-1] # Get the text between "Open Cache: " and "Cache Type: " OpenCache = w1.text[w1.text.find("Open Cache: ")+12:w1.text.find("Cache Type: ")-1] # More of the same CacheType = w1.text[w1.text.find("Cache Type: ")+12:w1.text.find("Cache Size: ")-1] CacheSize = w1.text[w1.text.find("Cache Size: ")+12:w1.text.find("Difficulty: ")-1] Difficulty= w1.text[w1.text.find("Difficulty: ")+12:w1.text.find("Terrain : ")-1] Terrain = w1.text[w1.text.find("Terrain : ")+12:] elif w1.tag == "coord": if w1.keys(): for name,value in w1.items(): if name == "lat": Lat = value elif name == "lon": Lon = value elif w1.tag == "type": GType = w1.text elif w1.tag == "link": if w1.keys(): for name, value in w1.items(): Info = value Link = w1.text print "Cache Name: ",CacheName print "Cache ID: ",CacheID print "Open Cache: ",OpenCache print "Cache Type: ",CacheType print "Cache Size: ",CacheSize print "Difficulty: ", Difficulty print "Terrain: ",Terrain print "Lat: ",Lat print "Lon: ",Lon print "GType: ",GType print "Link: ",Link import elementtree.ElementTree as ET tree = ET.parse('Cache.loc') w = tree.find('.//waypoint') for w1 in w: if w1.tag == "name": # Get text of cache name up to the phrase "Open Cache: " CacheName = w1.text[:w1.text.find("Open Cache: ")-1] # Get the text between "Open Cache: " and "Cache Type: " OpenCache = w1.text[w1.text.find("Open Cache: ")+12:w1.text.find("Cache Type: ")-1] # More of the same CacheType = w1.text[w1.text.find("Cache Type: ")+12:w1.text.find("Cache Size: ")-1] CacheSize = w1.text[w1.text.find("Cache Size: ")+12:w1.text.find("Difficulty: ")-1] Difficulty= w1.text[w1.text.find("Difficulty: ")+12:w1.text.find("Terrain : ")-1] Terrain = w1.text[w1.text.find("Terrain : ")+12:] if w1.keys(): for name,value in w1.items(): if name == 'id': CacheID = value elif w1.tag == "coord": if w1.keys(): for name,value in w1.items(): if name == "lat": Lat = value elif name == "lon": Lon = value elif w1.tag == "type": GType = w1.text elif w1.tag == "link": if w1.keys(): for name, value in w1.items(): Info = value Link = w1.text print "Cache Name: ",CacheName print "Cache ID: ",CacheID print "Open Cache: ",OpenCache print "Cache Type: ",CacheType print "Cache Size: ",CacheSize print "Difficulty: ", Difficulty print "Terrain: ",Terrain print "Lat: ",Lat print "Lon: ",Lon print "GType: ",GType print "Link: ",Link print "="*25 print "finished" def saystuff(somestring): print "String passed: ", somestring saystuff("Wowzers") python test.py from pygame import * # Use Pygame's functionality! ballpic = image.load('ball.png') done = False ballx = 0 # Ball position variables bally = 0 ballxmove = 1 ballymove = 1 init() # Start Pygame screen = display.set_mode((640, 480)) # Give us a nice window display.set_caption('Ball game') # And set its title while done == False: screen.fill(0) # Fill the screen with black (colour 0) screen.blit(ballpic, (ballx, bally)) # Draw ball display.update() time.delay(1) # Slow it down! ballx = ballx + ballxmove # Update ball position bally = bally + ballymove if ballx > 600: # Ball reached screen edges? ballxmove = -1 if ballx < 0: ballxmove = 1 if bally > 440: ballymove = -1 if bally < 0: ballymove = 1 for e in event.get(): # Check for ESC pressed if e.type == KEYUP: if e.key == K_ESCAPE: done = True ballx = ballx + ballxmove bally = bally + ballymove if ballx > 600: ballxmove = -1 if ballx < 0: ballxmove = 1 if bally > 440: ballymove = -1 if bally < 0: ballymove = 1 mydict = {'Bach': 100, 'Handel': 75, 'Vivaldi': 90} print mydict['Vivaldi'] for count in range(numballs): balls[count]['xmove'] = random.randint(-2, 0) if balls[count]['x'] < -10: balls[count]['xmove'] = random.randint(0, 2) if balls[count]['y'] > 470: balls[count]['ymove'] = random.randint(-2, 0) if balls[count]['y'] < -10: balls[count]['ymove'] = random.randint(0, 2) for e in event.get(): if e.type == KEYUP: if e.key == K_ESCAPE: done = True if screen.get_at((mouse.get_pos())) == (255, 255, 255, 255): done = True print "You lasted for", time.get_ticks()/1000, "seconds!" from pygame import * import random ballpic = image.load('ball.png') ballpic.set_colorkey((0,0,0)) numballs = 10 delay = 5 done = False balls = [] for count in range(numballs): balls.append(dict) balls[count] = {'x': 0, 'y': 0, 'xmove': random.randint(1, 2), 'ymove': random.randint(1, 2)} init() screen = display.set_mode((640, 480)) display.set_caption('Ball game') event.set_grab(1) while done == False: screen.fill(0) for count in range(numballs): screen.blit(ballpic, (balls[count]['x'], balls[count]['y'])) display.update() time.delay(delay) for count in range(numballs): balls[count]['x'] = balls[count]['x'] + balls[count]['xmove'] balls[count]['y'] = balls[count]['y'] + balls[count]['ymove'] for count in range(numballs): if balls[count]['x'] > 620: backdrop = image.load('backgr ound.jpg') screen.blit(backdrop, (0,0)) GraphicsDev Internet M/media System HDDCD/DVD USB Drive Laptop Wireless GraphicsDev Internet M/media System HDDCD/DVD USB Drive Laptop Wireless gnome-look.org http://www.gnome-look.org/co ntent/show.php/Underground+U buntu+GDM?content=81765 sudo gedit /etc/default/grub sudo update-grub find ~ -iname'*.dwg'
本文档为【issue36 zh-CN】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_777549
暂无简介~
格式:pdf
大小:9MB
软件:PDF阅读器
页数:0
分类:互联网
上传时间:2012-01-01
浏览量:19