Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

pythonдÎļþʱ³öÎÊÌâ

Òì³£´úÂëÈçÏ£º
write a file error: [Errno 2] No such file or directory: 'C:\x0cile.txt'

Traceback (most recent call last):
  File "C:\Documents and Settings\USER\×ÀÃæ\¸´¼þ test.py", line 84, in <module>
    test()
  File "C:\Documents and Settings\USER\×ÀÃæ\¸´¼þ test.py", line 78, in test
    writefile(s)
  File "C:\Documents and Settings\USER\×ÀÃæ\¸´¼þ test.py", line 59, in writefile
    f.write(str(string))
UnboundLocalError: local variable 'f' referenced before assignment


Python code:

¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£

def writefile(string):
strfile="C:\file.txt"
try:
f = open(strfile,'a')
except IOError,e:
print "write a file error:",e

f.write(str(string))
f.close()



def test():
fname = 'C:\ZLLKDoc.cpp'
#raw_input('Enter filename: ')
try:
fobj = open(fname, 'r')
except IOError, e:
print "*** file open error:", e
strFile=fobj.read()

fobj.close()

s = eraser(strFile)
print s





ʵÔÚ²»ÖªµÀÄÄÀï´íÁË£¬Çë´óÏÀÃǰïæ¿´¿´£¬¸Ð¼¤²»¾¡
test£¨£© º¯ÊýÖеÚÒ»ÐмÓÈë global f
È»ºóÄãµÄÁ½¸öº¯ÊýµÄÂß¼­


Ïà¹ØÎÊ´ð£º

eric4ÔõôÔËÐÐpython³ÌÐò£¿

pythonºÍpyqtÒÔ¼°Eric4¶¼ÒѾ­ÅäÖúÃÁË£¬´ò¿ªEric4д¸öpython³ÌÐò±ÈÈç¼òµ¥µÄ
print¡°hello£¬world¡±£¬Ôõô±àÒëÔËÐÐÁË£¬Start²Ëµ¥µÄËùÓÐÃüÁî¶¼³öÏÖºÍͼÖв¶àµÄ¶Ô»°¿ò£¬Ó¦µ±ÔõôÔËÐÐÁË£¿

Çó´ó¼ÒÖ¸½Ì

ûÓÐÈËÓà ......

¾«ÐÄËѼ¯µÄѧϰpythonµÄ7±¾Êé

ѧϰpythonµÄ7±¾Êé
°üÀ¨6±¾chm£¬Ò»±¾pdf×ÊÁÏ
¶ÔѧϰpythonÓкܴóµÄ°ïÖú 
http://download.csdn.net/source/619791
¾«ÐÄËѼ¯£¬²»Òª»ý·Ö£¬ÄóöÀ´·ÖÏí
лл¥Ö÷£¬ÐÁ¿àÁË~



lz ×îºÃ°ÑÊéÃûºÍ¼òµ¥½éÉܼÓÉ ......

python ÖÐÒ»¸öÒÉ»ó

return func Óëreturn func()
ÓÐʲô²»Í¬µÄ£¿
return func·µ»ØµÄÊÇÒ»¸öº¯Êý¶ÔÏó£¬
return func()·µ»ØµÄÊÇfunc()º¯ÊýµÄ·µ»Ø½á¹û¡£

Â¥ÉÏÕý½â

Ò»¸öÊÇ·µ»Ø±äÁ¿ Ò»¸öÊÇ·µ»ØµÄʱºò ÔÙµ÷ÓÃÒ»ÏÂfuncº¯Êý
ÎÒ¾õµÃÊÇ ......

C# RSA Python - .NET¼¼Êõ / C#

C#ÀïÃæÓÃusing System.Security.Cryptography; RSACryptoServiceProvider¼ÓÃܹýµÄÏûÏ¢
ÓÃPython CryptoÖÐRSAµÄ·½·¨ ÄÜÖ±½Ó ½âÂð£¿
RSA¼ÓÃÜ·½Ê½²»ÊÇͳһµÄÂð£¿ÐèҪעÒâЩʲô£¿

ÓаïÖú¡£µ«ÊÇû½â¾öÎÊÌâ¡£¡£¡£
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