1.换源
1.1 进入源文件夹
cd /etc/apt/
1.2 备份源
sudo cp sources.list sources.list.bak
1.3 删除源
sudo rm -rf sources.list
1.4 新建源文件
sudo vi sources.list
1.5 向源文件添加源地址
#添加阿里源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe
multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe
multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe
multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe
multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe
multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted
universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted
universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted
universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted
universe multiverse
1.6 更新源
sudo apt-get update
2. Python输出学号名字
2.1 下载vim
sudo apt-get install vim
2.2 新建python文件
sudo vim main.py
2.3 写入代码
import numpy
print("2020008849_ChangJinLong")
2.4 下载pip
sudo apt-get install python3-pip
2.5 通过pip下载numpy包
pip3 install numpy -i https://mirrors.aliyun.com/pypi/simple
2.6 执行写好的python文件
python3 main.py
3. Nginx反向代理
3.1 进入配置文件夹
cd /etc/nginx/conf.d
3.2 新建nginx配置用于反向代理本地网页
sudo vim a.conf
3.3 输入配置信息
server{
listen 81 default_server;
server_name localhost;
root /var/www;
index index.html;
}
3.4 到配置信息对应文件位置
cd /var/www
3.5 新建index.html,输入自己的学号
vim index.html
3.6 重启nginx服务,打开Firefox输入【localhost:81】 显示学号
sudo service nginx restart
3.7 新建nginx配置文件用于反向代理外网网页
sudo vim b.conf
3.8 输入配置信息
server{
listen 82;
server_name localhost;
location /{
proxy_pass https://www.taobao.com;
index index.html index.htm index.jsp;
}
}
3.9 重启nginx服务,打开Firefox输入【localhost:82】 显示淘宝网信息
sudo service nginx restart
4 未做
5.Qt实现简易计算器
代码如下,
记住每第二个num1和第二个num2 是你在ui里面选择LineExdit时的变量名
void MainWindow::on_pushButton_clicked()
{
QString num1 = ui -> num1 -> text();
QString num2 = ui -> num2 -> text();
int sum = num1.toInt() + num2.toInt();
ui->lineEdit_3 ->setText(QString::number(sum));
}
好像第一个和第二个是并在一个的,两个及格,三个良好,四个优秀样