Getting started with Python: simply can't be simpler

Source: Internet
Author: User

From the syntax of Python, it's simply not easy.

To learn it, please take a tour of the Xuefeng python2.7 and Python3. This is really the best introductory tutorial. Too many references:

    • Tutorials for foreign countries
    • Python Getting Started Guide
    • What are the recommended practiced hand projects in Python?
    • Python Artifice
    • Which Python libraries make you Brief Encounter
Python Getting Started disadvantage

If you are a full-stack engineer, then you need to be aware of the differences between it and other languages. It does not have some basic features, such as:

    • There is no switch function, if-else instead, you can use a dictionary instead of switch
    • Function overloads are missing and can only be replaced with default parameters
    • Code forced indentation cured you of obsessive-compulsive disorder.

I hope you can add a bit more Python slots, more messages.

Python's syntax is simple, which means that Python's learning costs are low, but it's not. Python is the product of a mixed language, commonly known as the "glue language". In this quote I often say a word.

Python can act as your first language and can be your last language.

The reason is that Python syntax is simple and syntax is similar to other languages. If you know other languages such as C++,java, you have no learning costs. But it's complicated, there are a variety of third-party packages, learning to use these libraries to a certain cost of learning. It also has different interpreters, although the syntax is the same, but the differences in the interpreter also cause third-party packages to be generic. Today's interpreters are mainly:

    • Cpython interpreted as C language machine code
    • Jython is interpreted as a Java language byte code
    • Ironpython interpreted as C # language byte code
    • PyPy interpreted as JIT-on-the-fly compilation
    • Pyjion Microsoft launches, using the CLR to achieve JIT interpretation acceleration for CPython

The usual python is from CPython, a wonderful relationship with C, that makes it even a hacker language, thanks to CType, but just because of the C-language underlying, it's hard to use freely on the Windows platform. windows deserves to be the hardest platform for development. This is another point of Python, unlike Java and other languages with virtual environments have their own virtual machines can come and go freely across the platform.

At the version level, it is divided into 2 and 3. Poor compatibility with each other. Although there is a six library like this to implement code compatibility, but still from the perspective of commonality and practicality, or recommend that the Novice choose to install 2.7 version of Python, from the point of view of coding problems and the process of programming, choose to install version 3.5. Of course, the ability can be selected by the way.

Advantages

Say a lot of shortcomings, say the advantages. It is an API language that uses different libraries to implement small functions (prototyping, crawlers, server operations, Web servers). Of course, it can also be used as an API language for the development of C language software, such as ArcGIS and Qgis, and refer to what Gis+python's development experience deserves to be shared. There are a number of possibilities for GIS to be combined with Python:

    • arcpy reference arcpy and ArcGIS (watercress)
    • Pyqgis Reference Pyqgis Developer Cookbook
    • Geopython GIS Related Library
    • GDAL reference Welcome to the Python gdal/ogr cookbook!
    • Various spatial databases, such as Spatialite reference Spatialite Cookbook

So here I recommend each giser should take some time to learn it, of course, it and other disciplines also have a lot of intersection, such as Artificial intelligence .

Ide

Installing Python is not a difficult task. Really do not understand the classmate reference Python environment and IDE selection, the article also mentions the choice of the IDE, mostly some of the heavy-weight IDE, such as paid product Pycharm. My personal idea is that I don't want to use a large IDE to write Python, unless I write a large, full-stack web framework like Django, or I'm going to choose some small editor to do the writing. Combined with there's no recommended lightweight Python IDE answers, I personally recommend using the Vscode+python plugin, which enables smart hints, syntax checking, progressive debugging, and more.

Installation steps

Download the corresponding installation package on the Vscode website, then install it in a fool's style. After the installation is complete, press Ctrl +Shift + P the Enter command, enter ext install python or just enter install , you can also find the installation prompt. Click the icon or icon like a cloud Readme to complete the plug-in installation, Microsoft server is a bit slow.

Implementation of some features requires a global installation of third-party packages (optional):

    • First install Python on the system, set the system path
    • (optional) Pylint for grammar checking
      Command Line Inputpip install pylint
    • (optional) Pep8 for grammar checking
      Command Line Inputpip install pep8
    • (optional) Flake8 for grammar checking
      Command Line Inputpip install flake8
    • (optional) Autopep8 for code formatting
      Command Line Inputpip install pep8
      Command Line Inputpip install --upgrade autopep8
    • (optional) Yapf for code formatting
      Command Line Inputpip install yapf
    • (optional) nosetests for unit testing
      Command Line Inputpip install nose

Then, Coding.Alt + Shift + Fformat and debug by code F5 .

From Microsoft Marketplace from Microsoft Marketplace Deep Research materials
    • Python Common scripts
    • Python for hack
    • Pack your Python code and put it on the PyPI
    • Pack your own Python scripts and upload them to PyPI.



Brandonxiang
Links: https://www.jianshu.com/p/a2b172049730
Source: Pinterest
The copyright of the book is owned by the author, and any form of reprint should be contacted by the author for authorization and attribution.

Getting started with Python: simply can't be simpler

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.