當前位置: 首頁>>代碼示例>>Python>>正文


Python tkFileDialog.asksaveasfile方法代碼示例

本文整理匯總了Python中tkFileDialog.asksaveasfile方法的典型用法代碼示例。如果您正苦於以下問題:Python tkFileDialog.asksaveasfile方法的具體用法?Python tkFileDialog.asksaveasfile怎麽用?Python tkFileDialog.asksaveasfile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在tkFileDialog的用法示例。


在下文中一共展示了tkFileDialog.asksaveasfile方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: save_inputs

# 需要導入模塊: import tkFileDialog [as 別名]
# 或者: from tkFileDialog import asksaveasfile [as 別名]
def save_inputs(self, *args):

        out_file = tkFileDialog.asksaveasfile(mode='w', defaultextension=".simpbm")

        if out_file is None:
            return

        for data in self.inputs:
            text = '{0}\n'.format(data.get())
            out_file.write(text)

        out_file.write('*Loads*\n')
        for load in self.loads_gui_select_var:
            text = '{0},{1},{2},{3},{4},{5},{6}\n'.format(load[0].get(),load[1].get(),load[2].get(),load[3].get(),load[4].get(),load[5].get(),load[6].get())
            out_file.write(text)
        out_file.close() 
開發者ID:buddyd16,項目名稱:Structural-Engineering,代碼行數:18,代碼來源:simple_beam_metric.py

示例2: save_config

# 需要導入模塊: import tkFileDialog [as 別名]
# 或者: from tkFileDialog import asksaveasfile [as 別名]
def save_config(self, filename=None):
        if filename is None:
            file_obj = tkFileDialog.asksaveasfile()
            if file_obj is None: return
        else:
            file_obj = open(filename, 'w')
        try:
            save_config(file_obj, self.lens1, self.lens2)
        except:
            tkMessageBox.showerror('Config save error', traceback.format_exc())

    # Render and save output in various modes. 
開發者ID:ooterness,項目名稱:DualFisheye,代碼行數:14,代碼來源:fisheye.py

示例3: _render_generic

# 需要導入模塊: import tkFileDialog [as 別名]
# 或者: from tkFileDialog import asksaveasfile [as 別名]
def _render_generic(self, render_type, render_size=1024):
        # Popup asks user for output file.
        file_obj = tkFileDialog.asksaveasfile(mode='wb')
        # Abort if user clicks 'cancel'.
        if file_obj is None: return
        # Proceed with rendering...
        self._set_status('Rendering image: ' + file_obj.name, 'wait')
        try:
            panorama = self._create_panorama()
            render_func = getattr(panorama, render_type)
            render_func(render_size).save(file_obj)
            self._set_status('Done!')
        except:
            tkMessageBox.showerror('Render error', traceback.format_exc())
            self._set_status('Render failed.') 
開發者ID:ooterness,項目名稱:DualFisheye,代碼行數:17,代碼來源:fisheye.py

示例4: save_file

# 需要導入模塊: import tkFileDialog [as 別名]
# 或者: from tkFileDialog import asksaveasfile [as 別名]
def save_file():
    file=fdialog.asksaveasfile(mode="wb", title="Save Figure", defaultextension=".png", filetypes = (("png files","*.png"),("all files","*.*")))
    if file is None:
        return None
    img_to_save=open(".temp/generated_plot.png","rb").read()
    file.write(img_to_save)
    file.close() 
開發者ID:NITDgpOS,項目名稱:PlotIt,代碼行數:9,代碼來源:gui_main.py

示例5: save_inputs

# 需要導入模塊: import tkFileDialog [as 別名]
# 或者: from tkFileDialog import asksaveasfile [as 別名]
def save_inputs(self, *args):
        
        out_file = tkFileDialog.asksaveasfile(mode='w', defaultextension=".strapbm")
        
        if out_file is None:
            return
        
        for data in self.inputs:
            text = '{0}\n'.format(data.get())
            out_file.write(text)
        
        out_file.close() 
開發者ID:buddyd16,項目名稱:Structural-Engineering,代碼行數:14,代碼來源:strap_beam_gui.py


注:本文中的tkFileDialog.asksaveasfile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。