Chinese character display with VPtyhon
VPython到底能不能显示中文字符?能显示哪些中文字体?下面的code给出答案。
Continue reading ‘Chinese character display with VPtyhon’ »
Molecular modeling in Materials Sciences Web development Programming IT
Posts tagged ‘Python’
VPython到底能不能显示中文字符?能显示哪些中文字体?下面的code给出答案。
Continue reading ‘Chinese character display with VPtyhon’ »
The key steps
1. Create a folder named “~/python-packages”, then create a path “~/python-packages/lib/python2.6/site-packages/” with
1 | mkdir -p python-packages/lib/python2.6/site-packages/ |
The above path containing the version number of Python should be adjust accordingly base on the actual Python version you are using.
This step sets up a directory structure that is needed by python modules.
Continue reading ‘Install Python modules as non-root user on HPC cluster’ »
OK, even after reading the handbook a few times, it is not very clear which python file is the initial script for Qtiplot. It is important to know if you want to extend Qtiplot with python. After checking all the default python files in the Qtiplot installation path, I found qtiplotrc.py should be the one, although a smarter guy would have realized this from its name. You could import your own Python module in this startup file and enjoy them right after entering Qtiplot.
A demo program showing the way to make animation with matplotlib.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # A demo for animation with matplotlib # Written by Ting Li (Dr.Ting.Li at gmail.com) # 2010-09-10 # Ref: http://www.scipy.org/Cookbook/Matplotlib/Animations import numpy as np import time import matplotlib matplotlib.use('WXAgg') #before import pylab, choose the GUI backend #It can also be done while calling this script from command line: #>>> python animation.py -dWXAgg #Other backends are: valid strings are ['ps', 'Qt4Agg', 'GTK', 'GTKAgg', 'svg', # 'agg', 'cairo', 'MacOSX', 'GTKCairo', 'WXAgg', 'TkAgg', 'QtAgg', 'FltkAgg', # 'pdf', 'CocoaAgg', 'emf', 'gdk', 'template', 'WX'] from pylab import * <a href="http://9rivers.linkka.com/2010/09/11/animation-with-matplotlib/#more-561" class="more-link"><small>Continue reading ‘Animation with matplotlib’ »</small></a> |
通常只要修改Page_name和total_pages即可实现自动换页批量下载,喜欢听书的朋友可以试试。
While running a command line program or some GUI initiated from command line on Windows, there is always a black console window on the screen. This sometime becomes annoying. For example, when you start the Eric Python IDE on Windows, normally you start it by calling a batch file “eric4.bat” which calls the actual eric4.py script sequentially. Since Eric4 is designed to be a GUI program, the black console window has no use but it is there. To prevent that or hide it, there are several ways. Continue reading ‘Hide the command console window while running a GUI/Command line program on Windows’ »
Python的distutils可以很方便地制作模块安装程序,但是没有提供反安装/卸载功能。
Windows: there is ‘tree.com‘ command showing the directory structure.
http://chxkyy.javaeye.com/blog/213864
Continue reading ‘Print directory tree on Windows and Linux using tree, sed, awk or Python’ »
This document demonstrates how we could run client-server software via SSH. The main purpose of using this technique relies on that on most HPC servers most of the IP ports are nromally blocked except for the SSH port 22.
Continue reading ‘SSH tunneling and example Python client-server codes’ »