Category Archives: Python

[Python] fix error while loading shared libraries: libpython2.7.so.1.0

error log: /opt/rh/python27/root/usr/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory check libpython2.7.so.1.0 exist? find . -name ‘libpython2.7.so.1.0’ if the file was exist: edit the ldconfig config echo “/opt/rh/python27/root/usr/lib64” > /etc/ld.so.conf.d/python27.conf ldconfig … Continue reading

Posted in CentOS, Python | Leave a comment

[Gitbook] 使用 Windows 視窗編輯器

試著使用 Windows 的視窗編輯器來撰寫 Gitbook 目前測試了 Miu 跟 MarkdownPad 這兩個編輯器 不過前者 Miu 因為 Liveview 並不支援 HTML 語法,所以被我拋棄了 等他有支援再回去用看看 PS. Mac 上大家推的都是 Mou 而用 Windows 寫 Gitbook 就不像在 Linux 上有 gitbook init 可以產生相對映的 md 檔案 就改之前寫的 parse.py 來產生吧 (這邊使用的 python 版本是 3.0) … Continue reading

Posted in Python | Leave a comment

[Python] SyntaxError: Missing parentheses in call to ‘print’

因為在 Ubuntu 上目前安裝的 Python 版本還是 2.7 而之前在 Windows 安裝的版本為 3.0 導至把 Ubuntu 上寫好的 code 拿至 Windows 上編譯時會發生下列錯誤… SyntaxError: Missing parentheses in call to ‘print’ 這時候參考stackoverflow: What does “SyntaxError: Missing parentheses in call to ‘print’” mean in Python? 得知要把 print 語法修正一下 … Continue reading

Posted in Python | Leave a comment

Gitbook 超過兩層目錄無法創建檔案/目錄的解套

因為gitbook作者認為一本書的章節目錄不應該過於複雜 所以原本預設只有兩層目錄 在去年一堆相關討論串結束後雖然已讓目錄可以超過兩層 但是gitbook (github源)卻無法建立相對應的目錄及檔案 在爬了許多code後 (/usr/lib/node_modules/gitbook)決定還是自己寫一個parse code來處理 這邊在讀完SUMMARY.md後會自動偵測檔案目錄是否不存在 不存在就直接創建 預設只抓三層檔案目錄的結構

Posted in Gitbook, Python | Leave a comment

[Wisemapping] find user by email in Python

Posted in Python, Wisemapping | Leave a comment

Eclipse 安裝 Python 模組

下載 Python 進行安裝 Python 下載連結 安裝過程中記得勾選加入環境變數 開啟 Eclipse => Help => Eclipse Marketplace 搜尋 Python => Go 安裝 PyDev – Python IDE for Eclipse 勾選 PyDev for Eclipse、Pydev Mylyn Integration => Next I accept the terms of the license agreements … Continue reading

Posted in Eclipse, Python | Leave a comment

Python 註解

Posted in Python | Leave a comment