Skip to content

Instantly share code, notes, and snippets.

@ddbs
Last active January 4, 2023 08:25
Show Gist options
  • Save ddbs/f89969576ce32ced65c1fcd3bfaaf0f2 to your computer and use it in GitHub Desktop.
Save ddbs/f89969576ce32ced65c1fcd3bfaaf0f2 to your computer and use it in GitHub Desktop.
run bash script from python
import os
cmd = 'wget -O products.csv --user="xxx" --password="xxx" http://online.xxx.com/download_xxx_products.php'
os.system(cmd)
import os
cmd = 'bash download.sh'
os.system(cmd)
#!/bin/bash
echo "Downloading products file.."
wget -O products.csv --user='xxx' --password='xxx' http://online.xxx.com/download_xxx_products.php
echo "Downloading customers file.."
echo "Downloading orders file.."
echo "Tasks completed."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment