Showing posts with label python. Show all posts
Showing posts with label python. Show all posts

Wednesday, July 15, 2015

feedparser

https://pypi.python.org/pypi/feedparser




Thursday, May 14, 2015

python rss parser

https://wiki.python.org/moin/RssLibraries




Sunday, October 19, 2014

python : slice notation

https://docs.python.org/2/tutorial/introduction.html#strings
https://docs.python.org/2.3/whatsnew/section-slices.html


Slice indices have useful defaults; an omitted first index defaults to zero, an omitted second index defaults to the size of the string being sliced.

Tuesday, July 15, 2014

Python: scikit

http://scikit-learn.org/
http://scikit-learn.org/stable/tutorial/basic/tutorial.html
http://scikit-learn.org/stable/auto_examples/plot_digits_classification.html#example-plot-digits-classification-py
http://scikit-learn.org/stable/tutorial/machine_learning_map/index.html
https://pypi.python.org/pypi/scikit-learn/0.14.1
http://scikit-learn.org/stable/_downloads/plot_digits_classification.py
http://scikit-learn.org/stable/user_guide.html

$ pip install numpy
$ pip install scipy
$ pip install scikit-learn
(or $ easy_install scikit-learn)


Recognizing hand-written digits




















Friday, June 27, 2014

python : package management

http://jishus.org/?p=452
https://www.openfoundry.org/tw/tech-column/8536-introduction-of-python-extension-management-tools
http://atbrox.com/2009/09/21/how-to-get-pipvirtualenvfabric-working-on-cygwin/


If you have easy_install(Setuptools),
$ easy_install pip


[Note] cygwin default have easy_install , but not pip

Saturday, May 10, 2014

PyData

http://pydata.org/
http://www.slideshare.net/pydata
https://us.pycon.org/2013/schedule/presentation/28/

Sunday, January 27, 2013

pip - install Python packages

http://pypi.python.org/simple/

# sudo apt-get install python-pip
# pip install xxx

Saturday, October 13, 2012

Putty : utf8



Window -> Translation -> Remote character set: -> UTF-8

(default is ISO-8859-1:1998 (Latin-1, West Europe))


Check if your linux is utf8

# locale

if now, set locale...

# locale -a   //show locale you have
# export LC_ALL=en_US.utf8  //set en_US for example

Tuesday, July 05, 2011

Python: types

http://docs.python.org/tutorial/datastructures.html
http://docs.python.org/library/stdtypes.html
http://www.ideastar.me/2010/05/python-list-dictionary.html

list
mylist = []

set
myset = set(mylist)

dictionary
mydict = {}

Tuesday, May 24, 2011

python: compare a list of list by list len

http://wiki.python.org/moin/HowTo/Sorting/#The_Old_Way_Using_the_cmp_Parameter



loop = []
loop.append((1,2))
loop.append((1,2,3,4,5))
loop.append((1,2,3))

def cmpfunc(x,y):
return len(x)-len(y)


loop.sort(cmp=cmpfunc)
print loop

Output:
[(1, 2), (1, 2, 3), (1, 2, 3, 4, 5)]

Wednesday, April 21, 2010

PyQt

http://www.ibm.com/developerworks/linux/library/l-qt/
http://www.cs.usfca.edu/~afedosov/qttut/
http://www.commandprompt.com/community/pyqt/
http://www.saltycrane.com/blog/2008/01/how-to-install-pyqt4-on-ubuntu-linux/

Saturday, January 02, 2010

pygtk: filechooser

http://emacsjunkie.blogspot.com/2008/08/gtkfilechooserdialog-mini-howto.html
http://www.pygtk.org/pygtk2tutorial/sec-FileChoosers.html
http://www.pygtk.org/pygtk2tutorial/examples/filechooser.py

Sunday, December 06, 2009

Python Bluetooth

http://org.csail.mit.edu/pybluez/

import bluetooth
bluetooth.discover_devices(lookup_names = True)
bluetooth.find_service()

Sunday, November 29, 2009

python : web.py

http://webpy.org/

Default port is 8080.

Note: You can specify the port number to use on the command line like this if you can't or don't want to use the default:

$ python code.py 1234




[Note] put file into static/, you can browse this static file...


Monday, November 23, 2009

Google App Engine

http://code.google.com/intl/zh-TW/appengine/
http://code.google.com/intl/zh-TW/appengine/downloads.html
http://code.google.com/intl/zh-TW/appengine/docs/python/gettingstarted/uploading.html

Google host a server to run your web program, using python.

1. Apply your account
2. Download SDK
3. Upload sample (demos/guestbook)

3.1Modify application name in appl.yaml
3.2appcfg.py update demos/guestbook




[Note] To upload some static files, say test.html, add following to config file...
- url: /test.html
static_files: test.html
upload: test.html

[Note] To run it locally:
$ ./devserver.py demos/guestbook

[Note]
$ ./appcfg.py download_app
Usage: appcfg.py [options] download_app -A app_id [ -V version ]
Related Posts Plugin for WordPress, Blogger...