def banner(request, player): response = HttpResponse(mimetype="image/png") try: p = Player.objects.filter(name__exact=player)[0] except: try: p = Player.objects.get(name=player) except: return render_to_response( '404.html', {'text': 'Player {0} Not Found'.format(player)}) try: c = p.clan.name if c.count('NoClan'): c = '' except: c = '' pstring = "{0} {1}".format(c, p.name) wkills = p.kill_set.filter(time__gte=get_timespan('weekly')[0]).count() dkills = p.kill_set.filter(time__gte=get_timespan('daily')[0]).count() b = Banner(name=pstring, kills=p.kills, wkills=wkills, dkills=dkills, deaths=p.deaths, gold=p.gold) b.write(response) return response
def __init__(self, master): # Prevent the app window from being resized master.resizable(False, False) self.banner = Banner(master) self.content = Content(master) # KEYBOARD SHORTCUTS SECTION master.bind('<Control-n>', lambda e: self.content.add_task()) # MENU BAR SECTION master.option_add('*tearOff', False) self.menubar = Menu(master) master.config(menu=self.menubar) # FILE MENU file = Menu(self.menubar) file.add_command(label='Test', command=lambda: messagebox.showinfo( title='Test', message='This is a test.')) file.add_command(label='Add Task', command=lambda: self.content.add_task()) file.entryconfig('Add Task', accelerator='CTRL+N') self.menubar.add_cascade(menu=file, label='File') # EDIT MENU edit = Menu(self.menubar) edit.add_command(label='Change Banner Color', command=lambda: self.banner.change_banner_color()) self.menubar.add_cascade(menu=edit, label='Edit')
def main(): banner = Banner() parser = optparse.OptionParser( "Usage python email-gathering.py -u <target url> -f <file to save>") parser.add_option('-u', '--url', dest='target_url', type='string', help='Insert target url') parser.add_option('-f', '--file', dest='file_path', type='string', help='Insert destination file') (options, args) = parser.parse_args() target_url = options.target_url file_path = options.file_path if target_url == None: print parser.usage sys.exit(1) target_url = deque([target_url]) email_gathering = EmailHarvester(target_url) email_gathering.scrape_emails() email_gathering.print_emails() if file_path != None: email_gathering.save_to_file(file_path)
def main(): print(Banner("GUESS THE NUMBER APP").content) calibrator = Calibrator(random.randint(0, 100)) prompt = Prompt() success = False while not success: calibration = calibrator.calibrate(prompt.input()) print(calibration.message) success = calibration.is_equal
def read_config(file_path='config.csv'): """ >>> read_config('test_config.csv') #doctest: +ELLIPSIS [<banner.Banner object at 0x...>] """ with open(file_path, 'rb') as csv_file: lines = csv.reader(csv_file, delimiter=';') config = [Banner(line) for line in lines] return config
def make_banner(self): """ Instatiate Banner object """ colors = self.flag.colors screen_size = self.screen_size self.banner = Banner(self.flag.name, screen_size) self.banner.scale_text(40) # we want the text to be 40 pixels tall self.banner.scale_logo(100) # and we want the logo to be 100 pixels tall self.banner.center_text()
def check_game_state(self) -> None: """Checks for cell capture and if the game is over.""" if self._captured_edge: cell1_captured, cell2_captured = False, False # Check to see if any cells were captured. If so, increment score # of current player for each cell captured. if self._captured_edge.cell1: cell1_captured = self._captured_edge.cell1.check_for_capture( self._current_player) if cell1_captured: self._game.increment_score(self._current_player) if self._captured_edge.cell2: cell2_captured = self._captured_edge.cell2.check_for_capture( self._current_player) if cell2_captured: self._game.increment_score(self._current_player) if cell1_captured or cell2_captured: self._scoreboard.update_score( self._current_player, self._game.get_score(self._current_player)) # Check to see if anyone won winners = self._game.check_for_winner() if winners: # If there are winners, display the banner and play again button self._banner = Banner( pg.Rect(0, 0, self._cfg.SCOREBOARD_WIDTH * 0.8, 100), LIGHT_GRAY) self._banner.draw(winners) self._game_over = True self._play_again_button = Button( (self._banner.centerx - 50, self._banner.bottom + 35), (100, 35), callback=self.new_game, text='Play Again?', visible=False) self._play_again_button.visible = True self._play_again_button.draw() else: # If no cells were captured, move to next player if not cell1_captured and not cell2_captured: self._scoreboard.set_inactive(self._current_player) self._current_player = self._game.next_player() self._scoreboard.set_active(self._current_player) self._captured_edge = None
def run(self): """ Fungsi awal saat program dijalankan """ if (self._isDebug): print(s("Mode Debug Active")) if self._link is None: self.tanyaLink() cls() B = Banner() B.cetakbanner() cetakgaris("Pilih Resolusi Video") self._YT = YouTube(self._link) self._YT.check_availability self.infoVideo() print("") time.sleep(3) pilihan = self.resolusi() cek = Logs() if (not cek.cek()): print(s("%s" % prRed("Lokasi penyimpanan belum diset "))) cek.gantiPath() self._savePath = cek._path cls() B.cetakbanner() cetakgaris("Please Wait.. Downloading") try: if pilihan == 'video': super(DownloadYT, self).Downloaderffmpeg(self._Audio, self._Video, self._savePath) elif (pilihan == 'audio'): super(DownloadYT, self).DownloadMP3(self._Audio, self._savePath) else: raise ValueError("Error") except: print(s("Terjadi kesalahan!")) return sys.exit(prCyan("Terima kasih! ;) "))
def ready(self): self.lock_player_input() self.fighter[0].avatar.face(1) self.fighter[0].set_position((150, 190)) self.fighter[1].avatar.face(0) self.fighter[1].set_position((170, 190)) # make sure the default animation is played at start of fight [f.reset() for f in self.fighter] banner_x = 322 / 2 - (self.fight_image.get_rect().width / 2) fight_banner = Banner(self.fight_image, (banner_x, 100), 1000) fight_banner.avatar.callback = (self.release_input_lock, []) fight_banner.show() self.pre_run()
def __init__(self, parent=None): super().__init__(parent) self.mBanner = Banner(self) self.mIntroTitle = QLabel(self) self.mIntroTitle.setFont(QFont("SegeoUI", 15, QFont.Light)) self.mIntroTitle.setWordWrap(True) self.mIntroTitle.setObjectName("IntroTitle") self.mIntroTitle.setText( "Put the right products on every shelf at every outlet to satisfy ever-evolving customer demands" ) self.mIntroDesc = QTextBrowser(self) self.mIntroDesc.verticalScrollBar().setStyleSheet( VSCROLL_STYLE.NARROW.value) self.mIntroDesc.setFrameShape(QFrame.NoFrame) self.mIntroDesc.setOpenExternalLinks(True) self.mLearnMore = LinkList(self, "Learn more") self.mLearnMore.setSpacing(20) self.mLearnMore.addLinkByText("Solution Overview", "https://deepcognition.ai/") self.mLearnMore.addLinkByText("Sample Data Specifications", "https://deepcognition.ai/") self.mLearnMore.addLinkByText("Arca Continental Case Study", "https://deepcognition.ai/") self.mLayout = QVBoxLayout(self) self.mLayout.setContentsMargins(0, 0, 0, 0) self.mLayout.addWidget(self.mBanner) self.mLayout.addWidget(self.mIntroTitle) self.mLayout.addWidget(self.mIntroDesc) self.mLayout.addWidget(self.mLearnMore, 0, Qt.AlignLeft | Qt.AlignTop) self.setObjectName("IntroFrame") self.setStyleSheet("#IntroFrame{background-color: white;}") self.setAutoFillBackground(True)
# Cores R = '\033[1;31m' B = '\033[1;34m' C = '\033[1;37m' Y = '\033[1;33m' G = '\033[1;32m' RT = '\033[;0m' system('clear') print(f'{G}Checando por atualizacoes... {C}') run(["git", "pull"]) Banner() sleep(3) system('clear') print(f'''{G}*By PoisonBR {B} ██████╗██████╗ ███████╗{C}████████╗ ██████╗ ██████╗ ██╗ ███████╗ {B}██╔════╝██╔══██╗██╔════╝{C}╚══██╔══╝██╔═══██╗██╔═══██╗██║ ██╔════╝ {B}██║ ██████╔╝█████╗ {C} ██║ ██║ ██║██║ ██║██║ ███████╗ {B}██║ ██╔═══╝ ██╔══╝ {C} ██║ ██║ ██║██║ ██║██║ ╚════██║ {B}╚██████╗██║ ██║ {C} ██║ ╚██████╔╝╚██████╔╝███████╗███████║ {B} ╚═════╝╚═╝ ╚═╝ {C} ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝╚══════╝ {G}v1.1 Consulta de CPF gratis! {B}THX @Sr_M0h4mm3d_4li''')
def run(self): banner = Banner() while 1: self.main_menu.draw() self.main_menu.do_action()
from contextlib import contextmanager from banner import Banner EVENT_API_FIELD_TYPE = "type" EVENT_API_FIELD_CHALLENGE = "challenge" EVENT_API_REQ_TYPE_URL_VERIFICATION = "url_verification" EVENT_API_REQ_TYPE_EVENT = "event_callback" SLACK_APP_API_KEY = "xoxb-241837748225-MZ9SgESli64vpVtUbbkWTMJR" message_processor = MessageProcessor() app = Flask(__name__) banner = Banner() class UnsupportedRequestException(BaseException): pass def handle_errors(func): """Decorator for functions that take single request argument and return dict response.""" def error_handling_wrapper(req): try: response = func(req) print("Responding:", response) except UnsupportedRequestException: print("UnsupportedRequestException:", req) response = make_response("Unsupported request %s" % req, 400) except Exception as exc:
import mysql.connector from banner import Banner mydb = mysql.connector.connect(host="localhost", user="******", passwd="root", database="hksite") cur = mydb.cursor() cur.execute("select * from banner") users = cur.fetchall() banners = [] for user in users: banner = Banner(user[0], user[1], user[2], user[3], user[4]) banners.append(banner) print banner
client = paramiko.SSHClient() # 获取SSHClient实例 client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) client.connect(hostname="122.51.155.8", username="******", password="******", port=22) # 连接SSH服务端 transport = client.get_transport() # 获取Transport实例 # 创建sftp对象,SFTPClient是定义怎么传输文件、怎么交互文件 sftp = paramiko.SFTPClient.from_transport(transport) file_name = file_name[:-1] for root, dirs, files in os.walk(file_name): path = '/home/ubuntu' + root.replace(file_name, '') + '/' if path == '/home/ubuntu//': path = '/home/ubuntu/' print('当前目录路径', path) # 当前目录路径 print('当前路径下所有非目录子文件', files) # 当前路径下所有非目录子文件 for i in files: print(path + i) print(root + '/' + i) sftp.put(root + '/' + i, path + i) sftp.close() # 关闭连接 client.close() if __name__ == '__main__': Banner().get_limitation() MovieList().start_crawl() MovieDetail().start_crawl()
def main(): print(Banner('hello app').content) print(Greeting(NamePrompt().input()).greet())
import colors import os import threading import sys import time if __name__ == '__main__': try: # Do root or reboot! if os.geteuid() != 0: exit(colors.RED + "[!] Root privileges needed to run this script" + colors.DEFAULT) # Everyone loves banners b = Banner() b.show() net = Net() net.enable_forward() print(colors.WHITE + "[*] Available network interfaces:\n" + colors.DEFAULT) count = 0 for x in net.get_avail_interfaces(): print("\t" + str(count) + ") " + x) count += 1 ans = "" while not ans.strip().isdigit() or int(ans.strip()) > count: ans = input(colors.BLUE + "\nmitm" + colors.WHITE + ":" + colors.BLUE + "interface" + colors.WHITE + "> " +
def __init__(self, string): #super().__init__(string) self.__banner = Banner(string)
def __init__(self, string): self.banner = Banner(string)