Downloading the feed using feedparser

2013-09-04 Thread mukesh tiwari
) d.etag u'Vx5oxwMUzEFvFpd6BNR23912Zk4' d.modified 'Wed, 04 Sep 2013 10:32:06 GMT' feedparser.parse(feed://feeds.huffingtonpost.com/HP/MostPopular, etag= d.etag, modified=d.modified).status 304 Thank you Mukesh Tiwari -- https://mail.python.org/mailman/listinfo/python-list

Re: Improving the web page download code.

2013-08-28 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: [snip] if __name__== '__main__': u = Downloader

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, socket

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 as much less resource ( server time

Regular expression problem

2013-03-10 Thread mukesh tiwari
._][a-zA-Z0-9._][a-zA-Z0-9._][a-zA-Z0-9._]*@[a-zA-Z0-9]+.(com|edu|org|co.in)[^~!@#$%^*()?,.a-zA-Z0-9]*[ ]+','mukeshtiwari.iiitm...@gmail.com mukeshtiwari.iiitmm...@gmail.com') ['com'] I am suppose to get [ mukeshtiwari.iiit...@gmail.com , mukeshtiwari.iiit...@gmail.com] ? Regards Mukesh Tiwari [1

Re: Regular expression problem

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

Re: Regular expression problem

2013-03-10 Thread mukesh tiwari
, [ re.search ( '[a-zA-Z0-9][a-zA-Z0-9._]{4,}@[a-zA-Z0-9]+.(com|edu|org|co.in)' , x ) for x in raw_input().split(' ') ] ) t = len ( email ) print 'Case #' + str ( c ) + ': ' + str ( t ) for i in xrange ( t ) : print email[i].group() c += 1 Regards Mukesh

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: Reading pen drive data

2011-09-03 Thread mukesh tiwari
On Sep 3, 7:40 pm, mukesh tiwari mukeshtiwari.ii...@gmail.com 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 pyudev

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]

Re: Listing HAL devices

2011-09-01 Thread mukesh tiwari
On Sep 1, 8:46 pm, mukesh tiwari mukeshtiwari.ii...@gmail.com 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

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

Re: Elliptic Curve Prime factorisation

2011-01-14 Thread mukesh tiwari
On Jan 15, 7:02 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info 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

Re: File transfer on network

2010-07-16 Thread mukesh tiwari
On Jul 16, 4:08 am, MRAB pyt...@mrabarnett.plus.com 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 for Client

File transfer on network

2010-07-15 Thread mukesh tiwari
only first image copyscreenshot_0.png while my client continuously taking screen shot. Kindly tell me what is wrong with my server code. Thank you Mukesh Tiwari

Re: File transfer on network

2010-07-15 Thread mukesh tiwari
; #print ' file received ' conn.close() My problem is that server is copying only first image copyscreenshot_0.png while my client continuously taking screen shot. Kindly tell me what is wrong with my server code. Thank you Mukesh Tiwari -- http://mail.python.org/mailman/listinfo/python-list

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 some

Re: Precision issue in python

2010-02-20 Thread mukesh tiwari
On Feb 20, 5:44 pm, Mark Dickinson dicki...@gmail.com wrote: On Feb 20, 11:17 am, mukesh tiwari mukeshtiwari.ii...@gmail.com 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

Re: Precision issue in python

2010-02-20 Thread mukesh tiwari
On Feb 20, 8:13 pm, mukesh tiwari mukeshtiwari.ii...@gmail.com wrote: On Feb 20, 5:44 pm, Mark Dickinson dicki...@gmail.com wrote: On Feb 20, 11:17 am, mukesh tiwari mukeshtiwari.ii...@gmail.com wrote: Hello everyone. I think it is  related to the precision with double arithmetic

Re: Python Optimization

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

Python Optimization

2010-02-14 Thread mukesh tiwari
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 def gcd(a,b): while b

Problem Regarding Queue

2010-02-09 Thread mukesh tiwari
. __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(p2): return False if(p!=2 and p%2==0): return False s=p-1 while(s%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