Re: [Tutor] python3.4m

2015-04-02 Thread Alex Kleider
On 2015-04-02 19:42, Ben Finney wrote: Alex Kleider writes: A listing of /usr/bin/python* on my Ubuntu 14.04 LTS machine yields the following: alex@t61p:~$ ls -l /usr/bin/python* […] -rwxr-xr-x 1 root root 3802224 Apr 11 2014 /usr/bin/python3.4m lrwxrwxrwx 1 root root 10 Aug 23 2014 /us

Re: [Tutor] Functional Programming in Python

2015-04-02 Thread Steven D'Aprano
On Thu, Apr 02, 2015 at 11:52:40AM -0700, Danny Yoo wrote: > >> What are your thoughts on Functional in Python? > >> Currently I am re-writing functions to reduce their side effects. > >> I am also removing the state from objects and putting it into a closure > >> type function. > > > > That doesn'

Re: [Tutor] Functional Programming in Python

2015-04-02 Thread Steven D'Aprano
On Thu, Apr 02, 2015 at 03:36:17PM -0400, WolfRage wrote: > On 04/02/2015 02:07 PM, Steven D'Aprano wrote: > > >>What are the best practices to create more Functional Python? > > > >Best practices: > > > >* Don't force your code to use one style exclusively. Use the most > > natural style for th

Re: [Tutor] python3.4m

2015-04-02 Thread Ben Finney
Alex Kleider writes: > A listing of /usr/bin/python* on my Ubuntu 14.04 LTS machine yields > the following: > alex@t61p:~$ ls -l /usr/bin/python* > […] > -rwxr-xr-x 1 root root 3802224 Apr 11 2014 /usr/bin/python3.4m > lrwxrwxrwx 1 root root 10 Aug 23 2014 /usr/bin/python3m -> > python3.4

[Tutor] python3.4m

2015-04-02 Thread Alex Kleider
A listing of /usr/bin/python* on my Ubuntu 14.04 LTS machine yields the following: alex@t61p:~$ ls -l /usr/bin/python* lrwxrwxrwx 1 root root 9 Aug 23 2014 /usr/bin/python -> python2.7 lrwxrwxrwx 1 root root 9 Aug 23 2014 /usr/bin/python2 -> python2.7 -rwxr-xr-x 1 root root 317689

Re: [Tutor] Command Line Editting: How to improve options?

2015-04-02 Thread J L
Thank you Steve.  This electronic mail including any attachments may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination of this electronic email or its contents including any attachm

Re: [Tutor] Functional Programming in Python

2015-04-02 Thread Tim Johnson
* WolfRage [150402 11:45]: > On 04/02/2015 03:08 PM, Tim Johnson wrote: > > > You have already received valuable replies from two advanced > > python experts. > > If you are looking for a book (available digitally for kindle) > > I would recommend > > Guide To: Functional Python & Compr

Re: [Tutor] New to Programming: TypeError: coercing to Unicode: need string or buffer, list found

2015-04-02 Thread Saran Ahluwalia
Danny, You were spot on with that issue. I debugged this. Here are my two commits for my homework: Starting with pyinotify and OS agnostic?

Re: [Tutor] Request review: A DSL for scraping a web page

2015-04-02 Thread Alan Gauld
On 02/04/15 20:49, Albert-Jan Roskam wrote: Yes, the Pearls books should be required reading Is this the book you are referring to? http://www.amazon.com/Programming-Pearls-2nd-Edition-Bentley/dp/0201657880 Yes thats it. -- Alan G Author of the Learn to Program web site http://www.alan-g

Re: [Tutor] Request review: A DSL for scraping a web page

2015-04-02 Thread Dave Angel
On 04/02/2015 03:49 PM, Albert-Jan Roskam wrote: - On Thu, Apr 2, 2015 1:17 PM CEST Alan Gauld wrote: On 02/04/15 12:09, Dave Angel wrote: Ah, Jon Bentley (notice the extra 'e'). I should dig out my *Pearls books, and have a trip down memory lane. I bet 95% of t

Re: [Tutor] New to Programming: TypeError: coercing to Unicode: need string or buffer, list found

2015-04-02 Thread Dave Angel
On 04/02/2015 08:28 AM, Saran Ahluwalia wrote: Good Morning: I understand this error message when I run this code. However, I am curious to know what the most pythonic way is to convert the list to a string? I use Python 2.7. "Traceback (most recent call last): before = dict([(f, None) for f i

Re: [Tutor] Request review: A DSL for scraping a web page

2015-04-02 Thread Albert-Jan Roskam
- On Thu, Apr 2, 2015 1:17 PM CEST Alan Gauld wrote: >On 02/04/15 12:09, Dave Angel wrote: > >> Ah, Jon Bentley (notice the extra 'e'). I should dig out my *Pearls >> books, and have a trip down memory lane. I bet 95% of those are still >> useful, even if they refer

