By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,050 Members | 1,019 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,050 IT Pros & Developers. It's quick & easy.

Hi All - Newby

P: n/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

Oct 25 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Ask wrote:
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.

--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'o****@xiludom.gro'.split('@')])"
Oct 25 '05 #2

P: n/a
"Ask" wrote:
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>

Oct 25 '05 #3

P: n/a
Ask
Hi Bruno,

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

Thanks
Pauly
"bruno modulix" <on***@xiludom.gro> wrote in message
news:43*********************@news.free.fr...
Ask wrote:
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.

--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'on***@xiludom.gro'.split('@')])"

Oct 25 '05 #4

P: n/a
> 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

Oct 26 '05 #5

P: n/a
D H
Ask wrote:

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.
Oct 27 '05 #6

P: n/a
"Ask" <pu@pmville.com> wrote:

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.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Oct 27 '05 #7

P: n/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

"Tim Roberts" <ti**@probo.com> wrote in message
news:5n********************************@4ax.com...
"Ask" <pu@pmville.com> wrote:

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.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.

Oct 27 '05 #8

P: n/a
"Ask" <pu@pmville.com> wrote:

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.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Oct 29 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.