Monitor key presses in Python?

2013-09-09 Thread eamonnrea
Is there a way to detect if the user presses a key in Python that works on most 
OS's? I've only seen 1 method, and that only works in Python 2.6 and less.  If 
you get the key, can you store it in a variable?

Also, is there a way to create a callback in Python?
-- 
https://mail.python.org/mailman/listinfo/python-list


Python GUI?

2013-09-11 Thread eamonnrea
There are a few known GUI toolkits out there, and the main ones from what I can 
tell are:

Tkinter -- Simple to use, but limited
PyQT -- You have a GUI designer, so I'm not going to count that
PyGTK -- Gnome officially back this I think
wxPython -- Very nice, very professional, approved by Python creator, but alas 
hard to get started with

So, what are your personal preferences and why? Why use X over Y?

I, personally, really like wxPython, but I also really like Tkinter. I've 
messed with PyGTK, but I'd choose wxPython over it.

Have you got anything to say on what one I should be using(excluding PyQT 
because it has a D&D designer >:( )? Is Tkinter really dead? Should I stick 
with wxPython?

It's might be similar to the "What language to use" argument, or the "What 
background to code on" argument(I prefer darker backgrounds xD Please don't 
argue about this though!), in the sense that there is *no* answer, just 
preference.

Also, with wxPython, it has kind of a "flow" layout like JFrame, whereas it 
will adjust it's layout to look like a native Mac App, Windows app or Linux 
App, correct? It'll look almost identical, right? Not that it matters, I'm just 
curious! :D

Thanks!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python GUI?

2013-09-12 Thread eamonnrea
On Thursday, September 12, 2013 6:05:14 AM UTC+1, Michael Torrie wrote:
> On 09/11/2013 02:55 PM, [email protected] wrote:
> 
> > PyQT -- You have a GUI designer, so I'm not going to count that
> 
> 
> 
> What do you mean?  Gtk has a GUI designer too.  what of it?
> 
> 
> 
> > I, personally, really like wxPython, but I also really like Tkinter.
> 
> > I've messed with PyGTK, but I'd choose wxPython over it.
> 
> 
> 
> Not me.  wxWidgets' event model is way too MFC-esque for me.  Does it
> 
> still use event numbers that you define?  Shudder.
> 
> 
> 
> Gtk and Qt's method of signals and slots is by far the most powerful and
> 
> flexible.
> 
> 
> 
> > Have you got anything to say on what one I should be using(excluding
> 
> > PyQT because it has a D&D designer >:( )? Is Tkinter really dead?
> 
> > Should I stick with wxPython?
> 
> 
> 
> I still don't understand why you are excluding Qt.  All modern toolkits
> 
> are heading towards imperative GUI design.  With Gtk I use Glade and
> 
> GtkBuilder.  My GUI is in a nice XML file that gets loaded and
> 
> manipulated by my python class.  It's extremely clean.  And in the case
> 
> of compiled programming, you don't have to recompile just to tweak
> 
> something like a layout.
> 
> 
> 
> At the moment if someone were to come in from scratch and ask what GUI
> 
> toolkit to use, I would answer Qt with PySide.  It's the most
> 
> cross-platform of all the toolkits, and it's one of the most mature.
> 
> Gtk is also good, but Windows and Mac support is always lagging behind
> 
> X11, and it's not as good at fitting into the native look and feel.
> 
> 
> 
> > Also, with wxPython, it has kind of a "flow" layout like JFrame,
> 
> > whereas it will adjust it's layout to look like a native Mac App,
> 
> > Windows app or Linux App, correct? It'll look almost identical,
> 
> > right? Not that it matters, I'm just curious! :D
> 
> 
> 
> Possibly.  I know Qt and Gtk both can flip the button orders, etc to
> 
> look more native.  And all good toolkits give you layout managers so you
> 
> never have to resort to fixed layouts.  Qt's layout system is very
> 
> different than Gtk's, but once you get the feel of it (use the Qt
> 
> Designer program!), it makes a lot of sense.

I didn't realise GTK has a GUI designer too :(

I don't like it when you can D&D to position things. I don't understand why 
someone wouldn't want to write the positioning code, and have fun with the 
debugging. That's the best part about writing a program, in my opinion. I'm 
against D&D with programming, and I'm not sure why.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python GUI?

2013-09-13 Thread eamonnrea
I don't like the idea of being able to drag and drop anything in the 
programming world. Outside of that, I use D&D programs a lot. I got into GUI 
programming because I thought that I could get away from them, but I guess not.

