Monday, 23 June 2008
Short break
No posts in the next couple of days due to school & work deadlines approaching at speed.
Monday, 16 June 2008
More on strings and data in general
IDLE 1.2.1 #That's my Windows Python GUI
>>> x = 'hello'
>>> y = 'll'
>>> x in y
False
>>> y in x
True
>>> x = 'hello'
>>> y = 'll'
>>> x in y
False
>>> y in x
True
Wednesday, 11 June 2008
Comic relief #1
Looking at all the spamify() functions in my Python manuals reminded me of the great heritage Python advertises and at the same time gave me an idea about making this blog a tad more colorful. The first of the comic reliefs. A true classic.
Thursday, 8 May 2008
Simple math
#! /usr/bin/python
# kg 2 stone converter
print "Mass in kilos?"
mass_kg = int(raw_input())
mass_stone = mass_kg * 2.2 / 14
print "Mass in stones is" + str(mass_stone) + " stone."
# kg 2 stone converter
print "Mass in kilos?"
mass_kg = int(raw_input())
mass_stone = mass_kg * 2.2 / 14
print "Mass in stones is" + str(mass_stone) + " stone."
Thursday, 6 March 2008
Conditions (if) and indenting
>>> world_flat=1
>>> if world_flat:
... print "You can fall off!" #this line is indented
...
You can fall off!
>>> if world_flat:
... print "You can fall off!" #this line is indented
...
You can fall off!
Config stuff for Unix and Windows machines
Usual location of the interpreter:
/usr/local/bin/python (Unix)
C:\Python25 or sth similar (Windows)
Environment path setting (Windows)
set path path=%path%;C:\python25
/usr/local/bin/python (Unix)
C:\Python25 or sth similar (Windows)
Environment path setting (Windows)
set path path=%path%;C:\python25
Saturday, 1 March 2008
Friday, 29 February 2008
First notes
Python characteristics:
-interpreted
-creates bytecode normally saved to disk (one compilation)
-allows OO
-spaces matter
-indentation for indicating where block starts and ends ('{}' in C)
-dynamically typed (data type based on the stored value)
-interpreted
-creates bytecode normally saved to disk (one compilation)
-allows OO
-spaces matter
-indentation for indicating where block starts and ends ('{}' in C)
-dynamically typed (data type based on the stored value)
Python Programming
I´m beginning to think it would be a good subject for the otherwise unproductive process. Having actual content is the only way to go with blogs AND I have access to a Web-connected Linux machine these days.
It's bloggering time.
It's bloggering time.
Thursday, 28 February 2008
Subscribe to:
Posts (Atom)
