Skip to content

Instantly share code, notes, and snippets.

View blackstream-x's full-sized avatar

blackstream-x

View GitHub Profile
@blackstream-x
blackstream-x / einmaleins.py
Last active September 20, 2015 11:15
print a multiplication table
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Print a multiplication table.
Default numbers are set for the "kleine Einmaleins" (1 to 10).
"""
import sys
#!/usr/bin/env python
# basic_regex_demo3.py
import re
def okay(test):
print test, '=',
print re.findall('''["'](?i)(\S+\.(?:jpe?g|gif))$''', test)
#!/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 = []
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)