I searched for this online but couldn't find any answer related to my problem.
My idea is to create a Python GUI with tkinter which could read text files from dragging from the desktop or a folder to the GUI itself, like for example on facebook (PC) you can drag images or text files to a chat and it processes it as a file.
Is there any way I could know what is my mouse dragging or clicking (outside the GUI) so I could save it on a variable? Or a library which has already that functionality?
Related
Now I want to design a simple game by using python, the step I want to do is to add an icon on the left of the window.
However, when I type
game_window.iconbitmap('favicon.ico')
game_window.mainloop()
the system just tell me Document Drag Error.
I am sure I save favicon and the both in the desktop and both of the path is correct.
I search this question in the internet but all of them are using window os.
If your icon is in the same folder as your file, the script will surely work...
I think that you're getting the error because you didn't save the file you're working on for the first time.
Try the following:
Save your file in the same folder another time (if you've already done it).
If it doesn't work, then write the full path of the icon
I have an window application that install in pc, I wish to used Python code to auto click on a icon after the application open. Below is my application look:
from this case I wish to used code to look for the Excel Icon and auto click it, the purpose of this icon is download the data.
I cannot used webdriver function because this is not the web application and this application don't have any coding behind, that mean when i run on Sample.exe it will direct pop up this window as the picture shown here.
Anyone have any idea on this?
import pyautogui
while True:
iconX, iconY = pyautogui.locateCenterOnScreen('icon.png')
pyautogui.doubleClick(iconX, iconY)
There are many different types of modules that you can use in order to achieve this but the one i would recommend is python auto GUI. This allows for screen searches and control over peripherals such as a mouse and keyboard. The code is relatively simple and is very basic. You can install it using the pip function using pip install pyautogui.
The code to achieve something like you say is one of the first things you will be able to do and if you need further help then feel free to ask but for convenience I will drop a website with the following functions.
https://pypi.org/project/PyAutoGUI/
I shall provide a demo code above.
Since upgrading to Windows 8.1 from Windows 8 I've noticed the colour of the tiles looks awful, is there a way to change these that is...
Free
Doesn't involve hacking around with registry/XML files
As you can see below my GIT icons are barely visible :(
I don't have a non XML Solution, but the XML solution is quite easy to follow and could easily be converted into a tool.
For example to change the background of the GIT Bash tile:
the shorcut of the tile links to something like: "C:\Program Files (x86)\Git\bin\sh.exe" --login -i (to find the shortcut: right click -> goto location)
Go to the folder of the executable (here C:\Program Files (x86)\Git\bin)
Create a sh.visualelementsmanifest.xml with the content:
<Application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<VisualElements
BackgroundColor="maroon"
ShowNameOnSquare150x150Logo="on"
ForegroundText="light"/>
</Application>
(full spec at http://msdn.microsoft.com/en-us/library/windows/apps/dn393983.aspx)
Update the shorcut file time stamp (e.g. copy file, delete old file)
Enjoy new tile. For example:
In reference to Xyroid's answer which has - so far - received no points, maybe this is because the link has changed / gone.
OblyTile, for those who want a GUI to manage Tile design, works perfectly on my Windows 8.1
The link to this is:
http://forum.xda-developers.com/showthread.php?t=1899865
In particular, the developer has provided much improved icons for some internal windows apps (e.g. Control Panel) where the standard tile doesn't really match the design of the other Modern App tiles.
(I would have just added a comment, but I still need more reputation)!
According to Desktop App Tiles on the Start Screen, the background color of desktop app's Start menu tile is derived from the user's chosen background color, so try changing Start menu's background color.
Also checkout
How to customize tiles (change/bigger icon, change color) for desktop applications in the Start Screen?
How to Create Custom Windows 8 Tile Icons for Any Desktop Program
I am wondering if it is possible to create two windows in two different .py files where the first window will be some settings about the game, and the second the game with the setting, set by the user in the first window.
The first screen, it would be something easy, like 3 texts where the user can choose with the arrows. And when one of the three texts pressed, the game will be load on the screen.
Thanks
I think you want to create a window where a user can choose the resolution, or other settings, with a play button.
I would recommend Tkinter for the job.
Here you will find some tutorials about it.
You should then link a button with launching of the game itself.
EDIT:
Since you want to use pygame, this is still possible. Just have 2 seperate pygame scripts, and launch the second script after a MOUSE_DOWN event on one of the texts.
If by two windows you mean two separate windows, then no, PyGame can't do that yet.
This feature was only just added in SDL2, and I hardly think PyGame is using SDL2 yet.
If you want to use SDL2 with Python, then have a look at PySDL2: http://pysdl2.readthedocs.org/en/latest/tutorial/pygamers.html
It is suggested that you can fake it using multiprocessing: Creating multiple screens in pygame
If you want two different applications (a launcher and the game), then that shouldn't be much trouble. Just treat them as two separate PyGame applications.
I'm trying to automate Skype on Ubuntu using LDTP which has a GUI that is written with Qt. LDTP requires that I know the names of the frames I'm interacting with and their objects. I don't have the Skype source code, but I was hoping there was some tool that might exist for extracting information about a Qt window or that it might at least confirm for me that automation is impossible for the window I'm trying to play with.
The reason I think this exists in the first place is that AutoIT had a similar application on Windows.
To find out if a window is able to be automated using LDTP, you can use the getapplist() and getwindowlist() functions as shown in the tutorial which can be found under doc on the github. To list the objects of this window, you can use getobjectlist().