RE: Python 3.4.4 Install

2016-01-11 Thread Emanuel Barry
> Date: Sat, 9 Jan 2016 14:25:40 -0800
> Subject: Python 3.4.4 Install
> From: cjwilliam...@gmail.com
> To: python-list@python.org
> 
> The reponse is not understood.
Which response? Obviously Python's, but response to what? More context would be 
useful.
> *** Python 3.4.4rc1 (v3.4.4rc1:04f3f725896c, Dec  6 2015, 17:06:10) [MSC 
> v.1600 64 bit (AMD64)] on win32. ***
> >>>   File "C:\Users\Adm\AppData\Roaming\PyScripter\python_init.py", line 1
> Öü:V�t‡Ö{ZðN)’ƒ2%hóýL"®ÁwÇ,”¿ƾJ
>  ^
> SyntaxError: invalid syntax
>   File "C:\Users\Adm\AppData\Roaming\PyScripter\pyscripter_init.py", line 1
> Öü:V�t‡Ö{ZðN)’t—œ2¢í.�Tûôø«ÄØ´Õ7l‰ˆ(°¢äßÅ
>  ^
> SyntaxError: invalid syntax
What is this file, and where does it come from? What command are you issuing 
that gives you this result?
-- Emanuel

  -- 
https://mail.python.org/mailman/listinfo/python-list


RE: subscripting Python 3 dicts/getting the only value in a Python 3 dict

2016-01-12 Thread Emanuel Barry
> Hi all,
> 
> Seemingly simple problem:
> 
> There is a case in my code where I know a dictionary has only one item in it. 
> I want to get the value of that item, whatever the key is.
> 
> In Python2 I'd write:
> 
> >>> d = {"Wilf's Cafe": 1}
> >>> d.values()[0]
> 1
The equivalent in Python 3 is `list(d.values())[0]`
> None of this feels like the "one, and preferably only one, obvious way to do 
> it" we all strive for. Any other ideas?

If you feel like doing that, `for v in d.values(): pass` will set `v` to your 
value. But it's a bit cryptic, so you can probably resort to the list() 
alternative above :)
- Emanuel 
-- 
https://mail.python.org/mailman/listinfo/python-list