Jump to Navigation

Me on Twitter

  • RT @codinghorror: Don't forget to have an extra special scary programmer halloween.. by doing the SCARIEST THING IMAGINABLE... looking at y… 6 years 5 weeks ago
  • @instapaper @Pocket @wallabagapp I'm now using a personal instance of #wallabag and it really does the job ! 6 years 5 weeks ago
  • @instapaper @Pocket @wallabagapp I'm now using a personal instance of #wallabag and it really does the job ! 6 years 5 weeks ago
  • RT @gavinsblog: Spot the robot dog dancing to UpTown Funk is simultaneously both terrifying and hilarious. https://t.co/UNPsXZrXvh 6 years 6 weeks ago
  • Almost full screen cookie warning... On the cookie policy page ! The Internet is going crazy... #GDPR https://t.co/n3RtuNYJC8 6 years 6 weeks ago
  • @TwidereProject I hope not. Twidere is the best Twitter client around. I've tried many before, including Twitter's… https://t.co/XZWJNwqk1U 6 years 6 weeks ago
  • Not being aware of an exploit doesn't mean there wasn't... New Bluetooth Hack Affects Millions of Devices from Maj… https://t.co/Prjj3VMCnV 6 years 7 weeks ago
  • @_FranceConnect_ A est-il prévu pour fournir l'équivalent d'un justificatif de domicile à toute société le demandant ? 6 years 10 weeks ago
  • @GroupeLaPoste Bravo pour https://t.co/cBOQQDdlVq Le facteur est venu vérifier mon identité en 24h et mon identité… https://t.co/xixwTwxsCF 6 years 10 weeks ago
  • Soooo true.... https://t.co/vhEsNGV0uQ 6 years 11 weeks ago

Reply to comment

python Python versus Shell scripting : from experience

A quick "pros & cons" to choose between Python or Shell scripting, from what I've observed through the years.

This could probably apply to other high level script languages* vs shell.

* Like Ruby, but not like Perl, as it shares more with shells from my point of view, like unreadable syntax and execution speed.

Python vs Shell

Choose Python for :

  • its simple syntax : can be read even by non Python-speaking people. End users may not be scared to change scripts to fit their need.
  • portability : Python is actually more portable than shell because of ease of installation for any OS. Shell is theoretically portable but it's complicated to explain end users how to install the runtime (e.g. see cygwin). A Python script can be packaged into an executable program. There may be ways to bundle a script with the shell runtime.

Choose Shell for :

  • speed : except in case of bad code logic, shell scripts are usually a lot faster than Python's equivalents.
  • its ease to deal with external programs and system : shell's syntax is already made to test/pipe/chain easily existing programs, whereas Python requires some extra boilerplate. Shell also has built-in functions to deal directly with files and the system, whereas Python uses an object-oriented model, which may not be as handy.

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • E-Mail addresses are hidden with reCAPTCHA Mailhide.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Vous pouvez activer la coloration syntaxique du code source à l'aide des balises suivantes: <code>, <blockcode>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>. The supported tag styles are: <foo>, [foo].
  • Twitter-style #hashtags are linked to search.twitter.com.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.