Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Hide/Show a Program /w Macro~Python

Name: Shira 2009-05-02 15:33

Ok, so I'm learning Python as my first language. I know the basic syntax and everything by this point, so I've moved onto some more advanced things. The problem is for the program I'm writing now, I want the main application window to Hide/Show by a hot key. How would I go about doing this in Python?

I'm trying to make this App cross platform, as I plan on using it on my Windows and my Linux boxes. (It's cool if I need to use C/C++ or whatever else to accomplish this, since Python should allow me to use other languages in the script.)

I've toyed with the idea of making a Daemon to run constantly looking for the key combo, but that seems largely pointless and near impossible to do with Python.

ALSO: nb4 SICP

Name: Anonymous 2009-05-02 15:47

Go away, tard.

Name: Anonymous 2009-05-02 16:07

HOT KEYS ARE PIG DISGUSTING

Name: Anonymous 2009-05-02 16:39

Well first of all, what GUI toolkit are you using?

Name: Anonymous 2009-05-02 16:48

>>1
hide/show by a hotkey
Let the user minimize it with whatever hotkey their window manager includes.

It's cool if I need to use C++
No, it's not.

Name: Anonymous 2009-05-02 16:52

>>4
wxGlade, but I'm not sure I see why it matters.

Name: Shira 2009-05-02 16:53

>>4
wxGlade, but I'm not sure I see why it matters.

Name: Shira 2009-05-02 16:54

>>6
>>7
ok that was weird...

Name: Anonymous 2009-05-02 17:03

Name: Anonymous 2009-05-02 17:37

Name: Shira 2009-05-02 17:38

>>9
All I'm getting from this is to use C instead of Python, and run the Python script inside it. I would rather just use Python as the entirety if possible. all the WM hooks are written for one OS or the other, nothing cross platform. Is there anyway I can make the program monitor the keyboard for the hotkey, with out having to limit it to hooking on only one OS ?

Name: Anonymous 2009-05-02 19:11

>>11
No, you're not listening. Don't do your stupid hotkey monitoring, because it's not your place. Let users use the system facilities for minimizing or restoring the window.

There should be some kind of law against writing programs before you learn to factor properly.

Name: Anonymous 2009-05-02 19:49

>>12
Perhaps you should re-read my original post. I'm asking how to do global hotkey monitoring in Python. To be quite honest, I'm not interested in hearing your philosophy about why hotkey monitoring is a Bad Thing(tm), I'm interested only in results.

Name: Shira 2009-05-02 19:57

>>12
Further more, the program I'm trying to build is similar to the app launcher Launchy if you have ever heard of it and or used it. I want it to be able to come up by a hotkey and allow the user to interact, and then hide its self when the same hotkey is pressed.
Would it be easier to think of it as a Terminal emulator, with a Hide Show feature, because more or less that's what it will be in the end. I'm aware that I'm reinventing the wheel, but I would like to build one in Python.

Name: Shira 2009-05-02 20:02

>>12
If it helps your view of hotkeys being evil for taking control from the user, the end result will include a settings menu to allow the user to choose the hotkey for the program.

Name: Anonymous 2009-05-02 20:20

>>13
I'm interested only in results.
Perhaps the same could be said of the torture business.

Name: Anonymous 2009-05-02 20:43

I'm not interested in hearing your philosophy about why hotkey monitoring is a Bad Thing(tm)
Guido would not be amused

Name: Anonymous 2009-05-02 20:46

Fuck you ma¹»°³"I¤JOEIWJW"#CONNECTION LOST

Name: Anonymous 2009-05-02 20:50

>>16
The only result of torture is a tortured victim. The victim will tell anything to cease the torture and that information coming from the victim is usually complete fiction.

Name: Anonymous 2009-05-02 20:52

>>19
[citation needed]

Name: Anonymous 2009-05-02 20:58

Name: Anonymous 2009-05-02 21:33

Name: Anonymous 2009-05-02 22:31

>>16
>>17
>>18
>>19
>>20
>>21
>>22
Not Helpful.

Name: Anonymous 2009-05-02 23:02

>>1,7,8,11,13-15
Not Helpful.

>>23
Sagefault detected.

Name: Anonymous 2009-05-02 23:06

use the cpp function.  make sure gcc is installed though.


cpp('''
#include <iostream>

using namespace std;

int main(){
    cout << "HELLO WORLD" << endl;
    return 0;
}
''')





Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Owner>cd Desktop

C:\Documents and Settings\Owner\Desktop>cpptest.py
HELLO WORLD

Name: Anonymous 2009-05-03 0:36

>>19
You shouldn't assume that torture is only used to get information.

>>13
Oh, what a shock! You're telling me that you do want to do what you said you wanted to do? Somehow, that doesn't make it a better idea. Just make an AutoHotkey script or something.

Name: Anonymous 2009-05-03 2:07

>>25
Using Python to execute Sepples code
6/10

Name: Anonymous 2009-05-03 14:22

>>27
Looks like YHBT, there is no cpp function in FIOC.

Name: Anonymous 2009-05-03 16:27

>>28
YHBMT

Name: sage 2009-05-03 16:27

>>29sage
ssagesagesage asage

Name: Anonymous 2009-05-03 16:52

>>1
nb4 SICP
Damn, I thought /prog/ was smart enough to not be fooled by this trick.

Anyway, READ SICP

Name: Anonymous 2009-05-03 18:13

>>31
YHBTAMTC

Don't change these.
Name: Email:
Entire Thread Thread List