Re: [Tutor] Functional Programming in Python

2015-04-02 Thread WolfRage
On 04/02/2015 03:08 PM, Tim Johnson wrote: You have already received valuable replies from two advanced python experts. If you are looking for a book (available digitally for kindle) I would recommend Guide To: Functional Python & Comprehension Constructs by Matt Harrison Tha

Re: [Tutor] Functional Programming in Python

2015-04-02 Thread WolfRage
On 04/02/2015 02:52 PM, Danny Yoo wrote: This is not to say that closures are bad. It's just to point out that just because functional programs use closures quite a lot, doesn't automatically mean closures are the most appropriate tool for everything. If there are parts of the language that al

Re: [Tutor] Functional Programming in Python

2015-04-02 Thread WolfRage
On 04/02/2015 02:07 PM, Steven D'Aprano wrote: What are the best practices to create more Functional Python? Best practices: * Don't force your code to use one style exclusively. Use the most natural style for the task. Python makes it easy to mix functional, procedural, imperative and

Re: [Tutor] New to Programming: TypeError: coercing to Unicode: need string or buffer, list found

2015-04-02 Thread Danny Yoo
On Thu, Apr 2, 2015 at 12:19 PM, Saran Ahluwalia wrote: > Danny, > > You were spot on with that issue. I debugged this. Here are my two commits > for my homework: Starting with pyinotify and OS agnostic? I am still working > on the latter - in regards to adding more customization that fits the > h

Re: [Tutor] Functional Programming in Python

2015-04-02 Thread WolfRage
On 04/02/2015 01:07 PM, Alan Gauld wrote: I'm not sure what you mean is impossible? The specific issues you are having or the general FP paradigm? I mean achieving truely functional code, atleast to the extent of some of the things that I have read. But in general I do not need nor want any of

Re: [Tutor] Functional Programming in Python

2015-04-02 Thread Tim Johnson
* WolfRage [150402 08:25]: > These are just some questions that I have regarding the topic of > Functional Programming. I am working towards a more functional approach > to programming but acknowledge that it is far from Functional, > especially since this is mostly impossible in Python. > Ques

Re: [Tutor] Functional Programming in Python

2015-04-02 Thread Danny Yoo
>> What are your thoughts on Functional in Python? >> Currently I am re-writing functions to reduce their side effects. >> I am also removing the state from objects and putting it into a closure >> type function. > > That doesn't remove state, it just moves it to a different place. > > However, enc

Re: [Tutor] Functional Programming in Python

2015-04-02 Thread Steven D'Aprano
On Thu, Apr 02, 2015 at 12:18:28PM -0400, WolfRage wrote: > These are just some questions that I have regarding the topic of > Functional Programming. I am working towards a more functional approach > to programming but acknowledge that it is far from Functional, > especially since this is most

Re: [Tutor] New to Programming: TypeError: coercing to Unicode: need string or buffer, list found

2015-04-02 Thread Danny Yoo
On Apr 2, 2015 9:45 AM, "Saran Ahluwalia" wrote: > > Good Morning: > > I understand this error message when I run this code. However, I am curious > to know what the most pythonic way is to convert the list to a string? I > use Python 2.7. > > "Traceback (most recent call last): > before = dict([

Re: [Tutor] Request review: A DSL for scraping a web page

2015-04-02 Thread Emile van Sebille
On 4/2/2015 4:22 AM, Dave Angel wrote: There was somewhere in one of the books a list of 'good practice,' including an item something like: Solve the right problem. There's a world of wisdom in that one alone. +1 Emile ___ Tutor maillist - Tuto

Re: [Tutor] Functional Programming in Python

2015-04-02 Thread Alan Gauld
On 02/04/15 17:18, WolfRage wrote: to programming but acknowledge that it is far from Functional, especially since this is mostly impossible in Python. I'm not sure what you mean is impossible? The specific issues you are having or the general FP paradigm? Python has fairly good support for F

Re: [Tutor] Request review: A DSL for scraping a web page

2015-04-02 Thread Joe Farro
Alan Gauld btinternet.com> writes: > DSL? Good to know the term/acronym is not ubiquitous. I was going for succinct, possibly too succinct... > Have you looked at the existing web scraping tools in Python? > There are several to pick from. They all avoid the kind of mess > you describe. I'm fam

Re: [Tutor] Request review: A DSL for scraping a web page

