Jump to Navigation

Me on Twitter

  • RT @computerfact: concerned parent: if all your friends jumped off a bridge would you follow them? machine learning algorithm: yes. 6 years 36 weeks ago
  • RT @timberners_lee: We have lost a colossal mind and a wonderful spirit. Rest in peace, Stephen Hawking. https://t.co/ectv7r4UIm 6 years 37 weeks ago
  • RT @helenvholmes: Yes, let's https://t.co/tM4iF50idY 6 years 41 weeks ago
  • Do people who can afford a LG wallpaper TV really care about paying it 7,999.99$ rather than 8,000$ ??? 7 years 1 week ago
  • As I understand this is 1 step closer to breaking current cryptography standards. Goodbye #privacy https://t.co/ncka6ldRV8 #quantumcomputing 7 years 2 weeks ago
  • Write 'cookie' in Unicode : 7 years 5 weeks ago
  • RT @FBonnifet: Un peu de pédagogie pour tous ceux qui n'ont pas compris l'intérêt d'une taxe carbone 7 years 7 weeks ago
  • @laquadrature Google sometimes frightens me. It just looked into my photos to suggest me a better look for my last… https://t.co/kGT8dnmVDb 7 years 8 weeks ago
  • "Voici les quatre mesures qui menacent notre vie privée" https://t.co/I6spzN5QKB 7 years 8 weeks ago
  • RT @datagouvfr: Service public de la donnée: les données du Cadastre sont maintenant disponibles en #opendata: https://t.co/BNfYwaFRhp http… 7 years 8 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.