Você está na página 1de 2

#!

/usr/bin/env python
# -*- coding: UTF-8 -*-

# Jelen szmlzprogram gyakorls cljbl kszlt.


# 88

import os
import sys

def TextPos(xpos, ypos, text):


sys.stdout.write("\x1b7\x1b[%d;%df%s\x1b8" % (xpos, ypos, text))
sys.stdout.flush()
def TextOut (xpos, ypos, width, linetype,text):
if linetype == 'top':
TextPos (xpos,ypos,'%s%s%s' % ('',''*width,''))
elif linetype == 'bottom':
TextPos (xpos,ypos,'%s%s%s' % ('',''*width,''))
elif linetype == 'norm':
TextPos (xpos,ypos,'%s%s%s' % ('',' '*width,''))
elif linetype == 'split':
TextPos (xpos,ypos,'%s%s%s' % ('',''*width,''))
elif linetype == 'textleft':
TextPos (xpos,ypos,'%s%s%s%s' % (' ','%s' % text,' ' * ((width-2)-
len(text)),' '))
elif linetype == 'textcent':
TextPos (xpos,ypos,'%s%s%s%s%s' % (' ',' ' * ((((width)-len(text))/2)-
1),'%s' % text,' ' * (((((width)-len(text))/2)-1)+(len(text)%2)),' '))
elif linetype == 'teplus':
TextPos (xpos,ypos,'%s%s%s' % ('',''* width,' '))
elif linetype == 'plusplus':
TextPos (xpos,ypos,'%s%s%s' % ('',''* width,' '))
elif linetype == 'pluste':
TextPos (xpos,ypos,'%s%s%s' % ('',''* width,' '))
elif linetype == 'tetele':
TextPos (xpos,ypos,'%s%s%s' % ('',''*width,''))
elif linetype == 'tetefel':
TextPos (xpos,ypos,'%s%s%s' % ('',''*width,''))
elif linetype == 'simple':
TextPos (xpos,ypos,text)
elif linetype == 'texttitleline':
TextPos (xpos,ypos,'%s%s%s%s%s' % ('','' * ((((width)-len(text))/2)-
1),' %s ' % text,'' * (((((width)-len(text))/2)-1)+(len(text)%2)),''))

#----------------------------------------------------------------------------------
------------------------

os.system('clear')

outs=[
'top','',
'textcent','Szamlazo program',
'textcent','17.09 verzio "Joranne"',
'split','',
'textleft','A program uzleti celu alkalmazasra alkalmatlan!',
'textleft','Gyakorlas celjabol keszitett alkalmazas :-)',
'bottom','',
'simple','',
'simple','A program inditasahoz kerem nyomja le az ENTER-t!']

for cnt in range (0,(len(outs)/2)):


TextOut ((8+cnt),18,54,outs[(cnt*2)],outs[((cnt*2)+1)])
TextOut (26,65,50,'simple','created by Fadgyas Egmond')

#os.system('setterm -cursor off')


raw_input ('')
#os.system('setterm -cursor on')
os.system('clear')

TextOut (11,1,20,'texttitleline','Bejelentkezes')
TextOut (12,1,20,'split','')

Você também pode gostar