Re: [Tutor] Need some help with setuptools for my project.

2015-04-06 Thread Dylan Evans
On 6 April 2015 at 18:56:57, tutor-requ...@python.org (tutor-requ...@python.org) wrote: > Any help would be greatly appreciated. I apologize if my question does not > belongs to this mailing list. My project is hosted on github[1]. > > Thank you. > > [1] https://github.com/neo1691/scorer.py Y

Re: [Tutor] Why is it invalid syntax to have a particular dictionary value as an argument?

2015-04-06 Thread Mark Lawrence
On 06/04/2015 20:20, Emile van Sebille wrote: On 4/6/2015 7:54 AM, boB Stepp wrote: Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. d = {'n': 'Print me!'} d {'n': 'Print me!'} d['n'] 'Print me

Re: [Tutor] Why is it invalid syntax to have a particular dictionary value as an argument?

2015-04-06 Thread Dave Angel
On 04/06/2015 03:20 PM, Emile van Sebille wrote: On 4/6/2015 7:54 AM, boB Stepp wrote: Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. d = {'n': 'Print me!'} d {'n': 'Print me!'} d['n'] 'Print

Re: [Tutor] Why is it invalid syntax to have a particular dictionary value as an argument?

2015-04-06 Thread Emile van Sebille
On 4/6/2015 7:54 AM, boB Stepp wrote: Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. d = {'n': 'Print me!'} d {'n': 'Print me!'} d['n'] 'Print me!' def func(d['n']): SyntaxError: invalid syn

Re: [Tutor] Need some help with setuptools for my project.

2015-04-06 Thread Alan Gauld
On 06/04/15 11:46, Anubhav Yadav wrote: Any help would be greatly appreciated. I apologize if my question does not belongs to this mailing list. My project is hosted on github[1]. Using the setup tools and creating/installing projects seems close enough to standard library functions that its o

Re: [Tutor] failed filter result

2015-04-06 Thread Alan Gauld
On 06/04/15 15:05, Jim Mooney wrote: Why did this fail where it did? It failed at listing the result of the filter of a word list, but I figured if it failed, it would have done so at the filter. words = open('5desk.txt').readlines() k = [word.rstrip for word in words] Notice that you are not

Re: [Tutor] failed filter result

2015-04-06 Thread Timo
Op 06-04-15 om 16:05 schreef Jim Mooney: Why did this fail where it did? It failed at listing the result of the filter of a word list, but I figured if it failed, it would have done so at the filter. words = open('5desk.txt').readlines() k = [word.rstrip for word in words] Your problem is in t

[Tutor] failed filter result

2015-04-06 Thread Jim Mooney
Why did this fail where it did? It failed at listing the result of the filter of a word list, but I figured if it failed, it would have done so at the filter. >>> words = open('5desk.txt').readlines() >>> k = [word.rstrip for word in words] >>> len(k) 61406 >>> p = filter(lambda word: len(word) >

[Tutor] Need some help with setuptools for my project.

2015-04-06 Thread Anubhav Yadav
Hi, I am new to python and still trying to get my concepts clear with respect to standard practices in python. I wrote a script which fetches the latest cricket scores from the internet and sends desktop notifications using pynotify. The project, initially supported both python2 as well as python3

Re: [Tutor] Why is it invalid syntax to have a particular dictionary value as an argument?

2015-04-06 Thread Dave Angel
On 04/06/2015 12:43 PM, boB Stepp wrote: I was breaking down longer functions into smaller ones. Along the way I noticed I was passing an entire dictionary from one function to another. I only needed to pass one particular value, not the whole dictionary, so that is how I got into the issue I a

Re: [Tutor] Why is it invalid syntax to have a particular dictionary value as an argument?

2015-04-06 Thread boB Stepp
Thanks, Joel! Thanks, Dave! On Mon, Apr 6, 2015 at 11:31 AM, Dave Angel wrote: [...] > Now, it's possible that what you're trying to do is something that can be > accomplished some other way. So please elaborate on your purpose in using > the syntax you did. Or supply a small program that sho

Re: [Tutor] Why is it invalid syntax to have a particular dictionary value as an argument?

2015-04-06 Thread Dave Angel
On 04/06/2015 10:54 AM, boB Stepp wrote: Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. d = {'n': 'Print me!'} d {'n': 'Print me!'} d['n'] 'Print me!' def func(d['n']): SyntaxError: invalid

Re: [Tutor] Why is it invalid syntax to have a particular dictionary value as an argument?

2015-04-06 Thread Joel Goldstick
On Mon, Apr 6, 2015 at 11:20 AM, Joel Goldstick wrote: > On Mon, Apr 6, 2015 at 10:54 AM, boB Stepp wrote: >> Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit >> (Intel)] on win32 >> Type "copyright", "credits" or "license()" for more information. > d = {'n': 'Print me!'}

Re: [Tutor] Why is it invalid syntax to have a particular dictionary value as an argument?

2015-04-06 Thread Joel Goldstick
On Mon, Apr 6, 2015 at 10:54 AM, boB Stepp wrote: > Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit > (Intel)] on win32 > Type "copyright", "credits" or "license()" for more information. d = {'n': 'Print me!'} d > {'n': 'Print me!'} d['n'] > 'Print me!' def fun

[Tutor] Why is it invalid syntax to have a particular dictionary value as an argument?

2015-04-06 Thread boB Stepp
Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> d = {'n': 'Print me!'} >>> d {'n': 'Print me!'} >>> d['n'] 'Print me!' >>> def func(d['n']): SyntaxError: invalid syntax >>> def func(d): p