... hab' ich mitzuteilen - L's blog

... with a touch of python - Didaktik der Informatik, Informatische Bildung, ...
Sun, 12 Feb 2006
Comparing path.py with os.path [ 18:14 Uhr ] [ 137 Worte ]

Taken from Simon Willson's blog post.
# with os.path.walk
def delete_backups(arg, dirname, names):
    for name in names:
        if name.endswith('~'):
            os.remove(os.path.join(dirname, name))

os.path.walk(os.environ['HOME'], delete_backups, None)

# with os.path, if (like me) you can never remember how os.path.walk works
def walk_tree_delete_backups(dir):
    for name in os.listdir(dir):
        path = os.path.join(dir, name)
        if os.path.isdir(path):
            walk_tree_delete_backups(path)
        elif name.endswith('~'):
            os.remove(path)

walk_tree_delete_backups(os.environ['HOME'])

# with path
dir = path(os.environ['HOME'])
for f in dir.walk():
    if f.isfile() and f.endswith('~'):
        os.remove(f)
Sun, 12 Feb 2006 15:08:53 GMT

[ Quelle: ]
korakot (Korakot Chaovavanich)
[ rss20 Feed ] http://www.bigbold.com/snippets/rss [ Verweis - Nachrichtenkanal ]

[ xhtml ] http://www.bigbold.com/snippets/posts/show/1463 [ Verweis - Eintrag ]

Sat, 11 Feb 2006
Comparing pygame and pys60 [ 19:36 Uhr ] [ 336 Worte ]

Quelle für Überlegungen, wie wir ggf. unsere Applikationen von PyGame zu Python auf dem Handy/Mobile übertragen könnten. M.E. sollte dazu ein einfacher Wrapper geschrieben werden, der je nach Fähigkeit des Endgeräts [wie schon bei AnyGui] eine entsprechende Realisierung benutzt.

I take the pygame code from here. Then, write my own pys60 part.

# pygame's typical beginning
import pygame
from pygame.locals import *

# pys60
import e32, graphics
from appuifw import *

Setting up the screen

# pygame
window = pygame.display.set_mode((468, 60))

# pys60
app.screen = 'full' # or 'normal', 'large'

Get screen or canvas

# pygame
screen = pygame.display.get_surface()

# pys60
app.body = canvas = Canvas(None, key.handle_event)
# you need to create key (a Keyboard instance) before this

Loading image

# pygame
monkey_image = pygame.image.load(file_name)

# pys60
monkey_image = graphics.Image.open(file_name)

Drawing image onto the screen

# pygame
screen.blit(monkey_image, (0,0))
pygame.display.flip()

# pys60
canvas.blit(monkey_image, target=(0,0))
# we may add a buffer, which will need buffer.blit(image)
# and canvas.blit(buffer) for equivalent steps

Loading and playing sound

# pygame
sound = pygame.mixer.Sound(fullname)
sound.play()

# pys60
import audio
sound = audio.Sound.open(fullname)
sound.play()


For Rect and Sprite, there is no pys60 equivalence yet.
I may write an equivalent class someday.
Fri, 10 Feb 2006 15:34:56 GMT

[ Quelle: ]
korakot (Korakot Chaovavanich)
[ rss20 Feed ] http://www.bigbold.com/snippets/rss [ Verweis - Nachrichtenkanal ]

[ xhtml ] http://www.bigbold.com/snippets/posts/show/1454 [ Verweis - Eintrag ]

The iPod nano, now in 1GB - and some thoughts about iPod at School [ 16:31 Uhr ] [ 330 Worte ]

Both the Unofficial Apple Weblog and Engadget, and presumably a few other people, are reporting the surprise launch of the 1GB iPod nano, shipping today at $149 in the US.


The iPod nano

At the same time, the price of the 256MB and 512MB iPod shuffle has been cut to $69 and $99 in the US respectively. All just in time for the billion song count down at the iTunes music store...

Update: The iLounge review (via Engadget) of the iPod nano notes that the backlight on the new 1GB is dimmer than the 2 and 4GB models.

...
2006-02-07T16:33:00+00:00

