Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #51358
| Path | csiph.com!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <devyncjohnson@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.029 |
| X-Spam-Evidence | '*H*': 0.94; '*S*': 0.00; 'assign': 0.07; 'alias': 0.09; 'collier': 0.09; 'subject:module': 0.09; 'callable': 0.16; 'os.getcwd()': 0.16; 'syntaxerror:': 0.16; 'typeerror:': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'header:User-Agent:1': 0.23; 'header :In-Reply-To:1': 0.27; 'tried': 0.27; 'function': 0.29; 'am,': 0.29; 'received:10.0.0': 0.31; "skip:' 10": 0.31; '"",': 0.31; 'file': 0.32; 'thanks!': 0.32; 'running': 0.33; '(most': 0.33; 'could': 0.34; "can't": 0.35; 'johnson': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'received:10.0': 0.36; 'received:10': 0.37; 'work?': 0.38; 'to:addr:python-list': 0.38; 'recent': 0.39; 'to:addr:python.org': 0.39; 'called': 0.40; 'how': 0.40; 'dave': 0.60; 'making': 0.63; 'angel': 0.91; 'works!': 0.91 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=4F7m/480AjZOCyhQznKGsQpDZJTVqyCRi3XkgxiKSEA=; b=Zced4TxdDu6FY4NDKxk8uhCymphdrCziu5MitmVFWrlzBH5Huxmej3I3Yg/4QrYj6I yjvfbebcP1k7TwwUCzQraszTMqCri0Tk63GgWQgUeBcxtVrme8uD8sO1fO8AP9tC9hUw EqFDwly8CKErM61WZw4EYwjh66Jc9mSd+yyq5UzxIPPkt6iWa4Be1p1jkqR5d17phLer mL4HzkMwX2eGWXyM+4a07QvlQJV0ktOdnbNCD8bGDmGgTbHOggV9l553M6DvsTsC1zeP q4ayg//fEIejGFF3U//mf2f0a1YzYPRBNZe5sXHpr0IM6fiWJkuUg8XvEbZdYdHuNRA3 mtiQ== |
| X-Received | by 10.60.96.170 with SMTP id dt10mr51942161oeb.81.1374932672447; Sat, 27 Jul 2013 06:44:32 -0700 (PDT) |
| Date | Sat, 27 Jul 2013 09:44:24 -0400 |
| From | Devyn Collier Johnson <devyncjohnson@gmail.com> |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 |
| MIME-Version | 1.0 |
| To | Python Mailing List <python-list@python.org> |
| Subject | Re: Critic my module |
| References | <mailman.5092.1374758683.3114.python-list@python.org> <51f334eb$0$29971$c3e8da3$5496439d@news.astraweb.com> <51F3C8FA.9040801@Gmail.com> <kt0ibg$3ev$1@ger.gmane.org> |
| In-Reply-To | <kt0ibg$3ev$1@ger.gmane.org> |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://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 | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.5172.1374932681.3114.python-list@python.org> (permalink) |
| Lines | 47 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1374932681 news.xs4all.nl 15996 [2001:888:2000:d::a6]:45905 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:51358 |
Show key headers only | View raw
On 07/27/2013 09:35 AM, Dave Angel wrote: > On 07/27/2013 09:19 AM, Devyn Collier Johnson wrote: >> > > <SNIP> > >> About the aliases, I have tried setting pwd() as an alias for >> "os.getcwd()", but I cannot type "pwd()" and get the desired output. >> Instead, I must type "pwd". I tested this in Guake running Python3.3. >> >> >>> os.getcwd() >> '/home/collier' >> >>> pwd = os.getcwd() >> >>> pwd() >> Traceback (most recent call last): >> File "<stdin>", line 1, in <module> >> TypeError: 'str' object is not callable >> >>> pwd >> '/home/collier' >> >>> pwd() = os.getcwd() >> File "<stdin>", line 1 >> SyntaxError: can't assign to function call >> >> >> How could I make pwd() work? > > Don't call getcwd() when making the alias. You want it to be called > when USING the alias. > > pwd = os.getcwd #creates the alias > > pwd() #runs the alias > > > Thanks! It works! >>> pwd = os.getcwd >>> pwd() '/home/collier' Mahalo, Dave! DCJ
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Critic my module Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-07-25 09:24 -0400
Re: Critic my module Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2013-07-25 16:09 +0200
Re: Critic my module Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-07-26 06:59 -0400
Re: Critic my module Alister <alister.ware@ntlworld.com> - 2013-07-26 15:08 +0000
Re: Critic my module Joshua Landau <joshua@landau.ws> - 2013-07-26 18:24 +0100
Re: Critic my module Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-07-27 02:48 +0000
Re: Critic my module Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-07-27 08:56 -0400
Re: Critic my module Alister <alister.ware@ntlworld.com> - 2013-07-27 16:32 +0000
Re: Critic my module Dave Angel <davea@davea.name> - 2013-07-27 12:58 -0400
Re: Critic my module Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-07-27 09:19 -0400
Re: Critic my module Dave Angel <davea@davea.name> - 2013-07-27 09:35 -0400
Re: Critic my module Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2013-07-27 15:36 +0200
Re: Critic my module Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-07-27 09:44 -0400
Re: Critic my module Chris Angelico <rosuav@gmail.com> - 2013-07-27 14:37 +0100
Re: Critic my module Dave Angel <davea@davea.name> - 2013-07-27 10:33 -0400
Re: Critic my module Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-07-27 10:53 -0400
Re: Critic my module Chris Angelico <rosuav@gmail.com> - 2013-07-27 16:15 +0100
csiph-web