本文整理匯總了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)