Commit df6c8327 authored by Bastien Terrier's avatar Bastien Terrier
Browse files

add functions and resources files + check args

parent 048598cd
character = [[0]*n for i in range(p)]
alphabel = { : }
for char in range(ord('a'), ord('z')+1):
print char
i_maxRows = 5
i_maxColums = 5
alphabet = {}
# for char in range(ord('A'), ord('Z')+1):
# alphabet[chr(char)] = [[0]*i_nbColums for i in range(i_nbRows)]
# print
# print alphabet[chr(char)]
alphabet['A'] = [
[0, 1, 1, 0],
[1, 0, 0, 1],
[1, 1, 1, 1],
[1, 0, 0, 1],
[1, 0, 0, 1]
]
alphabet['B'] = [
[1, 1, 1, 0],
[1, 0, 0, 1],
[1, 1, 1, 0],
[1, 0, 0, 1],
[1, 1, 1, 0]
]
from alphabet import * #import alphabet
from resources import * #import resources
def initFile(f_dataStream, sentence):
f_dataStream.write("#!/bin/bash")
f_dataStream.write("\n\n#Powered by Bastien T")
f_dataStream.write("\n#Sentence : {}".format(sentence))
def displayCharacter(char):
print char, "\n"
# print alphabet[char]
for r in alphabet[char]:
print("[")
for c in r:
print(c)
#display to screen
print("]\n")
def displaySentence(sentence):
with open(s_filename, 'w') as f_dataStream:
initFile(f_dataStream, sentence)
for char in sentence:
if ord(char) < ord('A') or ord(char) > ord('Z') :
print("Error, not a character")
else:
displayCharacter(char)
from functions import * #import functions
from resources import * #import resources
import sys #args
#check syntax
if (len(sys.argv) != 2):
print("Syntax error : python process.py sentence_to_display")
exit(0)
#sentence to display
s_sentence = sys.argv[1];
s_sentence = s_sentence.upper()
displaySentence(s_sentence)
s_filename = "xeyes_sentences.sh"
#!/bin/bash
#Powered by Bastien T
#Sentence : AABBA
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment