Re: generator/coroutine terminology

2015-04-02 Thread Paul Rubin
alb...@spenarnc.xs4all.nl (Albert van der Horst) writes: > You should give an example of usage. As a newby I'm not up to > figuring out the specification from source for > something built of the mysterious __ internal > thingies. In reality because of generator expressions, the yield statement, an

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-04-02 Thread Ian Kelly
On Thu, Apr 2, 2015 at 11:40 PM, Steven D'Aprano wrote: > This sterile, pointless arguing about the minutia of pedantic definitions is > not even close to useful. Honestly Thomas, Ian, nobody cares any more. If I > were a betting man, I'd bet that neither of you can describe, in one > sentence, wh

Re: generator/coroutine terminology

2015-04-02 Thread Steven D'Aprano
On Wednesday 01 April 2015 00:18, Albert van der Horst wrote: > In article <55062bda$0$12998$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: >>The biggest difference is syntactic. Here's an iterator which returns a >>never-ending sequence of squared numbers 1, 4, 9, 16, ... >> >>c

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-04-02 Thread Chris Angelico
On Fri, Apr 3, 2015 at 4:40 PM, Steven D'Aprano wrote: > This sterile, pointless arguing about the minutia of pedantic definitions is > not even close to useful. Honestly Thomas, Ian, nobody cares any more. If I > were a betting man, I'd bet that neither of you can describe, in one > sentence, wha

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-04-02 Thread Steven D'Aprano
On Friday 03 April 2015 08:31, Thomas 'PointedEars' Lahn wrote: > I am sorry that you cannot see that your argument is strewn with gaping > defects in logic, but I think I will stop trying to convince you of that > now. I'm sorry, I've been away for four days and have lost track of this thread.

Re: New to Programming - XML Processing

2015-04-02 Thread Steve Hayes
On Thu, 2 Apr 2015 05:42:18 -0700, Albert-Jan Roskam wrote: > >- >On Wed, Apr 1, 2015 10:00 AM CEST Mark Lawrence wrote: > >>On 01/04/2015 05:27, Andrew Farrell wrote: >>> You should follow Rustom's advice before just diving into the blog post >>> I linked to. Otherwis

New to Programming: Adding custom functions with ipynotify classes

2015-04-02 Thread Saran A
Hello All: Here is the program that I am trying to write (with specs): * Monitors 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 records in the file have the same length (line length) o THEN the file

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-04-02 Thread Ian Kelly
On Thu, Apr 2, 2015 at 3:31 PM, Thomas 'PointedEars' Lahn wrote: > Ian Kelly wrote: > >> […] Thomas 'PointedEars' Lahn […] wrote: >>> Ian Kelly wrote: Within a grammar, the question of "is an X a Y" is nonsensical in isolation. It can only be answered in relation to a parse tree. Co

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

2015-04-02 Thread Saran A
On Thursday, April 2, 2015 at 8:03:53 PM UTC-4, Dennis Lee Bieber wrote: > On Thu, 2 Apr 2015 05:46:57 -0700 (PDT), Saran A > declaimed the following: > > > > >@ChrisA - this is a smaller function that will take the most updated file. > >My intention is the following: > > > >* Monitor a folder f

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

