Where to go from here? newbee

R

Richard

Just downloaded python for the fun of it.
What do I run to begin coding with?
Version 2.3.3

When I run the "command line" thing, I get a dos window.
Now what?

The built in tutor explains some basics about programming but zilch on where
to begin.


BTW, you have 357 days left to do your christmas shopping.
 
J

Jules Dubois

On Wed, 31 Dec 2003 23:22:43 -0600, in article
Just downloaded python for the fun of it.
What do I run to begin coding with?
Version 2.3.3

Yes, unless you have some reason to use an older release.
When I run the "command line" thing, I get a dos window.
Now what?

Type some commands and see how the interpreter works.

Go to http://www.cs.unm.edu/~ej and click on these links.

Python Hacking I (Just do it!)
Python Hacking II (types, functions, exceptions)
Python Hacking III

Type the commands and see what happens.

Go to http://www.python.org/ and find some more advanced tutorials.
 
R

Richard

Wil said:
> If you are sure you're up to it, here's a good place to start...
> http://www.ibiblio.org/obp/thinkCSpy/

All nice and good for somebody with no knowledge of what a computer language
is and does.
It's like teaching 1st grade stuff to a college grad.
This tells me nothing on how to get started.
But I understand that the actual coding can be written in a text editor then
compiled?
 
R

Richard

Jules said:
> On Wed, 31 Dec 2003 23:22:43 -0600, in article
> Yes, unless you have some reason to use an older release.
> Type some commands and see how the interpreter works.
> Go to http://www.cs.unm.edu/~ej and click on these links.
> Python Hacking I (Just do it!)
> Python Hacking II (types, functions, exceptions)
> Python Hacking III
> Type the commands and see what happens.
> Go to http://www.python.org/ and find some more advanced tutorials.

Ok. Now I'm slowly understanding. I guess you could say that python is
similar to visual basic and c++ in coding.
I have a program written in python which has several "py" files included.
How do I view these for the coding examples?
 
C

Christos TZOTZIOY Georgiou

I have a program written in python which has several "py" files included.
How do I view these for the coding examples?

..py files are the source of python programs --plain text files. Use
your favourite text editor.
 
C

Cousin Stanley

Richard ....

A good way to get started with Python
is to use the interpreter in command-line mode
and experiment with it just by trying different things ....

Anything that works using the interpreter interactively
will also work by coding the commands in a text editor
and saving as a Python source file with the .py extension ....

To execute a saved program, open a DOS window,
and enter ....

python someProg.py

You may have to include your python installation directory
in the Windows path environment variable ....

set path=%path%;x:\yourPath\PythonXXX

A sample interactive session follows ....

You can copy/paste it into a text editor,
whack out the >>> and ... prompt characters,
save it as a .py file, and then execute
for a test ....

--
Cousin Stanley
Human Being
Phoenix, Arizona
.... # are comments ....
.... #
.... # Create some named objects
.... # and bind these names
.... # to their values
........ print ' ' , arg
....
# Create a list of objects ....
list_objects = [ r , x , y , z ]

# Print the objects ....
for this_object in list_objects :
.... fprint( this_object )
....
42.0
29.6984848098
29.6984848098
42.0
 
E

engsolnom

Richard,

Being a newbie to Python myself, I can relate.

One way...assuming windows
Click on the python command line thing you evidently found. This gives you a dos box showing the
Python prompt...>>>
Just type Python commands: print "Hello World", for example
Control Z to exit

Another way....
Bring up a 'real' dos box, cd to Python23, or whatever your install named it, and enter python
This again shows the Python prompt >>>

From the dos prompt, you can run a Python script by entering:
python myscript.py
where myscript is a text file with an extension of py, and located in the C:\python23 dir.

If you make a sub-directory myfiles (adviable) under C:\python23, to hold your test scripts, you
need to enter:
python myfiles\myscript.py

A third way...
Use a text editor to manage files and directories, and which may be able to launch dos commands.
There are dozens of editors out there, some good, some not so good. I use PFE, and have for years.

Hope this helps a bit.

Norm
 
J

Jules Dubois

Go to http://www.cs.unm.edu/~ej and click on these links.
Python Hacking I (Just do it!)
Python Hacking II (types, functions, exceptions)
Python Hacking III
Type the commands and see what happens.

Ok. Now I'm slowly understanding.[/QUOTE]

In an earlier article, you said "It's like teaching 1st grade stuff to a
college grad." These files were created by a university senior and were
intended as quick-and-dirty "tutorials", introducing Python to a
senior-level engineering class. All were new to Python.

What I liked about the tutorials was they were instructive but required the
user to determine the correspondence between the input and output. If you
or anyone else wants the tutorials, download them now before the account is
removed. I believe the author graduated in December.
I guess you could say that python is
similar to visual basic and c++ in coding.

It's not much like Visual Basic and is perhaps somewhat similar to C++. As
I learn Smalltalk, what I'm noticing more and more is how similar they are
-- less Smalltalk's integrated environment.

Further, if you're an experienced programmer, I recommend _Python in a
Nutshell_ by Alex Martelli. I've read it cover to cover about a dozen
times now and my conclusion is that it's one of the very best programming
language books I've read (and I've read many in the last 25 years.)

Finally, download the Python documentation from Python.org.
I have a program written in python which has several "py" files included.
How do I view these for the coding examples?

..py files are source code, so load them into your favorite text editor. I
use XEmacs.
 

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,174
Messages
2,570,940
Members
47,485
Latest member
Andrewayne909

Latest Threads

Top