예제 #1
1
파일: nybblergui.py 프로젝트: 602p/nybbler
def main():
	series=None
	while series==None:
		series=easygui.fileopenbox("Select a series file", title, './en_US_1.py', [["*.py", "*.nybser", "Series File"]])

	action=None
	while action==None:
		action=easygui.boolbox("Select an Action", title, ("Compress", "Decompress"))

	f_in=None
	while f_in==None:
		f_in=easygui.fileopenbox("Select an input file", title, '*')

	f_out=None
	while f_out==None:
		f_out=easygui.filesavebox("Select a output file", title, '*')

	if action: #Decompress
		os.system("python nybblecli.py -qs "+series+" -d "+f_in+" "+f_out)
	else: #Compress
		os.system("python nybblecli.py -qs "+series+" -c "+f_in+" "+f_out)

	repeat=None
	while repeat==None:
		repeat=easygui.boolbox("Again?", title, ("Yes", "No"))

	if repeat: main()
예제 #2
0
파일: main.py 프로젝트: joeherm/padEmulator
def fileMenu():
	#new, save bank, save midi, load bank, load midi, exit
	msg     = "File Menu"
	choices = ["New Project","Save Bank","Save MIDI","Load Bank","Load MIDI","Cancel"]
	reply   = eg.indexbox(msg,title='padEmulator',choices=choices)	
	if reply==0:
		print "bew"
	elif reply==1:
		sFile=eg.filesavebox(msg='',title='Save Bank',default='bank',filetypes=[["*.bdat", "Sample Bank"]])
		if sFile:
			tempFile=open(sFile,'w')
			for temp in range(0,16):
				if smplList[temp].fid_text_l!="":
					tempFile.write(smplList[temp].fid_text_l)
					tempFile.write("\n")
				else:
					tempFile.write("None\n")
			tempFile.close()
	elif reply==2:
		sFile=eg.filesavebox(msg='',title='Save MIDI',default='midi',filetypes=[["*.mdat", "MIDI Map"]])
		if sFile:
			tempFile=open(sFile,'w')
			for temp in range(0,16):
					tempFile.write(str(midiList[temp]))
					tempFile.write("\n")
			tempFile.close()
	elif reply==3:
		for temp in range(0,16):
			smplList[temp].stopSample()
		sFile=eg.fileopenbox(msg='',title='Load Bank',default='*',filetypes=[["*.bdat", "Sample Bank"]])
		if sFile:
			tempFile=open(sFile)
			lines=tempFile.readlines()
			tempFile.close()
			for temp in range(0,16):
					fileName=lines[temp][0:len(lines[temp])-1]
					if fileName!="None":
						smplList[temp].getSample(fileName)
					else:
						smplList[temp].fid=pygame.mixer.Sound('')
						smplList[temp].fid_text_l=''
						smplList[temp].fid_text=''
	elif reply==4:
		sFile=eg.fileopenbox(msg='',title='Load MIDI',default='*',filetypes=[["*.mdat", "MIDI Map"]])
		if sFile:
			tempFile=open(sFile)
			lines=tempFile.readlines()
			tempFile.close()
			for temp in range(0,16):
					midiName=lines[temp][0:len(lines[temp])-1]
					if midiName.isdigit():
						midiList[temp]=int(midiName)
					else:
						midiList[temp]=60
예제 #3
0
def main():
    db_name = 'pymongo_GridFS_test'
    collection_name = 'fs'

    client = pymongo.MongoClient(host = 'localhost', port = 27017)
    db = client[db_name]
    db.drop_collection(collection_name)

    # GridFS put test
    file_to_put = easygui.fileopenbox(
        msg = 'Select the file you want to put into GridFS:')
    if file_to_put:
        file_id, md5_digest = put_test(client, db, collection_name, file_to_put)
        if file_id:
            easygui.msgbox(
                msg = '"put" successfully!\nMD5: {}'.format(md5_digest),
                title = 'Congratulations!')
        else:
            easygui.msgbox(
                msg = 'Failed to "put"!', title = 'Error!')
            return

    # GridFS get test
    name, ext = os.path.splitext(os.path.basename(file_to_put))
    file_to_save = easygui.filesavebox(
        msg = 'Where do you want to save this file:',
        default = name + '_get_from_GridFS' + ext)
    if file_to_save:
        if get_test(client, db, collection_name, file_id, file_to_save):
            easygui.msgbox(
                msg = '"get" successfully!', title = 'Congratulations!')
        else:
            easygui.msgbox(msg = 'Failed to "get"!', title = 'Error!')

    client.drop_database(db_name)
예제 #4
0
    def _save_file_dialogs(self, extension = "txt"):
        ''' Dialogs asking users to save file, sanity checks for existence of file, etc.

        extension is the file's extension (txt, png, etc). It will automatically be added
        to the filename specified by the user.

        The function returns the filename specified by the user if one is specified or
        None if the user cancels the operation for any reason.
        '''
        # If user cancels it defaults to the FIRST choice. We want default to be NO so I reverse the default of choices here. 
        saveornot = easygui.buttonbox(msg="Do you want to save results to a file?", choices = ("No", "Yes") )
        if saveornot == "Yes":
            filename = easygui.filesavebox(msg = "Where do you want to save the file (extension %s will automatically be added)?" %(extension))
            if filename is None:
                return None
            filename = filename + "." + extension
            if os.path.exists(filename):
                ok_to_overwrite = easygui.buttonbox(msg="File %s already exists. Overwrite?" %(filename), choices = ("No", "Yes") )
                if ok_to_overwrite == "Yes":
                    return filename
                else:
                    return None
            else:
                return filename
        else:
            return None
예제 #5
0
	def OnKeyPress(self, event):
		if event.key == K_c:
			self.points.clear()
			self.selectedPoint = 0
		if event.key == K_o:
			filename = easygui.fileopenbox(filetypes = ['*.pts'])
			self.points.open( filename )
		if event.key == K_i:
			#try:
				self.image = pygame.image.load(easygui.fileopenbox(filetypes = ['*.jpg']))
			#except:
				pass
		if event.key == K_SPACE:
			filename = easygui.filesavebox(default = datetime.datetime.now().strftime('%Y%m%d_%H%M%S')+'.pts', filetypes = ['*.pts'])
			if filename: 
				self.points.save( filename )
		if event.key == K_INSERT:
			if self.state == psInsertAfter:
				self.state = psInsertBefore
			elif self.state == psInsertBefore:
				self.state = psNone
			else:
				self.state = psInsertAfter
		if event.key == K_DELETE:
			if self.selectedPoint != 0:
				self.points.remove(self.selectedPoint)
				self.selectedPoint = 0
		if event.key == K_ESCAPE:
			if self.state != psNone:
				self.state = psNone
			else:
				CRASH;
