1. 安装 python3.6
sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update sudo apt-get install python3.6
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1 sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2
Finally switch between the two python versions for python3
via command:
sudo update-alternatives --config python3
python3 -V
bug, gnome-terminal won’t launch after step 3, a workaround is running following commands to recreate the symlink:
sudo rm /usr/bin/python3 sudo ln -s python3.5 /usr/bin/python3
2. pip3.6安装regex失败 pip3 install regex
# mysql> use your_database_name;
# mysql> source file.sql;
import and export
Export:
mysqldump -u username –-password=your_password database_name > file.sql
Import:
mysql -u username –-password=your_password database_name < file.sql
Another way to import dump files when source <filename>
doesn't work is to do the following:
Dump
~> mysqldump --user=<user> --password=<password> <db_name> > <export_file_name>.sql
Import
> mysql -u <user> -p <pass> <db_name>
mysql> USE <db_name>; (if you didn't already select)
mysql> . ~/<export_file_name>.sql
5. 更换python版本后出现 No module named "apt_pkg"
First:
How to Fix Error sudo: add-apt-repository: command not found
Then:
Error sudo: add-apt-repository: command not found [duplicate]
6. douyin 爬虫
REF:
markdown简易语法(图文并茂)
Reloading modules in Python
For >=Python3.4
import importlib importlib.reload(module)
UnicodeEncodeError
编辑~/.bash_profile文件('~'指的是用户登录后的默认目录),添加一行:export LANG="en_US.UTF-8"
在运行python命令前添加参数 PYTHONIOENCODING=utf-8 python printcn.py
How can I set VIM's default encoding to UTF-8?
.vimrc
, add set encoding=utf-8
and restart Vim.