How do I save a POA file with a python program on a command line terminal in itlabs

Dear Sir / Madam,

I am having problems following the example on using the map-reduce python program as an application using the command line terminal in the IT labs environment.

I want to save the program in the terminal but there is not a save button on the terminal.

I have given the program below, I am trying to save it to directory; retail_app

And subdirectory src/main/python; orderItemsFile = open("/data/retail_db/order_items/part-00000")

orderItemsRead =

orderItems = orderItemsRead.splitlines()

orderItemsFilter = filter(lambda rec: int(rec.split(",")[1]) == 68880, orderItems)

orderItemsMap = map(lambda rec: float(rec.split(",")[4]), orderItemsFilter)

orderItemsRevenue = reduce(lambda total, element: total+element, orderItemsMap)

You cannot save using terminal. Terminal is to run commands in interactive fashion.

Dear Sir / Madam,

I understand that the terminal is interactive, but in the video ‘GET REVENUE FOR GIVEN ORDER ID - AS APPLICATION’ , after you set up the retail_app directory and the subdirectory src/main/python you created a python file in the subdirectory using;

[/python]$ vi

This opens another window (application POA) in which you copy and paste the Python Map-Reduce program you created earlier and then you say that the program should be saved to the subdirectory location.

Then you go back to the terminal and write;

[/python]$ python iv

This is to get the program you just saved to run in the POA to give you the result of 999.77

If I can’t save the POA with the python Map-Reduce program within the POA how am I going the run the program to give the result of 999.77


Kind regards

Sasha Ajay Malkani

thanks for the awesome information.

thanks my issue has been fixed.