Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #89630
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!newsfeed.tele2net.at!news.panservice.it!feed.xsnews.nl!border02.ams.xsnews.nl!feeder04.ams.xsnews.nl!abp002.ams.xsnews.nl!frontend-F10-15.ams.news.kpn.nl |
|---|---|
| From | Cecil Westerhof <Cecil@decebal.nl> |
| Newsgroups | comp.lang.python |
| Subject | Re: seek operation in python |
| Organization | Decebal Computing |
| References | <8b2bd328-08a6-4211-85c4-8d117d1aae1e@googlegroups.com> |
| X-Face | "(y8cC@tg_12{">GF'UXTW]FHI2wMiZNrnf'1EFQ&O#$m:f#O7+7}kR<J%a^F2lh4[N~Yz4 nSp#c+aQo1b5=?HcNEkQ7QzF<])O3X4MDL/AYjys&*mt>,v+Pti8=Vi/Z"g^?b"E |
| X-Homepage | http://www.decebal.nl/ |
| Date | Thu, 30 Apr 2015 14:31:20 +0200 |
| Message-ID | <874mnxx0fb.fsf@Equus.decebal.nl> (permalink) |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
| Cancel-Lock | sha1:qY0xZd2XfjE82v1BQJ1Ac6kE/k0= |
| MIME-Version | 1.0 |
| Content-Type | text/plain |
| Lines | 21 |
| NNTP-Posting-Host | 81.207.62.244 |
| X-Trace | 1430397891 news.kpn.nl 21089 81.207.62.244@kpn/81.207.62.244:37993 |
| Xref | csiph.com comp.lang.python:89630 |
Show key headers only | View raw
Op Wednesday 29 Apr 2015 20:08 CEST schreef siva sankari R.:
> file=open("input","r")
> line=file.seek(7)
> print line
>
> The above code is supposed to print a line but it prints "none". I
> don't know where the mistake is. Help.!
You could use my module:
https://github.com/CecilWesterhof/PythonLibrary/blob/master/filebasedMessages.py
Then use:
from filebasedMessages import get_indexed_message
get_indexed_message('input.cpp', 7)
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
seek operation in python siva sankari R <buddingrose11@gmail.com> - 2015-04-29 11:08 -0700
Re: seek operation in python Joel Goldstick <joel.goldstick@gmail.com> - 2015-04-29 14:17 -0400
Re: seek operation in python siva sankari R <buddingrose11@gmail.com> - 2015-04-29 11:26 -0700
Re: seek operation in python Billy Earney <billy.earney@gmail.com> - 2015-04-29 13:42 -0500
Re: seek operation in python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-04-29 21:53 +0100
Re: seek operation in python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-04-30 10:19 +1000
Re: seek operation in python MRAB <python@mrabarnett.plus.com> - 2015-04-29 19:50 +0100
Re: seek operation in python John Gordon <gordon@panix.com> - 2015-04-29 18:53 +0000
Re: seek operation in python Chris Angelico <rosuav@gmail.com> - 2015-04-30 10:33 +1000
Re: seek operation in python Cecil Westerhof <Cecil@decebal.nl> - 2015-04-30 08:27 +0200
Re: seek operation in python Chris Angelico <rosuav@gmail.com> - 2015-04-30 17:33 +1000
Re: seek operation in python Cecil Westerhof <Cecil@decebal.nl> - 2015-04-30 10:06 +0200
Re: seek operation in python Dave Angel <davea@davea.name> - 2015-04-30 04:31 -0400
Re: seek operation in python Cecil Westerhof <Cecil@decebal.nl> - 2015-04-30 11:06 +0200
Re: seek operation in python Chris Angelico <rosuav@gmail.com> - 2015-04-30 19:39 +1000
Re: seek operation in python Larry Hudson <orgnut@yahoo.com> - 2015-04-30 12:38 -0700
Re: seek operation in python Cecil Westerhof <Cecil@decebal.nl> - 2015-04-30 22:50 +0200
Re: seek operation in python Larry Hudson <orgnut@yahoo.com> - 2015-04-30 19:42 -0700
Re: seek operation in python Cecil Westerhof <Cecil@decebal.nl> - 2015-04-30 14:31 +0200
csiph-web