python 常用技巧 1.设置pip国内源 2.打开服务器上的图像界面3.创建linux命令的快捷方式4.中文编码

本文介绍如何通过更改pip的默认源来提高安装速度,推荐使用阿里云镜像,并展示了如何在Linux环境下创建图形界面及命令快捷方式的方法。

1. 设置pip国内源

使用pip install时,默认会采用系统的安装包下载源,往往比较慢。可以改为国内的镜像,使得PIP下载加速。常用的为使用aliyun的镜像,具体设置方法为在用户目录下,创建.pip目录,在.pip下面创建pip.conf文件,文件内容如下:

[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com

2. 打开服务器上的图像界面

This is the very basic way of how it should work:
On the client / local machine (Xorg installed on client) try this:

 $ xhost +

access control disabled, clients can connect from any host
Later try:

$ ssh -AY user@host xterm

or

$ ssh -AX user@host xterm

With non standard clients xhost may be needed.
check 9.3.5.6. Nonstandard X clients

3.创建linux命令的快捷方式

比如创建一个ssh连接服务器的快捷方式,可以如下:

$ vi ~/.bashrc 

添加

alias godnn=‘ssh -XY username@192.168.110.250' 

完成后,重启terminal或者

$ source ~/.bashrc

4.中文编码

# -*- coding: utf-8 -*-
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值