• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python tkFileDialog.asksaveasfile函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中tkFileDialog.asksaveasfile函数的典型用法代码示例。如果您正苦于以下问题:Python asksaveasfile函数的具体用法?Python asksaveasfile怎么用?Python asksaveasfile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了asksaveasfile函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: file_save2

 def file_save2(self):
     Out=str(rospy.Time.now())+",  "+str(self.x)+"   "+str(self.y)+"   "+str(self.z)+"   "+str(self.Rz)+"   "+str(self.Ry)+"   "+str(self.Rx)+"\n"
     f2 = tkFileDialog.asksaveasfile(mode='a', defaultextension="",initialdir="/home/philip/FastResults/Calibration/")
     if f2 is None: # asksaveasfile return `None` if dialog closed with "cancel".
         return
     f2.write(Out)
     f2.close() # `()` was missing.
开发者ID:philip-long,项目名称:Python,代码行数:7,代码来源:kinect_gui.py


示例2: save_command

def save_command():
    file = tkFileDialog.asksaveasfile(mode='w')
    if file != None:
    # slice off the last character from get, as an extra return is added
        data = txt.get('1.0', END+'-1c')
        file.write(data)
        file.close()
开发者ID:Darriall,项目名称:notepad-1,代码行数:7,代码来源:notepad6.py


示例3: save_as

def save_as():
	global saved_filename
	handle = tkFileDialog.asksaveasfile(mode='w')
	if handle:
		saved_filename = handle.name
		model.save(saved_filename)
		update_ui_hints(None)
开发者ID:rmtmckenzie,项目名称:uvic-seng360-a2,代码行数:7,代码来源:quiz_spec_gui.py


示例4: save_file

 def save_file(self):
     fileToSave = tkFileDialog.asksaveasfile(mode='w', defaultextension = ".txt")
     text2save = []
     other_acts=[]
     for period in range(12):
         text2save.append([])
         for group in range(len(self.groups)):
             if self.groups[group].get_schedule()[period] in self.activities:
                 text2save[period].append(self.activities.index(self.groups[group].get_schedule()[period]))
             else:
                 o_act = self.groups[group].get_schedule()[period]
                 other_acts.append([o_act.get_name(), o_act.get_min_age(), o_act.get_max_age(),
                                   o_act.get_competing_activity(), o_act.not_days, [self.activities.index(o_act.other_act[0]),
                                    self.activities.index(o_act.other_act[1])]])
                 text2save[period].append(100)
     activity_list = []
     for act in self.activities:
         if type(act.get_competing_activity()) == type(None):
             activity_list.append([act.get_name(), act.get_min_age(), act.get_max_age(),
                                   act.get_competing_activity(), act.not_days])
         else:
             comp_act = self.activities.index(act.get_competing_activity())
             activity_list.append([act.get_name(), act.get_min_age(), act.get_max_age(),
                                   comp_act, act.not_days])
     
     fileToSave.write(str([text2save,activity_list, other_acts]))
     fileToSave.close()
开发者ID:bsmith8108,项目名称:SF_Scheduler,代码行数:27,代码来源:Final_GUI_27.py


示例5: file_save

 def file_save(self):
   f = tkFileDialog.asksaveasfile(mode='w', defaultextension=".txt")
   if f is None: # asksaveasfile return `None` if dialog closed with "cancel".
     return
   text2save = str(text.get(1.0, END)) # starts from `1.0`, not `0.0`
   f.write(text2save)
   f.close() 
开发者ID:paliwalnishant,项目名称:online_coding_judge,代码行数:7,代码来源:Client_gui.py


示例6: savemd

def savemd():
      """get a filename and save the text in the editor widget"""
      # default extension is optional, here will add .txt if missing
      md = tkFileDialog.asksaveasfile(mode='w', defaultextension=".md")
      text2save = str(text2.get(0.0,END))
      md.write(text2save)
      md.close()
开发者ID:venova,项目名称:pcgui,代码行数:7,代码来源:lil.py


示例7: generateFile

    def generateFile(self):
        filteredString = self.parseFilterString()

        if filteredString == "":
            txtWindow = popupWindow(self.master, "No filter string is entered \n kindly enter a filter string")
            self.master.wait_window(txtWindow.top)
            print "No filter is entered"
            return
        file =  tkFileDialog.asksaveasfile(filetypes=(("text files", "*.txt"), ("All files", "*.*")))
        #TODO: here parse the string according to the filter output the file

        #write data in the file
        v = open(file.name,'w')
        count = len(self.data)
        for i in range(0, count-2):
            for j in range(1, len(filteredString)):

                #TODO: chcek this out!... if re.match(self.data[i].rawLineString, filteredString[j]) != None:
                tempString = self.data[i].rawLineString
                tempFilter = filteredString[j]
                tempString = tempString.upper()
                tempFilter = tempFilter.upper()
                if tempString.find(tempFilter) != -1:
                    print "Raw Data:"+ self.data[i].rawLineString
                    v.writelines(self.data[i].rawLineString)
                    break
        v.close()
