学以致用

focus on Python , C++, and some interest in Go and R

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2012年12月27日

摘要: 转载一段python代码,通过urllib2使用multipart/form-data来发送文件import httplib, mimetypesdef post_multipart(host, selector, fields, files): """ Post fields and files to an http host as multipart/form-data. fields is a sequence of (name, value) elements for regular form fields. files is a sequence of 阅读全文
posted @ 2012-12-27 17:48 Jerry.Kwan 阅读(996) 评论(0) 推荐(0)

摘要: 在已经运行的系统中更改了某些以前存在于PATH环境变量所指明的目录中的程序的存放目录后可能出现No such file or directory的错误提示。比如,以前python存放于/usr/bin/下,现在临时将/usr/bin/python删除,在/usr/local/bin下生成python,按照正常逻辑,此时直接执行python的话,会找到/usr/local/bin/python,因为/usr/local/bin也在环境变量PATH中,但却会出现bash: /usr/bin/python: No such file or directory为何?具体原因如下:bash会保存一个从开 阅读全文
posted @ 2012-12-27 17:27 Jerry.Kwan 阅读(658) 评论(0) 推荐(0)