Brief introduction
Hello, when you open the document, I know, what you want is! Python reptiles, how to quickly learn Python reptiles, are you most looking forward to things, but this matter should not be quite that easy, besides your program is not necessarily a good foundation, this course, there is no basis Python you want, no basic knowledge of variables, loops, arrays, and so on, because I do not want to places where you can directly and quickly learned, to waste your time.
Well, this course is based on more than Python3.0 write, my operating system is CentOS7 + so there's a lot of content and you may be not the same, of course, will lead to solving many of the problems and is different from yours, so some problem, you need to Baidu or FQ resolve the matter, I wish you encounter N number of BUG. O (∩_∩) O
What's next first step?
Install a virtual machine, because your computer is 99% of the windows, so you need a piece of software called the VMware Then, download the address in May 10, 2018 On this day, I Baidu is to
In this website there download the software and you know.
Then, I went on Baidu to the operating system of a CentOS7
After the name of the software download
Ready to do a good job, then you need is the need to complete the operation
First of all, this software is installed VM, and it "pojie" off. (When one day, you make money, remember to buy what this software to support it)
Install the software, you can use all the default options, this place simply because I do not need to write, there is a problem we can solve on their own.
The last step before installation
CentOS 7 installation
Then they enter the CentOS installation
The installation process a few key points to determine good
Select Chinese, the next step
Please note that in several places the red box
Modified to look at FIG.
OK, we are well configured, then click Next, the next step, you only need to configure a password for the root account on it
The next step is to wait for a few minutes, have a relationship with your computer configuration, time flies.
After installation, open the CentOS operating system, hey there will be a DOS command window, enter the root account and password you just set into no problems, perfect - on behalf of your operating system already installed
接下来,为了方便我们后面的操作,我们要给我们的虚拟机安装一个GUI交互界面(也就是像windows一样的视窗操作软件)
如果失败了,怎么办,百度“如何安装gnome图形界面程序” 想办法啃下来。
当出现这样子的一些图标的时候,你成功了
可能碰到的问题
好了,接下来说一下,你可能碰到的问题
-
你点击应用程序,里面找到一个叫做火狐浏览器的软件,然后打开,发现竟然无法上网?!
- 你发现竟然无法使用中文输入法?!nice 这个问题,自行解决,随便找找一堆解决方案。
好了,上面问题2解决了,那么解决一下问题1吧,这个问题首先确认一下你在一开始安装的时候,下面这个图配置的是否正确。
需要显示已连接
如果上图没有问题,那么99%的童鞋是可以上网的,那么还是有无法上网的,这时候,打开一个叫做终端
的软件
输入代码
ping www.baidu.com
网络通畅
如果联网失败,敲入下图中的命令,如果联网成功,那么下面的内容,你直接跳过,去查看安装Python部分吧。
网络连接失败,修改方案
使用命令 ,注意,你的文件不一定叫ifcfg-ens33,可能叫 ifcgf-xxx 操作都一样
vi ifcfg-ens33
进入编辑页面 vi 的简单的操作
进入编辑状态请按键盘上的 i
退出编辑状态,请按键盘上的 ESC
然后输入 :wq 保存,退出,其他的命令用到在说吧。
图中有几个重点的地方,已经标注
首先看到你的文件中是否有 HWADDR=mac地址 【MAC地址获取见下图】
如果没有,自己手动加上,这里使用的DHCP连接网络的方式,所以,你需要把BOOTPROTO="dhcp" 如果需要修改成 "static" 也可以,不过需要配置一些其他的内容Python资源分享秋秋裙 784758214 ,内有安装包,学习视频资料,这里是Python学习者的聚集地,零基础,进阶,都欢迎
保存文件退出
获取MAC地址,注意图片中的标注
接下来 使用下面的命令重启网络服务
service network restart
在这里,你可能就重启成功了
If it fails, then this place could be a very large pit, and online tutorials varied, but mostly Copy the same.
Here you can follow the various tutorials to try, here to give you some common solutions.
- Your own computer is not turned on the above two services
- CentOS operating systems NetworkManager service conflicts
The need to address in the terminal
Open a terminal, enter the following command
service NetworkManager stop 【回车】
chkconfig NetworkManager off 【回车】
上面的命令是停止Network然后禁止开机启动,这样子在执行 service network restart 去尝试一下
Installing Python
Our next step is to develop a tool, Python installation
Our default CentOS has brought us a Python2
You can directly use
We reinstall more than the latest version of Python3.0 here to install some basic content, CentOS using yum install program
yum -y install zlib zlib-devel
yum -y install bzip2 bzip2-devel
yum -y install ncurses ncurses-devel
yum -y install readline readline-devel
yum -y install openssl openssl-devel
yum -y install openssl-static
yum -y install xz lzma xz-devel
yum -y install sqlite sqlite-devel
yum -y install gdbm gdbm-devel
yum -y install tk tk-devel
Inside the -y on behalf of all local user to confirm the selection does not require the user enters yes
In order to facilitate the back of our Python3 compilation, also you need to install a gcc compiler
yum -y install gcc
After the python official website to download https://www.python.org
Run the following command terminal
Download the installation package
wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz
Unzip package downloaded Python-3.xxtgz
tar -zxvf Python-3.6.5.tgz
Directory after the files are decompressed, compile and install.
cd Python-3.6.5/
./configure --prefix=/usr/local/python3
make
make
make install
make install
The establishment of soft python3
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
OK so far, you have created a python3 environment, and try it in the terminal
Next, a problem you might face is the installation of the setuptools and pip3, this would leave you to go themselves.
Finally, enter a hello world to end our 1/100
print("hello,world")