आदेश whos
और linemagic %whos
IPython में उपलब्ध हैं, लेकिन मानक अजगर का हिस्सा नहीं हैं। इनमें से दोनों उनके बारे में कुछ जानकारी के साथ वर्तमान चर सूचीबद्ध करेंगे। आप फ़िल्टर करने के लिए type
निर्दिष्ट कर सकते हैं, उदा।
whos
Variable Type Data/Info
----------------------------
a list n=3
b int 2
c str hello
whos list
Variable Type Data/Info
----------------------------
a list n=3
संबंधित आदेश who
या linemagic %who
एक छोटी सूची का उत्पादन करेगा, केवल चर नाम दिखा: है
who
a
who list
a
एक विशिष्ट चर ?
का निरीक्षण करने के लिए आप क्या देख रहे हैं:
a?
Type: list
String form: [1, 2, 3]
Length: 3
Docstring:
list() -> new empty list
list(iterable) -> new list initialized from iterable's items
यदि आप और भी जानकारी के बारे में जानकारी चाहते हैं ऑब्जेक्ट, जैसे फ़ंक्शन। पूर्ण ऑब्जेक्ट सहायता प्राप्त करने के लिए आप word??
फ़ॉर्म में दो ?
का उपयोग कर सकते हैं।
int??
Type: type
String form: <type 'int'>
Namespace: Python builtin
Docstring:
int(x=0) -> int or long
int(x, base=10) -> int or long
Convert a number or string to an integer, or return 0 if no arguments
are given. If x is floating point, the conversion truncates towards zero.
If x is outside the integer range, the function returns a long instead.
If x is not a number or if base is given, then x must be a string or
Unicode object representing an integer literal in the given base. The
literal can be preceded by '+' or '-' and be surrounded by whitespace.
The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to
interpret the base from the string as an integer literal.
>>> int('0b100', base=0)
4
क्या ... अजगर का कौन सा संस्करण है जो में है: उदाहरण के लिए, प्रकार के लिए पूरा प्रलेखन
int
आप का प्रयोग करेंगे पाने के लिए? मैंने कभी इस बारे में नहीं सुना है ... यदि आप numpy का उपयोग कर रहे हैं तो आकार प्राप्त करने के लिए आप 'array.shape' का उपयोग कर सकते हैं ... –धन्यवाद, और v2.7 चंदवा आईडीई –