Let's talk about the 10 time-saving methods for Python developers and the time-saving methods for python developers.

Source: Internet
Author: User

Let's talk about the 10 time-saving methods for Python developers and the time-saving methods for python developers.

Python is a beautiful language that inspires your love for it. So if you try to join programmers, or you are a little tired of C ++, Perl, Java and other languages, I recommend you try Python.

Python has many functions that attract programmers. It is easy to learn, object-oriented, bytecode compilation, free and open-source. There is also a runtime check. Complete and fast support for various task extensions.

Efficient Python

In this article, I want to emphasize some things that Python can save time and maximize productivity. When preparing, I consulted several Pythonists. What are their time-saving skills? The answer is here...

1. Do not use semicolons

The use of semicolons is optional in Python. Compared with other object-oriented languages, you do not need to use semicolons after each statement.

This looks simple and does not seem to save much time; however, once your code volume is extended to thousands, these semicolons become distracting and do not need to be typed.

2. Find a code editor

Selecting a code editor can save a lot of time. Faced with so many code editors, many new users will feel confused.

It is confusing to use other editors in an editor, so it is a good starting point to select a name. No matter which one you choose, you must support flake8 and PEP8 in real time.

For more information about how to select an editor, see Which Code Editors Do Pythonists Use?

3. Follow the Python code specifications

Following the Python code specifications can improve code readability and save time for code review. (The design philosophy of Python emphasizes code readability .)

4. Use the help () function

Python help () is a built-in function that is readily available and saves a lot of time, such as searching for explanations of other functions. You can directly run this function on the interpreter terminal.

The Python documentation provides more usage of this function.

5. database used

Python has a large number of libraries so that you don't have to repeat the wheel every time.

For example, you can select a large number of available packages from PyPI (Python package index), which is a software repository.

Scikit-image is a good example. It makes image processing tasks such as blurring and enhancing contrast. scaling can be completed only by calling some functions.

6. Use Cookiecutter


Cookiecutter is a command line tool that helps you create a Python project from a project template, which saves a lot of time.

7. Strict comments

Developing a good habit of writing comments can save you and others time, especially for debugging and tracking. (Yes, we have heard a lot, but it seems that many programmers still need to remind me ).

Comments are critical to teamwork, especially when a large number of changes have been made.

8. Frequent tests

Test every component in your program. It sounds a little time-consuming, but long running can save a lot of time, help you find hidden bugs, and make you more comfortable with the code, it also forces you to understand how each piece of code runs in real conditions.

REPL is a read-eval-print loop, a common code testing tool that many Pythonists use.

9. Focus and professionalism

Pythonists recommend that you have a dedicated area and expertise. You can use Python to do a lot of things, from writing web video to processing computing and algorithms.

There are already a large number of libraries that can help complete these tasks, such as SimpleCV, computer vision processing, Biopython, a biological computing library, and SymPy, a mathematical symbol computing library.

Go deep into these fields and master a specific framework to help you learn Python at a deeper level and master a specific code style (as mentioned in Part 3 ), handle specific types of problems.

10. Daily Encoding

When you develop the habit of writing python code every day and solving problems using python, you will start to think about it using python. In this case, it will eventually help you solve problems faster.

Summary

In this brief article, I have already listed several tips I have collected from conversations with python developers. Below are other tips I can add.

Participate in python activities and gatherings

Ensure that you participate in every activity and gathering that you can attend. They benefit from sharing experiences, best practices, tools, and other interesting topics.

This may not be an easy-to-use strategy on the surface, but it is another way to avoid repeating the wheel by using suggestions and prompts to learn others' experiences.

The annual PyConf is a good place to know the activity.

Thinking on paper

Thinking on paper -- doing so before going straight into the code -- gives you the flexibility to make changes. Writing code directly forces you to consider implementation details from the very beginning, which is often not the best way to use your time when starting a project. It is good for brainstorming and solving problems to think about this method on paper!

Basic knowledge

The last line seems obvious, but it takes time to learn the basic knowledge of Python. this will save you a lot of time, because you will have better preparation for more complex theme.
Some good books can help, including:

Learning Python

Getting started with Python programming: introduces the Python computer language and computer programming.

It is also important to keep relevant information fresh by reading blogs and articles. The Mouse Vs. The Python.

Address: http://www.sitepoint.com/10-time-saving-tips-pythonists/

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.