2015-04-02 Thread Joe Farro
Thanks, Peter. Peter Otten <__peter__ web.de> writes: > Can you give a real-world example where your DSL is significantly cleaner > than the corresponding code using bs4, or lxml.xpath, or lxml.objectify? Yes, definitely. Will work something up. > Your code on github looks good to me (too fe

[Tutor] New to Programming: TypeError: coercing to Unicode: need string or buffer, list found

2015-04-02 Thread Saran Ahluwalia
Good Morning: I understand this error message when I run this code. However, I am curious to know what the most pythonic way is to convert the list to a string? I use Python 2.7. "Traceback (most recent call last): before = dict([(f, None) for f in os.listdir(dirlist)]) TypeError: coercing to Un

[Tutor] Functional Programming in Python

2015-04-02 Thread WolfRage
These are just some questions that I have regarding the topic of Functional Programming. I am working towards a more functional approach to programming but acknowledge that it is far from Functional, especially since this is mostly impossible in Python. Questions: What are the best practices to

Re: [Tutor] Command Line Editting: How to improve options?

2015-04-02 Thread Steven D'Aprano
On Thu, Apr 02, 2015 at 06:36:03AM +, J L wrote: >  Win 7Python v 3.4.3 > I'm new to Python and only have coursework under my belt in another > object oriented programming language as well as limited systems > skills. After launching Python from the command line with py.exe, it > appears tha

Re: [Tutor] Request review: A DSL for scraping a web page

2015-04-02 Thread Peter Otten
Joe Farro wrote: > The package implements a DSL that is intended to make web-scraping a bit > more maintainable :) > > I generally find my scraping code ends up being rather chaotic with > querying, regex manipulations, conditional processing, conversions, etc., > ending up being to close togethe

Re: [Tutor] Request review: A DSL for scraping a web page

2015-04-02 Thread Dave Angel
On 04/02/2015 07:17 AM, Alan Gauld wrote: On 02/04/15 12:09, Dave Angel wrote: Ah, Jon Bentley (notice the extra 'e'). I should dig out my *Pearls books, and have a trip down memory lane. I bet 95% of those are still useful, even if they refer to much earlier versions of language(s). Yes, t

Re: [Tutor] Request review: A DSL for scraping a web page

2015-04-02 Thread Alan Gauld
On 02/04/15 12:09, Dave Angel wrote: Ah, Jon Bentley (notice the extra 'e'). I should dig out my *Pearls books, and have a trip down memory lane. I bet 95% of those are still useful, even if they refer to much earlier versions of language(s). Yes, the Pearls books should be required reading

Re: [Tutor] Request review: A DSL for scraping a web page

2015-04-02 Thread Dave Angel
On 04/02/2015 06:41 AM, Alan Gauld wrote: On 02/04/15 10:50, Dave Angel wrote: On 04/02/2015 04:22 AM, Alan Gauld wrote: DSL? This is "Domain Specific Language". This is a language built around a specific problem domain, Ah, Thanks Dave! I am used to those being called simply "Little lang

Re: [Tutor] Request review: A DSL for scraping a web page

2015-04-02 Thread Alan Gauld
On 02/04/15 10:50, Dave Angel wrote: On 04/02/2015 04:22 AM, Alan Gauld wrote: DSL? This is "Domain Specific Language". This is a language built around a specific problem domain, Ah, Thanks Dave! I am used to those being called simply "Little languages" after the famous Jon Bently ACM art

Re: [Tutor] Request review: A DSL for scraping a web page

2015-04-02 Thread Dave Angel
On 04/02/2015 04:22 AM, Alan Gauld wrote: DSL? This is "Domain Specific Language". This is a language built around a specific problem domain, in order to more easily express problems for that domain than the usual general purpose languages. I was a bit surprised to find few google matche

Re: [Tutor] Request review: A DSL for scraping a web page

2015-04-02 Thread Alan Gauld
On 02/04/15 04:18, Joe Farro wrote: Hello, I recently wrote a python package and was wondering if anyone might have time to review it? This list is for people learning Python and answering questions about the core language and standard library. I suspect this is more appropriate to the main py

Re: [Tutor] Command Line Editting: How to improve options?

2015-04-02 Thread Alan Gauld
On 02/04/15 07:36, J L wrote: Win 7Python v 3.4.3 After launching Python from the command line with py.exe, it appears that the interrupter starts up fine. Thats interpreter, not interrupter. It interprets your commands. I've read on Python.Org's site in a tutorial section that some int

[Tutor] Request review: A DSL for scraping a web page

2015-04-02 Thread Joe Farro
Hello, I recently wrote a python package and was wondering if anyone might have time to review it? I'm fairly new to python - it's been about 1/2 of my workload at work for the past year. Any suggestions would be super appreciated. https://github.com/tiffon/take https://pypi.python.org/pypi/tak

[Tutor] Command Line Editting: How to improve options?

2015-04-02 Thread J L
 Win 7Python v 3.4.3 I'm new to Python and only have coursework under my belt in another object oriented programming language as well as limited systems skills. After launching Python from the command line with py.exe, it appears that the interrupter starts up fine. I've read on Python.Org's sit

[Tutor] Question for Strategy for Directory Monitor

2015-04-02 Thread Saran Ahluwalia
Good Evening : Here is what I want me program to do: • *Monitor* a folder for files that are dropped throughout the day • When a file is dropped in the folder the program should scan the file o IF all the contents in the file have the same length (let's assume line length) o THEN the file shou