New to python
Brian Quinlan
brian at sweetapp.com
Sun Oct 20 16:00:49 EDT 2002
> Are there any decent reference sites I can peek at (im a seased
> programmer btw, so the fundamentals will be fine).
http://www.python.org/doc/current/tut/tut.html
> I see that if you want to use a function you have to import it from
> the library at the top (grr :P), anyhow, are there any more 'quirks'
> such as this I should know about ?
There are many ways to do imports:
>>> from math import sin, cos
>>> sin(5) + cos(2)
-1.3750711112102809
OR:
>>> import math
>>> math.tan(3) + math.ceil(5)
4.8574534569257226
OR:
>>> from math import *
>>> atan(2)
1.1071487177940904
The last method is not recommended because it can cause name collisions.
> Also, whats the easiest way to see what data type is help in a
> variable? Eg string, integer etc.
>>> foo = 5
>>> type(foo)
<type 'int'>
> And last but not least, whats the best place to find the
> different exception handling techniques,
Are you asking a design pattern question, are you looking for a list of
Python exception handling control structures or are you looking for a
list of builtin exception types?
> the python.org site is obismal when compared to php.net
> and the likes :( About as much use as a dead dog :(
Do you have any specific (i.e. useful) criticism? I quite like the
Python documentation.
Cheers,
Brian
More information about the Python-list
mailing list