Font size

A

Adam

Please help me.
How do you clear the screen and then display a number with an enlarged font
size (about 300).
Adam.
 
B

BOOGIEMAN

Please help me.
How do you clear the screen and then display a number with an enlarged font
size (about 300).
Adam.

To clear screen in windows :

#at the beggining of the program
import os

#when you want to clear the screen
os.system("cls")
 
A

Adam

BOOGIEMAN said:
To clear screen in windows :

#at the beggining of the program
import os

#when you want to clear the screen
os.system("cls")

Thanks
I'll try that.
Adam.
 
A

Adam

Adam said:
Thanks
I'll try that.
Adam.
Unfortunately that didn't work.
Here's what I'm trying to do.
We are running a numbers game at our retirement village and using a roulette
wheel to generate the numbers. but this wheel is only about 12 in diameter
and is little more than a toy. So we came up with the idea of using a random
number generator to generate numbers from 0 to 36 and display them in large
figures on my laptop. This is for the benefit of those people who are hard
of hearing. They like to see what is happening.
I was an RPG programmer before retirement but am new to Python. So I used
the following code to generate the numbers but I don't know how to display
them in large figures (about 3 ins high) or get rid of the idle text.

from random import randint
rand = randint(0,36)
print rand

my os = XP
Can you help?
Adam.
 
J

Jeff Shannon

Adam said:
Here's what I'm trying to do.
We are running a numbers game at our retirement village and using a roulette
wheel to generate the numbers. but this wheel is only about 12 in diameter
and is little more than a toy. So we came up with the idea of using a random
number generator to generate numbers from 0 to 36 and display them in large
figures on my laptop. This is for the benefit of those people who are hard
of hearing. They like to see what is happening.
I was an RPG programmer before retirement but am new to Python. So I used
the following code to generate the numbers but I don't know how to display
them in large figures (about 3 ins high) or get rid of the idle text.

The problem is that console displays don't support variable font
sizes. In order to do this, you're going to need to write a simple
GUI program, which will be significantly more complex.

A simple program to display a random number in large text should be
relatively easy to do in Tkinter, which has the benefit of being
bundled with your Python distribution. (It's got a few downsides,
too, but most of them won't apply for this project.) I haven't
actually looked at it, but EasyGui (recently mentioned here; google
should help you find it) may meet your needs and be simpler to use.

Jeff Shannon
Technician/Programmer
Credit International
 
P

Peter Hansen

Adam said:
We are running a numbers game at our retirement village and using a roulette
wheel to generate the numbers. but this wheel is only about 12 in diameter
and is little more than a toy. So we came up with the idea of using a random
number generator to generate numbers from 0 to 36 and display them in large
figures on my laptop. This is for the benefit of those people who are hard
of hearing. They like to see what is happening.
I was an RPG programmer before retirement but am new to Python. So I used
the following code to generate the numbers but I don't know how to display
them in large figures (about 3 ins high) or get rid of the idle text.

from random import randint
rand = randint(0,36)
print rand

my os = XP

I'd suggest this as the possible best-bang-for-the-buck solution,
at least in terms of quick success. If it's not good enough, at
least you've got now a baseline to compare against.

In XP, under the Start menu, under All Programs then Accessibility
you should find a "Magnifier" tool. Run this, right-click and change
the options to a magnification level of 9, then drag the window
somewhere convenient and make it a decent size.

Then run your Python script, and move the mouse near where the
output shows up.

The result is a "coarse" magnification of the font, as in individual
pixels will show up as large squares, but from any kind of distance
it's likely to look good enough to be usable...

And you don't need to learn a GUI framework to use it. :)

-Peter
 
M

mensanator

Adam said:
Unfortunately that didn't work.
Here's what I'm trying to do.
We are running a numbers game at our retirement village and using a roulette
wheel to generate the numbers. but this wheel is only about 12 in diameter
and is little more than a toy. So we came up with the idea of using a random
number generator to generate numbers from 0 to 36 and display them in large
figures on my laptop. This is for the benefit of those people who are hard
of hearing. They like to see what is happening.
I was an RPG programmer before retirement but am new to Python. So I used
the following code to generate the numbers but I don't know how to display
them in large figures (about 3 ins high) or get rid of the idle text.

from random import randint
rand = randint(0,36)
print rand

my os = XP
Can you help?
Adam.

What about using banner printing?

@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@ @@@@@@@@@@@
@@@@@@@@ @@@@@@@@@@
@@@@@@@@ @@@@@@@@@@
@@@@@@@@ @@@@@@@@@@
@@@@@@@@ @@@@@@@@@@
@@@@@@@@ @@@@@@@@@@
@@@@@@@@ @@@@@@@@@@
@@@@@@@@ @@@@@@@@@@
@@@@@@@@ @@@@@@@@@@
@@@@@@@@ @@@@@@@@@@
@@@@@@@@ @@@@@@@@@@
@@@@@@@@ @@@@@@@@@@
@@@@@@@@ @@@@@@@@@@
@@@@@@@@ @@@@@@@@@@
@@@@@@@@@ @@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@
 
F

Fredrik Lundh

Adam said:
So we came up with the idea of using a random number generator to
generate numbers from 0 to 36 and display them in large figures on my
laptop. This is for the benefit of those people who are hard of hearing.
They like to see what is happening.

here's one way to do this:

from Tkinter import *
from random import randint
from time import sleep

def update(event=None):
for i in range(10):
label.config(text=str(randint(0,36)))
label.update()
sleep(0.05)

# create a maximized window
root = Tk()
root.wm_state("zoomed")
root.title("my roulette wheel")

# 80% of the screen height
height = int(root.winfo_screenheight() * 0.8)

# create label (use negative font size for size in pixels)
label = Label(root, font="Arial " + str(-height), bg="gold")
label.pack(fill=BOTH, expand=1)

# click anywhere in window to pick a new number
root.bind("<Button-1>", update)

update() # display first number

mainloop()

(tweak as necessary)

</F>
 
A

Adam

Fredrik Lundh said:
here's one way to do this:

from Tkinter import *
from random import randint
from time import sleep

def update(event=None):
for i in range(10):
label.config(text=str(randint(0,36)))
label.update()
sleep(0.05)

# create a maximized window
root = Tk()
root.wm_state("zoomed")
root.title("my roulette wheel")

# 80% of the screen height
height = int(root.winfo_screenheight() * 0.8)

# create label (use negative font size for size in pixels)
label = Label(root, font="Arial " + str(-height), bg="gold")
label.pack(fill=BOTH, expand=1)

# click anywhere in window to pick a new number
root.bind("<Button-1>", update)

update() # display first number

mainloop()

(tweak as necessary)

</F>
I thank all of you.
I will try each one of these suggestions.
Adam.
 
A

Adam

Thanks Fredrik,
I got your program running (with a couple of tweaks) with just a quarter of
an hour to spare before using it at our happy hour yesterday.
The old ladies loved it.
I can now adapt it for bingo.
Thanking you
Adam.
 

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

Forum statistics

Threads
474,221
Messages
2,571,130
Members
47,747
Latest member
swapote

Latest Threads

Top