how to read a string whose length is not known
and string is so long that we can't read it all at once?
input (i.e string) is terminated by EOF
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
If I understand question correctly, then just read as many characters as you
can using standard string functions. (like fgets n all related)
Output these all characters in a file.
Iterate until you have read all the characters and go on appending what you
have read to file.
You intended to ask
You can quite easily map this problem to that of a typical client-server
protocol.
You don't know the size of the data, and the all packets will be of a
certain size, possibly, except the last one.
So the solutions provided for that problem might apply to some cases of
this!
--
Anup Ghatage
--
Hello everyone,
I'm new to python.How can I check the EOF for inputs in SPOJ?
Thanks in advance!!
-Vishnutej
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe
while(1):
try:
# code
#
#
except EOFError: break
On Wed, May 25, 2011 at 8:41 PM, Vishnutej
mylavarapu.vishnu...@gmail.comwrote:
Hello everyone,
I'm new to python.How can I check the EOF for inputs in SPOJ?
Thanks in advance!!
-Vishnutej
--
You received this
Thnx a lot abhijith..
Do you have any links for tutorials for beginners?
On Wed, May 25, 2011 at 8:42 PM, abhijith reddy abhijith200...@gmail.comwrote:
while(1):
try:
# code
#
#
except EOFError: break
On Wed, May 25, 2011 at 8:41 PM, Vishnutej
A Byte of Python - Freely available online.
http://docs.python.org/library/; - Python Library Reference.
On Wed, May 25, 2011 at 8:52 PM, Vishnutej Mylavarapu
mylavarapu.vishnu...@gmail.com wrote:
Thnx a lot abhijith..
Do you have any links for tutorials for beginners?
On Wed, May 25,
for line in sys.stdin:
print line,
print eof
--
Aman Agarwal
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
do not forget to import sys
import sys
for line in sys.stdin:
print line,
print eof
On Wed, May 25, 2011 at 9:12 PM, Aman (neshu) Agarwal
neshuagarwal1...@gmail.com wrote:
for line in sys.stdin:
print line,
print eof
--
Aman Agarwal
--
Aman Agarwal
--
You received this
What are the cases for which I might get NZEC??
On Wed, May 25, 2011 at 9:13 PM, Aman (neshu) Agarwal
neshuagarwal1...@gmail.com wrote:
do not forget to import sys
import sys
for line in sys.stdin:
print line,
print eof
On Wed, May 25, 2011 at 9:12 PM, Aman (neshu) Agarwal
10 matches
Mail list logo