Help with Python in the interactive

Source: Internet
Author: User
Tags shallow copy

C:\users\ceshi>python
Python 2.7.12 (v2.7.12:d33e0cf91556, June, 15:24:40) [MSC v.1500-bit (AMD64)] on Win32
Type "Help", "copyright", "credits" or "license" for more information.
>>> Import Copy
>>> dir (copy)
[' Error ', ' pystringmap ', ' _emptyclass ', ' __all__ ', ' __builtins__ ', ' __doc__ ', ' __file__ ', ' __name__ ', ' __package__ ', ' _ Copy_dispatch ', ' _copy_immutable ', ' _copy_inst ',
' _copy_with_constructor ', ' _copy_with_copy_method ', ' _deepcopy_atomic ', ' _deepcopy_dict ', ' _deepcopy_dispatch ', ' _ Deepcopy_inst ', ' _deepcopy_list ', ' _deepcopy_method ',
' _deepcopy_tuple ', ' _keep_alive ', ' _reconstruct ', ' _test ', ' Copy ', ' deepcopy ', ' dispatch_table ', ' Error ', ' name ', ' t ', ' Weakref ']

>>> [n for N in dir (copy) if not N.startswith (' __ ')]
[' Error ', ' pystringmap ', ' _emptyclass ', ' _copy_dispatch ', ' _copy_immutable ', ' _copy_inst ', ' _copy_with_constructor ', ' _copy_with_copy_method ', ' _deepcopy_atomic ',
' _deepcopy_dict ', ' _deepcopy_dispatch ', ' _deepcopy_inst ', ' _deepcopy_list ', ' _deepcopy_method ', ' _deepcopy_tuple ', ' _keep_alive ', ' _reconstruct ', ' _test ', ' Copy ', ' Deepcopy ',
' Dispatch_table ', ' Error ', ' name ', ' t ', ' weakref '
>>> copy.__all__
[' Error ', ' Copy ', ' Deepcopy ']

#用help获取帮助
>>> Help (Copy.copy)
Help on function copy in module copy:

Copy (x)
Shallow copy operation on arbitrary Python objects.

See the module ' s __doc__ string for more info.

#快速查看函数的参数

>>> Print range.__doc__
Range (stop), List of integers
Range (start, stop[, Step), List of integers

Return a list containing an arithmetic progression of integers.
Range (I, j) returns [I, I+1, i+2, ..., j-1]; Start (!) defaults to 0.
When step is given, it specifies the increment (or decrement).
For example, range (4) returns [0, 1, 2, 3]. The end point is omitted!
These is exactly the valid indices for a list of 4 elements.

#查看源码位置, find the corresponding. py file open to view
>>> Print copy.__file__
D:\Python27\lib\copy.pyc

Help with Python in the interactive

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.