本文整理汇总了Python中core.colors.white方法的典型用法代码示例。如果您正苦于以下问题:Python colors.white方法的具体用法?Python colors.white怎么用?Python colors.white使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core.colors
的用法示例。
在下文中一共展示了colors.white方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: prompt
# 需要导入模块: from core import colors [as 别名]
# 或者: from core.colors import white [as 别名]
def prompt(default=None):
# try assigning default editor, if fails, use default
editor = os.environ.get('EDITOR', defaultEditor)
# create a temporary file and open it
with tempfile.NamedTemporaryFile(mode='r+') as tmpfile:
if default: # if prompt should have some predefined text
tmpfile.write(default)
tmpfile.flush()
child_pid = os.fork()
is_child = child_pid == 0
if is_child:
# opens the file in the editor
try:
os.execvp(editor, [editor, tmpfile.name])
except FileNotFoundError:
logger.error('You don\'t have either a default $EDITOR \
value defined nor \'nano\' text editor')
logger.info('Execute %s`export EDITOR=/pat/to/your/editor` \
%sthen run XSStrike again.\n\n' % (yellow,white))
exit(1)
else:
os.waitpid(child_pid, 0) # wait till the editor gets closed
tmpfile.seek(0)
return tmpfile.read().strip() # read the file
示例2: banner
# 需要导入模块: from core import colors [as 别名]
# 或者: from core.colors import white [as 别名]
def banner():
print ('''
%s⚡ %sBOLT%s ⚡%s
''' % (yellow, white, yellow, end))
示例3: banner
# 需要导入模块: from core import colors [as 别名]
# 或者: from core.colors import white [as 别名]
def banner():
newText = ''
text = '''\n\t{ meta v0.1-beta }\n'''
for char in text:
if char != ' ':
newText += (random.choice([green, white]) + char + end)
else:
newText += char
print (newText)