예제 #6
0
def image2pdf():
    try:
        num = g.enterbox(
            title="Количество изображений ",
            msg="Введите количество изображений которые хотите добавить ")
        n = int(num)

        indir = g.fileopenbox("Выберите изображение в формате JPEG или PNG")
        image1 = Image.open(str(indir))
        im1 = image1.convert('RGB')
        n -= 1
        imagelist = []

        while n != 0:
            indir_1 = g.fileopenbox(
                "Выберите изображение в формате JPEG или PNG")
            image2 = Image.open(str(indir_1))
            im2 = image2.convert('RGB')
            imagelist.append(im2)
            n -= 1
        todir = g.filesavebox("Выберите место для сохранения")
        im1.save(str(todir) + ".pdf", save_all=True, append_images=imagelist)
        Dialog.show()
    except:
        Dialog.show()
    return 0
예제 #7
0
def main():
    easygui.msgbox(msg=splash_msg,
                   title=window_title,
                   ok_button="Yeah, whatever. Just do what you're made for!")

    inpath = easygui.fileopenbox(
        msg="choose input file (.xmcd)",
        title=window_title,
        filetypes="*.xmcd",
    )
    outpath = easygui.filesavebox(msg="choose output file (.tex)",
                                  title=window_title,
                                  default="out.tex",
                                  filetypes="*.xmcd")
    if inpath == None or outpath == None:
        print("no file chosen, abort!")
        easygui.msgbox(msg="No file chosen. Abort.",
                       title=window_title,
                       ok_button="Exit")
    else:
        mc2tex.convert(inpath, outpath)
        easygui.msgbox(
            msg="Everything done as you wished " +
            "(well, hopefully. Better have a look at the results...)\n" +
            "Have a nice day!",
            title=window_title,
            ok_button="Exit")
    exit()
예제 #8
0
파일: __init__.py 프로젝트: iTecAI/DM-SAK
def export(tmap):
    path = filesavebox(title='Export',default='*.png')
    posx = {}
    posy = {}
    for n in tmap.keys():
        posx[n[0]] = n
        posy[n[1]] = n
    spx = sorted(list(posx.keys()))
    spy = sorted(list(posy.keys()))
    w = abs(spx[0]-spx[len(spx)-1])+1
    h = abs(spy[0]-spy[len(spy)-1])+1
    minx = spx[0]
    miny = spy[0]
    surf = pygame.Surface((w*32,h*32))
    for x in range(w):
        for y in range(h):
            try:
                _tile = tmap[(x+minx,y+miny)]
            except KeyError:
                continue
            for L in _tile:
                surf.blit(pygame.transform.scale(L['rendered'],(32,32)),(x*32,y*32))
    if state_inst.grid:
        for x in range(w):
            surf.fill([224, 224, 224, 100],rect=pygame.Rect(x*32,0,1,h*32))
            for y in range(h):
                surf.fill([224, 224, 224, 100],rect= pygame.Rect(0,y*32,w*32,1))
    pygame.image.save(surf,path)
예제 #9
0
    def save(self):

        file = eg.filesavebox(msg="Guardar archivo",
                              title="TransCity",
                              default='./data/save/',
                              filetypes=["*.json"])
        if file:
            data = dict()
            data['buses'] = {}
            data['stations'] = {}
            data['users'] = {}
            data['routes'] = {}
            data['paths'] = {}
            data['map_paths'] = []
            for bus in self.buses:
                data['buses'][bus.get_code()] = bus.encode()
            for station in self.stations:
                data['stations'][station.get_code()] = station.encode()
            for user in self.users:
                data['users'][user.get_code()] = user.encode()
            for route in self.routes:
                data['routes'][route.get_code()] = route.encode()
            for path in self.paths:
                data['paths'][path.get_code()] = path.encode()
            for map_path in self.map_paths:
                data['map_paths'].append(map_path)
            with open(file, 'w') as outfile:
                json.dump(data, outfile, indent=2)
def savefile(oldtext, text):
    filename = easygui.filesavebox()
    if filename == None:
        return # user selected Cancel
    output = open(filename,"a") # a: append 
    output.write("\n- - - - -\n{}\n{}".format(oldtext, text))
    output.close()
예제 #11
0
 def to_csv(self, name_list=None, index=False):
     """ Save one or multiple dataframes to csv
     with a gui (when no names are passed)
     
     Parameters
     ----------
     name_list : List of strings (optional)
         Names of the dataframes you want to save
         
     index : bool (optional)
         Default value: False
         Save the index as well when True.
     """
     
     data_dict = self.data_dict
     if name_list is None:
         name_list = easygui.multchoicebox(msg="Pick the to save dataframes",
                                           choices=[item for item in self.data_dict])
     
     for name in name_list:
         loc = easygui.filesavebox(msg="Save the file",
                                   title="Save location",
                                   default='data.csv', filetypes=['csv'])
         data = data_dict[name]
         data.to_csv(loc, index=index)
예제 #12
0
def main():
    try:
        while True:
            # Directory input
            directory = easygui.diropenbox(
                "Select a folder to recursively search", program)
            if directory is None:
                if easygui.ccbox("No folder selected. Try again?", program):
                    continue
                else:
                    exit()
            print("Directory: ", directory)

            # Keyword input
            keyword = easygui.enterbox(
                "Enter the keyword to search for, case insensitive", program)
            if keyword is None:
                if easygui.ccbox("No keyword entered. Try again?", program):
                    continue
                else:
                    exit(0)

            print("Keyword: ", keyword)

            results = search(directory, keyword)

            print("Entries: ", len(results))
            print("Results: ", results)

            if results is None:
                if easygui.ccbox("No Results found. Try again?", program):
                    continue
                else:
                    exit(0)
            unc = pathlib.Path(directory).resolve()
            header = "To save press OK.\nResults: \n Directory: " + directory + "\n UNC: " + str(
                unc
            ) + "\n Keyword: " + keyword + "\n Number of Results: " + str(
                len(results))
            results_pretty = ""
            for line in results:
                results_pretty += line + "\n\n"
            if easygui.textbox(header, program, results_pretty):
                path = easygui.filesavebox("Save Results", program,
                                           program + "_" + keyword,
                                           results_pretty)
                if path is not None:
                    save_file(path, results)
                    exit(0)
                else:
                    exit(0)
            else:
                exit(0)

    except SystemExit:
        exit(0)
    except:
        easygui.exceptionbox(
            "Error occurred. Please contact the maintainer of this program.",
            program)
