optest.py :  » Business-Application » ThanCad » thancad-0.0.9 » p_gfil » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » Business Application » ThanCad 
ThanCad » thancad 0.0.9 » p_gfil » optest.py
# -*- coding: iso-8859-7 -*-

from p_ggen import inpDoubleR,medDoubleR
from openfile import openFile1,closeFiles1,setPar


#==========================================================================

depek=50.0; apmin=18.0; apmax=20.0; vMel=50.0


def test():
      setPar(openfileParTest)
      openFile1(0, ' ',   ' ',   0, '     ')
      openFile1(1, 'tri', 'old', 1, '/ ')

      openFile1(1, 'nb1', 'old', 1, ' BREAKLINES  idbrk')

      openFile1(1, 'brw', ' ',   2, ' BREAKLINES')

      openFile1(1, 'ptn', 'old',-1, ' ')
      openFile1(1, 'con', ' ',  -1, ' ')

      frw = openFile1(888, ' ', ' ',   0, ' ')
      ftri = frw["tri"]
      fnb1 = frw["nb1"]
      fbrw = frw["brw"]

      fbrw.write('brw')
      closeFiles1()

def openfileParTest(icod1, un):
    "Read parameters from keyboard."
    global depek, apmin, apmax, vMel
    if icod1 == 0:
      print
      apmin = inpDoubleR('Min  .  (m)  (enter=18): ',
                         1.0e-6, 1.0e6, 18.0)                       
      apmax = inpDoubleR(' Max  .  (m)  (enter=20): ',
                         1.0e-6, 1.0e6, 20.0)
      vMel  = inpDoubleR('   (km/hr)    (enter=30): ',
                         1.0e-6, 1.0e6, 30.0)
      depek = inpDoubleR('  . (m) (enter=50): ',
                         1.0e-6, 1.0e6, 50.0)
      arxika= True

#--Read parameters from unit un (file="mediate.tmp")

    elif icod1 == 1:
      depek = medDoubleR(un, '    . (m)=',
                         1.0e-6, 1.0e6, 50.0)
      apmin = medDoubleR(un, '  Min  .  (m) =',
                         1.0e-6, 1.0e6, 18.0)                       
      apmax = medDoubleR(un, '  Max  .  (m) =',
                         1.0e-6, 1.0e6, 20.0)
      vMel =  medDoubleR(un, '     (km/hr)   =',
                         1.0e-6, 1.0e6, 30.0)

#---Write parameters to unit un (file="mediate.tmp")

    elif icod1 == 2:
      un.write("%15.3f\n"*4 % (depek, apmin, apmax, vMel))

#---Write any direction to the user of the program
#         icod1 = -1 : Greek
#         icod1 = -2 : English

    elif icod1 < 0:
      if icod1 == -1: print grp('\n    . .\n')
      else:           print grp('\nThis program was made by T. Stamos.\n')

#---Error messages

    else:
      assert False, 'Sr openFilePar: Fildat library error: unknown code!'


test()
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.