Vielleicht ist es an der Zeit, auf dem iPod unter Linux im Informatikunterricht Python zu erproben?
Die folgende E-Mail ging am 4. Februar über die Python-Ankündigungsliste:
Since May 2005 there is a port of python (v2.4.1) for Apple iPod.
Porting was an 'easy' job, the only consideration was how you can
write with a iPod, ipodlinux [1] people did an interface called 
iPodRead that allows you  type into iPod scrolling left or right 
on the wheel. (This affects to the file Parser/myreadline.c, line 47).

Furthermore, is necessary run configure with options: --without-threads,
--without-shared and --with-cxx and build it in a cross-compile
environment for ARM architecture.

You can see the differences between python original and python ported
source in [2].

First announce about the port can be found in [3].
More info about this port, cool pictures and 
binaries & source code in [4].

 [1] http://ipodlinux.org
 [2] http://www.ciberjacobo.com/en/diffs.html
 [3] http://ipodlinux.org/forums/viewtopic.php?t=1945
 [4] http://www.ciberjacobo.com/en/linux_on_ipod.html#python


-- Jacobo Avariento Gimeno http://ciberjacobo.com
[ Quellen: ]
Al.
[ xhtml ] http://feeds.feedburner.com/TheDailyAck?m=752 [ Verweis - Eintrag ] Python Mailliste

Fri, 10 Feb 2006
Linux Journal: Why Not Python?, Part 3 [ 13:30 Uhr ] [ 87 Worte ]

Linux Journal: Why Not Python?, Part 3 [«Now it's time for this new Python user to do the hard work--code the program to fill in the blanks of Sudoku puzzles.»]
[ rss20 Feed ] http://www.pythonware.com/daily/rss2.xml [ Verweis - Nachrichtenkanal ]

[ xhtml ] http://www.pythonware.com/daily/index.htm#113951047035143361 [ Verweis - Eintrag ]

Gekünstelte Schlangen-Intelligenz [ 13:21 Uhr ] [ 120 Worte ]

tile image Building Decision Trees in Python: »Python is a good language for machine learning - it's easy to express powerful algorithms maintainably, and it's flexible to experiment with new approaches. Christopher Roach demonstrates the use and implementation of decision trees, a fundamental feature of datamining, that can help you find trends in your data.« [Meerkat: An Open Wire Service: ONLamp.com]
[ rss20 Feed ] http://www.schockwellenreiter.de/xml/rss.xml [ Verweis - Nachrichtenkanal ]

[ xhtml ] http://www.schockwellenreiter.de/2006/02/10.html#geknstelteSchlangenintelligenz [ Verweis - Eintrag ]

Wed, 08 Feb 2006
Learning Letters [ 22:12 Uhr ] [ 269 Worte ]
Python Cookbook: Classes for Working with URIs [ 16:53 Uhr ] [ 84 Worte ]

Python Cookbook: Classes for Working with URIs [«This is a set of classes I have used for dealing with URL parsing in an easy and convenient manner.»]
[ rss20 Feed ] http://www.pythonware.com/daily/rss2.xml [ Verweis - Nachrichtenkanal ]

[ xhtml ] http://www.pythonware.com/daily/index.htm#113939132744067944 [ Verweis - Eintrag ]

Dev Shed: A PyGame Working Example: Starting a Game [«In... [ 16:51 Uhr ] [ 135 Worte ]

Dev Shed: A PyGame Working Example: Starting a Game [«In 'PyGame for Game Development', I showed you the very basics of PyGame's graphical side. However, creating a game with PyGame requires a bit more. All the concepts described before need to be glued together somehow, and new concepts will need to be introduced in order to create a functional game. In this article, we'll do just that by tackling a working example of PyGame's capabilities — a Python-powered game.»]
[ rss20 Feed ] http://www.pythonware.com/daily/rss2.xml [ Verweis - Nachrichtenkanal ]

[ xhtml ] http://www.pythonware.com/daily/index.htm#113941068248443887 [ Verweis - Eintrag ]

<<  0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 [26] 27 28 29 30 31 32 33 34 35  >>


Inhalte unterliegen dem Copyright von L. Humbert.
Creative Commons License
Die Inhalte stehen unter einer Creative Commons License.