# apt-get install libmysqlclient-dev
2014年2月10日 星期一
Install a package and write to requirements.txt with pip
$ pip freeze > requirements.txt $ pip install -r requirements.txt
References :
Cookbook — pip 1.5.2 documentation
Upload your package PyPI
PyPI — the Python Package Index
Create a
setup.py
setup.cfg
References :
How to Create a Python Library | Pypix
Create your accounts
PyPI Live
PyPI Test
Create a .pypirc configuration file
[distutils] # this tells distutils what package indexes you can push toindex-servers =PyPI # the live PyPIPyPI-test # test PyPI[PyPI] # authentication details for live PyPIrepository: https://PyPI.python.org/PyPIusername: {{your_username}}password: {{your_password}}[PyPI-test] # authentication details for test PyPIrepository: https://testPyPI.python.org/PyPIusername: {{your_username}}
Prepare your package
root-dir/ # arbitrary working directory namesetup.pysetup.cfgLICENSE.txtREADME.mdmypackage/__init__.pyfoo.pybar.pybaz.py
setup.py
from distutils.core import setupsetup(name = 'mypackage',packages = ['mypackage'], # this must be the same as the name aboveversion = '0.1',description = 'A random test lib',author = 'Ajay',author_email = 'aj@gmail.com',url = 'https://github.com/ajkumar25/mypackage', # use the URL to the github repodownload_url = 'https://github.com/ajkumar25/mypackage/tarball/0.1', # I'll explain this in a secondkeywords = ['testing', 'logging', 'example'], # arbitrary keywordsclassifiers = [],)
setup.cfg
[metadata]description-file = README.md
Register your package
$ python setup.py register -r PyPI-test
Upload your package
Upload to PyPI Test
$ python setup.py sdist upload -r PyPI-test
Upload to PyPI Live
$ python setup.py register -r PyPI
$ python setup.py sdist upload -r PyPI
References :
How to Create a Python Library | Pypix
2014年2月8日 星期六
Dump database to csv format
SELECT *FROM the_tableINTO OUTFILE '/tmp/the_table.csv'FIELDS TERMINATED BY ','ENCLOSED BY '"'LINES TERMINATED BY '\n';
References:
Save MySQL query results into a text or CSV file | a Tech-Recipes Tutorial
2014年2月3日 星期一
Linux Markdown Editor
1. ReText
最簡易,可同步預覽,編輯視窗字體不能放大
2. MdCharm
功能齊全,有快速鍵修改 Markdown 語法,可自定樣式 (Windows, Linux, C++, QT)
3. Remarkable
功能齊,界面直觀,有快速鍵修改 Markdown 語法,可自定 CSS,GitHub 呈現樣式不錯 (Write in Python,支援 Linux,非完全 Open Source)
References :
Linux下Markdown的安装及常用语法 - WeberXie - 博客频道 - CSDN.NET
最簡易,可同步預覽,編輯視窗字體不能放大
# apt-get install python3-docutils python3-markdown retext
2. MdCharm
功能齊全,有快速鍵修改 Markdown 語法,可自定樣式 (Windows, Linux, C++, QT)
3. Remarkable
功能齊,界面直觀,有快速鍵修改 Markdown 語法,可自定 CSS,GitHub 呈現樣式不錯 (Write in Python,支援 Linux,非完全 Open Source)
References :
Linux下Markdown的安装及常用语法 - WeberXie - 博客频道 - CSDN.NET
Could not parse file contents, check if you have the necessary module installed!
# apt-get install python3-docutils python3-markdown
References :
ReText / Tickets / #104 Preview error, missing module
訂閱:
文章 (Atom)