Question: Lab Exercises 1. Write a python program which do the following 1.1. Creates one process, this process must ask the user to enter a valid

 Lab Exercises 1. Write a python program which do the following
1.1. Creates one process, this process must ask the user to enter

Lab Exercises 1. Write a python program which do the following 1.1. Creates one process, this process must ask the user to enter a valid ip address. A valid IP address must be in the form of A.B.C.D, where A,B,C and D are numbers from 0-255. The numbers cannot be o prefixed unless they are 0. 2. Write a python program which do the following: 2.1. Create two processes and one queue. 2.2. The first process must put commands into the queue. The commands are 2.2.1. id 2.2.2 whoami 2.2.3. pwd 2.2.4. Is 2.2.5.cat 2.3. The second process must get the elements from the queue and execute them using the os module. If the command is cat, then the script must ask the user for the file name to view its contents. 2.4. Note: Don't forget to use a proper lock to prevent any errors in the code 3. Using Pool( do the following: 3.1. The pool must have 2 processes, each process will pass two parameters to a search function, these parameters must be the name of the file and a word to search for these two parameters must be entered by the user and must be different from the process to another. 3.2. The Search function must search for the word in the file and if the word is found then find out the number of occurrences for this word otherwise return that the word doesn't appear in the file. 3.3 You need to verify that the file the user input is actually a file and it exists in the system

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!