2007年11月29日 星期四 14:47
rt Ö»ÄÜÏȽ¨Ä¿Â¼²ÅÄÜдÈëÉú³ÉÎļþÂð? -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071129/575c3bc1/attachment.htm
2007年11月29日 星期四 14:51
On Nov 29, 2007 2:47 PM, 篱笆 <nameliba在gmail.com> wrote: > rt > 只能先建目录才能写入生成文件吗? 是的。 -- Best Regards, Leo Jay
2007年11月29日 星期四 17:32
使用open函数的a参数:在有文件时会追加,没有文件时创建后追加
2007年11月30日 星期五 09:07
Ó¦¸ÃµÄÈ·Èç´ËµÄ£¬ÔÚwin32µÄAPIÀÓÐÒ»¸öMakeSureDirectoryExistsµÄº¯Êý£¬¿ÉÒÔ½«²ÎÊýÀïµÄĿ¼¶¼¸ø´´½¨³öÀ´£¬²»ÖªµÀpythonµÄ¿âÀïÓÐûÓС£ ²»¹ý¾ÍËãûÓÐ×Ô¼ºÐ´Ò»¸öº¯ÊýÒ²²¢²»Â鷳Ĩ¡£ 2007-11-30 À¥ÂØ ·¢¼þÈË£º Àé°Ê ·¢ËÍʱ¼ä£º 2007-11-29 14:48:08 ÊÕ¼þÈË£º pythonÓʼþÁÐ±í ³ËÍ£º Ö÷Ì⣺ [python-chinese] Èç¹ûÏòÒ»¸ö²»´æÔÚµÄĿ¼ÀïÃæÐ´ÈëÊý¾ÝÎļþ rt Ö»ÄÜÏȽ¨Ä¿Â¼²ÅÄÜдÈëÉú³ÉÎļþÂð? -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071130/b31d707f/attachment.html
2007年11月30日 星期五 09:12
Òѽâ¾ö ÔÚ07-11-30£¬À¥ÂØ <jackyboy在163.com> дµÀ£º > > > Ó¦¸ÃµÄÈ·Èç´ËµÄ£¬ÔÚwin32µÄAPIÀÓÐÒ»¸öMakeSureDirectoryExistsµÄº¯Êý£¬¿ÉÒÔ½«²ÎÊýÀïµÄĿ¼¶¼¸ø´´½¨³öÀ´£¬²»ÖªµÀpythonµÄ¿âÀïÓÐûÓС£ > ²»¹ý¾ÍËãûÓÐ×Ô¼ºÐ´Ò»¸öº¯ÊýÒ²²¢²»Â鷳Ĩ¡£ > > > 2007-11-30 > ------------------------------ > À¥ÂØ > ------------------------------ > *·¢¼þÈË£º* Àé°Ê > *·¢ËÍʱ¼ä£º* 2007-11-29 14:48:08 > *ÊÕ¼þÈË£º* pythonÓʼþÁбí > *³ËÍ£º* > *Ö÷Ì⣺* [python-chinese] Èç¹ûÏòÒ»¸ö²»´æÔÚµÄĿ¼ÀïÃæÐ´ÈëÊý¾ÝÎļþ > rt > Ö»ÄÜÏȽ¨Ä¿Â¼²ÅÄÜдÈëÉú³ÉÎļþÂð? > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20071130/552d8202/attachment.html
2007年11月30日 星期五 09:12
On Nov 30, 2007 9:07 AM, 昆仑 <jackyboy在163.com> wrote: > > > 应该的确如此的,在win32的API里,有一个MakeSureDirectoryExists的函数,可以将参数里的目录都给创建出来,不知道python的库里有没有。 > 不过就算没有自己写一个函数也并不麻烦呢。 > os.makedirs可以一次创建多个目录,但是如果目录已经存在,则报错,可以先检查是否存在,再创建,如: import os if not os.path.exists(dirs): os.makedirs(dirs) -- I like python! UliPad <>: http://code.google.com/p/ulipad/ meide < >: http://code.google.com/p/meide/ My Blog: http://www.donews.net/limodou
Zeuux © 2025
京ICP备05028076号