Cameron,
Thanks for the heads up on that. (I have been
following it, but from a long distance, as I very
happy with my garden-variety Python.)
Separately, let me offer you my thanks for your
contributions to the community; they are great and
they are much appreciated. The community around Python
Thanks for your reply.
That seems like an interesting and practical approach. However, I have
one worry. In addition to the config file I am parsing command-line
overrides to the config values via optparse. Many modules, classes and
functions depend on these values, which means a lot of code dupli
In article <[EMAIL PROTECTED]>,
bbands <[EMAIL PROTECTED]> wrote:
.
[puzzlement about globals,
on which several others
have already aptly counseled]
.
.
>camper with Python. I wa
On Mar 25, 2005, at 5:16 PM, [EMAIL PROTECTED] wrote:
For example I have a class named Indicators. If I cut it out and put it
in a file call Ind.py then "from Ind import Indicators" the class can
no longer see my globals. This is true even when the import occurs
after the config file has been read
"bbands" <[EMAIL PROTECTED]> writes:
> For example I have a class named Indicators. If I cut it out and put it
> in a file call Ind.py then "from Ind import Indicators" the class can
> no longer see my globals. This is true even when the import occurs
> after the config file has been read and pars
bbands wrote:
For example I have a class named Indicators. If I cut it out and put it
in a file call Ind.py then "from Ind import Indicators" the class can
no longer see my globals. This is true even when the import occurs
after the config file has been read and parsed.
globals aren't all that glob
bbands wrote:
For example I have a class named Indicators. If I cut it out and put it
in a file call Ind.py then "from Ind import Indicators" the class can
no longer see my globals. This is true even when the import occurs
after the config file has been read and parsed.
globals aren't all that glob
Kind of vague, but I'll give it a shot:
1) Don't read config.ini values in main and pass to class if they
aren't needed in the main program. Instead create instance of
ConfigParser and pass it as an argument to the class and extract
the individual section/option information in the class.
INI=Con
For example I have a class named Indicators. If I cut it out and put it
in a file call Ind.py then "from Ind import Indicators" the class can
no longer see my globals. This is true even when the import occurs
after the config file has been read and parsed.
John
--
http://mail.python.org/mailman/
On 25 Mar 2005 12:37:29 -0800, bbands <[EMAIL PROTECTED]> wrote:
> I've a 2,000 line and growing Python script that I'd like to break up
> into a modules--one class alone is currently over 500 lines. There is a
> large config.ini file involved (via ConfigParser), a fair number of
> passed and globa
I've a 2,000 line and growing Python script that I'd like to break up
into a modules--one class alone is currently over 500 lines. There is a
large config.ini file involved (via ConfigParser), a fair number of
passed and global variables as well as interaction with external
programs such as MySQL (
11 matches
Mail list logo