Python tips (keep up to date)

Source: Internet
Author: User

1. View the class properties and methods of the import library

Python has a bit of a feeling especially inconvenient is that, unlike C + +, when a type is specified, an instance of that type is called "." Intelligently prompts for the method or property it contains

Previously, it was resolved by viewing the official documents corresponding to the library. This time, we found a new way. Help, you can list methods and properties

Import Dlibhelp (dlib.rectangles) Help on class rectangle in module Dlib:class rectangle (pybind11_builtins.pybind11_ Object) |  This object represents a rectangular area of an image. |   |  Method Resolution Order: |      Rectangle |      Pybind11_builtins.pybind11_object |      Builtins.object |   |  Methods defined here: |   |  __eq__ (...) |      __eq__ (Self:dlib.rectangle, arg0:dlib.rectangle), BOOL |   |  __getstate__ (...) |      __GETSTATE__ (self:dlib.rectangle), tuple |   |  __init__ (...) |      __init__ (Self:dlib.rectangle, Left:int, Top:int, Right:int, Bottom:int), None |   |  __ne__ (...)

2. Jump to the source code of the function definition

Using Pycharm, hold down CTRL and click Functions to jump to the function definition

3. Define a fixed-length array

Import= highlights_sub = Np.zeros (Dtype=np.float64)

Python tips (keep up to date)

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.