I try to learn python by writing working bash-scripts in python. How can I do a bash-syntax like this with python: mysql --host=$MYSQLHOST -A --user=$MYSQLUSER --password=$MYSQLPWD $MYSQLDB <<END_OF_SQLINPUT | sed '1,/^export/d' > "$FDIMPORT" $MYSQLEXPORTCMDFD END_OF_SQLINPUT Thanks a lot for your help! Al