[Tutor] Newbie!! many questions
Tue, 30 Jan 2001 20:59:07 +0100
Content-Type: text/plain; charset=iso-8859-1
> !). There is a way to define and call functions in Python, but is there =
> way to define and call a subroutine? Or a way to jump to another line of=
> code? i.e.:
Ummm... You lost me there. What's the difference?
> 2). sys.stdout and sys.stdin
> what are they!? ok, sys.stdout is where the print statement goes.=
> so how can I use that to my advantage? How can I manip[ulate this to my=
Note that sys.stdin, sys.stdout and sys.stderr are file objects. Thus, it's
easier to change where your output goes.
msg =3D "Hello, file world!"
fname =3D raw_input("Where should I print the message? ")
if fname in ["", "-", "stdout"]:
> 3). Is there a graphics library for Python? To go along with the thread=
> about making games in Python... Not games that use OS-like grpahics, like=
> Tk... Like commercial games with grpahics lilke that. Like so you can pl=
> pixel on the screen at coordinate x,y, color=3Dred. Microsoft QBasic did=
> (my first programming language(i know its obsolete, but its great for=20
> beginners)). Or locate text anywhere besides the next line down. Maybe=
> there is a way to use DirectX with python?
Check out pygame (http://pygame.seul.org/).
> 4). making executables... so I can run it without Python installed! How=
> Someone posted about Freeze... I never heard of that, would someone care =
> explain? Is that what I am looking for?
There are a couple of ways. None is really nice, but if you really want to,
it's possible. IIRC, there should be some kind of link on the pygame site.
I always force my friends to install python... <wink>
Email: email@example.com | You can tune a filesystem, but you
Web: http://www.gnupung.net/ | can't tune a fish. -- man tunefs(8)
PGP fingerprint: 0C56 B171 8159 327F 1824 F5DE 74D7 80D7 BF3B B1DD
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org
-----END PGP SIGNATURE-----