python pycharm error highlights

URL: HTTP: //www.cnblogs.com/hinimix/p/8016859.html 

. 1, the this List Creation Could the rewritten BE AS A literal List
is predefined a List
List1 = [1,2,3,4] # so used better
than
list1 = [1,2,3] # so with the bad
list1.append (4)
will appear at this time the tips
to resolve link: https: //stackoverflow.com/questions/31063384/when-i-assign-a -to-variable--list Why-PyCharm-Me-a-give-prompt the this-that-iS-List-

2, Unsupported the operand type (S) for -: 'STR' and 'int'
file is read out character string, the input string, to pay attention to strongly turn type

3, write () argument must be str, not None
written to the file must be a string type

4, TypeError: 'NoneType' object is not callable
write time decorator function return value if the band () will be out of this wrong
DEF the Timer (FUNC):
DEF test2 ():
= time.time start_time ()
FUNC ()
end_time = time.time ()
Print ( "Interval is: ->% S"% (end_time - start_time))
return test2 ()
correctly should be written so
def timer (func) :
DEF test2 ():
START_TIME the time.time = ()
FUNC ()
END_TIME = the time.time ()
Print ( "time intervals are: -> S%"% (END_TIME - START_TIME))
return test2
returns to test2 memory address, and then to call this address, rather than directly direct test2 ()

5, auth () Takes 1 0 Positional arguments the WAS GIVEN but
when decorator, add

6, dbm.error: db type could not be determined
d = shelve.open ( 'shelve_test.txt') , the file name sheleve removed

. 7, TypeError: Object A like IS-bytes required, Not 'STR'
with Open ( 'aoao.cnf', 'WB') AS CFG : open the file do not use b, direct w

8, TypeError: Key: expected bytes or ByteArray, but GOT 'str'
encryption when to use byte type, rather than the str

9, SyntaxError: bytes CAN only Contain ASCII literal characters.
encryption time ASCII-type should be used, rather than characters

10, TypeError: AN Level not Valid Integer String or A: <AT 0x7f9a4081f048 function info>
Level = logging.info uppercase = logging.info Level

. 11, _gdbm.error: [Errno. 11] the Resource temporarily unavailable
do not know

12, TypeError: string indices must be integer
type does not see there is not a bunch of dict str, this will lead to

13, ValueError: must have exactly one of create / read / write / append mode
file open mode has r, w, a r +, w +, a +, I wrote rw, not

14, TypeError: 'builtin_function_or_method' object is not iterable


15, a bytes-like object is required, not 'str'
transmission needs to be a string into a byte

16, TypeError: Write () MUST bE STR argument, not bytes
the pickle the dump file is a byte, it can not be used to open the file w, use the wb

17, TypeError: not All arguments the Converted During String Formatting
Print ( "the SET% S Dog" Dog%) did not write the whole, less write S%

18, TypeError: Object () Takes the Parameters NO
__init__ wrote __int__

20, module 'urllib' has NO attribute 'Request'
because python3.X sometimes sub-modules will not be automatically imported into it, so changed to import url.request problem is solved

21, TypeError: exchange_declare() got an unexpected keyword argument 'type'
将type='fanout'变成exchange_type='fanout'

22, NameError: name 'uuid' is not defined
....from uuid import uuid4

Guess you like

Origin www.cnblogs.com/jiangxiaobo/p/11622730.html