Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #95389 > unrolled thread

Re: Global command doesn't seem to work...

Started byChris Angelico <rosuav@gmail.com>
First post2015-08-15 16:56 +1000
Last post2015-08-15 16:56 +1000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Global command doesn't seem to work... Chris Angelico <rosuav@gmail.com> - 2015-08-15 16:56 +1000

#95389 — Re: Global command doesn't seem to work...

FromChris Angelico <rosuav@gmail.com>
Date2015-08-15 16:56 +1000
SubjectRe: Global command doesn't seem to work...
Message-ID<mailman.23.1439621775.4764.python-list@python.org>
On Thu, Aug 13, 2015 at 9:06 PM, Dwight GoldWinde <Dwight@goldwinde.com> wrote:
> global subwordsDL
> from Functions import subwords
> subwords ()
> print (subwordsDL)
> print (subwordsDL['enjoy'][2])

In Python, "global" means module-level. The easiest way to do this
would be to import the Functions module directly (rather than using a
from-import), and then you can use Function.subwords and
Functions.subwordsDL.

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web