예제 #13
0
def DownloadStart(url, filename, extension):
    downloaded = True
    for i in range(5):
        try:
            url_path = extension
            if extension == "pdf":
                url_path = "download"
            r = requests.get(url + "/" + url_path, stream=True)
            break
        except requests.exceptions.ConnectionError:
            if i == 4:
                #!Error="Невозможно подключится к серверу. Отмена подключения."
                downloaded = False
        except Exception as e:
            #!Error=str(e)
            downloaded = False
    if downloaded:
        if extension == "fb2":
            extension = "fb2.zip"
        filename = remove(filename, '\/:*?"<>|.')
        save_path = easygui.filesavebox(
            default="C:\\Users\\User\\Downloads\\" + filename)
        if save_path != None:
            save_path += "." + extension
        else:
            return
        try:
            with open(save_path, 'wb') as fd:
                for chunk in r.iter_content(chunk_size=128):
                    fd.write(chunk)
            #!Error="Файл успешно скачан."
        except Exception as e:
            #!Error=str(e)
            pass
예제 #14
0
def get_document(url):
    # 文库url
    sess = requests.Session()
    html = sess.get(url).content.decode("gbk")
    # 抓取到文档标题
    title = re.search('id="doc-tittle-0">(.*?)</span>', html).group(1)
    # 使用正则提取 文档内容的url
    res = re.search("WkInfo.htmlUrls = '(.*)'", html).group(1)
    # \\x22是linux中的引号,替换成Python中的引号
    res = res.replace("\\x22", "\"")
    # 转成字典
    data = json.loads(res)
    # 新建一个文档
    document = docx.Document()
    string = ""
    for i in data["json"]:
        url = i["pageLoadUrl"]  # 获取到url
        url = url.replace("\\", "")  # url中有转义符\去掉
        # 请求文档内容
        data = requests.get(url).content.decode("utf-8")
        # 提取文本数据
        res = re.search("wenku_\d*\((.*)\)", data, re.S).group(1)
        # 将json对象数据转成Python对象
        data = json.loads(res)
        for i in data['body']:
            # 判断数据是什么类型
            if i["t"] == "word":
                # 获取到文本
                string += str(i["c"])
                # ps中不为空并且_enter==1的时候是换行也就是一段内容
                if i["ps"] and i["ps"].get("_enter") == 1:
                    document.add_paragraph(string)  # 将一段内容写入到word
                    string = ""  # 重新复制 "" 表示新的一段文本
    # 保存word
    document.save(easygui.filesavebox(title='保存文件',default=title+".docx"))
예제 #15
0
def exercise0():
    """Demonstrate writing a text file."""
    # TODO 0: Read, discuss, and understand the following code.

    # A familiar list of strings to test writing to a file.
    values = [
        "Integrity First", "Service Before Self", "Excellence In All We Do"
    ]

    # Opening a file to write requires the second parameter, "w", to specify "write" mode.
    # For other modes, see https://docs.python.org/3.4/library/functions.html#open
    with open("./data/Values_Write.txt", "w") as data_file:
        data_file.write(", ".join(values))

    # Above, the data_file object's write() method was used. However, it can only
    # accept a single string parameter and does not automatically append a newline.
    # The print() function can be used with the file parameter, which then also
    # allows use of the print() function's sep and end parameters.
    with open("./data/Values_Print.txt", "w") as data_file:
        print(", ".join(values), file=data_file)

    # The easygui.filesavebox (as opposed to fileopenbox) will give a warning
    # if the file selected for writing already exists.
    with open(easygui.filesavebox(default="./data/*.txt"), "w") as data_file:
        print("\n".join(values), file=data_file)
예제 #16
0
    def save_data(
        self,
        filename = []
    ):
        '''
        Function to save current variables in '.npz' format. The file name and path
        for saving can be given as an input. If no input is given a GUI will prompt
        the user to select a location and file name. In both case no file extension
        '''
        if len(filename) == 0:
            output_path = gui.filesavebox()
        else:
            output_path = filename

        np.savez(
            output_path,
            approach = self.approach,
            retract = self.retract,
            z_approach = self.z_approach,
            z_withdraw = self.z_withdraw,
            adhesion = self.adhesion,
            modulus = self.modulus,
            data_offset = self.data_offset,
            data_length =self.data_length,
            ramp_size = self.ramp_size,
            samps_line = self.samps_line,
            zsens = self.zsens,
            zscale = self.zscale,
            def_sens = self.def_sens,
            spr_const = self.spr_const,
            file_name = self.file_name,
            run_name = self.run_name,
            measurements = self.measurements
        )
예제 #17
0
def two_dimensions_plot(xy, imagesData, show_notebook=True):

    x = xy[0]
    y = xy[1]
    images = imagesData.extract_lowRes()
    fig = plt.figure(figsize=(170, 170))
    ax = plt.subplot(111)

    ax.scatter(x, y, marker='.')
    for i in range(len(images)):
        im = OffsetImage(images[i], cmap='gray', zoom=0.5)
        im.image.axis = ax
        ab = AnnotationBbox(im, (x[i], y[i]), frameon=False)
        ax.add_artist(ab)
        ticks = np.linspace(0, np.max((x, y)), 36)
    ax.set_xticks(ticks)
    ax.set_yticks(ticks)
    ax.tick_params(labelsize=75)
    plt.xlabel('Principal dimension', fontsize=150)
    plt.ylabel('Second principal dimension', fontsize=150)
    if (not show_notebook):
        filename = easygui.filesavebox(msg="Give a name to your plot")
        fig.savefig(filename + ".jpg")

    else:
        plt.show()
예제 #18
0
def savefile(oldtext, text):
    filename = easygui.filesavebox()
    if filename == None:
        return  # user selected Cancel
    output = open(filename, "a")  # a: append
    output.write("\n- - - - -\n{}\n{}".format(oldtext, text))
    output.close()
예제 #19
0
 def prompt_for_firmware_save(self, filename):
     if easygui.ynbox("Save the firmware before loading?", self.title):
         return easygui.filesavebox(msg='Choose the image file to save',
                                    default=filename,
                                    title=self.title,
                                    filetypes=["*.bin", "*.*"])
     return None
