+ All Categories
Home > Technology > issue35 zh-CN

issue35 zh-CN

Date post: 21-Jan-2015
Category:
Upload: ice-singapore
View: 465 times
Download: 2 times
Share this document with a friend
Description:
 
Popular Tags:
40
full circle
Transcript
  • 1. full circle

2. p.21full circleUbuntu p.30 p.10Ubuntu p.32 p.18MOTU p.27p.14 p.05 p.16 Milestone/Droidp.25 p.28 Top 5 Android p.37 3. sudo chsh -s /path/to/binary $USER chsh -l 4. export $VARIABLE="value"[lswest@lswest-laptop:~] -[14:24:29] 5. status>>> for x in data.entries[0] version ... print x encoding... bozoupdated headers yweather_condition etagupdated_parsed hreflinks namespacestitle entries summary_detail geo_lat summary guidislink title_detail link geo_long yweather_forecast id>>>type(data) >>> import feedparser >>> url = "http://weather.yah ooapis.com/forecastrss?p=UKXX 0637&u=c" >>> data = feedparser.parse(u rl) >>> data >>> data.entries[0] {'updated': u'Wed, 1 Apr >>>for x in data :2009 12:50 am BST', ... print x ... 'yweather_condition': u, feed'updated_parsed': ... 6. from mutagen.mp3 import MP3 import os from os.path import join,getsize,exists import sys import apsw Dev Graphics Internet M/media Systemdef MakeDataBase():pass def S2HMS(t): CD/DVDHDD USB Drive Laptop Wireless pass def WalkThePath(musicpath):pass def error(message): pass def main(): pass def usage(): pass if __name__ == '__main__': main() 7. def error(message):print >> sys.stderr,str(message) def usage(): message = ('==============================================n''mCat - Finds all *.mp3 files in a given folder (and sub-folders),n''tread the id3 tags, and write that information to a SQLite database.nn''Usage:n''t{0} n''t WHERE is the path to your MP3 files.nn''Author: Greg Waltersn''For Full Circle Magazinen''==============================================n').format(sys.argv[0]) error(message) sys.exit(1) 8. def main(): global connection global cursor #---------------------------------------------- if len(sys.argv) != 2: usage() else: StartFolder = sys.argv[1] if not exists(StartFolder): # From os.path print('Path {0} does not seem to exist...Exiting.').format(StartFolder) sys.exit(1) else: print('About to work {0} folder(s):').format(StartFolder) # Create the connection and cursor. connection=apsw.Connection("mCat.db3") cursor=connection.cursor() # Make the database if it doesn't exist... MakeDataBase() # Do the actual work... WalkThePath(StartFolder) # Close the cursor and connection...Print('String that will be cursor.close()printed with {0} number of connection.close()statements).format(replaceme # Let us know we are finished...nt values) print("FINISHED!") 9. Dev Graphics Internet M/media System CD/DVDHDD USB Drive Laptop Wireless 10. Dev Graphics Internet M/media System CD/DVDHDD USB Drive Laptop Wireless wget http://www.kegel.com/wine/win etricks 11. >>> temp = re.split(r'n',tem p) >>> temp [u, u'Current Conditions:', sh winetricks corefonts u'Haze, 13 C', u'Forecast:', vcrun6 vcrun2005u'Thu - Rain. High: 14 Low: 9', u'Fri - Light Rain. High: 12 Low: 7', u, u'Full Forecast at Yahoo! Weather', u'(provided by The Weather Channel)'] >>>temp[2] u'Haze, 13 C' >>>summary = data.entries[0]. summary >>>import re >>>pattern = '' >>>temp = re.sub(pattern,,sum mary) >>>temp u'nCurrent >>>temp = re.findall(u'[0- Conditions:nHaze, 13 9]+',temp[2])[0] CnForecast:nThu - Rain. >>>temp High: 14 Low: 9nFri - Lightu'13' Rain. High: 12 Low: 7nn >>> Full Forecast at Yahoo! >>> temp = int(temp) Weathern(provided by The >>> temp Weather Channel)' 13 12. change_wallpaper('/home/evil nick/weather/warm.svg') ... else: ... change_wallpaper('/home/evil nick/weather/hot.svg') ... >>> def change_wallpaper(filename): ... cmd = .join(["gconftool- 2 -s /desktop/gnome/background/pi cture_filename -t string "",filename,"""]) ... os.system(cmd) ... >>> change_wallpaper('plop.jpg')>>> if (temp


Recommended