【鼎革‧革鼎】︰ Raspbian Stretch 《三‧壬》

220px-PythonProgLogo 1990s-2005

Python 語言的創造者吉多‧范羅蘇姆 Guido van Rossum 先生非常注重『程式風格』!主導著整體 Python 語言之內蘊。一九九四年元月,那時網際網路還盛行用『地鼠』 Gopher 挖掘資訊的時代, Python 1.0 發布。同年七月 Michael McLay (mclay@eeel.nist.gov)
Wed, 29 Jun 94 10:07:42 EDT 寫了一篇

If Guido was hit by a bus? 》 ── 萬一吉多被巴士撞了? ──

的文章,或許促進了 Python 語言的開始標準化。之後 Python 社群開始稱呼 Guido 『生殺決策之慈悲獨裁者BDFL Benevolent dictator for life︰

BDFL is a title given to a small number of open-source software development leaders, typically project founders who retain the final say in disputes or arguments within the community.

無疑的吉多是第一位擁有這個殊榮稱號的第一人。二零零一年三月六日『 Python軟體基金會』 PSF Python Software Foundation 成立,一個月後 Python 2.1 發行,所有的發行版開始使用 PSF 授權。事實上吉多的熱情與睿智,更多的展現在『 Python 改進提案PEPs Python Enhancement Proposals 的發文裡。有關『可讀性』之『程式風格』的論述主要集中在︰

PEP 7 – Style Guide for C Code

PEP 8 – Style Guide for Python Code

也許吉多的理念是︰

程式雖是一時一人之寫作,確有多時多人的閱讀,因此『可讀性』是十分重要的事情。

─── 《Physical computing ︰ python 《補充》︰ IDE 用法……

 

過去作者曾多篇幅介紹過 Python 忍者 IDE ︰

近來有人談起如何學習 python 語言的事,雖想在『部落格』中不便大談特談,之前既然說了《 Thue 》,《 λ 運算》與《圖靈機》,也許說幾件一般 python 書籍中比較少講的□○,或許是寥勝於無的吧!!

對於初學 python 語言的人,通常有一個『整合發展環境』 IDE integrated development environment 是很有幫助的。由於 python 內建的『 IDLE 』太過陽春,所以常被『閒置』!那麼在『樹莓派』上可有合適的 IDE 呢?於此我們將介紹一個也是用『 python 』寫的『別樣』 IDE ── 忍者 ninja ── ,WiKi 上說,它的命名來自︰
the recursive acronym: “Ninja-IDE Is Not Just Another IDE”

── 摘自《Physical computing ︰ python 《補充》︰ IDE ︰安裝

 

樂見其支持派生 PEPs 也。

雖然那時的版本尚且太舊,還需自己動手更新!

倘比之於今日

pi@raspberrypi:~ apt-cache show ninja-ide Package: ninja-ide Version: 2.3-2 Installed-Size: 1866 Maintainer: David Paleino <dapal@debian.org> </pre>    <span style="color: #666699;">縱早追上,非常容易安裝</span>  <span style="color: #808080;">sudo apt-get install ninja-ide</span>  <span style="color: #666699;">反倒無路用,將如之何耶?</span> <pre class="lang:default decode:true">pi@raspberrypi:~ ninja-ide 
Traceback (most recent call last):
  File "/usr/bin/ninja-ide", line 34, in <module>
    ninja_ide.setup_and_run()
  File "/usr/lib/python2.7/dist-packages/ninja_ide/__init__.py", line 71, in setup_and_run
    core.run_ninja()
  File "/usr/lib/python2.7/dist-packages/ninja_ide/core/core.py", line 48, in run_ninja
    from ninja_ide.gui import ide
  File "/usr/lib/python2.7/dist-packages/ninja_ide/gui/ide.py", line 45, in <module>
    from ninja_ide.core import plugin_services
  File "/usr/lib/python2.7/dist-packages/ninja_ide/core/plugin_services.py", line 29, in <module>
    from ninja_ide.gui.main_panel import main_container
  File "/usr/lib/python2.7/dist-packages/ninja_ide/gui/main_panel/main_container.py", line 36, in <module>
    from ninja_ide.gui.main_panel import tab_widget
  File "/usr/lib/python2.7/dist-packages/ninja_ide/gui/main_panel/tab_widget.py", line 40, in <module>
    from ninja_ide.gui.main_panel import browser_widget
  File "/usr/lib/python2.7/dist-packages/ninja_ide/gui/main_panel/browser_widget.py", line 27, in <module>
    from PyQt4.QtWebKit import QWebView
ImportError: No module named QtWebKit
pi@raspberrypi:~ $ 

 

故而讀此文告,實在心涼

Qt4’s WebKit removal

Template text to file bugs

Subject: Qt4's WebKit removal
Source: @FILLME@
User: debian-qt-kde@lists.debian.org
Usertags: qt4webkit-removal

