- Windows 10 64 bit
- Python 3.x 64 bit or errors will occour when installing pywinpty
- MS Visual Studio Build Tools (for c++ compiler)
- Set Python and Python/Scripts paths to system path (reboot required).
- pip install pywinpty
Add Socks5 support to pip:
pip install pysocksSocks5 proxy settings
(temporary setting, will turn void after shell closed):
set https_proxy=socks5://127.0.0.1:1081
set http_proxy=socks5://127.0.0.1:1081使得一行的数值根据另外一列的数值的改变而改变,关键点是函数输入结尾是以数组形式(CTRL+SHIFT+ENTER),而不是直接ENTER
一级菜单决定下一级菜单的内容,举例:一级菜单选择江苏省,那么二级菜单只能出现南京市、苏州市,而不会出现西安市。功能实现的核心:
gswin64c -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER -dFirstPage=27 -dLastPage=27 -sOutputFile=OUTPUT.pdf ORIGINAL.pdfCompress
gswin64c -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
| ::https://blog.csdn.net/u013642500/article/details/80138799 | |
| @echo off | |
| pushd "%~dp0" | |
| dir /b C:\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~3*.mum >List.txt | |
| dir /b C:\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package~3*.mum >>List.txt | |
| for /f %%i in ('findstr /i . List.txt 2^>nul') do dism /online /norestart /add-package:"C:\Windows\servicing\Packages\%%i" | |
| pause |
| # remove files less then 100k | |
| find . -type 'f' -size -100k -delete | |
| # remove tif files less than 160k | |
| find . -name "*.tif" -type 'f' -size -160k -delete | |
| # remove files that do NOT match with the pattern | |
| find . -type f ! -name '*.txt' -delete |
| # replace the path with your own | |
| # recommended usage: | |
| # run: chmod +x shell_search.sh | |
| # add path to $PATH | |
| # add alias to .bash_aliases | |
| # run: source ~/.bash_aliases | |
| result=$(find /Users/path_of_your_own -iname "*$1*") | |
| IFS=$'\n' # make newlines the only separator, or "for" loop splits when it sees any whitespace like space, tab, or newline. | |
| for i in $result |
| # find file that is less than 100k and rm them | |
| # https://unix.stackexchange.com/a/12904 | |
| find . -type f -size -100k -exec rm {} + | |
| # find the files in the current directory that contain the text "chrome". | |
| find . -exec grep chrome {} \; | |
| # or | |
| find . -exec grep chrome {} + | |
| # find will execute grep and will substitute {} with the filename(s) found. | |
| # The difference between ; and + is that with ; a single grep command for each file is executed | |
| # whereas with + as many files as possible are given as parameters to grep at once. |
| # central limit theorem in Python | |
| # 展现中心极限定理 | |
| # ref:https://zhuanlan.zhihu.com/p/25241653 | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| random_data = np.random.randint(1, 7, 10000) | |
| samples = [] | |
| samples_mean = [] | |
| samples_std = [] |
| # Asterisks for unpacking into function call | |
| # https://treyhunner.com/2018/10/asterisks-in-python-what-they-are-and-how-to-use-them/ | |
| fruits = ['lemon', 'pear', 'watermelon', 'tomato'] | |
| print(*fruits) | |
| # output lemon pear watermelon tomato | |
| date_info = {'year': "2020", 'month': "01", 'day': "01"} | |
| filename = "{year}-{month}-{day}.txt".format(**date_info) | |
| print(filename) | |
| # output '2020-01-01.txt' |