예제 #20
0
def function1():
    f_full_path = eg.fileopenbox(msg = None, title = None, default = '*.txt', filetypes = None, multiple = False)
    if f_full_path == None:
        eg.msgbox('未选中任何txt文件')
    else:
        f_obj = open(f_full_path, 'r')
        f_all_contxt = f_obj.read()
        f_obj.close()
        local_msg = '文本【%s】内容显示如下:' % (f_full_path.split(os.sep)[-1])
        local_title = '显示文件内容'
        f_new_context = eg.textbox(local_msg, local_title, f_all_contxt)
        if not f_new_context == None:
            if f_new_context == f_all_contxt:
                print('Match')
            else:
                w_msg = '检测到文件内容发生变化, 请选择以下操作'
                w_title = '警告'
                w_choice = ['覆盖保存', '放弃保存', '另存为...']
                choice = eg.choicebox(w_msg, w_title, w_choice, preselect = 0, callback = None, run = True)

                if choice == w_choice[0]:
                    f_obj = open(f_full_path, 'w')
                    f_obj.write(f_new_context[:-1])
                    f_obj.close()
                    eg.msgbox('文件覆盖完毕')

                elif choice == w_choice[1]:
                    pass

                elif choice == w_choice[2]:
                    new_f_name = eg.filesavebox(msg = None, title = '另存为', default = f_full_path.split(os.sep)[-1], filetypes = '.txt')
                    f_obj = open(new_f_name, 'w')
                    f_obj.write(f_new_context[:-1])
                    f_obj.close()
                    eg.msgbox('文件另存成功')
예제 #21
0
def _cmd_template(opts):
    dst_fpaths = opts.get('<excel-file-path>', None)
    is_gui = opts['--gui']
    if is_gui and not dst_fpaths:
        import easygui as eu
        fpath = eu.filesavebox(msg='Create INPUT-TEMPLATE file as:',
                               title='%s-v%s' % (proj_name, proj_ver),
                               default='co2mpas_template.xlsx')
        if not fpath:
            raise CmdException('User abort creating INPUT-TEMPLATE file.')
        dst_fpaths = [fpath]
    elif not dst_fpaths:
        raise CmdException('Missing destination filepath for INPUT-TEMPLATE!')

    force = opts['--force']
    for fpath in dst_fpaths:
        if not fpath.endswith('.xlsx'):
            fpath = '%s.xlsx' % fpath
        if osp.exists(fpath) and not force and not is_gui:
            raise CmdException("Writing file '%s' skipped, already exists! "
                               "Use '-f' to overwrite it." % fpath)
        if osp.isdir(fpath):
            raise CmdException(
                "Expecting a file-name instead of directory '%s'!" % fpath)

        log.info("Creating INPUT-TEMPLATE file '%s'...", fpath)
        stream = _get_input_template_fpath()
        with open(fpath, 'wb') as fd:
            shutil.copyfileobj(stream, fd, 16 * 1024)
예제 #22
0
def saveImge(img):
    #展示二维码
    img.show()
    #选择保存路径,默认为当前路径
    save_path = eg.filesavebox(msg="保存路径", title="保存文件", default=".")
    img.save(save_path)
    return save_path
예제 #23
0
    def _save_file_dialogs(self, extension = "txt"):
        ''' Dialogs asking users to save file, sanity checks for existence of file, etc.

        extension is the file's extension (txt, png, etc). It will automatically be added
        to the filename specified by the user.

        The function returns the filename specified by the user if one is specified or
        None if the user cancels the operation for any reason.
        '''
        # If user cancels it defaults to the FIRST choice. We want default to be NO so I reverse the default of choices here. 
        saveornot = easygui.buttonbox(msg="Do you want to save results to a file?", choices = ("No", "Yes") )
        if saveornot == "Yes":
            filename = easygui.filesavebox(msg = "Where do you want to save the file (extension %s will automatically be added)?" %(extension))
            if filename is None:
                return None
            filename = filename + "." + extension
            if os.path.exists(filename):
                ok_to_overwrite = easygui.buttonbox(msg="File %s already exists. Overwrite?" %(filename), choices = ("No", "Yes") )
                if ok_to_overwrite == "Yes":
                    return filename
                else:
                    return None
            else:
                return filename
        else:
            return None
예제 #24
0
def browse_stream (ole, stream):
    """
    Browse a stream (hex view or save to file)
    """
    #print 'stream:', stream
    while True:
        msg ='Select an action for the stream "%s", or press Esc to exit' % repr(stream)
        actions = [
            'Hex view',
##                'Text view',
##                'Repr view',
            'Save stream to file',
            '~ Back to main menu',
            ]
        action = easygui.choicebox(msg, title='olebrowse', choices=actions)
        if action is None or 'Back' in action:
            break
        elif action.startswith('Hex'):
            data = ole.openstream(stream).getvalue()
            ezhexviewer.hexview_data(data, msg='Stream: %s' % stream, title='olebrowse')
##            elif action.startswith('Text'):
##                data = ole.openstream(stream).getvalue()
##                easygui.codebox(title='Text view - %s' % stream, text=data)
##            elif action.startswith('Repr'):
##                data = ole.openstream(stream).getvalue()
##                easygui.codebox(title='Repr view - %s' % stream, text=repr(data))
        elif action.startswith('Save'):
            data = ole.openstream(stream).getvalue()
            fname = easygui.filesavebox(default='stream.bin')
            if fname is not None:
                f = open(fname, 'wb')
                f.write(data)
                f.close()
                easygui.msgbox('stream saved to file %s' % fname)
예제 #25
0
def main():
    db_name = 'pymongo_GridFS_test'
    collection_name = 'fs'

    client = pymongo.MongoClient(host='localhost', port=27017)
    db = client[db_name]
    db.drop_collection(collection_name)

    # GridFS put test
    file_to_put = easygui.fileopenbox(
        msg='Select the file you want to put into GridFS:')
    if file_to_put:
        file_id, md5_digest = put_test(client, db, collection_name,
                                       file_to_put)
        if file_id:
            easygui.msgbox(
                msg='"put" successfully!\nMD5: {}'.format(md5_digest),
                title='Congratulations!')
        else:
            easygui.msgbox(msg='Failed to "put"!', title='Error!')
            return

    # GridFS get test
    name, ext = os.path.splitext(os.path.basename(file_to_put))
    file_to_save = easygui.filesavebox(
        msg='Where do you want to save this file:',
        default=name + '_get_from_GridFS' + ext)
    if file_to_save:
        if get_test(client, db, collection_name, file_id, file_to_save):
            easygui.msgbox(msg='"get" successfully!', title='Congratulations!')
        else:
            easygui.msgbox(msg='Failed to "get"!', title='Error!')

    client.drop_database(db_name)
