Jghost

jeiao, In me the tiger sniffs the rose !

导航

随笔分类 -  python

python 学习
pycharm 配置虚拟开发环境
摘要:默认系统已经安装pycharmvirtualenvvirtualenvwrapperpycharm 默认的运行环境是系统自带的python2.6+的开发环境,不是我们想要的虚拟开发环境.此时我们需要增加interpreter 在pycharm的setting里面,具体操作:File ----- Setting ------Project Interpreter -----python interpreters :上面有选择 已经创建好的,删除以及创建一个新的local是地址,就是你要将这个虚拟开发环境保存的地方 一般在用户目录即可.openstack horizon 源代码开发的时候, 虚拟环 阅读全文

posted @ 2014-04-11 12:57 Jghost 阅读(1484) 评论(0) 推荐(0)

python 遍历指定文件夹下的所有文件内容
摘要:最近公司代码需要做版权审查需要一些代码,足足60页的word文档,如果一个一个文件的copy代码 就真是out,最近在学习python,就写了个python的脚本,方便上面操作。__author__ = 'jghost'import osfor root,dirs,files in os.walk('your source'): print root #path for name in files: if name.endswith('.java'): dic = open('/home/jghost/filefilter.txt' 阅读全文

posted @ 2014-04-03 15:42 Jghost 阅读(780) 评论(0) 推荐(0)

python -- why defined '__new__' and '__init__' all in a class
摘要:在学习openstack源码的时候发现一个类里面有'__new__' 和'__init__'两个构造,不知道什么原因,在stackoverflow中找到了满意的解答:粘贴解答至此:You can define either or both of__new__and__init__.__new__must return an object -- which can be a new one (typically that task is delegated totype.__new__), an existing one (to implement singlet 阅读全文

posted @ 2014-04-02 16:00 Jghost 阅读(197) 评论(0) 推荐(0)

AttributeError: 'module' object has no attribute 'maketrans'
摘要:AttributeError: 'module' object has no attribute 'maketrans'网上搜了好久,还是没找到原因。后来仔细阅读了一段文档:Actually, modules are searched in the list of directories given by the variable sys.path which is initialized from the directory containing the input script (or the current directory), PYTHONPATH a 阅读全文

posted @ 2014-03-17 09:37 Jghost 阅读(1909) 评论(0) 推荐(0)

django1.6 apache 项目部署.
摘要:前提:apache服务器已经安装好ps:安装Apache的WSGI 模块, sudo apt-get install libapache2-mod-wsgi .可以使用a2enmod wsgi来验证是不是已经安装成功。1,修改wsgi.py文件 加入path中"""WSGI config for o... 阅读全文

posted @ 2014-02-27 15:36 Jghost 阅读(610) 评论(0) 推荐(0)

myeclipse python插件安装和环境配置(Windows7下)
摘要:1.下载必备的软件和插件:python:http://www.python.org/getit/pydev:http://pydev.org/download.html安装python ,在myeclipse安装目录,如:D:\path\MyEclipse 10\dropins文件夹里创建pydev文件夹,将下载的pydev文件夹里的features和plugins文件放在所创建的 文件夹里.重启myeclipse.在myeclipse-->Preferences-->PyDev-->Interpreter-Python 配置python的路径也可以点击 Auto Confi 阅读全文

posted @ 2013-09-29 12:38 Jghost 阅读(905) 评论(0) 推荐(0)

ubuntu Ulipad 配置
摘要:1、安装python一般ubuntu上默认安装了2、安装 wxPython支持apt-get install python-wxgtk2.83、下载UilPad包http://ulipad.googlecode.com4、shell 里面,目录下直接执行 python UliPad.py或者UliPad.pywUbuntu中将快捷方式添加到“应用程序”现在想把Ulipad添加到系统的“应用程序”菜单里,方法如下:sudo gedit /usr/share/applications/Ulipad.desktop填写以下内容:[Desktop Entry]Name=UlipadComment=a 阅读全文

posted @ 2013-05-09 09:47 Jghost 阅读(321) 评论(0) 推荐(0)

python IndentationError:
摘要:IndentationError: unindent does not match any outer indentation levelIndentationError: expected an indented block 这写都是因为缩进造成的 检查一下 就能解决 阅读全文

posted @ 2013-05-08 14:14 Jghost 阅读(178) 评论(0) 推荐(0)

python 0.1
摘要:Whetting your Appetite激发你的欲望如果你经常使用电脑工作,最后你会发现你越来越喜欢一些能自动完成的任务,比如说,你可能希望一个平台,一个能在很大篇文章里查询替换,更改或者排序一大批的照片 用复杂的方式, 或许你喜欢写一个小的定制的数据库 或者一个特殊的GUI ,或者一个小的game.如果你是一个专业的软件开发人员,你可以用几个C/C++/Java的类库协助你工作,但是一个普遍的写/编译/测试/重新编译的循环是很慢的,或许你正在编写一个测试包为一个程序库,你会发现写代码是一个很乏味的任务,或者你已经编写了一个程序,能用一个编程,你不想设计和实现 一整个新语言对你的应用Pyt 阅读全文

posted @ 2013-05-02 23:21 Jghost 阅读(224) 评论(0) 推荐(0)