Hi! As you might know we the Qt/KDE team are preparing to remove Qt4's WebKit
as announced in [announce].

[announce] <https://lists.debian.org/debian-devel-announce/2015/05/msg00001.html>

Basically we are about to get the last Qt4 point release and upstream is
migrating from WebKit to Blink in the Qt5 series, so we won't have much upstreams
support for maintaining Qt4's WebKit (Qt5's WebKit is expected to stay supported
until Qt6).

In order to make this move, all packages directly or indirectly depending on
the Qt4's WebKit library have to either get ported to Qt5 or eventually get
removed from the Debian repositories.

Therefore, please take the time and:
- contact your upstream (if existing) and ask about the state of a Qt5 
port of your application
- if there are no activities regarding porting, investigate whether there are 
suitable alternatives for your users
- if there is a Qt5 port that is not yet packaged, consider packaging it
- if both the Qt4 and the Qt5 versions already coexist in the Debian 
archives, consider removing the Qt4 version

= Porting =

Some of us where involved in various Qt4 to Qt5 migrations [migration] and we
know for sure that porting stuff from Qt4 to Qt5 is much much easier and less
painful than it was from Qt3 to Qt4.

We also understand that there is still a lot of software still using Qt4. In
order to ease the transition time we have provided Wheezy backports for Qt5.

Don't forget to take a look at the C++ API changes page [apichanges] whenever
you start porting your application.

[migration] http://pkg-kde.alioth.debian.org/packagingqtbasedstuff.html
[apichanges] http://doc.qt.io/qt-5/sourcebreaks.html

For any questions and issues, do not hesitate to contact the Debian Qt/KDE 
team at debian-qt-kde@lists.debian.org

 

當真又得客製補釘乎??怎麼每逢新舊交替老是這樣哩!!

不過想學派生三、願入門者,樹莓派基金會已指明道路︰

Thonny on a Raspberry Pi: using the new Python IDE in Raspbian

Use the new Thonny IDE in Raspbian on a Raspberry Pi to understand what’s going on in your code

Thonny is a new IDE (integrated development environment) bundled with the latest version of the Raspbian with PIXEL operating system. Using Thonny, it’s now much easier to learn to code. Thonny comes with Python 3.6 built in, so you don’t need to install anything.

Just open up the program, which you’ll find under Menu > Programming. It offers a lot of advanced features not currently available in the Python 3 (IDLE) program, which is still included with Raspbian.

See also: Programming a Raspberry Pi with Python

When you start Thonny, you’ll see a new script editor and a shell. As with Python 2/3 IDLE, you enter a program in the script editor and run it in the shell. You can then use the shell to interact directly with the program; accessing variables, objects, and other program features.

Thonny has a range of additional features that are perfect for learning programming. One of the best features is a powerful, but easy-to-use, debug mode. Instead of running your program, it steps through the code line by line. You can see the variables and objects being created, and values being passed into functions or assessed by comparators.

You often find debuggers in powerful IDEs, but they tend to require you to manually set breakpoints (places where the program freezes so you can examine the code). The approach in Thonny is much more straightforward. It also has a range of panels that enable you to inspect various items, such as variables, objects, and the heap (the memory space where items are stored).

There’s some pretty good stuff in Thonny for young coders. The ability to step through your programs makes it much easier to understand what happens when you hit Run.

 

或許根本不必它求矣︰

Thonny

Python IDE for beginners

 

 

忠告愛 kde4 桌面者,『 之本義就是美◎

HIME Input Method Editor

Hime 新手上路

簡介

Hime 是一個極好用的輸入法框架, 輕巧、穩定、功能強大且支援許多常用的輸入法,包括倉頡, 注音,大易,行列,嘸蝦米 ,希臘字母, 日本 Anthy, 韓拼, 拉丁字母, 亂倉打鳥, 酷音等….

特色

  • 支援多種輸入法, 使用者選擇多
  • 支援多種智慧型注音輸入法
  • 支援多種拆字型輸入法
  • 支援內碼輸入

授權

LGPLv2.1 (Qt immodules are GPLv2)

取得/安裝

sudo apt-get install hime hime-chewing

開始使用 Hime

開啟/切換輸入法

  • 按 Ctrl+Space 來開啟輸入視窗
  • 按 Ctrl+Shift 來循環切換輸入法

常見問題

“HIME” 怎麼念?

  • HIME 在日語中是「姫」,公主的意思,發音為「ひめ」。中文沒有對應的音,英文的發音為: Pronounce “Hi” like the English word “he”, then pronounce “me” like the English word “may” or the “Me” in “Merry Christmas”。

為什麼(詞音的)詞庫不會隨著 HIME 更新?

  • 目前輸入法的設計並不會更新存放於使用者家目錄的詞庫資料,未來的版本可能會改善,細節請見 issue #136