└── Readme.md /Readme.md: -------------------------------------------------------------------------------- 1 | # First Prompt 1 ( STT ) 2 | 3 | --- 4 | Write a Python script that recognizes speech using the `speech_recognition` module while automating the installation of required packages via the `subprocess` module. Ensure the script uses advanced configurations of `sr.Recognizer` for optimal performance. Implement and configure the following parameters to achieve the fastest and most accurate results: 5 | 6 | 7 | r = sr.Recognizer() 8 | r.dynamic_energy_adjustment_damping = 0.3 9 | r.dynamic_energy_ratio = 0.9 10 | r.dynamic_energy_threshold = False 11 | r.pause_threshold = 0.5 12 | r.operation_timeout = None 13 | r.non_speaking_duration = 0.5 14 | 15 | 16 | Ensure the script demonstrates fast and efficient real-time speech recognition by handling background noise and optimizing speed. 17 | 18 | --- 19 | 20 | # Second Prompt 2 ( TTS ) 21 | 22 | --- 23 | 24 | Create an optimized and advanced Python code for text-to-speech using the pyttsx3 library. The code should be fast and efficient. Use the subprocess module to automate the installation of required dependencies with pip. Implement a function named speak that accepts text and converts it to speech. Within the function, vary the pitch of the speech randomly. Additionally, allow the user to set the voice property by using the voice ID 25 | 26 | --- 27 | 28 | # Prompt 3 to open multiple websites 29 | 30 | --- 31 | Create a Python script that automates the process of searching Google for a list of terms and opening the top results in a web browser. The script should include the following steps: 32 | 33 | Library Installation: 34 | 35 | Check if the required library googlesearch-python is installed. If not, automatically install it using pip. 36 | Google Search Functionality: 37 | 38 | Define a function to perform a Google search for each search term and return the top results. 39 | Allow the number of search results to be configurable (default: 5). 40 | Opening URLs: 41 | 42 | For each search term, open the top URLs in the web browser. 43 | The script should open the URLs one by one. 44 | Main Automation: 45 | 46 | The script should take a list of search terms, search Google for each, display the found URLs, and open the results in a web browser. 47 | Example Usage: 48 | 49 | Provide an example usage with a list of search terms (e.g., ‘youtube’, ‘instagram’, ‘facebook’, etc.). 50 | --- 51 | 52 | # prompt 4 open multiple apps 53 | 54 | --- 55 | 56 | Create a Python script that allows users to open multiple applications by specifying their names. The script should be able to open applications on different platforms (Windows, Linux, and MacOS) and handle errors gracefully. The script should: 57 | 58 | 1. **Accept user input:** Ask the user to input a list of application names (separated by space). 59 | 2. **Split the input into individual app names:** Handle the input as a space-separated string and split it into a list of applications. 60 | 3. **Platform-specific app launching:** 61 | - For **Windows**: Use the `start` command to open apps available in the system's PATH or specify full paths. 62 | - For **Linux**: Attempt to open apps directly by calling their executable names (if they are in the PATH). 63 | - For **MacOS**: Use the `open` command to open apps. 64 | 4. **Error handling:** 65 | - Handle the case where the app is not found by printing an appropriate error message. 66 | - Catch and report any exceptions that occur during the execution (like issues with permissions, invalid app names, etc.). 67 | 5. **Feedback:** Print a message when each app is successfully opened or if there is an error. 68 | 6. **Exit gracefully:** If no apps are entered, print a message and exit. 69 | 70 | The script should use Python's `subprocess` module to run system commands and handle exceptions. The main program should run only if the script is executed directly (i.e., `if __name__ == "__main__":` block). 71 | 72 | **Additional Requirements:** 73 | - Ensure the code works on **Windows**, **Linux**, and **MacOS**. 74 | - Provide clear error messages when things go wrong, such as when an app is not found or when the command execution fails. 75 | - Include checks for unsupported platforms. 76 | - Provide an example of usage, such as asking the user to input apps like "chrome firefox vscode" or "safari terminal". 77 | 78 | --- 79 | 80 | --------------------------------------------------------------------------------