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


Groups > comp.lang.python > #95389

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

Path csiph.com!au2pb.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.007
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'python,': 0.02; 'cc:addr :python-list': 0.09; 'subject:command': 0.09; 'thu,': 0.15; '"global"': 0.16; '(rather': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.16; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'aug': 0.20; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'module': 0.25; 'message-id:@mail.gmail.com': 0.27; 'skip:( 20': 0.28; '13,': 0.29; 'print': 0.30; 'received:google.com': 0.35; 'easiest': 0.35; 'pm,': 0.36; 'subject:: ': 0.37; 'means': 0.39; 'chrisa': 0.84; 'to:none': 0.91; 'subject:Global': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=uYkGi+jnqksWXj+zuffCqguuhDGIup940wu/awdMpaU=; b=chrftKSes49dQdHimIrEHHwnMNu9gmdubLm6dLyaO6Ja6EWp5QeiWF4JOEfdYTOHyr CDqQnnZ9Yo3rdpVi5kTCJv5YgEPpw/2CPzFq9fGdHsNQb0+Slq0eOGb/yGmXejiI1fPK eaVdkHZnG1Y8yLIlFSR135qSNFORY1vcjX6tW6o+NETjrezOBiNb9llt2LZqpuge2EgG wqKNCI4EqLoU4OAr81URC7sUXwSj6hHQBrMo/7DwA/8FqsZRlBKkZG0O+1bbNfCXwhW8 ocaf0Gi1R6pnqTbZ0LSTFiJyHauNTVWA2dZbH0INKN3L31E5aV6nwJmso/W78CBvXefR BLXQ==
MIME-Version 1.0
X-Received by 10.107.12.166 with SMTP id 38mr34142132iom.157.1439621772035; Fri, 14 Aug 2015 23:56:12 -0700 (PDT)
In-Reply-To <D1F29B20.10D53E%Dwight@GoldWinde.com>
References <D1F29B20.10D53E%Dwight@GoldWinde.com>
Date Sat, 15 Aug 2015 16:56:11 +1000
Subject Re: Global command doesn't seem to work...
From Chris Angelico <rosuav@gmail.com>
Cc Python Python <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.23.1439621775.4764.python-list@python.org> (permalink)
Lines 13
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1439621775 news.xs4all.nl 2955 [2001:888:2000:d::a6]:37579
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:95389

Show key headers only | View raw


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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web