#!/usr/bin/python3
def printHTML(str):
print("
====|%s|" % str)
def FindString(x, str1, str2):
pos1 = x.find(str1)
pos2 = x.find(str2, pos1+1)
if( str2 == ''):
pos2 = len(x)
offset = len(str1)
if( pos1 > -1 and pos2 > -1):
haha = x[pos1+offset:pos2].strip()
#printHTML(haha)
return haha
else:
return '404'
isotope = '404'
preacc = '404'
inflector = '404'
LEB_Voltage = '404'
LEB_Feedback = '404'
tandam_pot = '404'
beam_energy = '404'
charge = '404'
charge_frac = '404'
beta = '404'
analysisMagnet = '404'
beamLine = '404'
switchingMagnet = '404'
file = open("beam.txt")
print("Content-type:text/html\r\n\r\n")
print('')
print('
===================
')
print("Isotope: " + isotope.upper() + "
")
print("PreAcceleration: " + preacc + " kV
")
print("Inflector: " + inflector + " A
")
print("LEB Voltage: " + LEB_Voltage + " V
")
print("LEB feedback: " + LEB_Feedback + " V
")
print("Tandem Pot.: " + tandam_pot + " MV
")
print("Beam Energy: " + beam_energy + " MeV
")
print("Beam Charge: " + charge + "
")
print("Frac. Charge: " + charge_frac + "
")
print("Beta: " + beta + "
")
print("Analyzing Magnet: " + analysisMagnet + " G
")
print("Beam Line: " + beamLine + "
")
print("Switching Magnet: " + switchingMagnet + " A
")
#
#file = open("test.txt")
#
#for x in file:
# print("
")
# print(x)
#
#print('
===================
') print('') print('')