Middle
Tell us about Python — what did you write, what libraries did you use?
sobes.tech AI
Answer from AI
In Python, I wrote scripts for automating tasks, data processing, and system monitoring. I used standard libraries such as os, sys, subprocess for interacting with the OS, as well as requests for working with HTTP requests.
For more complex tasks, I employed libraries:
paramikofor SSH connections and remote server management.pytestfor writing and running tests.pandasandnumpyfor data processing and analysis.boto3for interacting with AWS.
Here's an example of a simple script to check server availability:
import requests
def check_server(url):
try:
response = requests.get(url, timeout=5)
return response.status_code == 200
except requests.RequestException:
return False
if __name__ == '__main__':
url = 'https://example.com'
if check_server(url):
print(f'Server {url} is up')
else:
print(f'Server {url} is down')