Differences

This shows you the differences between two versions of the page.

programiranje:python_challenge:nivo_5 [2009/11/23 09:06] (current)
delboy created
Line 1: Line 1:
 +===== Python Challenge - Nivo 5 =====
 +U [[http://www.pythonchallenge.com/pc/def/peak.html|ovom nivou]] treba koristiti //pickle// modul. Na to upućuje tekst iz titla i ispod slike. Kada se //peak// izgovori zvuči slično kao //pickle//. U source-u stranice može da se nađe ime //banner.p//. Kada se to stavi u adresu umesto //peak.html// stavi //banner.p// može da se skine taj fajl.
 +Kada se na //banner.p// primeni modul [[http://docs.python.org/lib/node317.html|pickle.Unpickler]] dobije se lista. Lista sadrži informacije koje su podatke koji su potrebni za iscrtavanje [[http://en.wikipedia.org/wiki/ASCII_art|ASCII art]]-a u stilu banner komande u Linux-u.
 +
 +<code python>
 +#!/usr/bin/env python
 +
 +from pickle import Unpickler
 +
 +f = open('banner.p', 'r')
 +b = Unpickler(f).load()
 +
 +for i in b:
 +    for j in i:
 +        for k in xrange(j[1]):
 +            print j[0],
 +    print
 +</code>
 +
 +**Rešenje**: http://www.pythonchallenge.com/pc/def/channel.html
 
programiranje/python_challenge/nivo_5.txt · Last modified: 2009/11/23 09:06 by delboy
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki