rules from an xml file

2007-09-24 Thread jonny
I have a python code that manages some parameters using some variable
rules that may change from day to day. I'd like that the code will
self-modify according to rules parsed from a xml file:

example:


   
  














   Something is wrong!

   
...  
...   


Due to the fact that rules may change, I have to manage the python
program, parsing the whole xml file, and self-modify the python code
according to these variable rules.
How can I do?

-- 
http://mail.python.org/mailman/listinfo/python-list


Help with my programming homework (python, and raptor)

2013-11-06 Thread jonny seelye
Employee Salaries
You are working for a medium sized construction company as an intern in 
the Information Technology department.  A director in the Human Resources 
department recently asked the IT department to write a small program that will 
help them do a salary comparison.  The program needs to be able to enter the 
name of the employee and their salary.  Once the data is loaded the program 
needs to find the average salary, the highest salary and the lowest salary.  
The program needs to print out these values along with the names of the 
employees that go along with the salary.
Your boss, who has great trust in you and your programming abilities, 
has given this project to you.  You, therefore, schedule a meeting with the HR 
director asking for the program to clarify the program’s requirements.  After 
your meeting you have summarized the following:
The program needs to ask for how many employees and salaries the 
program will be working with.  The program needs to do some data validation on 
this number to make sure it is a positive number.
The program needs to ask for the name of each employee along with their 
salary.  Since the name of the employee will be a string and the salary will be 
a number, you decide to use two parallel arrays to store the data.  The program 
will need to do some data validation on the salary to make sure it is a number 
and greater than 0 and less than $200,000.
The program will determine what the average salary is and print that 
out to the user.
The program will determine what salary is the lowest and print that out 
along with the name of the employee who has that salary figure.
The program will determine what salary is the highest and print that 
out along with the name of the employee who has that salary figure.


Use the following test data to test your program.
Employee Name   Salary  
John$45,600 Average Salary: $63, 862.50
Sue $55,400 Highest Salary: $89,750
David   $64,700 Lowest Salary:  $45,600
Betty   $89,750 

-- 
https://mail.python.org/mailman/listinfo/python-list


merge stdin, stdout?

2010-02-04 Thread jonny lowe
Hi everyone,

Is there an easy way to merge stdin and stdout? For instance suppose I
have script that prompts for a number and prints the number. If you
execute this with redirection from a file say input.txt with 42 in the
file, then executing

./myscript < input.txt > output.txt

the output.txt might look like this:

Enter a number:
You entered 42.

What I want is to have an easy way to merge input.txt and the stdout
so that output.txt look like:

Enter a number: 42
You entered 42.

Here, the first 42 is of course from input.txt.

Thanks.

-jon
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: merge stdin, stdout?

2010-02-05 Thread jonny lowe
On Feb 4, 8:20 pm, [email protected] wrote:
> On 01:56 am, [email protected] wrote:
>
>
>
> >Hi everyone,
>
> >Is there an easy way to mergestdinandstdout? For instance suppose I
> >havescriptthat prompts for a number and prints the number. If you
> >execute this with redirection from a file say input.txt with 42 in the
> >file, then executing
>
> >./myscript < input.txt > output.txt
>
> >the output.txt might look like this:
>
> >Enter a number:
> >You entered 42.
>
> >What I want is to have an easy way to merge input.txt and thestdout
> >so that output.txt look like:
>
> >Enter a number: 42
> >You entered 42.
>
> >Here, the first 42 is of course from input.txt.
>
> It sounds like you might be looking forscript(1)?
>
> Jean-Paul

Hi Jean-Paul,

I tried it. But stdin is not merged in with stdout. Maybe I'm using
script wrongly? This is what I've done. I have a python script y.
Here's what it looks like when I run it and I entered "sss":

$ ./y
gimme x:sss
you entered sss

Now I'm going to use the script command. I'm using an input file
input.txt that contains just the string "hello".

$ script -c "./y < input.txt" output.txt
Script started, file is output.txt
gimme x:you entered hello
Script done, file is output.txt

And when I view output.txt this is what I see:

$ less output.txt
Script started on Thu Feb  4 22:28:12 2010
gimme x:you entered hello

Script done on Thu Feb  4 22:28:13 2010

As you can see the stdin is not printed. What I'd really wanted was
something like this in output.txt:

gimme x:hello
you entered hello

-jon
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: merge stdin, stdout?

2010-02-06 Thread jonny lowe
On Feb 5, 11:10 pm, "Gabriel Genellina" 
wrote:
> En Fri, 05 Feb 2010 17:39:07 -0300, jonny lowe
>  escribió:
>
>
>
>
>
> > On Feb 4, 8:20 pm, [email protected] wrote:
> >> On 01:56 am, [email protected] wrote:
> >> >What I want is to have an easy way tomergeinput.txt and thestdout
> >> >so that output.txt look like:
>
> >> >Enter a number: 42
> >> >You entered 42.
>
> >> >Here, the first 42 is of course from input.txt.
>
> >> It sounds like you might be looking forscript(1)?
>
> > $ script -c "./y < input.txt" output.txt
> > Script started, file is output.txt
> > gimme x:you entered hello
> > Script done, file is output.txt
>
> Try moving the redirection out of the command:
>
> $ script -c ./y output.txt < input.txt
>
> --
> Gabriel Genellina- Hide quoted text -
>
> - Show quoted text -

The result is the same as before. I've tested in fedora11.

-jon
-- 
http://mail.python.org/mailman/listinfo/python-list