I learned Python by myself. what should I do now?

Source: Internet
Author: User
Tags virtualenv
Php Chinese network (www.php.cn) provides the most comprehensive basic tutorial on programming technology, introducing HTML, CSS, Javascript, Python, Java, Ruby, C, PHP, basic knowledge of MySQL and other programming languages. At the same time, this site also provides a large number of online instances, through which you can better learn programming... Reply content: you use the built-in IDLE ...... A wonderful editor =

In theory, this error is caused by the failure of the port after the Python virtual machine crashes. you can use command + space to input terminal, and then ps-ef | grep python to check whether there are uncompleted processes, just take it out. The worst case is to restart the machine.
If you want to learn Python, you 'd better not use idle. for IDE, Pycharm, wingide, and pydev + eclipse are also good choices. I personally recommend that you learn python in the early stage, install Easy_install and Homebrew in the system. The former is responsible for the Python package, the latter is responsible for the system package, and then install pip and ipython. then, you can directly use the interactive environment of ipython to learn, use an editor like vim/sbt2 to write scripts. By the way, remember to set space = 4, and the tab indent should be burned to death lol

Of course, in a sense, I personally do not recommend using an independent editor ...... As platform engineers always face the character interface TAT, the first stage of Python is actually very good, just in the interactive environment, then you need to learn about the package management/compilation chain (many C extension Python) and virtualenv. with these three, you can write a small Python script, if you go through Web development, what is the PEP333 WSGI protocol? if you learn more about the TCP/HTTP protocol layer and the server such as Gunicorn/Gevent, you can submit your resume to become a programmer =

============================ My split line from Weibo ================== ====================
= _ = When I answered the question, I thought @ Stefan Yu was a young man at the University who was still getting started. until I saw Weibo and got a sword in my knees ...... Well, I will give you a simple solution to learn Python.

First, each Apple machine carries something called a terminal. you can find this product in the Finder (command + space search) and open it. of course, it is ugly, it is not harmonious, but it is enough. input Python to enter the Python interaction interface. according to your system version, your Python version should be 2.7.X series.

Then, you can enter the python statement on this interface to learn. for the simplest manual, refer to the simple Python tutorial of mushroom uncle. Of course, your English should be enough to read the original version, so a Learning Python (Douban) This is your best choice for getting started (the Chinese version of this product has been spit out ).

Then you must write a script to run the script. for example, if you want to batch release the most popular script for American TV series, you need an editor to do this, the simplest is the next Chocolat plain Text Editor for Mac. , Set the indentation to 4 spaces and file type to start writing scripts. I do not recommend new users to use SB2 or VIM. The Learning cost of advanced editors is too high.

How to run the written script? you need to save the script in a certain location, such as the desktop, and switch your terminal path to the desktop, such as entering cd ~ /Desktop, and then the python script name. py, you can see the output.

Tips
  1. We do not recommend that you use pdb for debugging. if a program error occurs, you can use print for debugging.
  2. The thing encoding in python is definitely hell. The most common problem for beginners is Chinese character string processing. so brave enough to add # coding: UTF-8 at the top of each script file.
  3. A good coding style is helpful for debugging. at least for newcomers, they will not be confused about the program running process and ignore the nature of the problem, there is only one method to accomplish one thing in Python (Ruby should be burned to death !), See PEP 8 -- Style Guide for Python CodeThere will be a lot of inspiration.
  4. In fact, I 'd like to say that Python without Virtualenv and package management really cannot be used, how can we isolate the compilation chain package management environment to make your program run better without causing "pollution" to your system ".
Your current situation is like someone taught you to write a novel. First, you should open a notebook in windows and create a new article. as a result, the notebook has an error, so you can't continue learning to write novels ...... But you can actually use any text editor to learn to write novels, right?

Similarly, you can use any text editor to edit the. py file, not necessarily using idle. Save the edited file as. py, and enter python in terninal. <文件名> . Py to view the running result.

In fact, the only reason for using idle in the tutorial is that idle comes with python, saving you the trouble of finding other editors.

However, in actual use, almost no one except beginners will use idle to write code, because it is not easy to use.

All of the above mentioned vim and others are editors, but those are too hard-handed and are not suitable for beginners. I recommend an editor Sublime Text. You don't even need to run python into terninal. run cmd + B to see the running result.

Have a good time learning python.

==== Split line ====

In order to study the new window that you mentioned, I tried it on mac and didn't find anything wrong.

I saw you say, "This is the case when an error is reported later." I guess there is something wrong with this, but it is difficult to make a judgment because I don't know what the error is.

If you have any questions, please trust me. Http://www.codecademy.com
For those who do not have the foundation of computers and programming, the learning experience of this website is great.
Interesting, not boring, with tips and questions and answers.

To enter the programming world, English is a required skill, at least to be able to read. This is an English site that can be learned at the same time. Python is provided in Mac, but the IDLE of that version often has inexplicable problems.
Recommended:
  • PyCharm is an integrated python development environment, and its user experience is quite satisfactory. In addition to the code check, completion, folding, debugging, and other functions supported by the general editor, the editor is well-developed and supports the development of python web frameworks such as django and GAE. Customizable and scalable. Supports Windows, Mac, and Linux platforms. The only weakness for beginners is that it is a paid software with a 30-day trial period. If you want to use it as a helper for your work, it is worth starting.
  • Sublime Text 2 is an advanced Text editor. after installing several extension packages, it can become a powerful tool for python development. It can be associated with the python runtime environment. By default, the code highlighting and indentation functions are available. Through configuration, you can also add functions such as syntax check, format check, and automatic completion.
  • The legendary "God editor" Emacs and "editor God" Vim. They all share a feature of strong scalability. In theory, you can use it to complete any feature that the IDE can implement and tune it to your preferred weapon. Unfortunately, this tool is difficult to get started with and is not suitable for beginners.
Welcome to our classroom to discuss the problems encountered during python learning.
Http://crossin.me
: Crossincode
QQ group: 295921816 is called idle.

I'm glad that you are interested in learning python. I have only used the IDLE on win. after opening the IDLE interface, the New window should be a New file, which can be directly written. Save and press F5.

I think it is quite good for new users to use IDLE. it was designed for such a crowd. Http://www.compileonline.com
It is easy to use. you don't need to use IDLE to write Python. , Using any text editor Yes. we recommend that you use Sublime Text (Vim Essentially a text editor like Notepad But with the ability to perceive the syntax of the program code, it can display the abrupt growth Built-in shortcut keys, but vim learning curve steep, not suitable for beginners ).
1. find a reliable book!
Python Learning Manual (Douban)
For your questions, see Chapter 2: how to run a program
Come on! I learned python from scratch, and it was on mac.
In this case, you can reinstall it. The key is that we cannot reproduce it to help you.
We recommend that you use this book as your supplementary learning material. Http://m.douban.com/book/review/5023550? Id = 5363753 & session = b26e43c2 Is the editor or ide confused.
I don't know what to do if I like ide.
If you like the editor, I recommend vim.
Because python does not need anything.
Just control the indentation.
Or notepad.
You can use a familiar editor. Ipython notebook is recommended for learning or lightweight tasks.

Benefits:
1. the interface is like a webpage, which does not make beginners feel uncomfortable like terminal.
2. supports syntax highlighting, automatic indentation, and beautiful layout.
3. editing commands are the same as common commands. for example, command + c is copying, command + v is pasting, command + x is cutting, command + z is undo, and command + y is redo, it is not as uncomfortable for beginners as vi or emacs.
4. mixed source code and documents, writing programs like writing articles.
5. good interaction. You can draw a picture, display a video, and enter a mathematical formula.
6. many cool people use this because it is too convenient.

Start method:
1. Command + Space
2. enter terminal and press enter. In addition, terminal can also be found in utilities in Launchpad, not necessarily using command + space.
3. enter ipython notebook in terminal and press Enter. then, the browser used to access the Internet is automatically opened.
4. click "New Notebook" on the page displayed in the browser to create a New page.
5. there are some input boxes on this new page. enter any command or program code that python can recognize in it, and press Shift + enter to view the result. For example, if you Enter 1 + 1 and press Shift + Enter, a 2 is displayed.
6. you only need to try it several times to get familiar with it.

Exit method:
Save it in the menu, and then close it like you close the page. Then there may be something running in terminal. click the mouse in the terminal window and press control + c (not command + c). then confirm and exit the thing. Click "x" to disable terminal.

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.