下载Termux手机app。(手机应用商店或google play商店即可下载,google play商店可以下载到最新版。找不到请百度。)
打开Termux,输入pkg install python安装python,默认为python3。
此时打开Termux,输入python即可在python交互环境中进行python语句编写。
当然,要实现更好的编程体验,还是要用到vim编辑器。打开Termux,输入apt install vim即可安装vim。要想实现高亮等更好的编程效果,还需要对vim进行配置。打开Termux,输入vim .vimrc。输入i进入insert模式(屏幕出现--INSERT--即进入insert模式),即可写入配置语句。
我的配置如下:
set nocompatible
syntax on
filetype plugin indent on
set ic
set hlsearch
set encoding=utf-8
set fileencodings=utf-8,ucs-bom,GB2312,big5
set cursorline
set autoindent
set smartindent
set scrolloff=4
set showmatch
set nu
let python_highlight_all=1
au Filetype python set tabstop=4
au Filetype python set softtabstop=4
au Filetype python set