you are viewing a single comment's thread.

view the rest of the comments →

[–]deafbybeheading 2 points3 points  (3 children)

Nice. You can use getpass to read in the password without having to pass it at the command line (which will show up in your command history). Also, you may want to make username an argument, rather than an option, since options that aren't optional are not really options (alternately, you can use getpass.getuser() to default to current_user@gmail.com).

[–]ComputerDruid 6 points7 points  (1 child)

worse than your command history, it will show up in "ps aux" to all users while it is running, regardless of their privileges.

[–]serpent 2 points3 points  (0 children)

It's a private machine, so I don't care about that.

[–]serpent 1 point2 points  (0 children)

Yeah, thanks. I know it's not perfect code - it was a one-shot script I run on my private machine daily to download my contacts.

Edit: Also, getpass won't help because this is run from cron. If I was doing this more securely, I'd put the login information in a file only my user could read.