def run(self): delay = 0.5 sleep(delay) url = "http://%s:%d%s/" % (r_host, r_port, r_prefix) start("Open", url, "in browser") wopen(url, new=2) status("DONE")
def google_file(file): url="http://google.com/?#q=" f=open(file,'r') lines = f.readlines() for line in lines: searchTerm=line wopen(url+searchTerm) f.close()
def TaskHandler(self, index): openthis="" if not (self.thetype == "SPECs"): openthis = self.trigger[index](str(self.etext.get()), self.sources, index) if openthis != "": wopen(openthis) else: for x in xrange(0, len(self.sources[:])): if self.values.get() == x+1: openthis = self.trigger[x](str(self.etext.get()), self.sources, x) if openthis != "": wopen(openthis)
def open(self): global comicsdir if self.hasnew(): url = self.nexturl() print "Opening %s ..." % url wopen(url) self.current = self.last() self.write() else: url = self.url print "Opening %s ..." % url wopen(url)
def main(): current_honor, cap_goal = input_arguments() honor_difference = cap_goal - current_honor paths, honorable_kills = honor_calculator(honor_difference) with open("honor paths.htm", "w") as file: file.write( "<html><head><style>body{background-color:#e1e1e1;}p{color:#5f5f5f;font-family:'Sans-serif';font-size:'10px';border:1px;border-color:#f1f1f1;}</style></head><body>" ) file.write("<p>" + str(paths[0][0]) + " Battlemaster turn ins (<i>" + str(paths[0][0] * 3) + " marks)</i> </p><p><b>HK Paths: </b></p>") for item in paths[1:]: file.write("<p>") i = 1 for items in item: it = match_honor(items, honorable_kills) file.write(it.output()) if len(item) > 1: if i < len(item): i += 1 file.write(" -- ") file.write("</p>") file.write("</body></html>") wopen("honor paths.htm")
import Options from Tkinter import Tk as tk from webbrowser import open as wopen if __name__ == "__main__": rw = tk() rw.title("RIST Reputation Investigation Spawn Tool v.1.03 Apr16") rw.geometry("600x300") A = Options.option(rw, thetype="IPs") A.grid(sticky="NW") B = Options.option(rw, thetype="URLs") B.grid(sticky="NW") C = Options.option(rw, thetype="SPECs") C.grid(sticky="NW") wopen("https://github.com/SYANiDE-/RIST") rw.lift() rw.call('wm', 'attributes', '.', '-topmost', True) rw.mainloop()
def save_path(costpath, out_file=None, visualize=False): from sys import stdout if visualize and not out_file: status("WARNING (use --output to specify HTML file) ", end='') visualize = False cost, path = costpath if visualize: from folium import Map, Marker, Icon, PolyLine from folium.plugins import BeautifyIcon from binascii import hexlify from webbrowser import open as wopen from pathlib import Path from math import log2 min_lat = min_long = float('inf') max_lat = max_long = -float('inf') for x in path: if x[4] < min_lat: min_lat = x[4] if x[5] < min_long: min_long = x[5] if x[4] > max_lat: max_lat = x[4] if x[5] > max_long: max_long = x[5] m = Map() m.fit_bounds([(min_lat, min_long), (max_lat, max_long)]) start_color = (63, 255, 63) end_color = (63, 63, 255) diff_color = tuple( map(lambda x: x[0] - x[1], zip(end_color, start_color))) length = float(len(path)) for i in range(len(path)): x = path[i] background_color = "#" + hexlify( bytes( map(lambda x: int(x[0] + i * x[1] / length), zip(start_color, diff_color)))).decode('utf8') border_color = "#" + hexlify( bytes( map(lambda x: int((x[0] + i * x[1] / length) / 2), zip(start_color, diff_color)))).decode('utf8') line_color = background_color line_weight = 6 icon = None iconStyle = "" if x[3] < 0: icon = 'times' background_color = "#ffff3f" border_color = "#7f1f1f" elif x[2]: icon = 'flash' background_color = "#ff0000" border_color = "#7f0000" line_color = background_color line_weight = 10 elif i + 1 < len(path) and path[i + 1][2]: icon = 'flash' background_color = "#ff0000" border_color = "#7f0000" elif i == 0 or i + 1 == len(path): icon = 'flash' else: icon = 'none' iconStyle = "opacity: 0.1;" if i > 0 and cost is not None: PolyLine([path[i - 1][4:6], path[i][4:6]], color=line_color, opacity=0.4, weight=line_weight).add_to(m) if icon: Marker(x[4:6], icon=BeautifyIcon(icon=icon, iconStyle=iconStyle, borderColor=border_color, backgroundColor=background_color), popup=("cost: %.1fm, dist: %.1fm, air: %r, id: %d" % x[:4])).add_to(m) m.save(out_file) wopen(Path(out_file).resolve().as_uri(), new=2) else: file = open(out_file, "w") if out_file else stdout print("node(id:" + ",".join(map(lambda x: str(x[3]), path)) + ");out;", file=file)
def onUpdate(self, event=None): wopen(self.downloadUrl) return self.Close(True)
def on_open_diary_favorite(self, event): from webbrowser import open as wopen wopen(self.favorite_url or DIARY_MAIN_URL)
def on_open_diary_umails(self, event): from webbrowser import open as wopen wopen("http://www.diary.ru/u-mail/folder/?f_id=1")
def google_input(): url="http://google.com/?#q=" term=input('search for: ') wopen(url+term)
def __init__(self): self.raiz = Tk() # --------NORMAL VARIABLES-------------- self.raiz.geometry("660x525") self.raiz.title("!bin - Keeping things simple!") self.raiz.resizable(False, False) self.raiz.iconbitmap(self.resource_path("assets/bin_small_cont.ico")) self.hOffset = 115 self.vOffset = -95 self.dirEntryVar = StringVar() self.manualDir = "" self.checkVal = IntVar() self.checkVal.set(1) self.sizeVar = StringVar() self.sizeVar.set("0.0 MB") self.videoListLen = 0 # ----------INTERFACE INSTANCES---------------- self.frame1 = Frame( self.raiz, width=660, height=620, ) self.container2 = ttk.LabelFrame(self.frame1, width=600, height=300, text="Results") self.frame2 = Frame( self.frame1, width=378, height=242, ) self.container1 = ttk.LabelFrame(self.frame1, width=470, height=140, text="Scan videos") self.sizeLabel = ttk.Label(self.frame1, text="Memory occupied by videos:", font=("Calibri", 10)) self.songDirLabel = ttk.Label(self.frame1, text="Custom 'Songs' folder:", font=("Calibri", 11)) self.sizeLabelDyn = ttk.Label( self.frame1, textvariable=self.sizeVar, font=("Calibri", 11), ) self.authorLabel = ttk.Label(self.frame1, text="Axyss - 2019 ©", font=("Calibri", 11)) self.checkBoxLabel = Label(self.frame1, text="Use default 'Songs' folder", font=("Calibri", 11)) self.checkBox1 = ttk.Checkbutton(self.frame1, takefocus=False, cursor="hand2", variable=self.checkVal, command=lambda: self.check_switch(), onvalue=1, offvalue=0) self.dirEntryWidget = ttk.Entry(self.frame1, width=50, textvariable=self.dirEntryVar, state="disabled") self.browseButton = ttk.Button(self.frame1, text="Browse...", width=13, command=lambda: self.browse_window(), state="disabled") self.progressBar = ttk.Progressbar( self.frame1, orient="horizontal", length=128, mode="determinate", maximum=99999 ) # Here because must be rendered before the findVideosButton self.findVideosButton = ttk.Button(self.frame1, text="Find videos", width=20, command=lambda: self.find_thread()) self.videoList = Listbox( self.frame2, width=72, height=15, borderwidth=0, highlightthickness=1, relief="solid", highlightbackground="#A4A4A4", ) self.yscrollVideo = ttk.Scrollbar(self.frame2, command=self.videoList.yview) self.xscrollVideo = ttk.Scrollbar(self.frame2, command=self.videoList.xview, orient="horizontal") self.videoList.config(yscrollcommand=self.yscrollVideo.set) self.videoList.config(xscrollcommand=self.xscrollVideo.set) self.deleteButton = ttk.Button(self.frame1, text="Delete videos", width=15, command=lambda: self.delete_thread()) # ---------------ICON SET-UP--------------- self.aminoBut = Button(self.frame1) self.aminoIco = PhotoImage( file=self.resource_path("assets/amino_ico.png")) self.aminoBut.config( image=self.aminoIco, border=0, cursor="hand2", relief="sunken", takefocus=False, command=lambda: wopen("https://aminoapps.com/c/osu-amino-2/join/")) self.twitterBut = Button(self.frame1) self.twitterIco = PhotoImage( file=self.resource_path("assets/twitter_ico.png")) self.twitterBut.config( image=self.twitterIco, border=0, cursor="hand2", relief="sunken", takefocus=False, command=lambda: wopen("https://twitter.com/Axyss_")) self.githubBut = Button(self.frame1) self.githubIco = PhotoImage( file=self.resource_path("assets/github_ico.png")) self.githubBut.config( image=self.githubIco, border=0, cursor="hand2", relief="sunken", takefocus=False, command=lambda: wopen("https://github.com/Axyss")) self.binBut = Button(self.frame1) self.binIco = PhotoImage(file=self.resource_path("assets/bin_ico.png")) self.binBut.config(image=self.binIco, border=0, relief="sunken", takefocus=False, command=lambda: self.egg_run())
def tgopen(link, direct=False): wopen(tglink(link, direct))
def show_history(history_url): wopen(history_url, new=1, autoraise=True)
import Options from Tkinter import Tk as tk from webbrowser import open as wopen if __name__ == "__main__": rw = tk() rw.title("RIST Reputation Investigation Spawn Tool v.1.04 Jan2017") rw.geometry("600x300") A = Options.option(rw, thetype="IPs") A.grid(sticky="NW") B = Options.option(rw, thetype="URLs") B.grid(sticky="NW") C = Options.option(rw, thetype="SPECs") C.grid(sticky="NW") wopen("https://github.com/SYANiDE-/RIST") rw.lift() rw.call('wm', 'attributes', '.', '-topmost', True) rw.mainloop()