User:Eleanorg/Thematic1.1/Manipulate Longitude 3 - crossfade: Difference between revisions
(Created page with "<source lang=python> #!/usr/bin/python #-*- coding:utf-8 -*- ###version 3, using dynamic dummy % to test image crossfade import re, urllib2, random percent = random.randint(20...") |
No edit summary |
||
Line 1: | Line 1: | ||
http://pzwart3.wdka.hro.nl/~egreenhalgh/cgi-bin/shipTrack/shipTrack3.cgi | |||
<source lang=python> | <source lang=python> | ||
#!/usr/bin/python | #!/usr/bin/python |
Latest revision as of 15:50, 1 December 2011
http://pzwart3.wdka.hro.nl/~egreenhalgh/cgi-bin/shipTrack/shipTrack3.cgi
#!/usr/bin/python
#-*- coding:utf-8 -*-
###version 3, using dynamic dummy % to test image crossfade
import re, urllib2, random
percent = random.randint(20,90)
# if % is under 100, prefix with "0.": (todo: make exception if % is less than 1)
if percent < 100:
percent = "0." + str(percent)
### ------------------USE IN HTML---------------------
#determines opacity of an image
print "Content-Type: text/html"
print
print """
<html>
<body>
<div>
<p>percent is: """ + percent + """</p>
<img src="http://farm5.staticflickr.com/4039/4552559587_d35d7942ab_b.jpg" alt="http://www.flickr.com/photos/whiteknuckled/4552559587/" style="position:absolute; opacity:""" + percent + """;" />
<img src="http://farm3.staticflickr.com/2665/4228521046_0c421e03f0_o.jpg" />
</div>
</body>
</html>"""