文档

变量命名规范

更新时间:

1.  变量名只能为以字母开头的字母、数字和下划线组合,在20字符以内,例如web_title, excel_path_20220901等。注意同样字母,大小写不同,就是不同的变量,例如webpage和WebPage是两个不同的变量

2. 推荐变量命名统一风格,统一使用小写字母+下划线的组合

3. 变量命名尽量做到见名知意,便于开发和维护流程

4. 变量不能使用python关键字、内置函数名、python包名作为变量名,禁用的名称包括但不限于:

目录

关键字

A

and, as, assert, async, await, agent, ArithmeticError, AssertionError, AttributeError, 

B

break, bytes, bytearray, bool, BaseException, BufferError, BlockingIOError, BrokenPipeError, BytesWarning

C

class, continue, ctrils, classmethod, complex, ChildProcessError, ConnectionError, ConnectionAbortedError, ConnectionRefusedError, ConnectionResetError

D

def, del, datetime, dict, DeprecationWarning

E

elif, else, exec, except, elements, errors, enumerate, ellipsis, Exception, EOFError

F

False, finally, for, from, fnmatch, float, frozenset, FloatingPointError, FileExistsError, FileNotFoundError, FutureWarning

G

global, GeneratorExit

H

I

if, import, in, is, int, ImportError, IndexError, InterruptedError, IsADirectoryError, IndentationError

J

K

KeyboardInterrupt, KeyError

L

list, LookupError,lambda, logger

M

memoryview, MemoryError, ModuleNotFoundError

N

None, nonlocal, not, NameError, NotADirectoryError, NotImplementedError

O

or, os, object, OverflowError

P

pass, print, pyperclip, property, PermissionError, ProcessLookupError, PendingDeprecationWarning

R

raise, return,rpa_v33, rpa, re, random, requests, retry, ReferenceError, RuntimeError, RuntimeWarning

S

shutil, subprocess, SDKError, staticmethod, super, str, slice, set, SystemExit, StopIteration, StopAsyncIteration, SyntaxError, SystemError, SyntaxWarning

T

True, try, type, tuple, TypeError, TimeoutError, TabError

U

utils, UnboundLocalError, UnicodeError, UnicodeDecodeError, UnicodeEncodeError, UnicodeTranslateError, UserWarning, UnicodeWarning

V

visual, ValueError

W

while, with, WindowsError, Warning

X

Y

yield

Z

ZeroDivisionError

  • 本页导读 (0)
文档反馈