예제 #26
0
def quit_prompt(student_list):
    """Asks if the user wants to quit or not.
       If yes, saves the student_list as a CSV file.
    """
    if eg.ynbox("Cikmak istediginize emin misiniz?", choices=('Evet', 'Hayir')):
        csv_file = eg.filesavebox(title='Tabloyu kaydet',filetypes=['*.csv'])

        #Adds .csv extension if user did not already.
        if csv_file:
            if csv_file[-4:] != '.csv':
                csv_file += '.csv'

            with open(csv_file, 'wb') as f:
                writer = csv.writer(f, delimiter=';')
                writer.writerow(['AD', 'SOYAD', 'UNIVERSITE', 'OSYM PUANI', 'YILI',
                                 'CBUTF TABAN PUANI', 'NOT ORTALAMASI', 'SINIF',
                                 'EGITIM', 'DISIPLIN CEZASI', 'TELEFON', 'UYGUNLUK', 'PUAN'])
                student_list = sort_students(student_list)
                for student in student_list:
                    writer.writerow(student.export_for_csv())
            sys.exit(0)
        else:
            choice = eg.buttonbox(msg='Kaydetmeden cikmak istediginize emin misiniz?',
                                  title='Kaydetmeden cikis',choices=('Evet','Hayir'))
            if choice:
                sys.exit(0)
예제 #27
0
 def New_file(self):
     self.Dir = easygui.filesavebox(title="New",
                                    default=self.default + "document1.tst")
     if self.Dir == None:
         return
     Win.New_file(os.path.basename(Dir))
     Win.Reset_lines()
예제 #28
0
 def export_data(self):
     path_origin = Path(__file__).parent.absolute()
     dest_path = easygui.filesavebox(msg="Arquivo xls",
                                     title="Task for Bot -",
                                     default="Histórico")
     path = str(path_origin) + "\\results.xls"
     shutil.copy(path, str(dest_path) + '.xls')
 def savexls(self):
     output = open('data.txt', 'w', encoding='gbk')
     output.write('url,status,title,cms,huanjing\n')
     for row in all_info:
         rowtxt = '{},{},{},{}'.format(row[0], row[1], row[2], row[3])
         output.write(rowtxt + "\n")
     output.close()
     with open("data.txt", encoding="gbk") as rp:
         text = rp.read()
     ui.textbox(msg="网站" + website + "同IP网站的详细信息",
                title="网站" + website + "同IP网站的详细信息",
                text=text)
     weizhi = ui.filesavebox(msg="表格保存",
                             title="表格保存",
                             default="./" + website + "结果.xls",
                             filetypes="xls")
     print("[!]正在保存结果至" + website + "结果.xls")
     data_pd = pd.DataFrame(
         data=all_info,
         columns=["url", "状态值", "网站标题", "可能的CMS", "网站环境(包括中间件、开发框架、语言等信息)"])
     try:
         data_pd.to_excel(weizhi)
     except IOError:
         ui.msgbox("[x]保存失败,请检查是否已经打开该文件,或本程序是否有本文件夹及文件的读写权限")
         print("[x]保存失败,请检查是否已经打开该文件,或本程序是否有本文件夹及文件的读写权限")
     else:
         ui.msgbox("[√]保存成功!")
         print("[√]保存成功")
예제 #30
0
def browse_stream (ole, stream):
    """
    Browse a stream (hex view or save to file)
    """
    #print 'stream:', stream
    while True:
        msg ='Select an action for the stream "%s", or press Esc to exit' % repr(stream)
        actions = [
            'Hex view',
##                'Text view',
##                'Repr view',
            'Save stream to file',
            '~ Back to main menu',
            ]
        action = easygui.choicebox(msg, title='olebrowse', choices=actions)
        if action is None or 'Back' in action:
            break
        elif action.startswith('Hex'):
            data = ole.openstream(stream).getvalue()
            ezhexviewer.hexview_data(data, msg='Stream: %s' % stream, title='olebrowse')
##            elif action.startswith('Text'):
##                data = ole.openstream(stream).getvalue()
##                easygui.codebox(title='Text view - %s' % stream, text=data)
##            elif action.startswith('Repr'):
##                data = ole.openstream(stream).getvalue()
##                easygui.codebox(title='Repr view - %s' % stream, text=repr(data))
        elif action.startswith('Save'):
            data = ole.openstream(stream).getvalue()
            fname = easygui.filesavebox(default='stream.bin')
            if fname is not None:
                f = open(fname, 'wb')
                f.write(data)
                f.close()
                easygui.msgbox('stream saved to file %s' % fname)
예제 #31
0
def main():
    width = 120  # 宽和高默认为120和60
    height = 60
    [width_str, height_str] = g.multenterbox("请输入宽和高", "请输入信息", ["宽", '高'],
                                             [])  # 实现一个输入信息框
    if width_str != "":  # 如果没有输入,则使用默认值
        width = eval(width_str)
    if height_str != "":
        height = eval(height_str)
    pic_path = g.fileopenbox("请选择要转换的图像文件")  # 得到完整的图片路径
    im = Image.open(pic_path)
    im = im.resize((width, height), Image.NEAREST)
    # 文件存储目录选择,并返回完整的路径,有默认的设置
    in_path = g.filesavebox("请选择存储的文件路径,并输入文件名",
                            default='ascii_test.txt',
                            filetypes=['*.txt'])
    str = ""
    for i in range(height):
        for j in range(width):
            str += get_char(*im.getpixel((j, i)))  # 在字符串对应的位置中赋值
        str += '\n'
    with open(in_path, 'w') as f:
        f.write(str)
        g.msgbox("成功了!", title="", ok_button="厉害了")  # 提示信息框
        print(str)
def main():
    
    def process_test(test):
        answer_match = string_find(regexes[1], test)
        if answer_match:
            answer_key = [x[1] for x in answer_match]
            test = string_replace(regexes[0], "A) True\nB) False\n", test)
            for regex in regexes[1:]:
                test = string_replace(regex, '', test)
            print test
            format_answers(answer_key)
            
    def string_find(pattern, string):
        return re.findall(pattern, string, flags=re.I | re.X)            

    def string_replace(pattern, string_old, string_new):
        return re.sub(pattern, string_old, string_new, flags=re.I | re.X)

    def format_answers(answers):
        print 'Answers:'
        number = 0
        for answer in answers:
            number += 1          
            answers = string_replace(regexes[3], "", str(number) + '.' + answer.replace(":", ""))
            print string.capwords(answers)
            
    msg = "This program will attempt to format a test file for use with Respondus, Do you want to continue?"
    title = "Respondus Format Utility version 1.5 Beta"
    if easygui.ccbox(msg, title):
        pass
    else:
        sys.exit(0)        
    try:
        sys.stdout = open(easygui.filesavebox(msg='Before we begin choose where to save your formatted test file?',
                                          default='formatted_test.txt'), 'w')      
    except TypeError:
        sys.exit(-1) 
    file_choice = easygui.indexbox(msg="Choose the file type of your test file (Note: Word is very experimental)",
                                   choices=("Plain text file (.txt)", "Word 2007, 2010 file (.docx)", "Quit"))
    if file_choice is 0:
        input_file = easygui.fileopenbox(msg='Where is the test file to format?')
        try:
            with open(input_file) as inputFileHandle:
                process_test(inputFileHandle.read().replace("\n", "\n\n"))
        except (TypeError, IOError):
            sys.stderr.write('Could not open %s\n' % input_file)
            sys.exit(-1)
    elif file_choice is 1:
        try:
            with zipfile.ZipFile(easygui.fileopenbox(msg='Where is the test file to format?')) as docx:                
                process_test(re.sub('<(.|\n)*?>', '\n', docx.read('word/document.xml')))                             
        except (TypeError, AttributeError, IOError):
            sys.stderr.write('Could not open %s\n' % zipfile)
            sys.exit(-1)  
    else:
        sys.exit(0)
    easygui.msgbox("Format complete!", ok_button="Close", image="tick_64.png")
    sys.stdout.flush()
    sys.stdout.close()
예제 #33
0
    def open_files(self):
        if self.fileo1 is None:
            from easygui import filesavebox
            file1 = filesavebox(msg='Choose file with RAW data',
                                default=patho1,
                                filetypes=['*.QHD', '*.*'])
        else:
            file1 = self.fileo1
        if self.fileo2 is None:
            file2 = filesavebox(msg='Choose file with RF data',
                                default=patho2,
                                filetypes=['*.QHD', '*.*'])
        else:
            file2 = self.fileo2
        if file1 is not None and file2 is not None:
            try:
                self.st1 = read(file1)
                self.st2 = read(file2)
            except ValueError:
                print("Error while reading file!")
                return

            self.st2s = self.st2
            if self.select:
                self.st2s = self.st2.select(expr='not st.mark')
            event_ids = self.st2s.getHI('event.id')
            self.st1s = self.st1
            if len(self.st1s) != len(self.st2s):
                for tr in self.st1s:
                    if tr.stats.event.id not in event_ids:
                        self.st1s.remove(tr)
            if len(self.st1s) != len(self.st2s):
                raise ValueError('Streams do not have the same lenth')

            if num_tr is None:
                self.ind1 = 0
                self.ind2 = len(self.st2s)
            else:
                self.ind1 = 0
                self.ind2 = min(3 * num_tr, len(self.st2s))
            if self.bandpass is not None:
                self.st2s.filter2(*self.bandpass)
            #self.st2s.select(component='Q').normalize()
            self.st1s.sort(sort)
            self.st2s.sort(sort)
            self.plot_streams()
예제 #34
0
 def _save_to_file(self, filename=None):
     """Save current artwork/palette to a file"""
     if not filename:
         filename = filesavebox(title="Save art to file", default="./*.pxlart")
     if filename:
         self.log("Saving to: {}".format(filename))
         self.art.save_to_file(filename)
         self.previous_file_save = filename
 def save_horizontal(self):
     import easygui
     tmp = easygui.filesavebox(title='Save fiel')
     if tmp:
         try:
             save(tmp, self.model.intens_yz)
         except:
             print 'saving file failed'
 def save_section(self):
     import easygui
     tmp = easygui.filesavebox(title='Save file')
     if tmp:
         try:
             save(tmp, self.model.intens_xy)
         except:
             print 'saving file failed'
예제 #37
0
파일: saver.py 프로젝트: kant1724/RPA
def save_register_file(obj):
    default_path = os.path.abspath("./files/save")
    path = easygui.filesavebox(default=default_path + "\*.txt")
    if path == None:
        return
    with open(path, 'w') as f:
        for data_file_path in obj.data_file_arr:
            f.write(data_file_path + "\n")
예제 #38
0
파일: ui.py 프로젝트: gwsears/Commons
def select_save_loc():
    default_dir = get_default_dir()
    results_of_check = easygui.filesavebox("Select where to save the Duplicate Checker Results", "Save File",
                                           default=default_dir)
    file_ext = os.path.splitext(results_of_check)[1]
    if file_ext == '':
        results_of_check = results_of_check + ".xlsx"
    return results_of_check
예제 #39
0
파일: farmtool.py 프로젝트: iceseismic/sito
    def open_files(self):
        if self.fileo1 is None:
            from easygui import filesavebox
            file1 = filesavebox(msg='Choose file with RAW data',
                                        default=patho1,
                                        filetypes=['*.QHD', '*.*'])
        else:
            file1 = self.fileo1
        if self.fileo2 is None:
            file2 = filesavebox(msg='Choose file with RF data',
                                        default=patho2,
                                        filetypes=['*.QHD', '*.*'])
        else:
            file2 = self.fileo2
        if file1 is not None and file2 is not None:
            try:
                self.st1 = read(file1)
                self.st2 = read(file2)
            except ValueError:
                print("Error while reading file!")
                return

            self.st2s = self.st2
            if self.select:
                self.st2s = self.st2.select(expr='not st.mark')
            event_ids = self.st2s.getHI('event.id')
            self.st1s = self.st1
            if  len(self.st1s) != len(self.st2s):
                for tr in self.st1s:
                    if tr.stats.event.id not in event_ids:
                        self.st1s.remove(tr)
            if  len(self.st1s) != len(self.st2s):
                raise ValueError('Streams do not have the same lenth')

            if num_tr is None:
                self.ind1 = 0
                self.ind2 = len(self.st2s)
            else:
                self.ind1 = 0
                self.ind2 = min(3 * num_tr, len(self.st2s))
            if self.bandpass is not None:
                self.st2s.filter2(*self.bandpass)
            #self.st2s.select(component='Q').normalize()
            self.st1s.sort(sort)
            self.st2s.sort(sort)
            self.plot_streams()
