-
Notifications
You must be signed in to change notification settings - Fork 0
/
exc.txt
21 lines (21 loc) · 2.49 KB
/
exc.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
name,description,example
AssertionError,Raised when an assert statement fails,assert 1+1==2
OverflowError,Raised when a floating point operation fails,for y in range(1,x):
AttributeError,Raised when an attribute reference(see Attribute references)or assignment fails,class a():def s;import a;q=a.s
EOFError,Raised when the input() function hits an end-of-file condition (EOF) without reading,open("D:\\01\\project\\static\\filename.csv","r")and the filename is null
ImportError,Raised when the import statement has troubles trying to load a module and raised when the "from list" in from ... import has a name that cannot be found,import edcrfv but the edcrfv does not exist
IndexError,Raised when a sequence subscript is out of range,s=["a"] s(20)
KeyError,Raised when a mapping (dictionary) key is not found in the set of existing keys,t={'a':'a'} t['b']
MemoryError,Raised when an operation runs out of memory but the situation may still be rescued (by deleting some objects),Not enough storage
NameError,Raised when a local or global name is not found,print(a) but a does not exist
RuntimeError,Raised when an error is detected that doesn’t fall in any of the other categories,5/0
SyntaxError,Raised when the parser encounters a syntax error,priint(a)
TypeError,Raised when an operation or function is applied to an object of inappropriate type,class A:def _init_
UnicodeError,Raised when a Unicode-related encoding or decoding error occurs,use ascii
PermissionError,Raised when trying to run an operation without the adequate access rights—for example filesystem permissions,open(r’C:\Users\DLOL\Desktop’)
TabError,Raised when indentation contains an inconsistent use of tabs and spaces,use tab and space
ZeroDivisionError,Raised when the second argument of a division or modulo operation is zero,10*(1/0)
UnboundLocalError,Raised when a reference is made to a local variable in a function or method,but no value has been bound to that variable,def a():s=s+1
FileNotFoundError,Raised when a file or directory is requested but does not exist,open("D:\\01\\project\\static\\filename.csv","r") but the file does not exit
ValueError,Raised when a built-in operation or function receives an argument that has the right type but an inappropriate value,and the situation is not described by a more precise exception such as IndexError,int(100,2)
FloatingPointError,Raised when a floating point operation fails,numpy.seterr:np.seterr(invalid='raise',over='raise',under='raise')andc=beta[j,i]+oneminusbeta[j,i]