Hi All - Newby

A

Ask

G'day All,

Just thought I'd drop in and say hi. I'm new to Python, but old to software
development.

Python is one of the languages used in my new job, so I've just bought a
book, read it, and downloaded Python; It's pretty good isn't it? It's
particularly handy being able top run the same bytecode on different
platforms.

I found a link to this newsgroup, downloaded 1000 messages, and have only
put one user in my twit filter so hopefully it'll be a good resource!

I must admit to much confusion regarding some of the basics, but I'm sure
time, reading, and good advice will get rid of that. at this stage, it's
just working through some examples and getting my head around things. As an
example, if I create a window, I've been unable to force it to be a certain
size, and put a button (widget) at (say) 20,40 (x & y). Is window formatting
possible?

Thanks and I'm sure to be reading your posts soon.

Pauly
 
B

bruno modulix

Ask said:
G'day All,
(snip)

Welcome here...
I must admit to much confusion regarding some of the basics, but I'm sure
time, reading, and good advice will get rid of that. at this stage, it's
just working through some examples and getting my head around things. As an
example, if I create a window, I've been unable to force it to be a certain
size, and put a button (widget) at (say) 20,40 (x & y). Is window formatting
possible?

As you say, Python runs on a lot of platforms. It also allow the use of
a lot of GUI toolkits. So "windows formatting" isn't a Python problem -
it's specific to to toolkit you're using. Since we don't know which
you're using, there's no way to answer your question.
 
F

Fredrik Lundh

Ask said:
As an example, if I create a window, I've been unable to force it to be a certain size, and put a
button (widget) at (say) 20,40 (x & y). Is window formatting possible?

I'm pretty sure all GUI toolkits can do that, but the exact details depend on the library
you're using.

(if you're using Tkinter, see this page: http://effbot.org/tkinterbook/place.htm )

</F>
 
A

Ask

Hi Bruno,

I'm simply using the IDLE editor to hand code, then compiling and running.

Thanks
Pauly
 
M

Michael Tobis

confusion regarding some of the basics...

Reset your brain.

This came up recently, and despite there being a pending quibble, I
think it's extremely useful to the experienced programmer/new
Pythonista:

http://effbot.org/zone/python-objects.htm

And since Frederik is apparenlty reading this thread, it gives me an
opportunity to say thanks for it!

mt
 
D

D H

Ask said:
I found a link to this newsgroup, downloaded 1000 messages,

You might check out the python-tutor list if you have beginner
questions: http://mail.python.org/mailman/listinfo/tutor

I must admit to much confusion regarding some of the basics, but I'm sure
time, reading, and good advice will get rid of that. at this stage, it's
just working through some examples and getting my head around things. As an
example, if I create a window, I've been unable to force it to be a certain
size, and put a button (widget) at (say) 20,40 (x & y). Is window formatting
possible?

You might also see wxpython: http://www.wxpython.org/ The "wiki" there
has some examples and beginner resources.
 
T

Tim Roberts

Ask said:
I'm simply using the IDLE editor to hand code, then compiling and running.

That doesn't help. wxPython, Tkinter, and pyQt are just a few of the
packages that can be used to put windows on the screen from Python. Python
has no built-in user interface stuff, so whatever you are using to place a
window is something you downloaded, or something that was installed with
your Python. That's what we need to find out.
 
A

Ask

Hi TIm,

Ahh I see.. (Told you I was a newby!) ;-)

Tkinter is what I'm using as that was loaded by default with the
installation of Python I am using.

Thanks

Regards
Pauly
 
T

Tim Roberts

Ask said:
Hi TIm,

Ahh I see.. (Told you I was a newby!) ;-)

Tkinter is what I'm using as that was loaded by default with the
installation of Python I am using.

Now your question makes good sense, especially if you were coming from
something like the Win32 API.

In Tkinter, as in MOST of the GUI toolkits for Python, you dont just place
a widget at a specific X,Y with a specific width and height. The problems
with that kind of approach are well known; such layouts don't scale with
different fonts, they look bad when the owning window is stretched, they
don't compensate for screen sizes, etc.

The various toolkits have different methods for managing this. In Tk, the
concept is called a "geometry manager". You use a geometry manager to
define the RELATIONSHIP between widgets, and between the widgets and the
owning window. The geometry manager, then, worries about the exact
placement and size.

Googling for "tkinter geometry manager" should prove fruitful. Here is an
excellent introduction:

http://effbot.org/zone/tkinter-geometry.htm

There is a fabulous book called "Python and Tkinter Programming" by John
Grayson, ISBN 1884777813. If you will be getting serious with Tkinter, I
strongly recommend it.

Personally, I started with Tkinter, but I couldn't wrap my brain around the
details. I switched to wxPython, and never looked back.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,183
Messages
2,570,965
Members
47,512
Latest member
FinleyNick

Latest Threads

Top