Jump to Navigation

Me on Twitter

  • RT @NASA: LIVE NOW: We're set to land @NASAInSight on Mars on Monday, Nov. 26. Get an overview of the mission as the team discusses the lan… 6 years 1 week ago
  • RT Moi qui me tape sur le torse en répétant « papa ! » depuis des mois jusqu'à ce que ma fille comprenne que « papa… https://t.co/BWEQs4CpWg 6 years 2 weeks ago
  • RT @dvIpr: Expectations v/s Reality 6 years 3 weeks ago
  • RT @OSAXIS: Osaxis accueillait aujourd’hui @WTTJ pour créer les médias qui animeront notre future page entreprise. Nous recrutons encore et… 6 years 3 weeks ago
  • This is why I don't use my laptop's hardware disk encryption - https://t.co/lLipmzA2FX 6 years 3 weeks ago
  • As usual short-sighted deputies acting against the general interest. "The's Link Tax Will Kill Open Access and Crea… https://t.co/GxE5stf81Q 6 years 3 weeks ago
  • RT @amazingmap: A map of the entire internet as of May 1973 https://t.co/b0gaP4ajx3 6 years 3 weeks ago
  • @Nextclouders I understand. Hope it won't be a cause of frustration and non adoption. 6 years 4 weeks ago
  • @Nextclouders what I like in #nextcloud #owncloud : centralized authentication and remote file access. What I don't… https://t.co/FZMdnPnyvc 6 years 4 weeks ago
  • RT @github: The most important takeaway? Contact your Council members. Let them know that limiting the exclusion to *only* non-profits in… 6 years 5 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.