Re: Limit Lines of Output

2013-06-27 Thread Joshua Landau
On 27 June 2013 00:57, Steven D'Aprano
 wrote:
> On Wed, 26 Jun 2013 10:09:13 -0700, rusi wrote:
>
>> On Wednesday, June 26, 2013 8:54:56 PM UTC+5:30, Joshua Landau wrote:
>>> On 25 June 2013 22:48, Gene Heskett  wrote:
>>> > On Tuesday 25 June 2013 17:47:22 Joshua Landau did opine:
>>>
>>> I did not.
>>
>> I guess Joshua is saying that saying ≠ opining
>
> But it is. From WordNet:
>
> opine
> v 1: express one's opinion openly and without fear or
>  hesitation; "John spoke up at the meeting" [syn: opine,
>  speak up, speak out, animadvert, sound off]

To give context;

On 25 June 2013 22:48, Gene Heskett  (incorrectly) wrote:
> On Tuesday 25 June 2013 17:47:22 Joshua Landau did opine:
>
> > On 25 June 2013 21:22, Bryan Britten  wrote:
> > > Ah, I always forget to mention my OS on these forums. I'm running
> > > Windows.
> >
> > Supposedly, Windows has "more"
> > [http://superuser.com/questions/426226/less-or-more-in-windows],
>
> Yes, but less is more than more.
>
> > For Linux+less; this works:
> >
> > from subprocess import Popen, PIPE
> > less = Popen("less", stdin=PIPE)
> > less.stdin.write(b"\n".join("This is line number
> > {}".format(i).encode("UTF-8") for i in range(1000)))
> > less.wait()

As you can see, my quoted text contained no *opinions*, at least of
the nuance that "opine" refers to.

> Admittedly we cannot tell what Joshua's mental state was at the time he
> responded to Bryan, he may have been absolutely terrified for all we
> know, but there's no sign of this fear, and no reason to think that he
> hesitated, given that his response came through a mere nine minutes after
> Bryan's comment.

That's taking a very analytic turn...

To clarify; I did have little hesitation but that was not the grounds
to my objection.

> Or if you prefer the Collaborative International Dictionary of English:
>
> Opine \O*pine"\, v. t. & i. [imp. & p. p. Opined; p. pr. & vb.
>n. Opining.] [L. opinari, p. p. opinatus; akin to opinus
>(in comp.) thinking, and perh. to E. apt: cf. F. opiner.]
>To have an opinion; to judge; to think; to suppose. --South.
>[1913 Webster]

As this accurately sums up, to "opine" requires one to "judge" in some
form, or to be "opinionated"; these are not things I did; I rather
just referenced someone's work without openly judging it and stated
(objectively so, you shall find) that some code worked.

>> [Or is he opining?]
>
> That's just his opinion, man.
>
> *wink*


--

(I wasn't expecting this to spawn so much discourse.)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Limit Lines of Output

2013-06-26 Thread Steven D'Aprano
On Wed, 26 Jun 2013 10:09:13 -0700, rusi wrote:

> On Wednesday, June 26, 2013 8:54:56 PM UTC+5:30, Joshua Landau wrote:
>> On 25 June 2013 22:48, Gene Heskett  wrote:
>> > On Tuesday 25 June 2013 17:47:22 Joshua Landau did opine:
>> 
>> I did not.
> 
> I guess Joshua is saying that saying ≠ opining

But it is. From WordNet:

opine
v 1: express one's opinion openly and without fear or
 hesitation; "John spoke up at the meeting" [syn: opine,
 speak up, speak out, animadvert, sound off]


Admittedly we cannot tell what Joshua's mental state was at the time he 
responded to Bryan, he may have been absolutely terrified for all we 
know, but there's no sign of this fear, and no reason to think that he 
hesitated, given that his response came through a mere nine minutes after 
Bryan's comment.

Or if you prefer the Collaborative International Dictionary of English:

Opine \O*pine"\, v. t. & i. [imp. & p. p. Opined; p. pr. & vb.
   n. Opining.] [L. opinari, p. p. opinatus; akin to opinus
   (in comp.) thinking, and perh. to E. apt: cf. F. opiner.]
   To have an opinion; to judge; to think; to suppose. --South.
   [1913 Webster]



> [Or is he opining?]

That's just his opinion, man.

*wink*



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Limit Lines of Output

2013-06-26 Thread Joshua Landau
On 26 June 2013 17:46, Steven D'Aprano
 wrote:
> On Wed, 26 Jun 2013 16:24:56 +0100, Joshua Landau wrote:
>
>> On 25 June 2013 22:48, Gene Heskett  wrote:
>>> On Tuesday 25 June 2013 17:47:22 Joshua Landau did opine:
>>
>> I did not.
>
> Unless there are two people called "Joshua Landau" with email address
> , I'm afraid that you did.

Ah, but as rusi has understood, I did not.

(Although "I did not" may itself be opining, that was not the quoted text.)

Hey, sometimes I just like being cryptic.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Limit Lines of Output

2013-06-26 Thread rusi
On Wednesday, June 26, 2013 8:54:56 PM UTC+5:30, Joshua Landau wrote:
> On 25 June 2013 22:48, Gene Heskett  wrote:
> > On Tuesday 25 June 2013 17:47:22 Joshua Landau did opine:
> 
> I did not.

I guess Joshua is saying that saying ≠ opining

[Or is he opining?]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Limit Lines of Output

2013-06-26 Thread Steven D'Aprano
On Wed, 26 Jun 2013 16:24:56 +0100, Joshua Landau wrote:

> On 25 June 2013 22:48, Gene Heskett  wrote:
>> On Tuesday 25 June 2013 17:47:22 Joshua Landau did opine:
> 
> I did not.

Unless there are two people called "Joshua Landau" with email address 
, I'm afraid that you did.

Here's the email that started the subthread, by Bryan Britten:

http://mail.python.org/pipermail/python-list/2013-June/650697.html

Your, or possibly your evil doppelganger's, reply to Bryan:

http://mail.python.org/pipermail/python-list/2013-June/650698.html

Followed by Gene's reply to your reply:

http://mail.python.org/pipermail/python-list/2013-June/650750.html

And your, or your evil doppelganger's, reply to Gene:

http://mail.python.org/pipermail/python-list/2013-June/650773.html


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Limit Lines of Output

2013-06-26 Thread Chris Angelico
On Thu, Jun 27, 2013 at 1:24 AM, Joshua Landau
 wrote:
> On 25 June 2013 22:48, Gene Heskett  wrote:
>> On Tuesday 25 June 2013 17:47:22 Joshua Landau did opine:
>
> I did not.

Beg pardon? It looked like an accurate citation to me - you quoted the
OP's second post, then added the line beginning "Supposedly". That's
what Gene quoted, so I'm not understanding this rejection.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Limit Lines of Output

2013-06-26 Thread Joshua Landau
On 25 June 2013 22:48, Gene Heskett  wrote:
> On Tuesday 25 June 2013 17:47:22 Joshua Landau did opine:

I did not.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Limit Lines of Output

2013-06-26 Thread Alister
On Tue, 25 Jun 2013 14:39:30 -0600, Ian Kelly wrote:

> On Tue, Jun 25, 2013 at 2:31 PM, Joshua Landau
>  wrote:
>> On 25 June 2013 21:22, Bryan Britten  wrote:
>>> Ah, I always forget to mention my OS on these forums. I'm running
>>> Windows.
>>
>> Supposedly, Windows has "more"
>> [http://superuser.com/questions/426226/less-or-more-in-windows],
>>
>> For Linux+less; this works:
>>
>> from subprocess import Popen, PIPE less = Popen("less", stdin=PIPE)
>> less.stdin.write(b"\n".join("This is line number
>> {}".format(i).encode("UTF-8") for i in range(1000)))
>> less.wait()
> 
> 
> Or simply:
> 
> $ python my_script.py | less
> 
> It works the same way in Windows:
> 
> C:\> python my_script.py | more

this would be my approach
it leaves it to the user to decide what to do with the output (they may 
even decide to write it to a file themselves)

and obeys to very good principles

1) Do not re-invent the wheel.
2) do only 1 job but do it well. 




-- 
"Every morning, I get up and look through the 'Forbes' list of the
richest people in America.  If I'm not there, I go to work"
-- Robert Orben
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Limit Lines of Output

2013-06-26 Thread Gene Heskett
On Tuesday 25 June 2013 17:47:22 Joshua Landau did opine:

> On 25 June 2013 21:22, Bryan Britten  wrote:
> > Ah, I always forget to mention my OS on these forums. I'm running
> > Windows.
> 
> Supposedly, Windows has "more"
> [http://superuser.com/questions/426226/less-or-more-in-windows],

Yes, but less is more than more.
 
> For Linux+less; this works:
> 
> from subprocess import Popen, PIPE
> less = Popen("less", stdin=PIPE)
> less.stdin.write(b"\n".join("This is line number
> {}".format(i).encode("UTF-8") for i in range(1000)))
> less.wait()


Cheers, Gene
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
My web page:  is up!
My views 

Campbell's Law:
Nature abhors a vacuous experimenter.
A pen in the hand of this president is far more
dangerous than 200 million guns in the hands of
 law-abiding citizens.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Limit Lines of Output

2013-06-25 Thread Dave Angel

On 06/25/2013 04:37 PM, Bryan Britten wrote:

Joel -

I don't want to send it to a text file because it's just meant to serve as a 
reference for the user to get an idea of what words are mentioned. The words 
being analyzed are responses to a survey questions and the primary function of 
this script is to serve as a text analytics program. Exporting the output to a 
text file would just be an unnecessary/undesirable step for the user.



Your subject says you want to limit the lines of output.  So after 25 
lines, quit the program.  Not too hard.


At the other extreme, your user wants to be able to scroll up or down 
within the hundreds of lines, seeing 25 at a time, and wants to be able 
to search for particular substrings, optionally with case-insensitivity, 
and wants to be able to sort them by some criteria, or copy/paste some 
portion elsewhere.


Write a spec that limits what you want, or you'll never finish the 
project.  And accept that if you want too much, you'll end up writing 
the equivalent of a text editor before you're done.


--
DaveA
--
http://mail.python.org/mailman/listinfo/python-list


Re: Limit Lines of Output

2013-06-25 Thread Ian Kelly
On Tue, Jun 25, 2013 at 2:31 PM, Joshua Landau
 wrote:
> On 25 June 2013 21:22, Bryan Britten  wrote:
>> Ah, I always forget to mention my OS on these forums. I'm running Windows.
>
> Supposedly, Windows has "more"
> [http://superuser.com/questions/426226/less-or-more-in-windows],
>
> For Linux+less; this works:
>
> from subprocess import Popen, PIPE
> less = Popen("less", stdin=PIPE)
> less.stdin.write(b"\n".join("This is line number
> {}".format(i).encode("UTF-8") for i in range(1000)))
> less.wait()


Or simply:

$ python my_script.py | less

It works the same way in Windows:

C:\> python my_script.py | more
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Limit Lines of Output

2013-06-25 Thread Bryan Britten
Joel -

I don't want to send it to a text file because it's just meant to serve as a 
reference for the user to get an idea of what words are mentioned. The words 
being analyzed are responses to a survey questions and the primary function of 
this script is to serve as a text analytics program. Exporting the output to a 
text file would just be an unnecessary/undesirable step for the user.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Limit Lines of Output

2013-06-25 Thread Joel Goldstick
On Tue, Jun 25, 2013 at 4:22 PM, Bryan Britten wrote:

> Ah, I always forget to mention my OS on these forums. I'm running Windows.
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>

I don't think I fully understand your problem.  Why can't you send output
to a text file, then use a text editor to view results?

-- 
Joel Goldstick
http://joelgoldstick.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Limit Lines of Output

2013-06-25 Thread Joshua Landau
On 25 June 2013 21:22, Bryan Britten  wrote:
> Ah, I always forget to mention my OS on these forums. I'm running Windows.

Supposedly, Windows has "more"
[http://superuser.com/questions/426226/less-or-more-in-windows],

For Linux+less; this works:

from subprocess import Popen, PIPE
less = Popen("less", stdin=PIPE)
less.stdin.write(b"\n".join("This is line number
{}".format(i).encode("UTF-8") for i in range(1000)))
less.wait()
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Limit Lines of Output

2013-06-25 Thread Bryan Britten
Ah, I always forget to mention my OS on these forums. I'm running Windows.

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


Re: Limit Lines of Output

2013-06-25 Thread Joel Goldstick
On Tue, Jun 25, 2013 at 4:09 PM, Bryan Britten wrote:

> Hey, group, quick (I hope) question:
>
> I've got a simple script that counts the number of words in a data set
> (it's more complicated than that, but that's one of the functions), but
> there are so many words that the output is too much to see in the command
> prompt window. What I'd like to be able to do is incorporate the "More..."
> feature that help libraries have, but I have no idea how to do it. I also
> don't know if I'm asking the question correctly because a Google search
> yielding nothing.
>
> Any insight would be appreciated. Thanks!
> --
> http://mail.python.org/mailman/listinfo/python-list
>

If you are using linux, you should look up the comand 'less'.  It allows
you to page thru a test file.  You can either write your list to a file or
pipe it into less (haven't tried that myself)

-- 
Joel Goldstick
http://joelgoldstick.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Limit Lines of Output

2013-06-25 Thread Bryan Britten
Hey, group, quick (I hope) question:

I've got a simple script that counts the number of words in a data set (it's 
more complicated than that, but that's one of the functions), but there are so 
many words that the output is too much to see in the command prompt window. 
What I'd like to be able to do is incorporate the "More..." feature that help 
libraries have, but I have no idea how to do it. I also don't know if I'm 
asking the question correctly because a Google search yielding nothing.

Any insight would be appreciated. Thanks!
-- 
http://mail.python.org/mailman/listinfo/python-list