Hacker News new | ask | show | jobs
by jmau5 5281 days ago
I've included the cosmetic/pythonic changes and I'm going to take some time to read through the link you left me.

Do you have any recommendations for what I should use other than sudo? This was meant to work under Ubuntu (my OS), but I'd like to extend it so that it will work on any platform.

Thanks :)

1 comments

Update:

1) I've conformed setup.py to distutils, so it's a lot prettier now.

2) I tried using the print [this for this in that] style, but that didn't work out as planned. The actual list itself was printed and the colors didn't work.

3) I'm still using sudo to set the chmod and to move reddit.py to /usr/local/bin, what alternatives are there? On my system I can't do either without sudo.

2. oh yeah, my bad.

3. frankly I don't know why you insist on copying this file with the installer. can't the user copy it themselves? if they want to use your app in shell terminal, it means they heavily use shell terminal, which means they know how to cp file /usr/local/bin or set a link. it's not a case of alternative to sudo, it's a matter of gaining permission to access write to /, Ubuntu (and some other) just has sudo set up out of the box, and a lot of Linux users do it anyway, but it's not required to use or even have sudo. you can also try to add an alias to ~/.bashrc, user has access to that file, but I doubt anyone will like you more for overriding their bashrc ;) (and it also assumes user uses bash, which also isn't required :))

Would appending the scripts current location to PATH be a better idea?
For 3: Look into using Distribute ( http://packages.python.org/distribute/ ). It'll let you specify the "scripts" parameter to the setup() function, which handles placing executables in the OS's PATH.