开发者ID:shoaib333,项目名称:TextParser,代码行数:27,代码来源:parser.py


示例8: _save_as

 def _save_as(self):
     if self.nb.tab(self.nb.select(), "text") == "control.F" :
         name = tkFileDialog.asksaveasfile(mode='w',filetypes=[('control files','.F'),('all files','.*')])
         text2save=str(self.txt_control.get(0.0,tk.END))
         name.write(text2save)
         name.close
     elif self.nb.tab(self.nb.select(), "text") == "POSFF":
         name = tkFileDialog.asksaveasfile(mode='w',filetypes=[('POSFF','POSFF* CONTFF*'),('all files','.*')])
         text2save=str(self.txt_posff.get(0.0,tk.END))
         name.write(text2save)
         name.close
     elif self.nb.tab(self.nb.select(), "text") == "log":
         name = tkFileDialog.asksaveasfile(mode='w',filetypes=[('all files','.*')])
         text2save=str(self.txt_stdout.get(0.0,tk.END))
         name.write(text2save)
         name.close
开发者ID:FilipeVasconcelos,项目名称:mdff,代码行数:16,代码来源:mdff_gui.py


示例9: savetofile

def savetofile():
    savefile=tkFileDialog.asksaveasfile()
    stringToSave=""
    for i in kids:
        stringToSave=stringToSave+i+","
    stringToSave=stringToSave[:-1]
    savefile.write(stringToSave)
开发者ID:Hurricane996,项目名称:random-student-selector,代码行数:7,代码来源:main.py


示例10: saveOutput

 def saveOutput(self):
     fname = tkFileDialog.asksaveasfile(mode='w', defaultextension=".bmp")
     if fname:
         try:
             self.Img.rgb_img.save(fname)
         except IOError as e:
             showerror("Cannot save file", "Failed to save file\n'%s'" % fname)
开发者ID:Nibiru-1337,项目名称:Computer_Graphix_Editor,代码行数:7,代码来源:App_Window.py


示例11: exporting

	def exporting(self):
		"""Export the IGV plot."""
		filename = tkFileDialog.asksaveasfile(mode='w', defaultextension='.png')
		out_file = filename
		if (out_file):
			temp_image = Image.open('{}local_scripts/recent_runs/trio_igv.png'.format(self.var_gui_abs_path))
			temp_image.save(filename)
开发者ID:Jana-A,项目名称:WTSI.DDD-VET,代码行数:7,代码来源:__init__.py


示例12: save_as_command

 def save_as_command():
     """get a filename and save your text to it"""
     # default extension is optional, will add .txt if missing
     fout = tkFileDialog.asksaveasfile(mode='w', defaultextension=".txt")
     text2save = str(textbox.get(0.0, 'end'))
     fout.write(text2save)
     fout.close()
开发者ID:chambear2809,项目名称:find_vlan,代码行数:7,代码来源:find_vlan.py


示例13: saveas

def saveas():
    f = tkFileDialog.asksaveasfile(mode='w', defaultextension=".txt", title="Save the scan as...")
    if f is None:  # asksaveasfile return `None` if dialog closed with "cancel".
        return
    textoutput = tekst_widget.get(0.0, END)
    f.write((unicode(textoutput)))
    f.write("\n")
开发者ID:networkscanneretf,项目名称:NetworkScanner,代码行数:7,代码来源:NetworkScanner.py


示例14: export

 def export():
     """Run the real estate program"""
     types = 'CSV {.csv}', 'Text {.txt}', 'All *'
     filehandle = tkFileDialog.asksaveasfile(filetypes=types)
     if filehandle:
         realestate.realestate(command.get(), search.get(), filehandle)
         filehandle.close()
开发者ID:grasevski,项目名称:realestate,代码行数:7,代码来源:tkrealestate.py


