´©Ô½Python Challenge£¨0
Ò»¸öÓÐȤµÄÍøÕ¾£º
http://www.pythonchallenge.com/
¼¯ÓéÀÖÓëѧϰÓÚÒ»Ì壬ÔÚ¿ª¶¯ÄԽ¹ØµÄ¹ý³ÌÖУ¬²»µ«À©Õ¹ÁË˼ά£¬»¹¶ÔPython¼ÓÉîÁËÀí½â¡£
Ò»¹²33¹Ø£¬Ã¿´³¹ýÒ»¹Ø¶¼¿ÉÒÔÔÚÌáʾϲ鿴×÷Õ߸ø³öµÄSolution¡£
µÚ0¹Ø£¨Ö¸µ¼¹Ø£©£º
³öÏÖÒ»·ù»Ã棬ÉÏÃæÐ´×Å2**38£¬½ÌÄãÈçºÎ½øÈëÏÂÒ»¹Ø¡£
ͨ¹ýPython¿Í»§¶Ë£¬¿ÉÒÔ¼òµ¥¼ÆËã³ö2**38 = 274877906944
ÄÇô°´ÕÕÌáʾֻҪ½«¸Ã¹ØÍøÖ·ÖÐ0.htm¸ÄΪ274877906944.html ¼´¿É
µÚ1¹Ø£º×Ö·ûת»»
ͼƬÉϸø³öÁËÈý¶Ô×Öĸ“K->M, O->Q, E->G"£¬Í¨¹ý·ÖÎöÖªµÀÕâÊÇÒ»¸ö¼òµ¥µÄ×Ö·ûת»»£¬×ª»»¹æÔòÊÇnew_c=chr(ord(old_c)+2) ³¬¹ý×Ô¶¯»Ø×ª¡£
ÎÒÃÇ¿ÉÒÔ¿´µ½£¬¸Ã¹ØµÄÍøÖ·Îªhttp://www.pythonchallenge.com/pc/def/map.html¡£ÄÇô°´ÕÕÖ¸µ¼¹Ø¸ø³öµÄ²ßÂÔ£¬Ö»Òª½«mapÌæ»»Îªocr¼´¿Éͨ¹Ø¡£µ«Èç¹û½öÊÇÈç´Ë£¬ÄÇô¾ÍÍêȫƲ¿ªÁËPython£¬¸Ã¹Ø½«³¹³¹µ×µ×µØÍË»¯ÎªÒ»°ãµÄÄԽתÍä¡£
ʵ¼ÊÉÏÔÚͼƬÏÂÓÐÒ»´®¿´²»¶®µÄ×Ö·û´®£¬°´ÕÕÉÏÊö×Ö·ûת»»¹æÔò£¬ÕâÓ¦¸Ã¿ÉÒÔͨ¹ýpython×ö¼òµ¥´¦Àí£¬´Ó¶øµÃµ½¿Éʶ±ðµÄ×Ö´®£¬´úÂëÈçÏ£º
import string
frm = "abcdefghijklmnopqrstuvwxyz"
to = "cdefghijklmnopqrstuvwxyzab"
data = """g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp.
bmgle gr gl zw fylbgq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle.
sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj."""
print string.translate(data, string.maketrans(frm,to))
ÔËÐнű¾£¬ÎÒÃǽ«µÃµ½ÏÂÃæÒ»¶ÎÃèÊö£º
”i hope you didnt translate it by hand. thats what computers are for.
doing it in by hand is inefficient and that's why this text is so long.
using string.maketrans() is recommended. now apply on the url. “
µ±ÎÒÃÇͨ¹ØÖ®ºó£¬Í¨¹ýhttp://www.pythonchallenge.com/pcc/def/ocr.html
½«µÃµ½¸ü¶à¹ØÓÚ±¾¹ØµÄÐÅÏ¢¡£
µÚ2¹Ø£ºÌáÈ¡ÓÐЧÐÅÏ¢
¸Ã¹ØÍ¼Æ¬ÉÏչʾÁËÒ»±¾Ê飬¶øÍ¼ÏÂÓÐÒ»¶Î»°“
recognize the characters. maybe they are in the book, but MAYBE
Ïà¹ØÎĵµ£º
Ctrl+3 ÐÐ×¢ÊÍ
Ctr+\ È¥ÐÐ×¢ÊÍ
Ctrl+Shift+3 È¥ÐÐ×¢ÊÍ
Ctrl+4 ¿é×¢ÊÍ
Ctrl+5 & ......
PythonÖÐÎļþ²Ù×÷¿ÉÒÔͨ¹ýopenº¯Êý£¬ÕâµÄÈ·ºÜÏñCÓïÑÔÖеÄfopen¡£Í¨¹ýopenº¯Êý»ñȡһ¸öfile object£¬È»ºóµ÷ÓÃread()£¬write()µÈ·½·¨¶ÔÎļþ½øÐжÁд²Ù×÷¡£
1.open
ʹÓÃopen´ò¿ªÎļþºóÒ»¶¨Òª¼ÇµÃµ÷ÓÃÎļþ¶ÔÏóµÄclose()·½·¨¡£±ÈÈç¿ÉÒÔÓÃtry/finallyÓï¾äÀ´È·±£×îºóÄܹرÕÎļþ¡£
file_object = open('thefile.txt' ......
PyRSS2Gen £ºrssÉú³É
ÏÂÔØµØÖ·£ºhttp://www.dalkescientific.com/Python/PyRSS2Gen-1.0.0.tar.gz
Àý×Ó£º
Java´úÂë
import datetime
import PyRSS2Gen
rss = PyRSS2Gen.RSS2(
title = " ......
from cmd import *
class MyShell(Cmd):
def preloop(self):
print "print this line before entering the loop"
def postloop(self):
&nb ......
2005-2006ѧÄêµÚ1ѧÆÚ
±à Òë Ô Àí
¿Î ³Ì Éè ¼Æ ±¨ ¸æ
°à¼¶ 02¼Æ(¶þ)
ѧºÅ 19
ÐÕÃû ÁõÏþÃ÷
³É¼¨
Ö¸µ¼½Ìʦ ¬³¯»Ô
Ò»¡¢ Éè¼ÆÄ¿µÄ
¼ÓÉî¶Ô±àÒ ......