工作上需要製作一個實時大屏,需要使用websocket實時傳遞信息。但是之前對websockety一直不熟悉。
主要使用的是channels,參考官方教程寫的代碼。教程已經寫的很全了。解釋很好.
所以需要新建python環境,新建git,安裝包等等。
更換源
由於使用官方源下載channels很慢,所以需要指定pip的源:
打開新建的文件夾,在裏面建一個名爲: pip.ini的文件,並在文件中輸入如下信息保存:
[global]
timeout = 6000
index-url = http://pypi.douban.com/simple
trusted-host = pypi.douban.com
- 科技大學的:https://mirrors.ustc.edu.cn/pypi/web/simple/
- https://pypi.tuna.tsinghua.edu.cn/simple
需要用到redis, chromedriver, selenium
獲取密碼
config get requirepass
設置密碼
config set requirepass 123456
當有密碼的時候登錄時需要密碼登錄
auth 密碼
取消密碼
config set requirepass ''
查看chrome的版本直接看關於就好了。
- http://npm.taobao.org/mirrors/chromedriver/ 淘寶源 chromedriver [selenium 配置 chromedriver](https://www.cnblogs.com/wzjbg/p/11192082.html)
chromedriver是一個控制chrome瀏覽器的驅動,相當於是個接口。
selenium是python的一個模擬瀏覽器,可以實現對瀏覽器的模擬。
由於需要將公司電腦這邊的git綁定到這邊的github,因此需要添加驗證
- 本地電腦配置好git
- 本地生成ssh公鑰 > ssh-keygen -t rsa -C “your email”
- 將ssh公鑰上傳到github的ssh key處
- 添加新的郵箱到github的認證郵箱中
- 創建.gitignore, 添加不跟蹤的目錄和文件
- git push 上傳代碼
.idea文件的用途
在創建.gitignore的時候,發現了一個.idea文件,不知道有什麼用途。經過查找,確定爲:
當使用pycharm作爲IDE時,會自動生成.idea/文件夾來存放項目的配置信息。其中包括版本控制信息、歷史記錄等等
git查看配置的一些命令
- 查看系統config
git config --system --list
- 查看當前用戶(global)配置
git config --global --list
- 查看當前倉庫配置信息
git config --local --list
- 查看user.name
git config user.name
- 查看user.email
git config user.email
- 修改user.name
git config --global --replace-all user.name "your user name"
- 修改user.email
git config --global --replace-all user.email"your user email"