This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import media | |
| def sum_red(pic): | |
| total = 0 | |
| for p in pic: | |
| r = media.get_red(p) | |
| total = r + total | |
| return total |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def ReturnExample(): | |
| return 5 | |
| x = ReturnExample() | |
| print x # Prints 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import media | |
| COLOUR_MAX = 255 | |
| COLOUR_MIN = 0 | |
| def get_picture(): | |
| '''Solicit user input to select a file and load it as a Picture. | |
| Return the Picture. | |
| ''' | |
| filename= media.choose_file() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import media | |
| COLOUR_MAX = 255 | |
| COLOUR_MIN = 0 | |
| def get_picture(): | |
| '''Solicit user input to select a file and load it as a Picture. | |
| Return the Picture. | |
| ''' | |
| filename= media.choose_file() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| > James Cash's Custom Quix Commands | |
| @James Cash's Custom Quix Commands | |
| src view-source:%r View source natively | |
| insta javascript:function%20iprl5(){var%20d=document,z=d.createElement('scr'+'ipt'),b=d.body,l=d.location;try{if(!b)throw(0);d.title='(Saving...)%20'+d.title;z.setAttribute('src',l.protocol+'//www.instapaper.com/j/pL8VMUDiGTio?u='+encodeURIComponent(l.href)+'&t='+(new%20Date().getTime()));b.appendChild(z);}catch(e){alert('Please%20wait%20until%20the%20page%20has%20loaded.');}}iprl5();void(0) Add to Instapaper | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def replace_template(map, template): | |
| trie = Trie(map) | |
| iter = template.__iter__ | |
| for c in iter: | |
| if c != '$': print c | |
| else: | |
| s = iter.next() | |
| trie.lookup(iter) | |
| if replacement: | |
| print replacement |
NewerOlder