Program with Pmw.OptionMenu in simvizGUI2.py. Modify the simvizGUI2.py script such that the func…

Program with Pmw.OptionMenu in simvizGUI2.py.

Modify the simvizGUI2.py script such that the func entry
field is replaced by a pulldown menu with the three legal choices (y, siny,
y3). Use Pmw.OptionMenu, and place the widget between the entry fields and the
Compute button.

Reuse the module from Exercise 8.10 to ensure that the
option menu is always up-to-date with the legal func names in the underlying
oscillator code.

Exercise 8.10

Extract info from a program code.

This exercise concerns an improvement of the simviz1.py
script. The valid names of the func string are always defined in
»

Program with Pmw.OptionMenu in simvizGUI2.py.

Modify the simvizGUI2.py script such that the func entry
field is replaced by a pulldown menu with the three legal choices (y, siny,
y3). Use Pmw.OptionMenu, and place the widget between the entry fields and the
Compute button.

Reuse the module from Exercise 8.10 to ensure that the
option menu is always up-to-date with the legal func names in the underlying
oscillator code.

Exercise 8.10

Extract info from a program code.

This exercise concerns an improvement of the simviz1.py
script. The valid names of the func string are always defined in the source
code of the oscillator program. Locate the file oscillator.f (the Fortran 77
version of oscillator) in the src tree. Extract the valid func names from this
file by looking for if-type statements of the form

if (func .eq. ’y’)

else if (func .eq. ’siny’)

Having the valid names for the -func option, one can check
that the value supplied by the user is legal.

First write a function for finding where a program (here
oscillator.f) is located and let the function return the program’s complete
path. Then write a function for extracting the valid func names using regular
expressions. Return a tuple of the valid names. The next step is to write a
function for testing if sys.argv has an option -func, and if so, the associated
value must be contained in the tuple of valid names. Raise an exception
(Chapter 8.8) if an illegal name is encountered. Otherwise, run simviz1.py with
sys.argv as (legal) command-line arguments. To run simviz1.py you can either
use an operating system call (Chapter 3.1.3) or you can execute import simviz1
(insert the directory where simviz1.py resides such that the simviz1 module is
found).

Let the whole script be organized as a module, i.e., put all
statements in the main program inside an if __name__ test (see Appendix B.1.1).
When the functionality for extracting valid func names in the oscillator.f code
is available as a function in a module, we can easily reuse the functionality
in extended versions of simviz1.py. This will be exemplified in Exercise 6.10.

Exercise 6.10

Program with Pmw.OptionMenu in simvizGUI2.py.

Modify the simvizGUI2.py script such that the func entry
field is replaced by a pulldown menu with the three legal choices (y, siny,
y3). Use Pmw.OptionMenu, and place the widget between the entry fields and the
Compute button.

Reuse the module from Exercise 8.10 to ensure that the
option menu is always up-to-date with the legal func names in the underlying
oscillator code.

»

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more