Critic my module

Chris “Kwpolska” Warrick kwpolska at gmail.com
Sat Jul 27 09:36:44 EDT 2013


On Sat, Jul 27, 2013 at 3:19 PM, Devyn Collier Johnson
<devyncjohnson at gmail.com> wrote:
> 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?
>
>
> Mahalo,
>
> DCJ
> --
> http://mail.python.org/mailman/listinfo/python-list

>>> import os
>>> pwd = os.getcwd
>>> pwd()
'/home/kwpolska'
>>> os.chdir('/')
>>> pwd()
'/'
>>>

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense



More information about the Python-list mailing list