groovy

Capture shell output after running python script that raised Exception

Capture shell output after running python script that raised Exception Question: I am running a shell in groovy, that executes a python script. I was able to get the out put of the python script by assigning it to a variable. However, i would like to capture Exceptions as well, but in case of exception …

Total answers: 1

Safe dereferencing in Python

Safe dereferencing in Python Question: Groovy has a nice operator for safe dereferencing, which helps to avoid NullPointerExceptions: variable?.method() The method will only be called, if variable is not null. Is there a way to do the same in Python? Or do I have to write if variable: variable.method()? Asked By: deamon || Source Answers: …

Total answers: 7

Catching typos in scripting languages

Catching typos in scripting languages Question: If your scripting language of choice doesn’t have something like Perl’s strict mode, how are you catching typos? Are you unit testing everything? Every constructor, every method? Is this the only way to go about it? Asked By: Geo || Source Answers: There are errors other than “typos”. If …

Total answers: 10

Python vs Groovy vs Ruby? (based on criteria listed in question)

Python vs Groovy vs Ruby? (based on criteria listed in question) Question: Considering the criteria listed below, which of Python, Groovy or Ruby would you use? Criteria (Importance out of 10, 10 being most important) Richness of API/libraries available (eg. maths, plotting, networking) (9) Ability to embed in desktop (java/c++) applications (8) Ease of deployment …

Total answers: 10