Created
February 11, 2016 16:09
-
-
Save tkrajina/48da56bf9cfdeccb9c36 to your computer and use it in GitHub Desktop.
Convert b exercises
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
# -*- coding: utf-8 -*- | |
import sys | |
f = open(sys.argv[1]) | |
string = f.read() | |
f.close() | |
parts = string.strip().split("*") | |
translation = parts[-1].strip() | |
parts = parts[:-1] | |
arabic_chunks = parts | |
english_chunks = translation.split("\n") | |
for i in range(len(arabic_chunks)): | |
print arabic_chunks[i] + ' {' + english_chunks[i].strip() + '}', |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment