[BangPypers] BangPypers Digest, Vol 34, Issue 27

madhuri vio madhuri.vio at gmail.com
Mon Jun 14 19:30:22 CEST 2010


how do  i give it in the f orm of a file handle????
instead of a string???
i dint get that..cud u clear it for me?

On Mon, Jun 14, 2010 at 9:21 PM, <bangpypers-request at python.org> wrote:

> Send BangPypers mailing list submissions to
>        bangpypers at python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        http://mail.python.org/mailman/listinfo/bangpypers
> or, via email, send a message with subject or body 'help' to
>        bangpypers-request at python.org
>
> You can reach the person managing the list at
>        bangpypers-owner at python.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of BangPypers digest..."
>
>
> Today's Topics:
>
>   1. Re: file handling (Supreet Sethi)
>   2. biopython (madhuri vio)
>   3. biopython (madhuri vio)
>   4. Re: biopython (Guruprasad)
>   5. Live update of cmdline output on browser? (Vikas BN)
>   6. Re: Live update of cmdline output on browser? (Noufal Ibrahim)
>   7. biopython (madhuri vio)
>   8. Re: biopython (Noufal Ibrahim)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 14 Jun 2010 10:48:14 +0100
> From: Supreet Sethi <supreet.sethi at gmail.com>
> To: Bangalore Python Users Group - India <bangpypers at python.org>
> Subject: Re: [BangPypers] file handling
> Message-ID: <1276508894.2900.22.camel at shakti>
> Content-Type: text/plain; charset="UTF-8"
>
> On Mon, 2010-06-14 at 11:48 +0530, madhuri vio wrote:
> > a = open("human","rb")
> > print a.readlines()
> >
> >
> >
> > this is the code i have
> > written to read a text file but i am unable to ..
> > i get a very weird output...
> >
> "PK\x03\x04\x14\x00\x00\x00\x00\x00\xd6+\xce<^\xc62\x0c'\x00\x00\x00'\x00\x00\x00\x08\x00\x00\x00mimetypeapplication/vnd.oasis.opendocument.textPK\x03\x04\x14\x00\x00\x00\x00\x00\xd6+\xce<\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1a\x00\x00\x00Configurations2/statusbar/PK\x03\x04\x14\x00\x08\x00\x08\x00\xd6+\xce<\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'\x00\x00\x00Configurations2/accelerator/current.xml\x03\x00PK\x07\x08\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00PK\x03\x04\x14\x00\x00\x00\x00\x00\xd6+\xce<\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00Configurations2/floater/PK\x03\x04\x14\x00\x00\x00\x00\x00\xd6+\xce<\x00\x00\x00\x00\x00
> >
> > i am unable to proceed
>
> You could try open via this sequence
>
> >> import zipfile
> >> z = zipfile.ZipFile("<filename here>")
> >> z.infolist()
>
> See if it helps
>
> >> help(z)  for further reference on interactive python shell.
>
>
>
> --
> Supreet Sethi
> Ph UK: +447859172473
> Ph IN: +919811143517
> Ph Skype: d_j_i_n_n
> Profile: http://www.google.com/profiles/supreet.sethi
> Twt: http://twitter.com/djinn
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Mon, 14 Jun 2010 19:23:05 +0530
> From: madhuri vio <madhuri.vio at gmail.com>
> To: bangpypers at python.org
> Subject: [BangPypers] biopython
> Message-ID:
>        <AANLkTinilYwsBNE5Fiem1XRb13ACR38awODyKsWgf6_K at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> i cudnt run this!!!!!!
>
> and this was the error occured
>
> for seq_record in SeqIO.parse("ls_MTbH37Rv.
> fasta","fasta"):
> ...     print seq_record.id
> ...     print repr(seq_record.seq)
> ...     print len(seq_record)
> ...
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "/var/lib/python-support/python2.6/Bio/SeqIO/__init__.py", line 342,
> in parse
>    raise TypeError("Need a file handle, not a string (i.e. not a
> filename)")
> TypeError: Need a file handle, not a string (i.e. not a filename)
>
> how do i handle this???
> i am waiting for the reply
> --
> madhuri :)
>
>
> ------------------------------
>
> Message: 3
> Date: Mon, 14 Jun 2010 19:32:33 +0530
> From: madhuri vio <madhuri.vio at gmail.com>
> To: pythonlist <python-list at python.org>, bangpypers at python.org
> Subject: [BangPypers] biopython
> Message-ID:
>        <AANLkTil7yupM18lIHVgDCAEji5oeyb3sUAObbWa7VNsX at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> i have tried this still unable to get an output
>
> from Bio import Seq
> from Bio import SeqIO
> from Bio import SeqRecord
>
> for seq_record in SeqIO.read("ls_MTbH37Rv.fasta", "fasta"):
>    print seq_record.id
>    print repr(seq_record.seq)
>    print len(seq_record)
>
> python bio.py
> Traceback (most recent call last):
>  File "bio.py", line 10, in <module>
>    for seq_record in SeqIO.read("ls_MTbH37Rv.fasta", "fasta"):
>  File "/var/lib/python-support/python2.6/Bio/SeqIO/__init__.py", line 433,
> in read
>    iterator = parse(handle, format, alphabet)
>  File "/var/lib/python-support/python2.6/Bio/SeqIO/__init__.py", line 342,
> in parse
>    raise TypeError("Need a file handle, not a string (i.e. not a
> filename)")
> TypeError: Need a file handle, not a string (i.e. not a filename)
> --
> madhuri :)
>
>
> ------------------------------
>
> Message: 4
> Date: Mon, 14 Jun 2010 19:36:34 +0530
> From: Guruprasad <lgp171188 at gmail.com>
> To: Bangalore Python Users Group - India <bangpypers at python.org>
> Subject: Re: [BangPypers] biopython
> Message-ID:
>        <AANLkTinLnbLJwwidGBQxoYCUxDLjA7R297niSrfgMSiV at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi,
>
> On Mon, Jun 14, 2010 at 7:32 PM, madhuri vio <madhuri.vio at gmail.com>
> wrote:
> > i have tried this still unable to get an output
> > TypeError: Need a file handle, not a string (i.e. not a filename)
>
> Isn't this error kind of obvious of what is going wrong? I haven't
> used any of these stuff but I think passing a file handle of the file
> as an argument instead of a string in whichever line number the error
> is referring to should solve the problem. Also avoid posting duplicate
> mails to the list or cross-posting.
>
> Regards,
> Guruprasad
>
>
> ------------------------------
>
> Message: 5
> Date: Mon, 14 Jun 2010 20:06:57 +0530
> From: Vikas BN <vikas.bn at gmail.com>
> To: Bangalore Python Users Group - India <bangpypers at python.org>
> Subject: [BangPypers] Live update of cmdline output on browser?
> Message-ID:
>        <AANLkTinRrQKTQCmR6CajG8SZ4z2i6B5oKPQcAu0Kkp3a at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi All,
>
>  I'm writing a django-based web app. One of the components involve
> executing
>  a cmd-line script on the server. This script takes quite a bit of time
> (anywhere
>  between a minute to about 20minutes) and is quite verbose.
>
>  Is there a way to 'tail' the output of this script to the browser? I
> searched on the
>  internet, but apparently my skills in that area seem to have fallen short
> in this case :(
>
> TIA,
> Vikas
>
>
> ------------------------------
>
> Message: 6
> Date: Mon, 14 Jun 2010 20:53:32 +0530
> From: Noufal Ibrahim <noufal at gmail.com>
> To: Bangalore Python Users Group - India <bangpypers at python.org>
> Subject: Re: [BangPypers] Live update of cmdline output on browser?
> Message-ID:
>        <AANLkTin0HCpqmpHrpRO2MHFxUnr8SuGdUgE3ffw-R9bz at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Mon, Jun 14, 2010 at 8:06 PM, Vikas BN <vikas.bn at gmail.com> wrote:
> [..]
> > ?Is there a way to 'tail' the output of this script to the browser? I
> > searched on the
> > ?internet, but apparently my skills in that area seem to have fallen
> short
> > in this case :(
>
> Not Python specific but Ajax term
> (http://antony.lesuisse.org/software/ajaxterm/) and it's predecessor
> anyterm implement web based terminals. You might be able to steal some
> ideas from there. As far as I know, they implement a simple polling
> mechanism with something like exponential back off to read back new
> data on the remote process.
>
>
> --
> ~noufal
> http://nibrahim.net.in
>
>
> ------------------------------
>
> Message: 7
> Date: Mon, 14 Jun 2010 21:15:50 +0530
> From: madhuri vio <madhuri.vio at gmail.com>
> To: pythonlist <python-list at python.org>, bangpypers at python.org
> Subject: [BangPypers] biopython
> Message-ID:
>        <AANLkTil-LXI9rUcl7zUvMYvipE9VU6rKfl8PvVr7ZEvI at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> i am still waiting for some help.....
> --
> madhuri :)
>
>
> ------------------------------
>
> Message: 8
> Date: Mon, 14 Jun 2010 21:21:41 +0530
> From: Noufal Ibrahim <noufal at gmail.com>
> To: Bangalore Python Users Group - India <bangpypers at python.org>
> Subject: Re: [BangPypers] biopython
> Message-ID:
>        <AANLkTilp9-1lBF9QsqbhCBt5VTbK87Bm-uNoE914sf5S at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Mon, Jun 14, 2010 at 9:15 PM, madhuri vio <madhuri.vio at gmail.com>
> wrote:
> > i am still waiting for some help.....
>
> 1. Read http://www.catb.org/~esr/faqs/smart-questions.html#urgent
> first and then read the entire article. This is volunteer mailing
> list.
> 2. Don't cross post (i.e. post to multiple lists in the same email).
> 3. Don't start threads which don't mean anything. "biopython" is
> hardly a descriptive subject and this thread just says that you're
> waiting for help (which doesn't obligate anyone to help you).
>
> Your original question was something trivial to which there was a
> reply. Did you try that? What error did you see? Why did it happen?
> Did you try to solve the problem? What hurdle did you hit?
>
>
> --
> ~noufal
> http://nibrahim.net.in
>
>
> ------------------------------
>
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>
>
> End of BangPypers Digest, Vol 34, Issue 27
> ******************************************
>



-- 
madhuri :)


More information about the BangPypers mailing list