Re: [Tutor] Web scrapping

2013-12-12 Thread Amal Thomas
On Fri, Dec 13, 2013 at 12:29 AM, Joel Goldstick wrote: > > > So, read the Requests tutorial, and study the POST examples as POST is the > http method that is used when filling in a form. First you will need to > examine the form to learn the names of the fields you need to provide data > for. >

Re: [Tutor] Web scrapping

2013-12-12 Thread Amal Thomas
-Form ) 3. Then further steps downloading the output.. Thanks, On Fri, Dec 13, 2013 at 12:19 AM, Joel Goldstick wrote: > > > > On Thu, Dec 12, 2013 at 1:41 PM, Amal Thomas wrote: > >> Hi, >> >> I am new to python3. I am working in computational biology. I need t

[Tutor] Web scrapping

2013-12-12 Thread Amal Thomas
Hi, I am new to python3. I am working in computational biology. I need to submit many sequence (one by one) to a http web server ( http://mfold.rna.albany.edu/?q=mfold/RNA-Folding-Form) . After the processing I need to download the output file. There is an offline package for this server but cer

Re: [Tutor] Load Entire File into memory

2013-11-05 Thread Amal Thomas
On Mon, Nov 4, 2013 at 10:00 PM, Steven D'Aprano wrote: > > > import os > filename = "YOUR FILE NAME HERE" > print("File size:", os.stat(filename).st_size) > f = open(filename) > content = f.read() > print("Length of content actually read:", len(content)) > print("Current file position:", f.tell(

Re: [Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
ry efficiency is easy, do it line by line off the disk. > > This assumes that you can process one line at a time, sequentially. I > expect that is not the case. > > > -- > Steven > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscript

Re: [Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
filename).st_size) f = open(filename) content = f.read() print("Length of content actually read:", len(content)) print("Current file position:", f.tell()) f.close() and send us the output. -- *AMAL THOMAS* ___ Tutor maillist - T

Re: [Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
way that is clear and understandable, then try to optimize > it if necessary. > > -- *AMAL THOMAS* ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
@Dave: thanks.. By the way I am running my codes on a server with about 100GB ram but I cant afford my code to use 4-5 times the size of the text file. Now I am using read() / readlines() , these seems to be more efficient in memory usage than io.StringIO(f.read()). On Mon, Nov 4, 2013 at 9:23 P

Re: [Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
Mon, Nov 4, 2013 at 7:16 PM, William Ray Wing wrote: > On Nov 4, 2013, at 8:30 AM, Amal Thomas wrote: > How long are the lines in your file? In particular, are they many > hundreds or thousands of characters long, or are they only few hundred > characters, say 200 or less? > > U

Re: [Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
in time. Thanks, On Mon, Nov 4, 2013 at 7:11 PM, Peter Otten <__pete...@web.de> wrote: > Amal Thomas wrote: > > > Yes I have found that after loading to RAM and then reading lines by > lines > > saves a huge amount of time since my text files are very huge. > >

Re: [Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
Yes I have found that after loading to RAM and then reading lines by lines saves a huge amount of time since my text files are very huge. On Mon, Nov 4, 2013 at 6:46 PM, Alan Gauld wrote: > On 04/11/13 13:06, Amal Thomas wrote: > > Present code: >> >> >> *f = op

Re: [Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
f.close()for lines in content: * *content.close()* Now I have found that memory use is roughly 1.5 times the size of text file. Previously it was around 4-5 times. Its remarkable change. Waiting for more suggestions. Thanks, On Mon, Nov 4, 2013 at 5:05 PM, Alan Gauld wrote: > On 04/11/13 11:07

[Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
to do this. Working on Python 3.3.1,ubuntu 13.04(Linux 3.8.0-29-generic x64) Thanks -- *AMAL THOMAS * ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Which version of python should i use?

2013-05-20 Thread Amal Thomas
Thank you very much..!! I am starting to learn python for my Bioinformatics work, so I would look for the version that has libraries helpful for me.. On Mon, May 20, 2013 at 6:38 PM, Dave Angel wrote: > On 05/20/2013 05:59 AM, Amal Thomas wrote: > >> hi, >> I am a begi

[Tutor] Which version of python should i use?

2013-05-20 Thread Amal Thomas
hi, I am a beginner. I am using a unix sytem (ubuntu 12.10). Python 2.7.3 is installed in my system. I found out that Python has version upto 3.3.2. Should I update my python version? Is the syntaxes of the each version different? Thanks, Thomas ___