The short answer is yes, you can do anything a bash script does in Python. But IMO it's not worth it in much of the time.
Bash is just easier for some tasks. And if you learn "awk" and include that in your scripting, the cases where a shell script is a better option expands quite a bit as far as I'm concerned. Here's an example of why I think that's the case.
Capturing the output from a command in a Bash script might look like this:
Code:
output="$(..some command here..)"
rc=$?
whereas doing the same in Python without running into stupid problems might look like this:
Code:
try:
cproc = Popen("..some command here...", stdout=PIPE, stderr=PIPE)
out, err = cproc.communicate()
rc = cproc.returncode
except OSError as __ex:
err = __ex.strerror
rc = __ex.errno
Both work but one it's a whole lot simpler to code. Of course you could make a general purpose function to run the commands, then import that module and not have to code it each time. I pulled that code from some code like that I wrote. But if you want to do something simple it's not always worth it to code things in Python IMO.
On the other hand, if the task at hand require doing something that would be tedious in Bash/Awk, like dealing with JSON data, then I would opt for Python every time.
For learning Python, I think picking a couple Bash scripts and coding equivalents sounds like a good idea. You'll probably learn a lot in the process.