2015-04-02 Thread Chris Angelico
On Fri, Apr 3, 2015 at 11:03 AM, Dennis Lee Bieber wrote: >>o IF all the contents in the file have the same length (let's assume line >>length) >> >>o THEN the file should be moved to a "success" folder and a text file written >>indicating the total number of records/lines/words processed >> >>o

Re: Strategy/ Advice for How to Best Attack this Problem?

2015-04-02 Thread Saran A
On Thursday, April 2, 2015 at 5:11:20 PM UTC-4, Dave Angel wrote: > On 04/02/2015 09:06 AM, Saran A wrote: > > > > > Thanks for your help on this homework assignment. I started from scratch > > last night. I have added some comments that will perhaps help clarify my > > intentions and my thought

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-04-02 Thread sohcahtoa82
On Thursday, April 2, 2015 at 2:33:17 PM UTC-7, Thomas 'PointedEars' Lahn wrote: > Ian Kelly wrote: > > > […] Thomas 'PointedEars' Lahn […] wrote: > >> Ian Kelly wrote: > >>> Within a grammar, the question of "is an X a Y" is nonsensical in > >>> isolation. It can only be answered in relation to a

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-04-02 Thread Thomas 'PointedEars' Lahn
Ian Kelly wrote: > […] Thomas 'PointedEars' Lahn […] wrote: >> Ian Kelly wrote: >>> Within a grammar, the question of "is an X a Y" is nonsensical in >>> isolation. It can only be answered in relation to a parse tree. >>> Consider the simple grammar: >>> >>> S -> A | B >>> A -> x >>> B -> x >>> >>

Re: Strategy/ Advice for How to Best Attack this Problem?

2015-04-02 Thread Dave Angel
On 04/02/2015 09:06 AM, Saran A wrote: Thanks for your help on this homework assignment. I started from scratch last night. I have added some comments that will perhaps help clarify my intentions and my thought process. Thanks again. from __future__ import print_function I'll just randomly

Re: pysftp connection not sending files, hanging on 'put'

2015-04-02 Thread ykravetz89
On Saturday, January 24, 2015 at 11:32:43 AM UTC-5, Jules Stevenson wrote: > Hi List, > > > I'm trying to send some files via pysftp, authentication seems fine, but > actually putting the file results in it hanging, doing nothing. The files are > small (<200kb) so I don't believe it's an upload

Re: Python to C++ in a pickle

2015-04-02 Thread richismyname
On Tuesday, July 4, 2000 at 12:00:00 AM UTC-7, Larry Whitley wrote: > I'd like to pickle an object in python and unpickle it in C++. The object > in question is a python dictionary so it will have to go into a C++ map. > Has someone done this and is willing to share? Or, is the cPickle source > a

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

2015-04-02 Thread Chris Angelico
On Fri, Apr 3, 2015 at 12:28 AM, Saran A wrote: > Does this modification to copyFile do the job of moving the file? I haven't > written a test yet. > > Thanks for catching the indentation for the helper functions. > > def copyFile(src, dest): >> > try: >> > shutil.rename(src,

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

2015-04-02 Thread Saran A
On Thursday, April 2, 2015 at 9:06:49 AM UTC-4, Chris Angelico wrote: > On Thu, Apr 2, 2015 at 11:46 PM, Saran A wrote: > > @ChrisA - this is a smaller function that will take the most updated file. > > My intention is the following: > > > > * Monitor a folder for files that are dropped throughou

Re: Strategy/ Advice for How to Best Attack this Problem?

2015-04-02 Thread Saran A
On Wednesday, April 1, 2015 at 7:52:27 PM UTC-4, Dave Angel wrote: > On 04/01/2015 09:43 AM, Saran A wrote: > > On Tuesday, March 31, 2015 at 9:19:37 AM UTC-4, Dave Angel wrote: > >> On 03/31/2015 07:00 AM, Saran A wrote: > >> > >> > @DaveA: This is a homework assignment. Is it possible that

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

2015-04-02 Thread Chris Angelico
On Thu, Apr 2, 2015 at 11:46 PM, Saran A wrote: > @ChrisA - this is a smaller function that will take the most updated file. My > intention is the following: > > * Monitor a folder for files that are dropped throughout the day > > * When a file is dropped in the folder the program should scan the

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

2015-04-02 Thread Saran A
On Thursday, April 2, 2015 at 8:26:51 AM UTC-4, Peter Otten wrote: > Saran A 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. > > > > "T

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

2015-04-02 Thread Saran A
On Thursday, April 2, 2015 at 8:26:01 AM UTC-4, Chris Angelico wrote: > On Thu, Apr 2, 2015 at 11:02 PM, Saran A wrote: > > 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

Re: New to Programming - XML Processing

2015-04-02 Thread Albert-Jan Roskam
- On Wed, Apr 1, 2015 10:00 AM CEST Mark Lawrence wrote: >On 01/04/2015 05:27, Andrew Farrell wrote: >> You should follow Rustom's advice before just diving into the blog post >> I linked to. Otherwise you risk blindly following things and losing your >> bearings when

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

2015-04-02 Thread Peter Otten
Saran A 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 in os.listdir(dirl

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

2015-04-02 Thread Chris Angelico
On Thu, Apr 2, 2015 at 11:02 PM, Saran A wrote: > 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. > I don't think you actually want to convert a list into a string, here. Te

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

2015-04-02 Thread Saran A
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

Re: Gpg python installer

2015-04-02 Thread Ned Deily
In article , leonardo davinci wrote: > I am using Kleopatra(gpg for win) to verify the 3.4.3 python installer, > Windows x86 MSI > > >https://www.python.org/ftp/python/3.4.3/python-3.4.3.msi> > www.python.org > /ftp/python/3.4.3/ >