[Tutor] first call - newcomer
Lie Ryan
lie.1296 at gmail.com
Mon Oct 6 07:59:02 CEST 2008
On Mon, 2008-10-06 at 05:32 +0200, tutor-request at python.org wrote:
>
> Message: 8
> Date: Sun, 5 Oct 2008 20:27:39 -0700
> From: Anthony Smith <gods_bud666 at hotmail.com>
> Subject: [Tutor] first call - newcomer
> To: <tutor at python.org>
> Message-ID: <BLU146-W21D0F815F794C49517F301CA390 at phx.gbl>
> Content-Type: text/plain; charset="iso-8859-1"
>
>
> This is my first post - I will be brief...
>
> One: I have programmed before - but it has been DECADES...so just a
> few simple queries:
>
> 1. A brief (but complete) description regarding the use of script
> editor (I will be using
Your script editor can be any plain text-editing tools, Notepad could
do.
> command prompt in Windows), as:
>
> a. details about loading and saving programs (not in that
> order) and little
> specs about pathnames or other requirements (I will
> probably store all
> my little goodies in one folder or space).
Pathnames is free, you can name your program anything your OS allows for
a file. A convention is to name the script ending with .py/.pyw
extension (command-line script/GUI script), although python doesn't
complain if it is not in those extension (in Windows, the extension is
associated with the interpreter). Calling a program from command line is
done like this:
python filename.py
> That should get me going ... a book and manual by my side should
> suffice for
> the rest - - - except for one thing:
> 2. I have been unable to locate the gizmo in the literature to get
> ascii codes
> in python. In the old days, it was a list of 256 (or so)
> characters that
> represented all keyboard symbols (A equalled 36; B equalled 37; et
> cetera).
> To assign a value, you used "Let A$ = ASC (36)" where A$ was a
> variable
> and 36 was the ASCII value for 'A'. I believe the reverse of this
> process
> was PRINT VAL(A$) or something. I want to play with a program
> that will
> assign a number to a word (using a simple algorhythm that will give
> a
> specific number to every word). Other stuff is pretty easy to
> find with
> the book and on-line literature. I will need to get an ascii code
> out of
> a string (whose content is not known to the programmer, as
> raw_input).
> Then to assign, I will need the actual list with assigned numbers.
a = ord('A')
b = chr(36)
-- read on the help file: Built-in Functions
> You will be giving me probably the only boost I will need! I will be
> available later on,
> if I want to take part in the ask/answer system here.
More information about the Tutor
mailing list