Some Basic Questions about Python

Bill Walker bwalker at earth1.net
Tue Mar 27 19:22:11 EST 2001


OK, I downloaded the installer and tried it. Works like a charm. Some
questions:

(For reference, the source code of my test program is at the bottom)

1. I compiled using Standalone and it created a directory with all the
needed stuff. Was kinda big, over a megabyte. It zipped up to 877K with
Winzip, so
it will all fit on a disk. During compilation, it immediately spit out an
error message that it couldn't find my dll files, however, it went ahead and
compiled anyway. Is this why the directory was so big? I have
\Windows\System in my path.

2. I compiled both with a test.py and then a test.pyw filename. Both
compilations gave me a test.exe that generated that annoying dos console in
the background. How can I get rid of it?

3. Also, I tried using the -tk option as outlined in the instructions on the
web page docs, but it flagged it as an error. However, it seemed to compile
fine without the option, so I guess I don't really need it?

All-in-all, it's a great solution for me.

Thanks a million!


>
> Sure you do.  It's
http://starship.python.net/crew/gmcm/installer_dnld.html
>
> It makes executables for Windows and Linux.  Typical results on Windows
> are around 500K depending on what modules you import.  I haven't used
> it on Linux.
>
> - Ken
>
>
>

#test

import Tkinter
from math import sin,pi

tk=Tkinter
root = tk.Tk()
root.title("Space Zounds Lab")

wHeight=300
wWidth=500
wBorder=20

myCanvas=tk.Canvas(root, height=wHeight, width=wWidth, bg='white')
myCanvas.create_line(wBorder,wHeight/2,wWidth-wBorder,wHeight/2,fill='green'
)
myCanvas.create_line(wWidth/2,wBorder,wWidth/2,wHeight-wBorder,fill='green')

for a in range(0,629):
   x1 = a/pi/200.*(wWidth-2*wBorder)+wBorder
   y1 = wHeight/2 - sin(a/100.)*(wHeight-wBorder)/2
   if (a>0): myCanvas.create_line(x1, y1, x2, y2, fill='red')
   x2 = x1
   y2 = y1

myCanvas.pack()

root.mainloop()






More information about the Python-list mailing list