Jump to Navigation

Me on Twitter

  • @Eyal_Lezmy pas seulement l'équipe mais potentiellement tte la communauté. Question d'intérêt public en qq sorte ;-) 12 years 34 weeks ago
  • @ParisAndroidUG Quel est le moyen privilégié de poser une question android au #PAUG ? J'ai beau chercher... pas de forum-like sur paug.fr... 12 years 34 weeks ago
  • @malsini documentation is (c) by @agoncal. I suggest u have a look at his book... Also we talked about articles at http://t.co/NZE3z6zG 12 years 34 weeks ago
  • A voir absolument : Animez vos pages HTML5, Martin Gorner, Google (Atelier Open Data Google / Dataconnexions) http://t.co/6quwgLu6 12 years 34 weeks ago
  • Yesterday ended a great 3-day Java EE 6 training course by @agoncal with @alexlewando and others. Group agrees on the quality of the class ! 12 years 34 weeks ago
  • @romainguy @ParisAndroidUG Retour d'expérience depuis les débuts d'android, qu'est-ce qui marche et ne marche pas ? Le futur d'android ? 12 years 35 weeks ago
  • #NegativeSpace A bit hard to use but a very ingenious puzzle game for #android that deserves a try http://t.co/71GvLfmV 12 years 35 weeks ago
  • @louistouzet Bravo pour cette belle appli qui monte, qui monte ! #AngryBirds https://t.co/i5ppeyvr http://t.co/3xBnMBBs 12 years 36 weeks ago
  • 2 dev java/android cherchent équipe / projet #dataconnexions 12 years 37 weeks ago
  • @Lim_Ace too bad it doesn't display correctly on my #android... Can't read anything 12 years 38 weeks ago

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.

Comments

Post new comment

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>
  • You can enable syntax highlighting of source code with the following tags: <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.