Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'read.': 0.03; 'referring': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:question': 0.10; '"global"': 0.16; 'fine.': 0.16; 'function).': 0.16; 'message-id:@4ax.com': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'trying': 0.19; '(but': 0.19; 'print': 0.22; 'exists': 0.24; 'url:home': 0.24; 'header:X-Complaints-To:1': 0.27; 'function': 0.29; 'dec': 0.30; 'statement': 0.30; 'file': 0.32; 'charset:us- ascii': 0.36; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'save': 0.62; "you'll": 0.62; 'email addr:gmail.com': 0.63; 'name': 0.63; 'goal': 0.75; 'received:108': 0.93; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Variables in a loop, Newby question Date: Wed, 25 Dec 2013 13:35:46 -0500 Organization: IISS Elusive Unicorn References: <9ad01eef-baf0-4018-833e-0b4dce4b9b85@googlegroups.com> <5414cedd-6e54-43d0-995b-fe116d4c8225@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-108-68-178-129.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387996549 news.xs4all.nl 2975 [2001:888:2000:d::a6]:36954 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62711 On Tue, 24 Dec 2013 09:54:48 -0800 (PST), vanommen.robert@gmail.com declaimed the following: >import time >global Sens_Raw1, Sens_Raw2, Sens_Raw3, Sens_Raw4, Sens_Raw5, Sens_Raw6, Sens_Raw7, Sens_Raw8, Sens_Raw9, Sens_Raw10 This statement does nothing... In Python, "global" is used /inside/ a function to indicate that the function is referring to a name that exists outside of the function (but inside the same module/file as the function). >This is the program I am trying to adjust. The goal is to make Sens_Raw1 to 10 global so I can use it in other programs on the Raspberry Pi. The print Sensor wordks fine. To make them available to "other programs" means you'll have to save them to a file that the other programs can read. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/