python类showinfo()的实例源码

CanvasSBG.py 文件源码 项目:CanvasSBG 作者: BRueckert 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def genTeachReport(self):
        '''
        Creates a CSV file with name, loginID, and group scores for each student in 
        app_data fullGBook. Headers are included.
        '''
        csvOut = []
        heads = ['name','login_ID',]
        for i in self.app_data['fullGBook'][0]['results']:
            heads.append(i['title'])
        for i in self.app_data['fullGBook']:
            toAdd = []
            toAdd.append(i['name'])
            toAdd.append(i['login_id'])
            for k in i['results']:
                for j in heads:
                    if j == k['title']:
                        toAdd.append(k['mean'])
            csvOut.append(toAdd)

        with open('StandardsReport.csv', 'w', newline='') as csvfile:
            writeOut = csv.writer(csvfile, delimiter=',',dialect='excel')
            writeOut.writerow(heads)
            for i in csvOut:
                writeOut.writerow(i)
        messagebox.showinfo(title='Export', message='Data exported to CSV')
codegui.py 文件源码 项目:dayworkspace 作者: copie 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def uploder(self):
        code = self.lfc_field_1_t.get('0.0', 'end')
        code = code.encode(encoding="utf-8")
        code = base64.urlsafe_b64encode(code)
        url = "http://" + HOST + ":" + PORT + "/postcode?code=" + str(code)

        try:
            req = requests.get(url)
            if req.text == "200":
                messagebox.showinfo("??", "????")
                # ?????
                self.lfc_field_1_t.delete('0.0', 'end')
            else:
                messagebox.showinfo("??", "????????")
        except:
            messagebox.showinfo("??", "????????")

    # ???? ?base64????
codegui.py 文件源码 项目:dayworkspace 作者: copie 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def upfile(self):

        url = "http://" + HOST + ":" + PORT + "/upfile"
        # ???????
        filename = filedialog.askopenfilename()
        self.lfc_field_1_t.delete('0.0', 'end')
        self.lfc_field_1_t.insert('0.0', "??????......")
        try:
            files = {'file': open(str(filename), 'rb')}
            req = requests.post(url, files=files)
            if req.status_code == 200:
                messagebox.showinfo("??", "????")
            else:
                messagebox.showinfo("??", "????????")
        except:
            messagebox.showinfo("??", "????????")
        finally:
            self.lfc_field_1_t.delete('0.0', 'end')

    # ????
codegui.py 文件源码 项目:dayworkspace 作者: copie 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def downfile(self):
        try:
            # ??????????????_???????????
            filename = filedialog.asksaveasfilename()
            self.lfc_field_1_t.delete('0.0', 'end')
            self.lfc_field_1_t.insert('0.0', "??????......\n")

            filename = filename + '.' + \
                requests.get("http://" + HOST + ":" +
                             PORT + "/downfiletype").text

            self.lfc_field_1_t.insert('0.0', "?????????......")

            req = requests.get("http://" + HOST + ":" + PORT + "/downfile")
            if req.status_code == 200:
                with open(filename, 'wb') as savefile:
                    savefile.write(req.content)
                messagebox.showinfo("??", "????")
            else:
                messagebox.showinfo("??", "????????")
        except:
            messagebox.showinfo("??", "????????")
        finally:
            self.lfc_field_1_t.delete('0.0', 'end')
CissaPortScanner.py 文件源码 项目:PortScanner 作者: tsucissa 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def scan(self):
        self.txt.delete(0.0, END)
        self.txt.insert(0.0, ('Scanning ' + self.srvr.get() + ' ... \n'))

        #The beginning of PSresult.txt
        port_file = open("PSresult.txt", "w")
        port_file.write("\n##Scanned " + self.srvr.get() + ': ##\n')
        #Beginning of the for loop:
        for port in range(int(self.start.get()), int(self.end.get()) + 1):
            if self.pscan(port):
                msg = "Port " + str(port) + ' Is open \n'
                self.txt.insert(float(port) + 1, msg)
                port_file.write(msg)

            else:
                self.txt.insert(float(port) + 1, 'Port ' + str(port) + ' is closed! \n')
                msg = "Port " + str(port) + ' Is closed \n'
                port_file.write(msg)
        port_file.close()

        messagebox.showinfo(title='Cissa Port Scanner', message='Your Scan is finished. Happy Hacking :)')