예제 #40
0
    def file_save(self):
        extension = ["*.py", "*.pyc"]
        archivo = eg.filesavebox(msg="Guardar archivo",
                                 title="Control: filesavebox",
                                 default='',
                                 filetypes=extension)

        eg.msgbox(archivo, "filesavebox", ok_button="Continuar")
        return archivo
예제 #41
0
def writeImageToFile(img, mask):
    # The mask of the signature can be used as the alpha channel of the image
    b, g, r = cv2.split(img)
    imgWithAlpha = cv2.merge((b, g, r, mask))
    file = easygui.filesavebox()
    fileName = file + '.png'
    if fileName is None:
        errorPrompt('No Name Selected')
    cv2.imwrite(fileName, imgWithAlpha)
예제 #42
0
파일: ppsdtool.py 프로젝트: iceseismic/sito
 def logging_file(self):
     file_ = easygui.filesavebox(default='/home/richter/Data/*.log')
     if file_ != None:
         if self.filehandler != None:
             log.removeHandler(self.filehandler)
         self.filehandler = logging.FileHandler(file_, 'a')
         self.filehandler.setLevel(logging.DEBUG)
         #filehandler.setFormatter(logging.Formatter('%(asctime)s
         #        - %(levelname)s - %(name)s.%(funcName)s - %(message)s'))
         log.addHandler(self.filehandler)
 def save_file(self):
     """
     Callback for the 'Save Image' menu option.
     """
     from easygui import filesavebox
     tmp = filesavebox(title = "Save to", default='*.npy') 
     if tmp:
         print tmp
         self._save_file = tmp
         np.save(self._save_file, self.data.field3d)
예제 #44
0
파일: cs1robots.py 프로젝트: NoSyu/cs101
def save_world(filename = None):
  """Save a robot world to filename.
  Opens file-chooser if no filename is given."""
  if not filename:
    filename = _easygui.filesavebox("Select a Robot world", 
                                    "Robot World", '*', [ "*.wld" ])
    if not filename: 
      raise RuntimeError("No world file selected.")
  out = open(filename, "w")
  _world.save(out)
  out.close()
예제 #45
0
def main():
    fileopen = easygui.fileopenbox(msg="Selecciona el archivo csv",
     filetypes = ["*.csv"])
    if fileopen is None:
        error("No se selecciono ningun archivo")
    pdf_file = easygui.filesavebox(msg = "Guardar archivo pdf con codigo de barras",
        default ="barcode.pdf", filetypes=["*.pdf"] )
    if pdf_file is None:
        error("No se guardo el archivo")
    genpdf(fileopen,pdf_file)
    easygui.msgbox("Archivo generado")
예제 #46
0
파일: __init__.py 프로젝트: Uberi/autom
def dialog_file_select(title = "Choose file(s)", initial_shown_glob = "./*", is_save_dialog = False, multiselect = False):
    """
    Show a file selection dialog with title `title`, initially showing files matching the glob `initial_shown_glob`.
    
    Has "Save" button when `is_save_dialog` is truthy, and otherwise an "Open" button.
    
    Returns a list of selected paths when `multiselect` is truthy and otherwise just the selected path, or `None` if cancelled.
    """
    if is_save_dialog: return easygui.filesavebox(None, str(title), str(initial_shown_glob))
    path = easygui.fileopenbox(None, str(title), str(initial_shown_glob), None, str(multiselect))
    if os.path.isfile(path): return path
    return None
예제 #47
0
파일: ppsdtool.py 프로젝트: iceseismic/sito
 def save_ppsd(self, file_=None):
     if self.ppsd == None:
         msgbox('No PPSD to save.')
         return
     if file_ == None:
         file_ = easygui.filesavebox(default=def_save_data,
                                    filetypes=['*.pickle', '*.*'])
     if file_ != None:
         try:
             self.ppsd.save(file_)
         except:
             exceptionbox("Error while writing file_!")
예제 #48
0
	def save(self):
		file_name = easygui.filesavebox('.txt','Save File as', '.txt')
		if file_name == None:
			return None
		file = open(file_name, 'w')
		for rows in self.matrix:
			line = ''
			for char in rows:
				for i in char:
					line += i
			line += '\n'
			file.write(line)
		file.close()
예제 #49
0
 def save_plot(self):
     from easygui import filesavebox
     file_string=str(self.file_name.rstrip('.npy')+'.png')
     tmp = filesavebox(title = "Save to", default=file_string)
     if tmp:
         try:
             self._save_file = tmp + '.png'
             win_size = self.plot.outer_bounds
             plot_gc = PlotGraphicsContext(win_size)
             plot_gc.render_component(self.plot)
             plot_gc.save(self._save_file)
         except:
             print 'Saving failed'
예제 #50
0
파일: rftool.py 프로젝트: iceseismic/sito
 def save_data(self, file=None): #@ReservedAssignment
     if self.st == None:
         msgbox('No stream to save.')
         return
     if file == None:
         file = easygui.filesavebox(msg='Please omit file ending.', default=def_save_data) #@ReservedAssignment
     if file != None:
         try:
             if self.ui.check_save.isChecked():
                 self.st.write(file, 'Q')
             else:
                 self.st.select(expr='st.mark==False').write(file, 'Q')
         except:
             exceptionbox("Error while writing file!")
예제 #51
0
파일: rftool.py 프로젝트: iceseismic/sito
 def save_rf(self, file=None): #@ReservedAssignment
     if self.st3 == None:
         msgbox('No stream to save.')
         return
     if file == None:
         file = easygui.filesavebox(default=def_save_rf) #@ReservedAssignment
     if file != None:
         try:
             if self.ui.check_save.isChecked():
                 self.st3.write(file, 'Q')
             else:
                 self.st3.select(expr='st.mark==False').write(file, 'Q')
         except:
             exceptionbox("Error while saving file!")
예제 #52
0
 def open_formula():
     fformula_name = easygui.filesavebox(msg=None, title=None, default='', filetypes=None)
     fformula = open(fformula_name, "rt")
     i = 0
     formulas = {}
     for line in fformula:
         if "=" in line:
             formula = line
             formulas[formula] = []
         else:
             delim = line.find(":")
             var = line[0:delim]
             description = line[delim:]
             formulas[formula].append([var,description])
     return
