The problem that code solves is finding the name of the invoked command and
getting rid of the Windows .exe extension. I'd write it a bit differently:
from os.path import basename, splitext
...
progname = splitext(basename(sys.argv[0]))[0]
(or, at length)
progfile = basename(sys.argv[0]
Getting old? That, I am!
Seriously, though, what's up with all the double-subscripts on string arrays?
Seems you always need string[0][0] to access a word, when I would expect just
one subscript unless you want a character. And I have absolutely no clue how
the quoted line extracts the fin
If that exceeds your syntax input queue, then you're getting old! :P
Am 2016-03-22 00:52, schrieb Gregory J. Ward:
All I can say is:
SHORTPROGN = os.path.splitext(os.path.split(sys.argv[0])[1])[0]
From: Georg Mischler
Subject: Re: [Radiance-dev] Python scripts for Radiance
Date: Mar
All I can say is:
SHORTPROGN = os.path.splitext(os.path.split(sys.argv[0])[1])[0]
> From: Georg Mischler
> Subject: Re: [Radiance-dev] Python scripts for Radiance
> Date: March 21, 2016 4:22:47 PM PDT
>
> You're arguing with some of the most syntactitcally complex aspects
> of current p
You're arguing with some of the most syntactitcally complex aspects
of current programming languages here. (STL?!?)
In contrast, Pythons syntax was specifically designed to be easy to
understand and use (there's a lot of research into that).
Maybe you should just invest an hour and play through t
Hmmm... Well, I may be a little thicker with respect to learning new languages
than you give me credit for. Lately, I've been trying to pick up Java for one
of my client projects and having a lot of trouble, despite (or because of?) its
passing similarity to C++. Perl is relatively easy for m
Dear Georg,
I would vote for the glaze csh script.
Best,
Wouter
On 03/21/2016 05:02 PM, Georg Mischler
wrote:
Hi again!
I have converted some of the original Radiance shell scripts into
Python.
Greg, someone of your capacity will be fluent in the Python syntax
within
an hour, the object and exception system in a day, and the most
elementary
parts of the library within a few days (the included library is so huge
that even experienced pythonistas will keep searching the documentation
for
There is the downside that I don't know Python at all, and learning yet another
object-oriented language with completely different syntax isn't high on my list
of priorities. That said, if we can get past the support issues on various
platforms, I have no problem with Schorsch and others making
Schorsch, you're making the rest of us look like slackers!
I'm all about this move. When I added some new stuff that was written in
Ruby, it was less than enthusiastically adopted because of yet another
dependency; Perl had recently been added to the dependency list with the
new rtcontrib utilitie
Hi again!
I have converted some of the original Radiance shell scripts into
Python.
https://github.com/gmischler/PyRad
The examples so far are exact drop-in replacements of the original csh
or Perl versions, but with some extra functionality and benefits.
* usage instructions (-H)
* progres
11 matches
Mail list logo