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
È»ºóÄãµÄÁ½¸öº¯ÊýµÄÂß¼
Ïà¹ØÎÊ´ð£º
pythonºÍpyqtÒÔ¼°Eric4¶¼ÒѾÅäÖúÃÁË£¬´ò¿ªEric4д¸öpython³ÌÐò±ÈÈç¼òµ¥µÄ
print¡°hello£¬world¡±£¬Ôõô±àÒëÔËÐÐÁË£¬Start²Ëµ¥µÄËùÓÐÃüÁî¶¼³öÏÖºÍͼÖв¶àµÄ¶Ô»°¿ò£¬Ó¦µ±ÔõôÔËÐÐÁË£¿
Çó´ó¼ÒÖ¸½Ì
ûÓÐÈËÓà ......
ѧϰpythonµÄ7±¾Êé
°üÀ¨6±¾chm£¬Ò»±¾pdf×ÊÁÏ
¶ÔѧϰpythonÓкܴóµÄ°ïÖú
http://download.csdn.net/source/619791
¾«ÐÄËѼ¯£¬²»Òª»ý·Ö£¬ÄóöÀ´·ÖÏí
лл¥Ö÷£¬ÐÁ¿àÁË~
lz ×îºÃ°ÑÊéÃûºÍ¼òµ¥½éÉܼÓÉ ......
return func Óëreturn func()
ÓÐʲô²»Í¬µÄ£¿
return func·µ»ØµÄÊÇÒ»¸öº¯Êý¶ÔÏó£¬
return func()·µ»ØµÄÊÇfunc()º¯ÊýµÄ·µ»Ø½á¹û¡£
Â¥ÉÏÕý½â
Ò»¸öÊÇ·µ»Ø±äÁ¿ Ò»¸öÊÇ·µ»ØµÄʱºò ÔÙµ÷ÓÃÒ»ÏÂfuncº¯Êý
ÎÒ¾õµÃÊÇ ......
C#ÀïÃæÓÃusing System.Security.Cryptography; RSACryptoServiceProvider¼ÓÃܹýµÄÏûÏ¢
ÓÃPython CryptoÖÐRSAµÄ·½·¨ ÄÜÖ±½Ó ½âÂð£¿
RSA¼ÓÃÜ·½Ê½²»ÊÇͳһµÄÂð£¿ÐèҪעÒâЩʲô£¿
ÓаïÖú¡£µ«ÊÇû½â¾öÎÊÌâ¡£¡£¡£
......