[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

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 joel.goldst...@gmail.comwrote: On Thu, Dec 12, 2013 at 1:41 PM, Amal Thomas amalthomas...@gmail.comwrote: Hi, I am new to python3. I am working in computational biology. I need

Re: [Tutor] Web scrapping

2013-12-12 Thread Amal Thomas
On Fri, Dec 13, 2013 at 12:29 AM, Joel Goldstick joel.goldst...@gmail.comwrote: 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

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 st...@pearwood.info 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:,

[Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
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] Load Entire File into memory

2013-11-04 Thread Amal Thomas
:07, Amal Thomas wrote: I am currently using this method to load my text file: *f = open(output.txt) content=io.StringIO(f.read()) f.close()* But I have found that this method uses 4 times the size of text file. So why not use f = open(output.txt) content=f.read() f.close

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 alan.ga...@btinternet.comwrote: On 04/11/13 13:06, Amal Thomas wrote: Present code: *f = open(output.txt

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. How exactly did you find out? You should only

Re: [Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
, Nov 4, 2013 at 7:16 PM, William Ray Wing w...@mac.com wrote: On Nov 4, 2013, at 8:30 AM, Amal Thomas amalthomas...@gmail.com 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

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

Re: [Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
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
= 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 - Tutor@python.org To unsubscribe or change

Re: [Tutor] Load Entire File into memory

2013-11-04 Thread Amal Thomas
To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor -- *AMAL THOMAS* ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[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 ___

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 da...@davea.name wrote: On 05/20/2013 05:59 AM, Amal Thomas wrote: hi, I am a beginner. I am