# -*- coding: iso-8859-7 -*-
from math import pi
#c program x
#c implicit none
#c character*35 dline
#c
#c call hhhh
#c100 continue
#c read 10, dline
#c10 format (a)
#c if (dline .eq. ' ') go to 200
#c
#c DLINE = ' A. S T A M O S S. A.'
#c dline = '\\31samba\runprogs\tif\var\sat.tif'
#c call ffff (dline)
#c print 20, dline
#c20 format (1x, a)
#c
#c dline = 'x:\tif\var\sat.tif'
#c call ffff (dline)
#c print 20, dline
#c
#c dline = 'XYZZYXYZZY'
#c call ffff (dline)
#c print 20, dline
#c
#c dline = 'A. STAMOS Library not found'
#c call ffff (dline)
#c print 20, dline
#c go to 100
#c
#c200 continue
#c read 10, dline
#c if (dline .eq. ' ') go to 100
#c dline = '!E/%)U&Y!E!R)Q&X!$T3)C4%'
#c call gggg (dline)
#c print 10, dline
#c go to 200
#c end
#============================================================================
def fff():
f = '!$3)"%$%"%$!7"3'
return gggg(f)
#============================================================================
# subroutine ffff (dl)
# implicit none
# character*(*) dl
# real*8 PI
# parameter (PI=3.14159265358979323d0)
# integer*4 i, j, k(8)
# real*8 a
#
# a = PI - dint(PI)
# do i=1, 8
# a = a * 10.0d0
# k(i) = idint(a)
# a = a - dint(a)
# end do
#
# do i=1, len(dl)
# j = ichar(dl(i:i))
# j = j + k(mod(i-1, 8)+1)
# dl(i:i) = char(j)
# end do
# return
# end
#
#c============================================================================
#
def gggg(dl):
a = pi - int(pi)
k = []
for i in xrange(8):
a *= 10.0
k.append(int(a))
a = a - int(a)
dl1 = []
for i,c in enumerate(dl):
j = ord(c)
j = j - k[i % 8]
dl1.append(chr(j))
return "".join(dl1)
#c============================================================================
#
# subroutine hhhh
# include 'fildat.inc'
# integer*4 ierr
# character*10 dline
# character*35 f
#
#c-----try to open file
#
#c f = '\\51thanasis\d\tif\var\sat.tif'
# f = ']`46|csgb`szwrxthw]yrhb{bv]xjv4yjj!' ! \\31samba\runprogs\tif\var\sat.tif
# call gggg (f)
# open (uArx, file=f, iostat=ierr)
# if (ierr .ne. 0) then
# f = ']`itvgxasyou{qmx]xjkexgw]wby7vok!$!' ! \\homer\runprogs\tif\var\sat.tif
# call gggg (f)
# open (uArx, file=f, iostat=ierr)
# if (ierr .ne. 0) go to 200
# end if
#
#c-----Try to validate
#
# read (uArx, 20, iostat=ierr) dline
#20 format (a)
# if (ierr .ne. 0) go to 100
# call gggg (dline)
# if (dline .ne. 'XYZZYXYZZY') go to 100 ! Magic word
# close (uArx)
# return
#
#c-----Validation failed
#
#100 continue
# close (uArx)
#200 continue
# f = 'B2!X]CSTT$Mnktgwz$ot}"ltvre%)"&%!$!' ! A. STAMOS Library not found
# call gggg (f)
# print 10, f
#10 format (1x, a)
# stop
# end
|