I am writing a program in Python for elliptic curve cryptography (for school and out of interest). I am currently working on the digital signature algorithm. I am currently looking for a good and secure hashing function which is either standard in Python or can easily be downloaded and imported. I thought about SHA256, since that's the only one I know which hasn't been broken yet (as far as I know). However, I have also read that SHA shouldn't be used for cryptography. Is SHA256 appropriate for a digital signature algorithm? Or should a different hashing function be used? If so, which one would be a good choice?
The best standardized algorithm currently available is still SHA-2. SHA-2 now consists of 6 hash functions: SHA-256, SHA-384 and SHA-512 were first defined. SHA-224 was later added to allow for a smaller output size. After that the less well available SHA-512/224 and SHA-512/256 were introduced.
SHA-2 mainly consists of the 32-bit oriented SHA-256 variants - SHA-256 and SHA-224 - and the 64-bit SHA-512 variants - the others. The performance of the SHA-512 variants may actually be higher on 64 bit machines, hence the introduction of SHA-512/224 and SHA-512/256. Basically the variants of SHA-256 / SHA-512 only differ in the constants they use internally and the amount of bits used as output size. Some newer Intel and AMD processors SHA extensions that only accelerate SHA-256, not SHA-512, possibly shifting the favor again towards SHA-256 with regard to speed.
During the SHA-3 competition it came to light that SHA-2 is still pretty strong, even if SHA-1 is under attack. I would suggest only to look at other hashes if SHA-2 is under attack or if better hash algorithms get standardized and used.
From Wikipedia:

In 2005, security flaws were identified in SHA-1, namely that a mathematical weakness might exist, indicating that a stronger hash function would be desirable.[6] Although SHA-2 bears some similarity to the SHA-1 algorithm, these attacks have not been successfully extended to SHA-2.

Note that SHA-2 uses a considerably more complex round function compared to SHA-1. So although it has a similar structure (both are so called Merkle-Damgard hashes) SHA-2 may be much more resistant than SHA-1 against attack none-the-less.
Cryptographic hash functions in Python