必需設定環境變數http_proxy和https_proxy
% export http_proxy=http://your.proxy.server:port
% export https_proxy=http://your.proxy.server:port
個人在學習Linux過程當中的個人筆記,提供個人及有需要的人查閱,若有錯誤歡迎提供指正,謝謝。 This Blog recorded notes about my learning Linux and provides myself and others reference. If there are any incorrect information, welcome to leave a message to correct me, Thanks.
2014年1月9日 星期四
2013年10月24日 星期四
Python Google Chart
安裝pygooglechart時出現找不到module setuptools:
Note if you catch an error:"ImportError: No module named setuptools" please download http://peak.telecommunity.com/dist/ez_setup.py and install the setuptools.
參考資料:
http://pygooglechart.slowchop.com/
http://trac.edgewall.org/wiki/TracOnWindows/Python2.5
Note if you catch an error:"ImportError: No module named setuptools" please download http://peak.telecommunity.com/dist/ez_setup.py and install the setuptools.
參考資料:
http://pygooglechart.slowchop.com/
http://trac.edgewall.org/wiki/TracOnWindows/Python2.5
2012年7月16日 星期一
install python setuptools (easy_install)
1. Download .egg from http://pypi.python.org/pypi/setuptools/ (according your python version)
2. using sh to execute .egg file
2. using sh to execute .egg file
2011年12月29日 星期四
using mod_wsgi deploy django project
1. install httpd-devel, python-devel
# yum install htppd-devel, python-devel
2. install mod_wsgi
a. Download mod_wsgi source code. modwsgi
b. untar & using ./configure; make; make install
3. edit /etc/httpd/conf/httpd.conf
LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias /mysite /usr/local/www/mysite/apache/django.wsgi
4. Create django project
#cd /usr/local/www
#django-admin.py startproject mysite
5. create apache folder
# cd /usr/loca/www/mysite
# mkdir apache
6. Create django.wsgi file in apache folder, the content is:
7. restart httpd
8. open brower and open link: http://localhost/mysite
Reference:
http://code.google.com/p/modwsgi/wiki/QuickInstallationGuide
http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide
https://docs.djangoproject.com/en/1.3/howto/deployment/modwsgi/
# yum install htppd-devel, python-devel
2. install mod_wsgi
a. Download mod_wsgi source code. modwsgi
b. untar & using ./configure; make; make install
3. edit /etc/httpd/conf/httpd.conf
LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias /mysite /usr/local/www/mysite/apache/django.wsgi
4. Create django project
#cd /usr/local/www
#django-admin.py startproject mysite
5. create apache folder
# cd /usr/loca/www/mysite
# mkdir apache
6. Create django.wsgi file in apache folder, the content is:
import os
import sys
path = '/usr/local/www'
if path not in sys.path:
sys.path.append(path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
7. restart httpd
8. open brower and open link: http://localhost/mysite
Reference:
http://code.google.com/p/modwsgi/wiki/QuickInstallationGuide
http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide
https://docs.djangoproject.com/en/1.3/howto/deployment/modwsgi/
2011年11月2日 星期三
python join
把string的list join成一個string
tmp = ["a", "b", "c", "d"]
" ".join(tmp)
a b c d
http://stackoverflow.com/questions/3627270/python-how-exactly-can-you-take-a-string-split-it-reverse-it-and-join-it-back
2011年7月26日 星期二
python subprocess
#!/usr/bin/python
from subprocess import *
from shlex import *
command = "ls -l"
print command
output = Popen(split(command), stdout=PIPE, stderr=PIPE)
outputData = output.communicate()[0]
returncode = output.returncode
http://docs.python.org/library/subprocess.html
訂閱:
文章 (Atom)