Questions tagged [filedialog]

Refers to both OpenFileDialog and SaveFileDialog in .NET WinForms.

This tag represents both the OpenFileDialog class and SafeFileDialog class from .NET. More information about them on MSDN here and here respectively.

358 questions
0
votes
0 answers

Save An Array numpy to a `.csv` file using filedialog

i Have an array of (200rows x 4 columns) and i want to save it into a .csv file i used the function savetxt() np.savetxt("myfile.csv", np.column_stack([time_axis[::1], outputdataEz[::1], outputdataHx[::1], outputdataHy[::1]]), delimiter=', ', fmt…
0
votes
0 answers

FileDialog automatically selects old selected file

I am using Java Swing to show a FileDialog on Mac OS X when user clicks button 1, to select a PDF file as shown below: After clicking "Open" the PDF is loaded fine. Then i click button 2 to show another FileDialog to select and load a text file.…
Brad
  • 4,457
  • 10
  • 56
  • 93
0
votes
1 answer

What is the difference between asksaveasfile and asksaveasfilename in tkinter filedialog?

What is the difference between asksaveasfile and asksaveasfilename in tkinter filedialog ? import tkinter as tk from tkinter import ttk from tkinter import messagebox as mbox from tkinter import filedialog as fd import os win=tk.Tk() def…
Abhimanyu Sharma
  • 858
  • 1
  • 9
  • 17
0
votes
2 answers

Is there a way to automatically add a filename extension when using the pandas df.to_csv?

I know how to use 'defaultextension' and 'filetypes', as follows: self.filetypes = (('CSV files', '*.csv'), ('CSV files', '*.csv')) self.result_file = fd.asksaveasfile(filetypes = self.filetypes, defaultextension = 'csv') I can simply add the…
vegebond
  • 197
  • 1
  • 2
  • 6
0
votes
0 answers

Upload an image to a folder in python

Does anybody know how to upload an image (using filedialog.askopenfile) and then storing the uploaded image to an existing folder on my computer?! All the examples available on the internet require image paths, and i get an error whenever i provide…
Sam
  • 11
  • 2
0
votes
0 answers

Is there a solution to return the selected file type (not only the file list) from askopenfilenames in Tkinter?

Python (Tkinter) filedialog.askopenfilenames dialog window returns only a tuple of selected files by default. However, for parsing different files I would need which file case was selected by the user. For example, the user can select from the…
SwitchOFF
  • 11
  • 2
0
votes
2 answers

Is there a way to get the FileDialog to open up a remote computer folder using the.InitialFileName property

I'm testing out a user app that they will be accessing remotely. There is file dialog functionality that I've included using the FileDialog object. I'd like for them to initially open up their own local files using the property .InitialFileName,…
Pflipper
  • 88
  • 6
0
votes
2 answers

Merge Two Files once importing them by filedialog and copy the result to another workbook

Dears: i have an issue with below code as i need to Merge Two Files once importing them by filedialog then copy the result direclty to another workbook the below cope is working but suddnly it copies only data of the first file which its file size…
0
votes
0 answers

VBA auto executes full code even in Step Into (Debug ode) after FileDialog folder selection step

I am creating a macro to create invoices from a template and filling the details with data table. UPDATE: I have found the issue. The code is not the problem. I was trying the code in step into mode every time and excel was executing the whole code…
Achal Desai
  • 93
  • 1
  • 8
0
votes
0 answers

How to get a user's username and use it with filedialog.askdirectory?

I would like python to find the current user's username and then implement it into the following line of code. I have used multiple suggestions given on here but they don't seem to work, the only thing that works is when I manually enter the…
TJ44
  • 3
  • 3
0
votes
1 answer

Using filedialog.askdirectory() with tkinter and pyglet freezes the application

I've been trying to create my own GUI mp3 player with pyglet module and i'm running into an error when clicking the 'd' button (dir_btn) as the entire GUI application freezes and furthermore, the IDE (pycharm) does not show any error here's the…
0
votes
2 answers

FileDialog hanging on Mac OS in JFX Application

So far, I've tried to run this on a fresh Mojave, and my main Catalina installation with the same hanging results. The code snippet to open FileDialog runs fine independently in a separate project, but if I create another class in the same package…
0
votes
2 answers

How do you prevent I/O 6 when canceling a filedialog in delphi

In my program I have an openfiledialogue and a savefiledialogue. Whenever I press cancel in these dialogue I get an I/O error 6. How do I remove this error? procedure TForm1.Open1Click(Sender: TObject); var s: string; // Declares a file type…
0
votes
1 answer

Save file with a specific name using tk filedialog

Is there a way to save a DataFrame into an excel file with filedialog but, using a specific name as 'my_file' for example? I usually use this code path_to_save = filedialog.asksaveasfilename(defaultextension='.xlsx') df.to_excel(path_to_save,…
Isa
  • 145
  • 8
0
votes
1 answer

Excel VBA Path error when inserting picture with file dialog

I have a problem with the following code. Basically it works as intended. This used to work correctly, but recently I had a problem with the save path of the image. If I insert a photo, everything works. But if the photo is changed in the storage…
Tisire
  • 37
  • 7