搭建梯子的原理 参考博客# 什么是 GFWGFW 是 Great Firewall 的简称,即中国防火墙,会屏蔽一些域名。参考 VPN 概念,技术原理和误区HTTP 协议比较大的缺点就是明文,其并没有对数据进行加密. VPN 是 Virtual Private Network, 虚拟专用网络. 公司所要发送的数据都要经过 VPN 集线器加密. VPN 有很多类型: VPN 类型站点 – 站点多用在同一个公司,但不 2022-08-28 CNSS
CNSS 夏令营网站习题总结 运行 NeofetchNeofetch 用于漂亮的显示系统 logo 和一些系统信息. 安装 Neofetch: 1sudo apt -yqq install neofetch 2022-08-28 CNSS
Ubuntu 下处理图片 需要用到 file 命令和 convert 命令,若没有 convert 命令: 1sudo apt install graphicsmagick-imagemagick-compat 使用 file 命令其作用为查看图片参数: 1$ file helloc.png 结果为: 1helloc.png: PNG image data, 976 x 1064, 8-bit/color RGBA, no 2022-08-28 Ubuntu
Python 中 time 库 time 库是 Python 中处理时间的标准库。 功能 获取系统时间,并格式化输出 计时,方便分析程序的性能 time() 函数用于获取从1970年1月1日00:00:00开始,到现在的总秒数,也被称为计算机内部时间. 123import timeprint(time.time()) localtime() 函数和 gmtime() 函数都可返回以元组表示的时间对象. localtime() 2022-08-27 Python
Python 中 format 函数用法 通过 index 即位置12>>> print('This is a {0} about {1}'.format('example', 'format'))This is a example about format 另一个例子: 12>>> print( 2022-08-27 Python
Ubuntu 安装 Google 浏览器 通过源代码安装,进入 https://www.google.cn/chrome/ 下载 .deb 包. 然后: 12cd ~/Downloadssudo dpkg -i google-chrome-stable_current_amd64.deb 从命令行打开 Google 浏览器: 1google-chrome 2022-08-27 Ubuntu
安装 Python 库 psycopg2 报错 报错内容为: 1234./psycopg/psycopg.h:36:10: fatal error: libpq-fe.h: No such file or directory 36 | #include <libpq-fe.h> | ^~~~~~~~~~~~ compilation terminated. 因此安装依赖 2022-08-27 Python
Python 3 连接 PostgreSQL 数据库 相关文档使用 psycopg2 库。 简介Psycopg2 在 C 中作为 libpg 包装器实现的。其兼容 Unicode 和 Python3. Basic module usage1234567891011import psycopg2conn = psycopg2.connect("dbname=test user=postgres")cur = conn.cursorc 2022-08-27 Python
Python 中 with open 用法 open() 的几个 mode: ‘r’ ‘w’ ‘a’ ‘r+’ 使用 with 关键词使用 with 可以不用担心 file.close() 问题。其在使用完毕后会自动关闭文件。 123with open('filename', 'mode') as f: data = f.read() print(data) 2022-08-27 Python
Python 编程从认知到实践 第8章 读写文件8.1 文件与文件路径8.1.1 Windows 上的倒斜杠以及 OS X 和 Linux 上的正斜杠如果想程序运行在所有操作系统上,在编写 Python 脚本时,就必须处理这两种情况。 8.1.3 绝对路径与相对路径8.2 文件读写过程在 Python 中,读写文件有 3 个步骤: 调用 open() 函数,返回一个 File 对象 调用 File 对象的 read() 或 w 2022-08-26 Python