Python compilation environment Discovery-from idle to sublime to Pycharm to Anaconda

Source: Internet
Author: User
Tags virtual environment virtualenv jupyter notebook



 A good compiler for us to deal with the daily scientific research is critical, good compiler whether from the interface, font style, hints, debugging and other aspects can be from the user point of view, to provide the best use experience. Python itself with the idle or in the CMD in the operation and debugging, for small test programs and learning time is possible, but for relatively large programs, they are somewhat inadequate, first of all to find and prompt, and when you want to change the program of a variable or function name, A search is a thing that people are going to collapse.



I display the Python code city process starting with idle and cmd, and slowly find that they are too low relative to the previous vs and Eclipse. I started trying to make edits in sublime, to sublime, to run the Python program directly (CTRL+B), and to code smart hints. Sublime used for a long time, or relatively easy to use, the code display is more enjoyable, you can also according to their preferences to configure. Overall, it is more recommended sublime. There is pycharm, a lot of Python developers use it, Pycharm is really the first choice of Python development. I also used a period of time, accustomed to sublime, there is not much to study, overall is also a more recommended compiler one.






 Later on in other people's blog saw Ipython, it is a python interactive shell, more than the default shell to use, support variable auto-completion, automatic indentation, Support Bash shell command, built up a lot of useful functions and functions. Installation is also simple, under Windows directly in the command line input: python–m pip install IPython. Most surprisingly, the Ipython provides a simple and useful magic function. The following are the common commands listed on Baidu:


% bg function puts the function in the background for execution, for example:% bg myfunc (x, y, z = 1), and then the results can be retrieved with jobs. myvar = jobs.result (5) or myvar = jobs [5] .result. In addition, jobs.status () can view the status of existing tasks.
% ed or% edit to edit a file and execute it. If only editing is not performed, use ed -x filename.
% env shows environment variables
% hist or% history show history
% macro name n1-n2 n3-n4 ... n5 .. n6 ... create a macro named name, and execute name to execute n1-n2 n3-n4 ... n5 .. n6 ... these codes.
% pwd displays the current directory
% pycat filename highlights a python file with syntax (without the .py suffix)
% save filename n1-n2 n3-n4 ... n5 .. n6 ... save too much code to a file
% time statement calculates the execution time of a piece of code
% timeit statement automatically selects the number of repetitions and loops to calculate the execution time of a piece of code, which is too convenient. 


However, Baidu has omitted the more commonly used%run, which can be used to run external python scripts. and a * *?? To display a module usage, such as import Os,os??。 The other includes viewing the values of variables, code run efficiency checks, and so on. Next time I will open a separate article about the Common Magic command, this time will not be more than repeat.





Finish the process of choosing compiler to develop, finally come to our focus--Anaconda. An accidental opportunity to see Seniors using Ipython notebook to report, can be written on the page code and document layout, for scientific calculation is very convenient. Ipython Notebook is a web based Ipython package, but can display rich text, so that the whole work can be presented in the form of notes, storage, interactive programming, learning is very convenient. For the specific use of Ipython notebook, find the opportunity to open a separate section, not the focus here. is its page, you can also edit the text with the markdown tag. Can render very good document pages.





Anaconda is an integrated environment that has now been upgraded to ANACONDA2, directly downloaded and installed, very handy, integrated with Python,ipython,notebook,spyder and Qtconsole, as shown below. The previous Ipython notebook also changed to Jupyter notebook.





Anaconda is a scientific computing environment similar to canopy, but it is more convenient to use. The Package Manager Conda is also very powerful. Anaconda provides two versions of Python2.7 and Python3.4, and can be created by Conda if additional versions are required.



Here's a look at Conda. Enter Conda list to see all the Python extensions that came with the installation. A cursory look, which includes commonly used Numpy, Scipy, Matplotlib and Networkx, and other network-related extensions such as Beautiful-soup, requests, flask, tornado, and common scientific toolkit , Scikit-image,scikit-learn and so on. Other packages that are not available can be installed through Pip,easy_install, or they can be installed through its unique Conda, conda install * * *, if you need to specify a version, you can also use [package-name]=x.x to specify. Conda repo in the extension is not too new, if you want to update, you may want to use PyPI or download the source code yourself. Conda and Pip are well-correlated. Using PIP to install something can be managed using Conda, which is better than canopy.





Another requirement for this scientific computing environment is the ability to coexist with multiple Python versions, especially the coexistence of 2.x and 3.x. This can be done by virtualenv. Anaconda is also achieved through it.



The following is a Conda to create a python3 version of the python3.4 environment.



Conda create-n Python3 python=3.4
This will create the Python3 directory under the Envs directory under the Anaconda installation directory.



Installing the extension to it can:



Use the Conda install directly with the-N to indicate the installed environment, which is naturally python3.
Like Virtualenv, first activate and then installed in the virtual environment.



The Spyder is a python extension, it is also more useful, interested in the ability to try it yourself, it inside the function of the view variable is very convenient.





2015-11-23 22:13:51



Python compilation environment Discovery-from idle to sublime to Pycharm to Anaconda


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.