Re: [Tutor] global variables/constants versus volatile variables/constants

2014-06-14 Thread diliup gabadamudalige
Thank you all for those great clarifications. I learnt a lot from these. My roots in programming are from the early 80s and with a gap of nearly 30 years till I restarted again last year in March with Python. :) So some of the new concepts like classes are a bit alien to me but I am catching on. I

Re: [Tutor] global variables/constants versus volatile variables/constants

2014-06-14 Thread Steven D'Aprano
On Sat, Jun 14, 2014 at 06:23:08PM +0530, diliup gabadamudalige wrote: > Say if I have a lot of Lists, strings and variables used to carry data to > and from various functions why can't I have a class with all these in it? Of course you *can*, but you *should not*. Read on... [...] > so I decla

Re: [Tutor] global variables/constants versus volatile variables/constants

2014-06-14 Thread S Tareq
On Friday, 13 June 2014, 12:45, Steven D'Aprano wrote: On Fri, Jun 13, 2014 at 12:51:25PM +0530, diliup gabadamudalige wrote: > Hi All! > Hope everyone is well. > > In my code there are many dictionaries and lists which are used in various > functions. Is it better/pythonic/efficient

[Tutor] python3 equivalent of coreutils stat command

2014-06-14 Thread street . sweeper
With the stat command in GNU coreutils, I can get a file's modification time, with timezone offset. For example, the output of "stat -c %y *" looks like 2014-02-03 14:48:17.0 -0200 2014-05-29 19:00:05.0 -0100 What I want to do is get the mtime in ISO8601 format, and I've

Re: [Tutor] global variables/constants versus volatile variables/constants

2014-06-14 Thread Alan Gauld
On 14/06/14 13:53, diliup gabadamudalige wrote: Say if I have a lot of Lists, strings and variables used to carry data to and from various functions why can't I have a class with all these in it? You can but it should also have the functions that operate on the data too. Thats the point of cl

Re: [Tutor] python3 equivalent of coreutils stat command

2014-06-14 Thread Alan Gauld
On 14/06/14 22:06, street.swee...@mailworks.org wrote: With the stat command in GNU coreutils, I can get a file's modification time, with timezone offset. gotten close with os.path.getmtime and os.stat, for example 2014-02-03T14:48:17. But, no timezone offset. os.stat returns the mtime as s