print.py 文件源码 项目:python- 作者: secondtonone1 项目源码 文件源码 阅读 35 收藏 0 点赞 0 评论 0
def hello(self):
        name = self.nameInput.get() or 'world'
        messagebox.showinfo('Message', 'Hello, %s' %name)
appjar.py 文件源码 项目:SceneDensity 作者: ImOmid 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def infoBox(self, title, message):
        self.topLevel.update_idletasks()
        MessageBox.showinfo(title, message)
        self.__bringToFront()
tkdialog.py 文件源码 项目:sc8pr 作者: dmaccarthy 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def __init__(self, response=str, text="", title=None, accept=0, **options):
        if response is bool:
            self.dialog = [askyesno, askokcancel, askretrycancel][accept]
        else: self.dialog = {None:showinfo, str:askstring, int:askinteger, float:askfloat,
            0:askopenfilename, 1:asksaveasfilename, 2:askdirectory}[response]
        self.options = options.copy()
        if "initialdir" in options:
            self.options["initialdir"] = abspath(options["initialdir"])
        if type(response) is int:
            self.args = tuple()
            if title: self.options["title"] = title
        else:
            if title is None:
                title = "Info" if response is None else "Confirm" if response is bool else "Input"
            self.args = title, text
calculator.py 文件源码 项目:Projects 作者: it2school 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def show_result(): 
    messagebox.showinfo("calcylator",str("game over"))
merac-o-matic-gui.py 文件源码 项目:merac-o-matic 作者: RogueAI42 项目源码 文件源码 阅读 35 收藏 0 点赞 0 评论 0
def quitProgram():
    tkMessageBox.showinfo(productName, coremeraco.constructExitStatement())
    if sound:
        sound.stop()
    sys.exit() # Just running exit() doesn't work with PyInstaller
appjar.py 文件源码 项目:Cryptokey_Generator 作者: 8BitCookie 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def infoBox(self, title, message):
        self.topLevel.update_idletasks()
        MessageBox.showinfo(title, message)
        self.__bringToFront()
juegochozas.py 文件源码 项目:Tutoriales_juegos_Python 作者: tidus747 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def anunciar_ganador(self, data):
        messagebox.showinfo("¡Atención!", message=data)

    # Handle Events
Tkinter-learn.py 文件源码 项目:learn-python 作者: xushubo 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def hello(self):
        name = self.nameInput.get() or 'world'
        messagebox.showinfo('Message', 'Hello, %s!' % name)
GUI_const_42.py 文件源码 项目:Python-GUI-Programming-Cookbook-Second-Edition 作者: PacktPublishing 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def _msgBox():
    msg.showinfo('Python Message Info Box', 'A Python GUI created using tkinter:\nThe year is 2017.')  

# Add another Menu to the Menu Bar and an item
GUI_const_42_777_global_print.py 文件源码 项目:Python-GUI-Programming-Cookbook-Second-Edition 作者: PacktPublishing 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def _msgBox():
    msg.showinfo('Python Message Info Box', 'A Python GUI created using tkinter:\nThe year is 2017.')  

# Add another Menu to the Menu Bar and an item
GUI_const_42_print_func.py 文件源码 项目:Python-GUI-Programming-Cookbook-Second-Edition 作者: PacktPublishing 项目源码 文件源码 阅读 15 收藏 0 点赞 0 评论 0
def _msgBox():
    msg.showinfo('Python Message Info Box', 'A Python GUI created using tkinter:\nThe year is 2017.')  

# Add another Menu to the Menu Bar and an item
GUI_data_from_widget.py 文件源码 项目:Python-GUI-Programming-Cookbook-Second-Edition 作者: PacktPublishing 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def _msgBox():
    msg.showinfo('Python Message Info Box', 'A Python GUI created using tkinter:\nThe year is 2017.')  

# Add another Menu to the Menu Bar and an item
GUI_const_42_print.py 文件源码 项目:Python-GUI-Programming-Cookbook-Second-Edition 作者: PacktPublishing 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def _msgBox():
    msg.showinfo('Python Message Info Box', 'A Python GUI created using tkinter:\nThe year is 2017.')  

# Add another Menu to the Menu Bar and an item
GUI_const_42_777_global.py 文件源码 项目:Python-GUI-Programming-Cookbook-Second-Edition 作者: PacktPublishing 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def _msgBox():
    msg.showinfo('Python Message Info Box', 'A Python GUI created using tkinter:\nThe year is 2017.')  

# Add another Menu to the Menu Bar and an item


问题


面经


文章

微信
公众号

扫码关注公众号