当前位置: 首页>>代码示例>>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;未经允许,请勿转载。