Downloading the feed using feedparser

2013-09-04 Thread mukesh tiwari
nload again then I will get 304 response since no data is changed on server. >>> d = feedparser.parse("feed://feeds.huffingtonpost.com/HP/MostPopular") >>> d.etag u'Vx5oxwMUzEFvFpd6BNR23912Zk4' >>> d.modified 'Wed, 04 Sep 2013 10:32:06 GMT' >>> feedparser.p

Re: Improving the web page download code.

2013-08-27 Thread mukesh tiwari
On Wednesday, 28 August 2013 04:03:15 UTC+5:30, MRAB wrote: > On 27/08/2013 21:53, mukesh tiwari wrote: > > > On Wednesday, 28 August 2013 01:49:59 UTC+5:30, MRAB wrote: > > >> On 27/08/2013 20:41, mukesh tiwari wrote: > > >> > >

Re: Improving the web page download code.

2013-08-27 Thread mukesh tiwari
On Wednesday, 28 August 2013 01:49:59 UTC+5:30, MRAB wrote: > On 27/08/2013 20:41, mukesh tiwari wrote: > > > Hello All, > > > I am doing web stuff first time in python so I am looking for suggestions. > > I wrote this code to download the title of webpages using

Improving the web page download code.

2013-08-27 Thread mukesh tiwari
not sure ). I don't have much web programming experience so I am looking for suggestion to make it more robust. top-1m.csv is file downloaded from alexa[1]. Also some suggestions to write more idiomatic python code. -Mukesh Tiwari [1]http://www.alexa.com/topsites. import urllib2, os, s

Re: Regular expression problem

2013-03-10 Thread mukesh tiwari
print email[i].group() c += 1 Regards Mukesh Tiwari -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular expression problem

2013-03-10 Thread mukesh tiwari
read data from STDIN. Regards Mukesh Tiwari > > > > ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Regular expression problem

2013-03-10 Thread mukesh tiwari
.com mukeshtiwari.iiitmm...@gmail.com') ['com'] I am suppose to get [ mukeshtiwari.iiit...@gmail.com , mukeshtiwari.iiit...@gmail.com] ? Regards Mukesh Tiwari [1] http://www.spoj.com/problems/MAIN12C/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading pen drive data

2011-09-03 Thread mukesh tiwari
On Sep 3, 7:40 pm, mukesh tiwari wrote: > Hello all > I am trying to write a python script which can mount a pen drive and > read the data from pen drive. I am using pyudev > [http://packages.python.org/pyudev/api/index.html] and wrote a small > python code > > import pyud

Reading pen drive data

2011-09-03 Thread mukesh tiwari
Hello all I am trying to write a python script which can mount a pen drive and read the data from pen drive. I am using pyudev [ http://packages.python.org/pyudev/api/index.html ] and wrote a small python code import pyudev, sys if __name__ =="__main__": context = pyudev.Context()

Re: Listing HAL devices

2011-09-01 Thread mukesh tiwari
On Sep 1, 8:46 pm, mukesh tiwari wrote: > Hello all > I am trying to write a python script which detects usb pen drive and > copy all the data into my home directory. After bit of searching , i > found these two links 1]http://en.wikibooks.org/wiki/Python_Programming/Dbus

Listing HAL devices

2011-09-01 Thread mukesh tiwari
Hello all I am trying to write a python script which detects usb pen drive and copy all the data into my home directory. After bit of searching , i found these two links 1] http://en.wikibooks.org/wiki/Python_Programming/Dbus and 2] http://stackoverflow.com/questions/469243/how-can-i-listen-for-us

Re: Elliptic Curve Prime factorisation

2011-01-14 Thread mukesh tiwari
On Jan 15, 7:02 am, Steven D'Aprano wrote: > On Fri, 14 Jan 2011 11:52:21 -0800, mukesh tiwari wrote: > > Hello all , I have implemented Elliptic curve prime factorisation using > > wikipedia [ > >http://en.wikipedia.org/wiki/Lenstra_elliptic_curve_factorization]. I &

Elliptic Curve Prime factorisation

2011-01-14 Thread mukesh tiwari
Hello all , I have implemented Elliptic curve prime factorisation using wikipedia [ http://en.wikipedia.org/wiki/Lenstra_elliptic_curve_factorization]. I think that this code is not optimised and posting for further improvement. Feel free to comment and if you have any link regarding Elliptic curv

Re: File transfer on network

2010-07-16 Thread mukesh tiwari
On Jul 16, 4:08 am, MRAB wrote: > mukesh tiwari wrote: > > Hello all > > Currently i am trying to develop a client and server in python. Client > > takes screenshot in every 20 seconds and send it to server. Server > > store the received file in folder. Here is code

Re: File transfer on network

2010-07-15 Thread mukesh tiwari
ata) f.close() print 'file received' time.sleep(20) i+=1; #print ' file received ' conn.close() My problem is that server is copying only first image copyscreenshot_0.png while my client continuous

File transfer on network

2010-07-15 Thread mukesh tiwari
time.sleep(20) i+=1; #print ' file received ' conn.close() My problem is that server is copying only first image copy

Re: Precision issue in python

2010-02-20 Thread mukesh tiwari
On Feb 20, 8:13 pm, mukesh tiwari wrote: > On Feb 20, 5:44 pm, Mark Dickinson wrote: > > > > > > > On Feb 20, 11:17 am, mukesh tiwari > > wrote: > > > > Hello everyone. I think it is  related to the precision with double > > > arithm

Re: Precision issue in python

2010-02-20 Thread mukesh tiwari
On Feb 20, 5:44 pm, Mark Dickinson wrote: > On Feb 20, 11:17 am, mukesh tiwari > wrote: > > > Hello everyone. I think it is  related to the precision with double > > arithmetic so i posted here.I am trying with this problem > > (https://www.spoj.pl/problems/CALCULA

Precision issue in python

2010-02-20 Thread mukesh tiwari
Hello everyone. I think it is related to the precision with double arithmetic so i posted here.I am trying with this problem (https:// www.spoj.pl/problems/CALCULAT) and the problem say that "Note : for all test cases whose N>=100, its K<=15." I know precision of doubles in c is 16 digits. Could s

Re: Python Optimization

2010-02-15 Thread mukesh tiwari
On Feb 15, 1:07 am, Steve Howell wrote: > On Feb 14, 11:52 am, Mark Dickinson wrote: > > > > > > > On Feb 14, 4:53 pm, mukesh tiwari > > wrote: > > > > Hello everyone. I am new to python and previously i did programming in > > > c/c++.Could

Python Optimization

2010-02-14 Thread mukesh tiwari
I am trying for this problem(https://www.spoj.pl/problems/ FACT1/). Thank you # To change this template, choose Tools | Templates # and open the template in the editor. __author__="Mukesh Tiwari" __date__ ="$Feb 10, 2010 1:35:26 AM$" import random from Queue import Queue

Problem Regarding Queue

2010-02-09 Thread mukesh tiwari
ate in the editor. __author__="Mukesh Tiwari" __date__ ="$Feb 10, 2010 1:35:26 AM$" import random import sys def gcd(a,b): while b: a,b=b,a%b return a def rabin_miller(p): if(p<2): return False if(p!=2 and p%2==0):

Last M digits of expression A^N

2010-02-05 Thread mukesh tiwari
Hello everyone. I am kind of new to python so pardon me if i sound stupid. I have to find out the last M digits of expression.One thing i can do is (A**N)%M but my A and N are too large (10^100) and M is less than 10^5. The other approach was repeated squaring and taking mod of expression. Is t