About 220,000 results
Open links in new tab
  1. user interface - Getting python to open a window - Stack Overflow

    May 24, 2015 · Python comes with Tkinter, and turtle (which is based on it); there are others like GObject and PySide (see Other Graphical User Interface Packages in the docs). Or you can use a lower-level library like PyGame (which doesn't handle widgets, just plain windows that you have to draw on manually).

  2. opening a main window in python - Stack Overflow

    May 27, 2015 · It should open a window of some sort, but nothing happens when i run it or press enter or whatever. what am i doing wrong or what did i forgot? import sys import tkinter def main(): root= tkinter.Tk() root.title('Reminder') root.resizable(width=False, height=False) tkinter.mainloop() if __name__ == '_ _main_ _': main() tkinter.mainloop()

  3. python - tkinter: Open a new window with a button prompt

    Dec 24, 2014 · The solution works in python 3.x. For python 2.x change the import to Tkinter rather than tkinter (the difference being the capitalization): import tkinter as tk #import Tkinter as tk # for python 2 def create_window(): window = tk.Toplevel(root) root = tk.Tk() b = tk.Button(root, text="Create new window", command=create_window) b.pack() root ...

  4. python - PyQT: how to open new window - Stack Overflow

    Apr 21, 2016 · I have a window which contains one button (Class First) and I want on pressed, a second blank window to be appeared (Class Second). I fiddled with the code copied from this question: PyQT on click open new window, and I wrote this code:

  5. Choosing a file in Python with simple Dialog - Stack Overflow

    Sep 12, 2017 · The suggested root.withdraw() (also here) hides the window instead of deleting it, and was causing problems when using interactive console in VS Code ("duplicate execution" error). Below two snippets to return the file path in "Open" or "Save As" (python 3 on Windows):

  6. How to keep a Python script output window open?

    Jun 16, 2009 · even better, use python %* and set it as one of the "open with" programs so you can either right click a .py file to open a pausing window or I also put it in my Anaconda3 folder (in PATH) as py_pause.bat so now I can run py_pause my-prog.py all my args from the cmd line –

  7. How to specify where a Tkinter window opens? - Stack Overflow

    Feb 16, 2013 · def center_window(size, window) : window_width = size[0] #Fetches the width you gave as arg. Alternatively window.winfo_width can be used if width is not to be fixed by you. window_height = size[1] #Fetches the height you gave as arg. Alternatively window.winfo_height can be used if height is not to be fixed by you.

  8. Obtain Active window using Python - Stack Overflow

    Apr 23, 2012 · I have updated my post with a benchmark to compare so that you can see for yourself. Perhaps you forgot that my code does two things (getting active window and then getting the title of that window), whereas that library only does 1 action at a time and you need to call two functions in it to achieve what my code does. –

  9. Quick and easy file dialog in Python? - Stack Overflow

    Feb 17, 2012 · Using tkinter (python 2) or Tkinter (python 3) it's indeed possible to display file open dialog (See other answers here). Please notice however that user interface of that dialog is outdated and does not corresponds to newer file open dialogs available in Windows 10.

  10. How to make a window with buttons in python - Stack Overflow

    The following code will create a window for you : import wx app = wx.App(False) # Create a new app, don't redirect stdout/stderr to a window. frame = wx.Frame(None, wx.ID_ANY, "Hello World") # A Frame is a top-level window. frame.Show(True) # Show the frame. app.MainLoop() Take a look at this section (how to create buttons).

Refresh