示例15: variance

	def variance(self, list_of_groups=None):
		list_of_groups = self.group_hash.keys()
		x_values = self.check_compatibility(list_of_groups)
		sorted_x = sorted(list(x_values))
		y_tracker = []
		file_chosen = asksaveasfile(mode='wb')
		#writer = csv.writer(file_chosen, delimiter = '	')
		list_of_rows = []
		for x in sorted_x:
			temp_list = []
			num_ys = 0
			for group in list_of_groups:
				for spectra in self.group_hash[group].spectralList:

					temp_list.append(spectra.y_to_x[x])
					num_ys += 1


			form = [trunc(float(x), 4), trunc(float(sum(temp_list) / num_ys), 4)]
			y_tracker.append(float(sum(temp_list) / num_ys))
			list_of_rows.append(form)
 		
		save_variance = saveFile(file_chosen, list_of_rows)
		save_variance.save_mestrenova()
		mp.plot_interp(x=sorted_x, y=y_tracker)
开发者ID:hderms,项目名称:nmrbinvar,代码行数:25,代码来源:tktest.py


示例16: save_file

    def save_file(self, path):
        """
        retrieve informations from the GUI to generate the markdown document
        and save it
        """
        title = self.title_entry.get()
        date = self.date_entry.get()
        categories = self.category_entry.get()
        tags = self.tags_entry.get()
        summary = self.summary_entry.get()
        body = self.body_entry.get(1.0, tk.END).strip()
        author = getpass.getuser()
        slug = self.clean_title(title)
        f = tkFileDialog.asksaveasfile(mode='w',
                                       defaultextension=".md",
                                       initialdir=path)
        if f is None:
            return
        text_to_save = u"""Title: {0}
Date: {1}
Category: {2}
Tags: {3}
Author: {4}
Slug: {5}
Summary: {6}
{7}
""".format(title, date, categories, tags, author, slug, summary, body)
        f.write(text_to_save)
        name = f.name
        f.close()
        return name
开发者ID:khrogos,项目名称:pelican-gui,代码行数:31,代码来源:main.py


示例17: csv

	def csv(self):
		filename = tkFileDialog.asksaveasfile(**self.file_opt)
		writer = csv.writer(filename, delimiter = ',')
		writer.writerow( ('File path', 'File name', 'PowerHash'))
		for i in range(len(self.hash[1])):
			writer.writerow((self.hash[1][i][0], self.hash[1][i][1], self.hash[1][i][2]))
		filename.close()
开发者ID:herpderpburk,项目名称:PyHash,代码行数:7,代码来源:powerHash.py


示例18: filesave_cb

 def filesave_cb():
     if (packedservovals != None):
         f = tkFileDialog.asksaveasfile(mode='w', defaultextension='srv')
         f.write(packedservovals)
         f.close()
     else:
         tkMessageBox.showerror(title='Error!', message='You can not save, when one, or more values inconsistent.')
开发者ID:barthess,项目名称:u,代码行数:7,代码来源:servotuner_airplane.py


示例19: _save_file

    def _save_file(self):
        save_file = tkFileDialog.asksaveasfile()
        if save_file is None:
            return

        save_file.write(str(self._text_log.get('1.0', tk.END)))
        save_file.close()
开发者ID:gorhan,项目名称:LFOS,代码行数:7,代码来源:ElevatorGUI.py


示例20: __save

    def __save(self):
        instructions = _EtcInstructions
        if self.script_style == 'data':
            instructions = _DataInstructions
        
        if self.script_type:
            ext = '.sh'
            self.script_msg += '\necho '.join(instructions.split('\n'))
        else:
            ext = '.bat'
            self.script_msg += '\r\nECHO '.join(instructions.split('\n'))
            self.script_msg += '\r\nPAUSE'

        if self.script_style == 'data':
            fname = 'getNCDCData-%s%s' % ('-'.join(self.update.stns),ext)
        else:
            fname = 'getNCDC-ISHFile%s' % ext
            
	fh = tkFileDialog.asksaveasfile(initialfile=fname, defaultextension=ext, initialdir='tmp')
	if fh:
	    fh.write(self.script_msg)
	    os.chmod(fh.name, stat.S_IRWXU|stat.S_IRWXG)
	    fh.close()
            
	if self.script_style == 'data':
	    del self.update.win.cdscripts
	    self.update.win.continue_btn.configure(state=ACTIVE)
            
	self.close()
开发者ID:KeithLatteri,项目名称:awips2,代码行数:29,代码来源:ClimateDataScripts.py



注:本文中的tkFileDialog.asksaveasfile函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python tkFileDialog.asksaveasfilename函数代码示例发布时间:2022-05-27
下一篇:
Python tkFileDialog.askopenfilenames函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap