About 14,900,000 results
Open links in new tab
  1. Resize display resolution using python with cross platform support

    Jan 8, 2014 · You can do a crude platform check with sys.platform (docs: http://docs.python.org/2/library/sys.html#sys.platform). This returns 'darwin' on MacOS. The bit architecture should be accessible with the Python platform module.

  2. Changing Screen Resolution of Computer using python

    Jan 18, 2019 · I had a look how to change screen resolution using C++ and then translated it to Python: import win32api import win32con import pywintypes devmode = pywintypes.DEVMODEType() devmode.PelsWidth = 1366 devmode.PelsHeight = 768 devmode.Fields = win32con.DM_PELSWIDTH | win32con.DM_PELSHEIGHT win32api.ChangeDisplaySettings(devmode, 0)

  3. Change your Display Resolution with Python from your Task Bar - YouTube

    This video will show you how to change your display resolution using Python and the pywin32 package. Additionally, you will learn how to create a Python app ...

  4. Change Windows 10/11 Display Resolution with a Python

    Jan 7, 2022 · The Python code for changing the Windows display resolution can now be found in the function on_set_resolution(width, height) and is called via a lambda function from the menu items in lines 30 and 31.

  5. screen - How do I get monitor resolution in Python? - Stack Overflow

    Jun 28, 2010 · import pygame pygame.init() infos = pygame.display.Info() screen_size = (infos.current_w, infos.current_h) However, if you're trying to set your window to the size of the screen, you might just want to do: pygame.display.set_mode((0,0),pygame.FULLSCREEN) to set your display to fullscreen mode.

  6. How to change Windows settings in Python? : r/learnpython

    Oct 19, 2019 · Googling for "python windows change screen resolution" gives a Stack Overflow answer as the top hit. Seems it can be done with the usual win32api library, but the script in the accepted answer is quite large.

  7. Python – Output Formatting - GeeksforGeeks

    Dec 16, 2024 · Python’s string methods such as str.center(), str.ljust() and str.rjust() provide straightforward ways to format strings by aligning them within a specified width. These methods are ideal for organizing textual data neatly in output without using more complex formatting tools.

  8. How to Set and Manage Window Size in Python Tkinter? - Python

    Feb 7, 2025 · When designing a Tkinter application, it’s important to consider different screen resolutions to ensure a consistent user experience. You can use the winfo_screenwidth and winfo_screenheight methods to retrieve the screen dimensions and adjust your window size accordingly. Here’s an example:

  9. Layout changes on a different screen resolution problem

    Jun 24, 2024 · My guess is that you want to set them depending on the desktop size, which you can get from tkinter. winfo_screenwidth and winfo_screenheigth are methods on widget which return those: …,where f1 is a created widget. Where you may have trouble is that not every screen has the same size ratios.

  10. An Essential Guide to Tkinter Window - Python Tutorial

    First, get the screen width and height using the winfo_screenwidth() and winfo_screenheight() methods. Second, calculate the center coordinate based on the screen and window’s width and height. Finally, set the geometry for the main window using the geometry() method.

Refresh