예제 #53
0
파일: farmtool.py 프로젝트: iceseismic/sito
 def save_file(self):
     if self.files is None:
         from easygui import filesavebox
         file_ = filesavebox(msg='Please omit file ending. Include * in '
                                 'to write one file for each year!',
                                 default=paths)
     else:
         file_ = self.files
     if file_ is not None:
         if '*' in file_:
             file_ = file_.replace('*', '%s')
             self.st2.writex(file_, 'Q', years=False)
         else:
             self.st2.write(file_, 'Q')
         print('Data saved!')
예제 #54
0
파일: rftool.py 프로젝트: iceseismic/sito
 def calculate_more(self):
     file_load_list = []
     file_save_list = []
     if self.ui.edit_slice.text() != ':' and easygui.ynbox(msg="Maybe you want to change the slice setting to ':'?"):
         self.ui.edit_slice.setText(':')
     while True:
         file_load = easygui.fileopenbox(default='/home/richter/Data/Parkfield/receiver/M5.5_events/*.QHD', filetypes=['*.QHD', '*.*'])
         if file_load == None:
             break
         file_save = easygui.filesavebox(msg='Please omit file ending.', default='/home/richter/Data/Parkfield/receiver/*')
         if file_save == None:
             break
         file_load_list.append(file_load)
         file_save_list.append(file_save)
     for i in range(len(file_load_list)):
         self.open_data(file_load_list[i])
         self.save_rf(file_save_list[i])
예제 #55
0
def Choice_Backup_Live():
    rightnow = datetime.datetime.now()
    defaultfilename =  rightnow.strftime("%B")
    defaultfilename = defaultfilename[:3] 
    
    if easygui.ynbox('Online Backup?') == 1:
         ynonline = "online"
    else:
        ynonline = ""
    easygui.msgbox(msg='After selecting Source, Destination & Online please wait, this can take a while and you will see no progress bar.')
    PilotApp.Backup(
        easygui.fileopenbox(
            'Select database to backup',
            default=PilotApp.Settings['EpicorDBDir']+'\\'),
        easygui.filesavebox(
            'Filename to backup to',
            default=PilotApp.Settings['EpicorDBDir']+'\\'+ defaultfilename + 'live' + str(rightnow.day ) ),
        ynonline)
예제 #56
0
	def save(self,filename=None):
		self.timesort()
		if filename == None:
			filename=easygui.filesavebox(None,'Select file to save compressed sequence','L:/software/apparatus3/sequence/')
		f = open(filename,"w")
		f.write(self.__str__())
		f.close()
		#Get SaveDir and RunNumber to save a copy of expseq
		f=open('L:/data/app3/comms/SaveDir')
		savedir=f.readline()
		f.close
		f=open('L:/data/app3/comms/RunNumber')
		shotnum=f.readline()
		f.close
		expseq=savedir+'expseq'+shotnum+'.txt'
		f = open(expseq,"w")
		f.write(self.__str__())
		f.close()
	def save(self,saveas=False):
		success=False;
		
		filename=self['winname'];
		initialfile=filename;
		savepath=self['savepath'];
		filechosen=None;
		if savepath is not None:
			initialfile=os.path.join(savepath,initialfile);
			if not saveas:
				filechosen=initialfile;
		if filechosen==None:
			filechosen=easygui.filesavebox('Please choose a file to save','Disksaving...',initialfile);
		if filechosen!=None:
			self.save2disk(filechosen);
			self.wintitle();
			success=True;
		return success;	
def last_job():
    if do == "放弃保存":
        g.msgbox(msg = "感谢使用~",title = "文本阅读器",ok_button="拜拜~")
    elif do == "覆盖保存":
        try:
            now_file = open(my_file,"w")
            now_file.write(notpade)
            now_file.close()
        except TypeError:
            g.msgbox(msg = "您已取消覆盖,文件将不会改变。",title = "文本阅读器",ok_button="拜拜~")
    elif do == "另存为...":
        try:
            file_name = os.path.basename(my_file)
            p = g.filesavebox(title = "另存为",default=file_name+'_new.txt',filetypes = [["*.txt", "文本文件"]])
            other_file = open(p,"w")
            other_file.write(notpade)
            other_file.close()
        except TypeError:
            g.msgbox(msg = "您已取消另存为,文件将不会改变。",title = "文本阅读器",ok_button="拜拜~")
            
    else:
        None           
예제 #59
0
파일: Lab18.py 프로젝트: Jaren831/usafa
def exercise0():
    """Demonstrate writing a text file."""
    # TODO 0: Read, discuss, and understand the following code.

    # A familiar list of strings to test writing to a file.
    values = [ "Integrity First", "Service Before Self", "Excellence In All We Do" ]

    # Opening a file to write requires the second parameter, "w", to specify "write" mode.
    # For other modes, see https://docs.python.org/3.4/library/functions.html#open
    with open( "./data/Values_Write.txt", "w" ) as data_file:
        data_file.write( ", ".join( values ) )

    # Above, the data_file object's write() method was used. However, it can only
    # accept a single string parameter and does not automatically append a newline.
    # The print() function can be used with the file parameter, which then also
    # allows use of the print() function's sep and end parameters.
    with open( "./data/Values_Print.txt", "w" ) as data_file:
        print( ", ".join( values ), file=data_file )

    # The easygui.filesavebox (as opposed to fileopenbox) will give a warning
    # if the file selected for writing already exists.
    with open( easygui.filesavebox( default="./data/*.txt" ), "w" ) as data_file:
        print( "\n".join( values ), file=data_file )
	def exportascii(self):
		import os;
		datadict=self.getcurrentdatadict();
		datanamelist=self.getcurrentdatanamelist();
		datalist=self.getcurrentdatalist();
		fullnamechosen=easygui.filesavebox("Choose the filename","Exporting ascii",".asc");
		
		li=os.path.split(fullnamechosen);
		pname=li[0];
		fname=li[1];
		self.stdout( "Exporting...");
		for i in range(len(datalist)):
			data=datalist[i];
			dataname=datanamelist[i];
			fname=dataname+'_'+fname;
			fullnamechosen1=os.path.join(pname,fname);
			if isdatobj(data):
				data.exportascii(fullnamechosen,dataname);
			else:
				st=repr(data);
				f=open(fullnamechosen1,"w");
				f.write(st);
				f.close();
		self.stdout("Done.");