Maybe I'm against them because if I can't code, I don't have anything else to 
do with my time. If I don't program, the only other thing I have to do is... 
well... nothing. So, because of this, they're making programming easier... by 
not coding as much. Oh well, guess coding is dead :(
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python GUI?

2013-09-13 Thread eamonnrea
On Friday, September 13, 2013 4:02:42 AM UTC+1, Michael Torrie wrote:
> On 09/12/2013 10:03 AM, [email protected] wrote:
>I think your hate of gui designers is about 10 years out of date now, 
> even if you still prefer not to use them.

So, you are recommending not to code as much? :'( That is what depresses me. 
These "tools" depress me!

I don't understand why people don't want to code. It's time consuming: But 
that's the point!!! It *should* be time consuming. It *should* take time to 
make programs. Speed isn't the main thing, fun is. And these "tools" are taking 
the fun away.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python GUI?

2013-09-13 Thread eamonnrea
I disagree with you. It's not hard, and I apologise if its ever sounded that 
way, but it is the fun part for me. I love spending hours(days even) debugging.

Well, thanks all for depressing me. Time to give up programming and find 
something else to do with my life.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python GUI?

2013-09-13 Thread eamonnrea
On Friday, September 13, 2013 8:56:15 PM UTC+1, Neil Cerutti wrote:
> On 2013-09-13, Joe Junior  wrote:
> 
> > On 13 September 2013 15:39, John Gordon  wrote:
> 
> >> In <[email protected]>
> 
> >> [email protected] writes:
> 
> >>> they're making programming easier... by not coding as much.
> 
> >>> Oh well, guess coding is dead :(
> 
> >>
> 
> >> Pressing keys on a keyboard was never the hard part of coding.
> 
> >
> 
> > Nor the fun part.
> 
> 
> 
> When John Henry was a little baby,
> 
> Sittin' on his daddy's knee,
> 
> He Telneted to the server with a tiny bit of code, and said:
> 
> Emacs will be the death of me, Lord, Lord!
> 
> Emacs will be the death of me.
> 
> 
> 
> Well John Henry said to the captain:
> 
> Go on and bring your toolkit round,
> 
> I'll pound out your GUI with a hundred thousand keystrokes,
> 
> And throw that GUI Builder down, Lord, Lord!
> 
> I'll throw that GUI Builder down.
> 
> 
> 
> Well John Henry hammered on his keyboard,
> 
> Till is fingers were bloody stumps,
> 
> And the very last words that were entered in his .blog were:
> 
> GUI Builders are for chumps, Lord, Lord!
> 
> Those GUI builders are for chumps.
> 
> 
> 
> -- 
> 
> Neil Cerutti

I don't fully understand the meaning of that, but that was a good poem!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python GUI?

2013-09-13 Thread eamonnrea
On Friday, September 13, 2013 8:50:13 PM UTC+1, Joe Junior wrote:
> On 13 September 2013 16:37,   wrote:
> 
> > I disagree with you. It's not hard, and I apologise if its ever sounded 
> > that way, but it is the fun part for me. I love spending hours(days even) 
> > debugging.
> 
> >
> 
> > Well, thanks all for depressing me. Time to give up programming and find 
> > something else to do with my life.
> 
> > --
> 
> > https://mail.python.org/mailman/listinfo/python-list
> 
> 
> 
> lol! You made my day. :-D
> 
> 
> 
> Well, you can always ignore any and all graphical design tools if
> 
> you're working alone. And write all those Xs and Ys and widths and
> 
> heights all day long. None of the mentioned graphical toolkits forces
> 
> you to use them.
> 
> 
> 
> And if you like debugging, GUI is not the main dish! Try networking
> 
> and concurrent programming, loads and loads of fun!
> 
> 
> 
> Of course, that's lots of other unnecessary time consuming stuff you
> 
> can do. You just have to use your imagination.
> 
> 
> 
> Joe

I was planning on getting into networking, but like I said, thanks to most 
people encouraging less coding, I don't code anymore. Glad I made your day 
though. :-) And "unnecessary time consuming stuff" -- That's my problem. Is 
*shouldn't* be unnecessary! It should be something that has to be done. That's 
what annoys me!!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python GUI?

2013-09-13 Thread eamonnrea
But is it efficient to use an axe? Is it sensible to use an axe when there is a 
chainsaw? No. Eventually, everyone will be using chainsaws, and no one will be 
using axes. This is my point: to have fun and be productive, but apparently 
it's not possible.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python GUI?

2013-09-14 Thread eamonnrea
On Saturday, September 14, 2013 2:23:03 AM UTC+1, Ben Finney wrote:
> [email protected] writes:
> 
> 
> 
> > But is it efficient to use an axe?
> 
> 
> 
> Which criterion is more important to *you* — fun, or efficiency?
> 
> 
> 
> > Is it sensible to use an axe when there is a chainsaw? No.
> 
> 
> 
> Which criterion is more important to *you* — fun, or sensibility?
> 
> 
> 
> > Eventually, everyone will be using chainsaws, and no one will be using
> 
> > axes.
> 
> 
> 
> Which criterion is more important to *you* — fun, or popularity?
> 
> 
> 
> > This is my point: to have fun and be productive, but apparently it's
> 
> > not possible.
> 
> 
> 
> Who has said that's not possible? If you find using a tool to be both
> 
> fun and productive, use it and be happy. If not, use something else.
> 
> 
> 
> -- 
> 
>  \   “They can not take away our self respect if we do not give it |
> 
>   `\to them.” —Mohandas Gandhi |
> 
> _o__)  |
> 
> Ben Finney

I hadn't thought of it that way! Thanks! :) I suppose it's like saying "Why use 
a MacBook when you could use X computer instead? Because I prefer Macs".

Also, this thread hasn't been a troll. I'm completely serious. Why is it when I 
ask things like this people think I'm trolling?? :(
-- 
https://mail.python.org/mailman/listinfo/python-list


Python + LÖVE?

2013-09-14 Thread eamonnrea
As you may know, there is a fantastic Lua game development engine called LÖVE. 
There is also a way to integrate Lua and Python. So, is it possible to use LÖVE 
and Python together?

Thanks!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Monitor key presses in Python?

2013-09-14 Thread eamonnrea
It might sound strange, but I'd need this to run without the user knowing.I 
believe I can do this by making the file a .pyw file, and use a GUI library to 
monitor the key presses. I think I could use PyGame, PyGlet and/or Cocos2d as 
well.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Monitor key presses in Python?

2013-09-14 Thread eamonnrea
I didnt wanna say that, in case people threw a fit and stuff.

So yeah, how would I monitor the key presses?
-- 
https://mail.python.org/mailman/listinfo/python-list