Python: Getting Started

Source: Internet
Author: User
Tags jupyter jupyter notebook

Hi, I was willing.

Six years ago, I designed an auxiliary tool for SuperMemo, accidentally crashed into the Python circle, from now on, out of hand.

At the time, my programming knowledge was almost 0 basis. Really to be careful to trace the traced words, um, I began to contact ASP in about 2000 years, did a few web sites, and then slowly learned a bit of PHP, until 2009, built a "willing to learn the garden" site. However, it is not polite to say that these are really not very helpful for me to learn to program later.

All say learning programming best has good English foundation. That's not true. If you can have some English reading ability, in Python learning, you can go directly to the various English documents.

Don't be intimidated by the four words "English basics". Willing to the English Foundation is not good, when the technical school in the time there is no English this course. So, my "primitive" English is based only on junior high school level. Can read the English document, is completely later gradually accumulated. I can do it, you can do it naturally.

Why Choose python?

Well, I really can't tell you a perfectly correct answer.

I can only be very idealistic to say a few points of my own views:

  • Simple, low learning costs: even my 0 basic learning will be, six years, the development of Conversion wizard, curriculum assistant, curriculum editor and other software, naturally because the learning cost of Python is low enough;
  • Development speed fast enough: write a few lines of code, can run at any time to see the effect;
  • A large number of libraries are available: You don't have to build your own wheels. The standard library comes with no need to say, read and write Excel has XLRD/XLWT, data analysis has pandas, database tools can choose SQLAlchemy, packaging can be used cx_freeze ...

    As for the development of graphical interface, it is also very convenient to use PYQT.

    How do I get started?

    As the saying goes, everything starts hard. This point is not false.

    Where is the difficulty?

    Difficult at the beginning of the easy to encounter a variety of cards to your problem, this is really a disappointing thing. So, if you can make the path of learning better, let the learning curve more flat, will undoubtedly help us to get through the early stage of learning faster.

    So, where do we start?

  • Put Python on your computer and be willing to install python3.4.x according to the current status of Python. 3.3 and previous versions, some of the commonly used libraries are no longer supported, and 3.5 and later versions, there is also a part of the library is too late to support it, so the most appropriate version of the current is 3.4.x. Willing to release the corresponding at the end of the text, of course, you can also go to the official download;
  • Read "Head first Python". Don't read too many books when you just learn python! The best way to learn is to read, while tapping the code to verify, to get the most intuitive experience, the results of code execution will let you understand, oh, the original book is said to be this! We don't need to know why writing this code can get this result, we just have to remember that this code allows you to achieve this effect, the next time you use the line. "Head first Python" is a python into the category of books in the leader, willing to recommend priority to eat;
  • Use some tools to speed up the learning process and improve learning efficiency. This stay will be willing to speak again;

    Then how to learn?

    Strictly speaking, this topic should be left to the future. But willing to think, the first preview also hurt:

      • Further improve the development environment: the installation of PYQT4, ERIC6, there are some commonly used libraries;
      • Learn from the official example of PYQT4: This is one of the quickest ways to learn. Most of the official examples are short and short, and you can take the "modify flow" route as you would like, and modify them by modifying them, just as you would with a pinch of clay, at the end of the same thing as your own. This is the same as the beginning of the study of bicycles, the beginning of someone to help hold, watching, riding ripe, slowly do not help, do not see, you learn to ride;

    How to use tools to improve learning speed?

    In front of willing to talk about, we have to read at the same time, do the corresponding exercises. This exercise can be done in Python's own shell. But the old saying is good, 工欲善其事, its prerequisite. It's too primitive to do exercises with your own shell. Now, we can have a better way.

    method One : Install the Ipython. This is a python interactive shell, much stronger than the one that comes with it. The following is willing to directly talk about the installation method (note that the following installation package will be available at the end of the download, the operating system is windows-win7 or WIN8, the example of the Python default installation path is "C:\Python34"):

    1. First extract the IPYTHON-5.1.0-PY2.PY3-NONE-ANY.WHL files to the Python34\scripts folder;

    2. Open a command Prompt window and go to the Scripts folder under Python:

        • Press Win+x to select "Command Prompt (Administrator)" From the Popup shortcut menu.
        • * If your system disk and Python installation location is not in the same partition, for example, you put Python under "D:\Python34", and the system disk is C, then you need to enter "D:" and then hit enter;
        • Enter "Cd\python34\scripts", then hit enter, will enter the Scripts folder;

    3. Enter "Pip install IPYTHON-5.1.0-PY2.PY3-NONE-ANY.WHL" and hit Enter again;

    4. If there is no error message, you can find the "Ipython3.exe" file under the Scripts folder, right-click it, and then select "Send to Desktop Shortcut" from the pop-up menu, then just run it, You can tap the code in this Ipython window to learn!

    method Two : Install notebook. This is a more advanced, more cool way, willing to send some of the post, will publish the corresponding notebook documents. This requires multiple packages to be installed, as explained in one by one below:

    1. Extract the WHL file used below to the Python34\scripts folder;

    2. Open a command Prompt window and go to the Scripts folder under Python, see method one for details;

    3. Enter "Pip install PYZMQ-16.0.2-CP34-CP34M-WIN32.WHL" and hit Enter again;

    4. Enter "Pip install JINJA2-2.8-PY2.PY3-NONE-ANY.WHL" and hit Enter again;

    5. Enter "Pip install TORNADO-4.4.2-CP34-CP34M-WIN32.WHL" and hit Enter again;

    6. Enter "Pip install NOTEBOOK-4.2.3-PY2.PY3-NONE-ANY.WHL" and hit enter. Theoretically 3-5 steps can not do, do the 6th step directly, but then rely on it to get the corresponding dependency package (that is, the three of the 3-5), the download speed may be slow, and sometimes even install interrupts, recommended such installation;

    7. After the completion of the work, you can find the "Jupyter-notebook.exe" file under the Scripts folder, right-click it, and then choose "Send to Desktop Shortcut" from the pop-up menu, of course you can double-click it to run directly;

    8. Double-click Run Jupyter-notebook.exe, the program will be in your browser (recommended to install chrome in the system, if you are still in the IE series browser, spicy, it is time to say goodbye to it) in the Open Jupyter page. This is a local server that Jupyter-notebook uses to tornado this web framework-if you are unfamiliar with these nouns, leave it alone, and if you know, execute the program and you will be able to tap the code in the browser to learn.

    9. On the right side of the Jupyter page, locate and click the "New" button and select "Python3" from the drop-down menu:

    10. We can enter the code in the next open page, enter the text box with the word "in", then click the button, you can see the effect of the code after execution.

    11. Use Jupyter Notebook one by one every day to finish the day learned, the use of code, you can click on the "File" button in the upper left corner, and then select "Download As->notebook" from the menu, you can save the day's learning results into "IPYNB" Format of the document, for later review, review use. This is the function that Ipython cannot provide, let alone the shell that comes with Python.

    What more efficient tools are there?

    To quickly get through the difficult stage of the start, shorten the "novice period", reduce the learning cost, the newly-learned points of knowledge firmly remember is the best choice.

    And remember these points of knowledge, by what? One is to practice repeatedly, the second is purposeful, targeted to review.

    Willing to suggest that you use the SuperMemo UX to help you review the knowledge points that you learned every day. The use of this software is not difficult, the use of specific methods, willing to write a special article to explain. In the follow-up of the topic of the process, willing to also make some corresponding SuperMemo courses, to help you improve the learning effect.

    Well, the starting part of Python is introduced here first. By the way, some of the tools described in this article are available for download:

    One, Python 3.4.4.msi

    Link: http://pan.baidu.com/s/1kVDbPyf Password: Oqba

    Second, "Head first Python" Chinese version, pdf format, the corresponding reader please download, recommended to use Baidu reader.

    Links: Http://pan.baidu.com/s/1c1O5g7A

    Third, Python recommended installation package:

    Link: http://pan.baidu.com/s/1dFHrKK5 Password: so4k

    This article copyright to willing to learn all, welcome reprint, reproduced please indicate the author and source. Thank you!
    Willing
    Starting: Willing Sina Blog

  • Python: Getting Started

    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.