Create and apply filters to lists of file paths (Python recipe)
An experiment with filtering lists of files, documentation is written directly into the code.
"""
This is a bit ...
Deploying Django to Heroku
ls blog
vim requirements.txt
Django <=1.*.*
South
psycopg2=2.4.2
pip install -r requirements.txt
gir commit -am "change requirements"...
How to use Pyhton to generate source file of 2 ways
利用Python的字符串处理模块,开发人员可以编写脚本用来生成那些格式相同的C、C++、JAVA源程序、头文件和测试文件,从而避免大量的重复工作。本文概述两种利用Python string类生成java源代码的方法。
String Template
...
Remote control with telnetlib (Python recipe)
# auto_telnet.py - remote control via telnet
import os, sys, string, telnetlib
from getpass import getpass
class AutoTelnet:
...
How to change the brightness in Ubuntu14.04
sudo vim /etc/rs.local
add one line before “exit 0”
echo 550 > /sys/class/backlight/intel_backlight/brightness
noted the “500”,...
Alphabetical list of GUI Applications.
CamelotCamelot provides components for building applications on top of Python, SQLAlchemy and Qt. It is inspired by the Django admin inter...
a sample example to understand and use yield
yield 用法说明
yield 简单来说就是一个生成器,生成器是这样一个函数,它记住上一次返回时在函数体中的位置。对生成器函数的第二次(n次)调用跳转至该函数中间,而上次调用的所有局部变量都保持不变。
生成器是一个函数,函数的所有参数都会保留 第...
Python编程中常用的12种基础知识总结:正则表达式替换,遍历目录方法,列表按列排序、去重,字典排序,字典、列表、字符串互转,时间对象操作,命令行参数解析(getopt),print 格式化输出,进制转换,Python调用系统命令或者脚本,Python 读写文件
1、正则表达式替换
目标: 将字符串line中的 overview.gif 替换成其他...
Here note summarize the ten points that can help you better lean Django,reduce errors and avoid detours,it is worth a look.
Here note summarize the ten points that can help you ...
How to use variable length argument lists in Python.
The special syntax, args and **kwargs in function definitions is used to pass a variable number of arguments to a function. ...