0%

Use terminal to open and close application or file

What the heck, a new world!

Very simple, so first of all, if we want to open a application

1
2
3
4
5
open -a applicationname
#我这里用的是Google Chrome
open -a "Google Chrome"#不加”“也可以,最好别加,好像有bug,因为下面atom加了显示失败
如果要打开某个文件
open ./Desktop/a.cpp -a Atom #打开桌面的c++文件用atom打开

Hell no, how to close

1
osascript -e 'quit app "Atom"'#osascript -e 'quit app "Applicationname"'

用terminal玩转web browser

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
You’ll want to install the main w3m package and the w3m-img package if you want inline image support. Use the following command on Ubuntu:

sudo apt-get install w3m w3m-img

For Mac following command will install:

brew install w3m

You can use the arrow keys to move the cursor around or click at the desired location to move the cursor there. If you want to type in a text box, select the text box with your cursor and press Enter before typing your text. Load a hyperlink by selecting it with your cursor and pressing Enter.
Shortcuts:
Tab: Press the Tab key to position your cursor over the next hyperlink on the page.
Shift-B: will take you back a page.
Shif-U: If you want to load a different URL, you’ll get an URL prompt.
Shift-H: To view the help page if you want to see a more complete list of keyboard shortcuts.
Shift-T: To open a new tab and then you can press Shift-U and enter the new URL. Yes, it does support tab browsing:)

使用

1
2
3
4
5
6
7
w3m 网址
w3m baidu.com
Tab: move to next interaction point
Enter:Trigger interaction item(click/enter)
有text的话可以输入想search的内容
jk,上下左右 移动光标
qy 退出w3m

GUI 图形用户界面编程

常用的 GUI 库

\1. Tkinter
tkinter(Tk interface)是 Python 的标准 GUI 库,支持跨

平台的 GUI 程序开发。tkinter 适合小型的 GUI 程序编写, 也特别适合初学者学习 GUI 编程。本书以 tkinter 为核心进 行讲解。
\2. wxPython

wxPython 是比较流行的 GUI 库,适合大型应用程序开发, 功能强于 tkinter,整体设计框架类似于 MFC(Microsoft Foundation Classes 微软基础类库)。

\3. PyQT
Qt 是一种开源的 GUI 库,适合大型 GUI 程序开发,PyQT

是 Qt 工具包标准的 Python 实现。我们也可以使用 Qt Desginer 界面设计器快速开发 GUI 应用程序。