On May 10, 6:56 pm, Steven D'Aprano wrote:
> > 4. What's the python way to emit warnings? (The script below should
> > warn the user that arguments after the first one are ignored.)
>
> import warnings
> warnings.warn("The end of the world is coming!")
The warnings module is used for warnings
On May 11, 12:30 pm, Nick Craig-Wood wrote:
> def __init__(self):
> usage = '''Usage: %prog [options] YYMMDD
> %prog -h|--help
> '''
> parser = OptionParser(usage=usage)
> parser.add_option("-n", "--no-newline", dest="nonl",
> action
kj wrote:
>
> Below is my very firs python script.
>
> This was just a learning exercise; the script doesn't do anything
> terribly exciting: for an argument of the form YYMMDD (year, month,
> day) it prints out the corresponding string YYMMDDW, where W is a
> one-letter abbreviation for th
Thank you all very much! I really appreciate it.
kynn
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
--
http://mail.python.org/mailman/listinfo/python-list
In <0216ec41$0$20647$c3e8...@news.astraweb.com> Steven D'Aprano
writes:
>On Sun, 10 May 2009 12:52:21 +, kj wrote:
>> 1. The name of the BadArgument exception class defined in the script
>>does not seem to me sufficiently specific. If one were to import the
>>script in order to reu
kj wrote:
Below is my very firs python script.
This was just a learning exercise; the script doesn't do anything
terribly exciting: for an argument of the form YYMMDD (year, month,
day) it prints out the corresponding string YYMMDDW, where W is a
one-letter abbreviation for the day of the week
Andre Engels wrote:
On Sun, May 10, 2009 at 5:56 PM, Steven D'Aprano
wrote:
5. The variable wd is meant to be "global" to the script. In other
languages I've programmed in I've seen some typographic convention
used for the name of such variables (e.g. all caps) to signal this
widened
Steven D'Aprano wrote:
On Sun, 10 May 2009 12:52:21 +, kj wrote:
5. The variable wd is meant to be "global" to the script. In other
languages I've programmed in I've seen some typographic convention
used for the name of such variables (e.g. all caps) to signal this
widened sco
On Sun, May 10, 2009 at 5:56 PM, Steven D'Aprano
wrote:
>> 5. The variable wd is meant to be "global" to the script. In other
>> languages I've programmed in I've seen some typographic convention
>> used for the name of such variables (e.g. all caps) to signal this
>> widened scope. Do
On Sun, 10 May 2009 12:52:21 +, kj wrote:
> 1. The name of the BadArgument exception class defined in the script
>does not seem to me sufficiently specific. If one were to import the
>script in order to reuse its wkday_abbrev function, I'd like this
>exception's name to be more un
Below is my very firs python script.
This was just a learning exercise; the script doesn't do anything
terribly exciting: for an argument of the form YYMMDD (year, month,
day) it prints out the corresponding string YYMMDDW, where W is a
one-letter abbreviation for the day of the week. E.g.
% wd
11 matches
Mail list logo