Home >Backend Development >Python Tutorial >Python development tools and framework installation example steps

Python development tools and framework installation example steps

零下一度
零下一度Original
2017-07-20 15:51:201395browse

Introduction:

In fact, before I knew Python, I only knew about this language. Most of them were developed using .net. I also learned MVC+EF development before, but since I didn’t use it at work, I didn’t record what I learned on the blog.

I recently came into contact with the crawler technology, and then I learned that Python seems to be very powerful in developing crawlers. So I became interested, and interest is an important thing, so I slowly started to get in touch with Python.

Then start with the most basic configuration of the development environment. Suddenly I found that it is really convenient to do .net. You don’t have to worry about the development environment at all. You only need to install Visual Studio and MSSQL Server on the Windows system to develop.

Of course, it may not be as simple as I said. Closer to home, let’s start with the most basic installation of development tools and configuration of the development environment.

Step one: Install development tools

Here I chose JetBrains Pycharm IDE, which is an IDE specially developed for Python by JetBrains company.

Download address (JetBrains official website):

After the download is completed, run the downloaded file and install it step by step according to the instructions. The installation process is very simple, but I still record my installation steps.

After running the downloaded .exe file, the following interface will appear, click Next directly.

Then select the installation address and Next again.

#Then choose to create a desktop shortcut and create an association. Of course, you can also choose Next without checking it by default. random.

Then wait a few minutes for the installation to be completed. Click Finish below to complete the installation.

How about it? Is the installation very simple? The next step is activation.

run. The following prompt will appear when you open it for the first time, which probably means choosing to import settings. Generally, if you use it for the first time, just select the second one without importing settings, and then click OK.

The following interface will appear. This is the most important step, activation. There are three options (the first is to enter the JetBrains account, which will not be introduced here).

The second method is to enter the registration code. You can find the registration code online. For example:

Here I choose the third option, using a server address authorized by the terminal. You can configure this server yourself, or you can find it online. I just found it online. . .

Can refer to: Or

The following is the last step, which is to choose the shortcut key of which development tool to use , IDE theme, font and color settings, etc. I chose the default and clicked OK.

The installation of development tools has come to an end. Next, configure the Python development environment, that is, install the Python code parser.

For the installation of Python, you can refer to this installation of Python. It is very detailed and I won’t go into too much introduction.

After completing the installation of Python, let’s start installing the Python web development framework.

There are many development frameworks for Python, you can learn about them by yourself. I learned about both Flask and Django.

Beginners are generally recommended to learn Flask, a relatively lightweight web development framework, and Django, a heavyweight web development framework that belongs to MVC. (I won’t install this here, after all, I am also a beginner...)

First install Flask, a lightweight web development framework.

First run the windows command line. (i.e. cmd)

Input: pip install flask

After the installation is completed, test whether it is successful. Enter: python

Then enter: from flask import Flask

If no error is reported, the installation is successful. . Continue to the next step. Install flask-sqlalchemy package, sqlalchemy I understand it as an ORM framework, similar to .net's EF framework.

First install sqlalchemy. Input: pip install sqlalchemy

After the installation is complete, then install flask-sqlalchemy. Enter: pip install flask_sqlalchemy

and then test whether the installation is successful. Input: from flask_sqlalchemy import SQLAlchemy

If there is still no error, the installation is successful. At this point, the Flask web development framework is installed.

The above is the detailed content of Python development tools and framework installation example steps. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn