4 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for chriswelborn

I just wanted to show the basic usage of docopt, a module that makes parsing command-line arguments so much easier. I'm not affiliated with the creators of docopt, but I'm certainly thankful for their work and happy to post this little snippet. I will point you to [docopt.org](http://docopt.org) for more …

1
3K
Member Avatar for chriswelborn

This is a script that was supposed to be very basic, just running a command with my scripts arguments attached. I didn't realize that if user 'cj' opens firefox, when user 'root' does '**firefox -new-tab**' it doesn't work. Firefox will just open a new window, and thats exactly what I …

Member Avatar for chriswelborn
0
306
Member Avatar for RenanLazarotto

I've found this a little hard to find, so I decided to share with you guys. This small code will allow your app to accept arguments. Just copy the whole code into the main sub (I didn't tested elsewhere) and edit the code inside the for to do what you …

Member Avatar for anoopkh
0
1K
Member Avatar for Gribouillis

Some time ago, I was writing a small command line interpreter, with the help of [url=http://docs.python.org/library/cmd.html#module-cmd]the standard module cmd[/url] which offers minimal support for such tasks, and I had the problem that this module doesn't have a function to parse a command line to produce a list argv which can …

Member Avatar for Gribouillis
1
849

The End.