This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""Print a multiplication table. | |
Default numbers are set for the "kleine Einmaleins" (1 to 10). | |
""" | |
import sys | |
This file contains 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
#!/usr/bin/env python | |
# basic_regex_demo3.py | |
import re | |
def okay(test): | |
print test, '=', | |
print re.findall('''["'](?i)(\S+\.(?:jpe?g|gif))$''', test) |
This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""importando módulo OS para que não seja | |
fechado o programa após o término de sua execução | |
No, just use a decent operating system that provides decent terminals ;-) | |
""" | |
concatenaRestoDivisao = [] |
This file contains 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
delete_lines_starting_with = 'abc' | |
source_file_name = 'data.txt' | |
target_file_name = 'new_data.txt' | |
with open(target_file_name, 'w') as output_file: | |
with open(source_file_name, 'r') as input_file: | |
for line in input_file: | |
if not line.startswith(delete_lines_starting_with): | |
output_file.write(line) |