I have a program I'm writing in python, and I have the need to store some passwords. These passwords will be the passwords to ftp servers, so it's important that they're not just plainly visible to everybody. This also means that I can't store a non-reversible hash of the password like you would on a webserver, because I'm not checking if somebody inputs the right password, I'm just relaying the password to somebody else.
So what's the best way to store passwords? I'm using python, and the program will be linux-only.
Depending on the distribution you can probably store it in the keychain if one is available. 
Otherwise take a look at some of the encryption algorithms available (PGP/GPG, DES, AES etc) and their Python ports/modules but this is hard stuff which you have to get right.
Storing passwords with python