do automate things on Linux
Project description
# auto_everything
Linux system automation
#### Installation
`pip3 install auto_everything`
#### Import
```
from auto_everything.base import Terminal
t = Terminal()
```
#### Run command & get reply
```
reply = t.run_command('uname -a')
print(reply)
```
#### Run program
`t.run_program('firefox')`
#### Run python script
`t.run_py('your_python_file_path')`
#### Run bash script
`t.run_sh('your_.sh_file_path')`
#### Detect if a program or script is running
```
status = t.is_running('terminal')
print(status)
```
#### Web automation
```
from auto_everything.web import Selenium
from time import sleep
my_selenium = Selenium("https://www.google.com")
d = my_selenium.driver
# get input box
xpath = '//*[@id="lst-ib"]'
element = my_selenium.wait_until_exists(xpath)
# text inputing
element.send_keys('\b' * 20, "yingshaoxo")
# click search button
element = my_selenium.wait_until_exists('//*[@id="tsf"]/div[2]/div[3]/center/input[1]')
element.click() # d.execute_script("arguments[0].click();", element)
# exit
sleep(3)
d.quit()
```
Linux system automation
#### Installation
`pip3 install auto_everything`
#### Import
```
from auto_everything.base import Terminal
t = Terminal()
```
#### Run command & get reply
```
reply = t.run_command('uname -a')
print(reply)
```
#### Run program
`t.run_program('firefox')`
#### Run python script
`t.run_py('your_python_file_path')`
#### Run bash script
`t.run_sh('your_.sh_file_path')`
#### Detect if a program or script is running
```
status = t.is_running('terminal')
print(status)
```
#### Web automation
```
from auto_everything.web import Selenium
from time import sleep
my_selenium = Selenium("https://www.google.com")
d = my_selenium.driver
# get input box
xpath = '//*[@id="lst-ib"]'
element = my_selenium.wait_until_exists(xpath)
# text inputing
element.send_keys('\b' * 20, "yingshaoxo")
# click search button
element = my_selenium.wait_until_exists('//*[@id="tsf"]/div[2]/div[3]/center/input[1]')
element.click() # d.execute_script("arguments[0].click();", element)
# exit
sleep(3)
d.quit()
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
auto_everything-0.9.tar.gz
(4.8 kB
view hashes)
Built Distribution
Close
Hashes for auto_everything-0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdfadb25c4c1202806be54f09535036c5f2adcfa29da13c2862aa32927637e3a |
|
MD5 | b6c67140018d1b778680df7dfa37550b |
|
BLAKE2b-256 | a1067c57d1824f6cc0e1911e6621f109c4b196850ce2db9c64f320003fbc49ff |