I have two questions about pygame and python:
One: It is using pygame in fullscreen mode and I was wondering how I can get other windows (google chrome, Safari, Mail, Thunderbird, Itunes) to go on top of the already fullscreen window. Two: Can I make Python install all the modules that the custom desktop will need without the user having to go and install them all themselves
Just make a borderless screen that is the size of your desktop excluding the start menu etc. For the second question, just compile so the user doesn't need python. I have done this quite easily with py2exe, assuming you are running windows, I have heard py2app is good for mac, py2exe cant really be used easily on linux but with wine its programs seem to run fine.
Related
I have just installed IntelliJ 9.0.2 on a machine running 64-bit Ubuntu 10.04.
How do I get another window to put on my second screen?
I would like to have both an editor and some tool windows on both screens.
All 'windows' inside of IntelliJ other than the code editor tabs have a "Float" option which pops open an independent window which you can drag to anywhere on your screen. This will allow you to manage your IDEA windows however you like.
IntelliJ also allow you to open multiple projects at once. When opening a project with one already opened, you are prompted as to wether you would like it in your current window or a "New Instance". If you choose new instance, it will open up a completely new IntelliJ with the other project in it. This will work for you if you have many projects you work on at once.
IntelliJ 14 and onwards you can select the settings cog and tick floating mode to detach menus, or drag editor tabs off the main window to detach them
If you're running on OSX you'll need to make sure it's not treating the screens as separate spaces, otherwise they'll snap back onto the same window as the main editor when switching between windows.
To do this untick Displays have separate Spaces in the Mission Control System Preferences.
IntelliJ 10 will have draggable & dockable editor tabs. A very nice feature. It's already present in the early access versions.
I've recently written a shell script which boots my Windows Python application with wine:
#!/bin/sh
wine data/Python/x86/python.exe loader.py 'x86'
While the program is running, everything works as expected. The problem is, when the SDL window is displayed, my second monitor is disabled, and the orientation of my primary monitor changes. The resolution of my primary monitor stays the same. My question is, what can I do to disable these changes?
Installing a Linux Python interpreter is out of the question, because the solution:
1: needs to be portable
2: would currently oversize download
EDIT:
some extra info, I just recently ran it with a terminal and got:
fixme:win:EnumDisplayDevicesW ((null),0,0x42f3ec,0x00000000), stub!
fixme:win:EnumDisplayDevicesW ((null),0,0x42f46c,0x00000000), stub!
fixme:wgl:X11DRV_wglChoosePixelFormatARB unused pfAttribFList
not sure if this solves anything though
If you run winecfg you can set it to run all applications in a window. From http://ubuntuforums.org/showthread.php?t=693292
Applications --> Wine --> Configure Wine or just run winecfg from the
terminal
Click on the Graphics tab Check the "Emulate Virtual Desktop" box And
enter in the virtual Desktop size (like 800x600 or something).
It sounds like your pygame application is setting a resolution and switching to fullscreen. If you could disable fullscreen in the pygame app, this would probably also work.
Well, I've used it long enough to verify this was the case.
I'd not even used linux for a month before posting this question.
The issue happened because of Wine version 1.6 incompatibilities.
The solution is to update Wine.
I'm quite new to linux, raspberry, tkinter and python and therefore I need some guidance to get on the right track.
I'm running Arch Linux on a raspberry pi and I want a quite fast loaded gui for my project. I have decided to go with tkinter. I have installed xorg and some other needed xorg packages, and when I run "startx" I get three windows and a litte clock with some green/blue colored borders and i can move the widows with drag and drop. If I run my tkinter py-file from any window it works just fine.
I came over the "xinit" command and this loads a little faster and just gives me one window without borders. This actually suits me better since my "base window" will work as some kind of desktop and from here I will pop up other windows. Since there's no borders or title bars on the windows, they are not moveable. Is there any way to achieve this? That is, I want just some windows to have a border and a title bar.
And; how can I run the tkinter py-file automatically when I run the xinit/startx? I have tried the other approach by run the xinit/startx in the pyfile, but this does not work. I guess this will be called as some kind of sub command in another thread, or something? Any suggestions how I do this?
I've written a Python utility that uses tkinter. I'm running it on a Macintosh. When it is executed, it runs within an apple-supplied Python launcher program (/Library/Frameworks/Python.framework/Versions/3.2/Resources/Python.app).
My code installs its own menus and I bind to the usual Macintosh command-key equivalents for my edit menu (Command-x, command-c, command-x, command-a, command-z) and for quitting (command-q). My problem is that the Python launcher program is responding to the command key bindings. This is inconvenient for things like pasting because it gets done twice. It's a real problem with quitting because the launcher program kills my program before I can save changed files.
Is there some way I can stop the Python launcher program from acting on command key equivalents? I attempted this: "rootWindow.unbind ('<Command-Key-q>')", but to no avail. The launcher program quits before my code can clean up.
I'm using CPython 3.2 on OS X 10.6.6.
Instead of overriding Tkinter's default key bindings, consider re-mapping Tcl's "exit" command to a custom function. (This is called every time you hit command-q or use the "quit" menu item.)
def save_and_exit():
save_changed_files()
sys.exit()
self.createcommand('exit', save_and_exit)
Besides that, I would recommend removing your copy/paste custom keybinds and letting the library do the work for you. If you're still hell-bent on overriding the defaults, Effbot has a nice tutorial on Tkinter events and bindings.
Is there a specific reason why you are using Python.app for launching? This .app is most likely the reason for misbehaving shortcuts.
If I have understood correctly, this launcher is just a wrapper for default python (/usr/bin/python) with special imports.
If you run from terminal (-v is the key here):
/Library/Frameworks/Python.framework/Versions/5.1.1/Resources/Python.app/Contents/MacOS/Python -v
You will see what it imports at the beginning. Adding these lines to your main file should make the command line launching the same as with the .app.
Note also that python.app is in version 5.1.1.
br,
Juha
First off, /Library/Frameworks/Python.framework/Versions/3.2/Resources/Python.app is not Apple-supplied. Most likely you installed Python 3.2 using one of the python.org installers here or from some third-party distributor or possibly you built a framework version from source. In any case, Python.app is a dummy application bundle included in each framework version. Its purpose is to ensure that when you invoke python, even from a command line, it is seen by OS X as a full-fledged GUI application. This is particularly important when using tkinter. The default menus and keybindings you see are supplied by Tcl/Tk, not tkinter. As you've discovered, the right way to go about changing these are to remap the default menus. Be aware that there are currently at least three major variants of Tk available on Mac OS X: Aqua Carbon Tk, Aqua Cocoa Tk, and X11 Tk. There are important details, especially with regards to Mac OS X 10.6, about Python and Tcl/Tk on Mac OS X at the python.org website.
I have a Python program (GUI application). I can run this program from the command prompt on Windows (command line on Linux). But it can be too complicated for users. Is there an easy way to initiate a start of the program with a click (double click) on a pictogram (a small image on the desktop)?
Linux:
I am not sure, which linux distro and desktop you use but for gnome I create such files on desktop e.. create a myapp.desktop and put in on desktop
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=MyApp
Type=Application
Exec=python /home/anushri/display.anurag/xxx.py
TryExec=
Icon=/usr/share/pixmaps/gnome-qeye.png
X-GNOME-DocPath=
Terminal=false
Name[en_IN]=MyApp
GenericName[en_IN]=MyApp
Comment[en_IN]=MyApp
GenericName=MyApp
Comment=MyApp
Windows:
Right-click an open area on the desktop, point to New, and then click Shortcut, type the command line to start you program, Type a name for the shortcut
I'm not sure if I understood the question well, but if you just need a way to simulate a command line input with a simply clickable icon, just create a simple .bat file (assuming windows) on the desktop, as a new text file containing something like
C:\[Pythonpath]\python C:\[MyPythonAppPath]\myapp.py
See http://en.wikipedia.org/wiki/Batch_file for more info.
Use py2exe to make an exe and just to make it more 'user friendly' use Inno set up (www.jrsoftware.org/isinfo.php ) along with IStools to build up an installer which would integrate the GUI with sound, widgets, other elements etc and users who do not have python etc installed in their systems can also play your GUI perfectly fine !
By the way what GUI are you using ? pygame, tk, wx, PyQt ...etc ?
What I've done in the past is use py2exe to create an executable from my python script. That embeds the interpreter and the source inside an EXE, that way it works just like a native executable and you don't have to have the users install python or anything complicated.