On 1/24/13, Peter Otten __pete...@web.de wrote:
Santosh Kumar wrote:
Yes, Peter got it right.
Now, how can I replace:
script, givenfile = argv
with something better that takes argv[1] as input file as well as
reads input from stdin.
By input from stdin, I mean that currently when I
Santosh Kumar wrote:
On 1/24/13, Peter Otten __pete...@web.de wrote:
Santosh Kumar wrote:
Yes, Peter got it right.
Now, how can I replace:
script, givenfile = argv
with something better that takes argv[1] as input file as well as
reads input from stdin.
By input from stdin, I
But I can; see: http://pastebin.com/ZGGeZ71r
On 1/24/13, Peter Otten __pete...@web.de wrote:
Santosh Kumar wrote:
On 1/24/13, Peter Otten __pete...@web.de wrote:
Santosh Kumar wrote:
Yes, Peter got it right.
Now, how can I replace:
script, givenfile = argv
with something better
Santosh Kumar wrote:
But I can; see: http://pastebin.com/ZGGeZ71r
You have messed with your cat command -- it adds line numbers.
Therefore the output of
cat somefile | ./argpa.py
differs from
./argpa.py somefile
Try
./argpa.py somefile
to confirm my analysis. As to why your
I am in a problem.
words = line.split(' ')
preserve whitespaces but the problem is it writes an additional line
after every line.
And:
words = line.split()
works as I expect (does not adds addition line after every line) but
does not preserves whitespaces.
--
Santosh Kumar wrote:
I am in a problem.
words = line.split(' ')
preserve whitespaces but the problem is it writes an additional line
after every line.
Strip off the newline at the end of the line with:
line = line.rstrip(\n)
words = line.split( )
--
On 01/23/2013 04:20 AM, Santosh Kumar wrote:
I am in a problem.
words = line.split(' ')
preserve whitespaces but the problem is it writes an additional line
after every line.
Think about what you said. It might be clearer if you wrote:
but the problem is it doesn't strip off the
Yes, Peter got it right.
Now, how can I replace:
script, givenfile = argv
with something better that takes argv[1] as input file as well as
reads input from stdin.
By input from stdin, I mean that currently when I do `cat foo.txt |
capitalizr` it throws a ValueError error:
Traceback
On 01/23/2013 07:56 AM, Santosh Kumar wrote:
Yes, Peter got it right.
Now, how can I replace:
script, givenfile = argv
with something better that takes argv[1] as input file as well as
reads input from stdin.
By input from stdin, I mean that currently when I do `cat foo.txt |
Santosh Kumar wrote:
Yes, Peter got it right.
Now, how can I replace:
script, givenfile = argv
with something better that takes argv[1] as input file as well as
reads input from stdin.
By input from stdin, I mean that currently when I do `cat foo.txt |
capitalizr` it throws a
Santosh Kumar wrote:
Yes, Peter got it right.
Peter? Which Peter? What's it that he got right?
You have deleted all context from your post, so I have no idea what you are
talking about. And whatever program you are using to post is stripping out
threading information, so I can't tell what post
On 01/23/2013 07:49 PM, Steven D'Aprano wrote:
Santosh Kumar wrote:
Yes, Peter got it right.
Peter? Which Peter? What's it that he got right?
You have deleted all context from your post, so I have no idea what you are
talking about.
Right.
And whatever program you are using to post is
On 19/01/13 21:13, Santosh Kumar wrote:
I have a working script which takes argv[1] as an input, deassembles
each line, and then each word. Then after it capitalizes all its word
(upcases the first letter) and then prints it out on the stdout.
That script does the capitalization work fine, but,
On 01/19/2013 05:13 AM, Santosh Kumar wrote:
I have a working script which takes argv[1] as an input, deassembles
each line, and then each word. Then after it capitalizes all its word
(upcases the first letter) and then prints it out on the stdout.
That script does the capitalization work fine,
14 matches
Mail list logo