Drake's Weblog

python

1 minute read

PyCon Taiwan 2020 is about to kick off, just one week to go.
Sometimes I’d wonder if we can host PyConTW somewhere else than Taipei.
And it just happened this year, right amid the pandemic, COVID-19, 2020.
The venue is in Tainan, south Taiwan, a historical and beautiful city.
I’m not sure how the committee made this decision.


I have to say, having PyConTW in Tainan is one of the best decisions!



Hopefully you can see a timeline, embedded through iframe, above that guide
you through PyCon Taiwan from 2012 to 2020.
And it seems the best viewing experience needs you to have a bigger screen, like a laptop,
along with a stand-alone webview.
So here it is, the stand-alone timeline of PyCon Taiwan 2012~2020.
Cheer~

1 minute read

What Python modules you use while in working?

我們都曉得,Python 有個模組倉庫 Cheese Shop (or PyPI),只要善用 Google + PIP + virtualenv,你需要什麼樣的模組,一般都有人替你寫好一版了。 不過這也不是什麼挺稀奇的。 Perl 老早就有 CPAN; PHP 也有個 PEAR; Ruby 的是 RubyForge; R 也有個 CRAN; 甚至連 Tex/LaTeX 都有個 CTAN; 喔,對了,Vim 也有個 Vim Scripts…
但你曉得你對某個程式語言的社群函式庫有多熟悉嗎? 你常用的模組倒底是哪些呢? 還是只是想到什麼,就 Google 什麼,然後看著 Tutorial 試用一下?!
以下是我在這七年多的工作期間,所寫的獨立執行的 Python scripts 所常用到的模組清單。 赫然發現,常用的模組,其實就那幾個!! (前頭的數字是引用的次數)
155 wx 126 os 119 sys 95 codecs 55 re 49 ldap 30 time 28 tempfile 28 shutil 20 datetime 19 urllib 18 setuptools 15 maya 15 copy 13 socket 11 subprocess 11 getpass 11 distutils 10 locale 9 warnings 8 threading 7 types 7 logging 6 traceback 這個清單裏頭,wx 的次數比 os, sys 來得多,應該是意外,不過也相差不遠。 與檔案處理有關的就有 codecs, tempfile, shutil, 這一點都不意外。 但是 re 居然也用很多次?

1 minute read

What is PyCon? PyCon Taiwan is organized by the Taiwan Python community for the community. PyCon Taiwan is intended to provide a professional venue to exchange technical information of Python. We want to clone the experience of PyCon (US), the largest annual gathering of Python programmers, in Taiwan, and bring the joy to more people.
PyCon Taiwan 2012 will also stress on industrial applications of Python.

1 minute read

Python, the so-called scripting language but actually more than that, keeps sweeping this CG/Animation/VFX/Game industries in technical programming field. The bigger the stronger. I even start to doubt if PyPy could take over this situation one day by it’s natural power of strength in concurrent programming.
> 由 Aardman Animations 與 Sony Pictures Animation 合力製作,於 2011 年放映的動畫。《聖誕快遞》揭示了一個令人難以置信、以前從未見過的答案,關於每一個孩子都曾有過的問題:“究竟聖誕老人是如何在一個晚上送完這些禮物?”答案是:聖誕老人在北極擁有超高科技的協助!但是,電影中心是關於一個家庭的故事,一個有漫畫功能障礙和一個不太可靠的主角阿瑟,一個緊迫的任務,一個必須在聖誕節前黎明的晨光前完成的任務。
Ok, 重點其實不是這部動畫,而是 Aardman Animations 這家動畫公司。這家位於 far far away(相對於台灣搭飛機過去所需要的時間來看)的大不列顛王國的動畫公司,一位技術研發人員於 2010 年釋出了一則有趣的訊息出來:Photoshop Embedded Python Pipeline。把整個 Python 給整合進 Photosthop 裏頭,提供 python programmer 一個管道,可以直接透過寫 python script 來與 PS 互動。放出來的一些圖,示範了可能的互動:

1 minute read

People keep asking about “How to learn Python”, “What to study for Python” or “Recommend Python books…” for VFX/Animation Industry. And here is a brief, not confirmed but, at least, some sort of informative answer I organized on Internet.
For general Python programming:
Official Python website, http://python.org/, http://docs.python.org/tutorial/ Learn Python the hard way, http://learnpythonthehardway.org/ Dive Into Python, http://www.diveintopython.net/ How to Think Like a Computer Scientist, http://greenteapress.com/thinkpython/ A Byte of Python, http://www.

1 minute read

2011 走了,民國 100 年在眾人互相廝殺的 boardgame, 美味湯頭火鍋, 以及散步看 101 煙火去中度過;2012 世界末日年也來了,我覺得 2012 年比其它年幸運,大家都記得它有個世界末日的外號,其它年份未必有這個福氣被大多數人記著。
論語《為政》篇裏頭提到“溫故而知新,可以為師矣。”參考 Tarek 的計畫,趁勢來個 2011 Python 回憶錄。
1. What’s the coolest Python application, framework or library you have discovered in 2011?
virtualenv, pip, Fabric, logbook, and mongoengine.
2. What new programming technique did you learn in 2011?
map reduce, git, optimization by matlab, and TDD.
3. What’s the name of the open source project you contributed the most in 2011?

1 minute read

There are several articles and Python modules talking about how to do concurrent/distributed/parallel computing in Python. There is an article in Python wik addressing “Parallel Processing and Multiprocessing in Python” which is a good start point for that. But the most interests me is how to make map parallel. One reason is that I started functional programming for a while and I started to switch my mind from imperative for-loop + if-else into map + filter + reduce + comprehension list; the other reason is that parallel map is just so good to boost up your program without chaning your code a lot.

2 minute read

Maya 2011 可能是有史以來,對於開發人員最最有善的一次改版了:整個 GUI 使用 Nokia Qt 重寫一遍。Maya 過去的版本發表中,影響程度足以和 2011 相提並論的,我想只有 Maya 8.5 推出時提供的 Python binding,以及隨後由 Chad Dombrova 個人領軍執行的 pymel open source project 可以匹敵。事實上我覺得,Maya 2011 以 Qt 重寫這件事,不止是用哪個 GUI framework 的差別而已,包括整個 GUI 的能力,與系統的整合,使用第三方程式庫的能力…等,差別遠比想像中的大很多。
所以當你拿到一個已經安裝好 Maya 2011 的機器時,就程式開發的角度來看的話,裏頭提供的環境應該就會有 Maya SDK + Python + pymel,然後應該也會有 Qt 的開發環境。然後既然有 Python 又有 Qt,那也應該可以使用 PyQt4 的吧? 似乎應該就是如此,但又有點不太一樣。一來,Maya 提供的 Qt 函式庫(.so or .dll)與 Nokia Qt 官方提供的有一些差異,甚至是有不全的地方;二來,Maya 並沒有提供 PyQt4! 事實上,Maya 要把 PyQt4 包入比你想像中的,都要來得複雜一些。在這邊分享一下 Maya 2011 + PyQt4 的作法與過程,雖然已經不是什麼新聞了 ;p

Recent posts

Categories

About

You're looking at Drake's words or statements. All opinions are my own.