Re: urllib2 error

2010-11-17 Thread asit dhal
On Wed, Nov 17, 2010 at 5:31 PM, Kushal Kumaran wrote: > On Wed, Nov 17, 2010 at 5:18 PM, asit wrote: >> I have this piece of code >> >> import urllib2 >> >> proc_url = 'http://www.nse-india.com/content/historical/EQUITIES/2001/ >> JAN/cm01JAN2001bhav.

urllib2 error

2010-11-17 Thread asit
I have this piece of code import urllib2 proc_url = 'http://www.nse-india.com/content/historical/EQUITIES/2001/ JAN/cm01JAN2001bhav.csv.zip' print 'processing', proc_url req = urllib2.Request(proc_url) res = urllib2.urlopen(req) when i run this...following error comes Traceback (most recent

indentation error

2010-03-05 Thread asit
else: print level, " does NOT have ", perm, " permission" except: print "There was a problem - check the message above" According to me, indentation is ok. but the python interpreter gives an indentation error [asit ~/py] $ python search.py File

Re: process mp3 file

2010-03-03 Thread asit
> Define "processing". getting the title, song name, etc of the file and updating in a database -- http://mail.python.org/mailman/listinfo/python-list

process mp3 file

2010-03-03 Thread asit
Somebody suggest me a python library for processing mp3 file. Here I don't want to play the file. Thank you -- http://mail.python.org/mailman/listinfo/python-list

fetch all tweets..

2009-11-08 Thread asit
This question is for any python-twitter developer I want to develop an application using python twitter . Just look at the code... import twitter api = twitter.Api(); sta = api.GetUserTimeline('ShashiTharoor') i = 0 for s in sta: i +=1 print str(i) + " " + s.text print print

database handling

2009-11-07 Thread asit
I need some tutorial about python-mysql connectivity(database handling). Somebody please help me !! -- http://mail.python.org/mailman/listinfo/python-list

Re: exception due to NoneType

2009-11-07 Thread asit
On Nov 7, 10:36 pm, Bruno Desthuilliers wrote: > asit a écrit : > > > In my program I want to catch exception which is caused by accessing > > NoneType object. > > > Can anyone suggest me how this can be done ?? > > Not without the minimal working code e

exception due to NoneType

2009-11-07 Thread asit
In my program I want to catch exception which is caused by accessing NoneType object. Can anyone suggest me how this can be done ?? -- http://mail.python.org/mailman/listinfo/python-list

exception in urllib2

2009-02-01 Thread asit
I hv been developing a link scanner. Here the objective is to recursively scan a particular web site. During this, my script met http://images.google.co.in/imghp?hl=en&tab=wi and passed it to the scan function, whose body is like this.. def scan(site): log=open(logfile,'a') log.write(site

Re: Handle SystemExit exception

2009-02-01 Thread asit
Thanx everyone This is my fault. Exception was thrown before the main function. -- http://mail.python.org/mailman/listinfo/python-list

Handle SystemExit exception

2009-02-01 Thread asit
aborted by user" except SystemExit: pass But it does not work. Can anyone help me out ??? Though KeyboradInterrupt is handled, but why SystemExit is not handles Regards Asit Dhal -- http://mail.python.org/mailman/listinfo/python-list

process command line parameter

2009-01-17 Thread asit
Recently I was coding a link extractor. It's a command line stuff and takes parameter as argument. I found that the in operator is not always helpful. eg. if "--all" in sys.argv: print "all links will be printed" its not helpful when some attribute value is sent in command line paramete

Re: why o/p is different ???

2009-01-15 Thread asit
On Jan 15, 11:47 am, "James Mills" wrote: > On Thu, Jan 15, 2009 at 4:34 PM, asit wrote: > > I recently faced a peculiar o/p. > > > My objective is to remove the command name(my script name) from > > sys.argv[0]. > > I coded like this > > If you

why o/p is different ???

2009-01-14 Thread asit
nkscan.pywww.google.com --verbose [option] --verbose/-V for verbose output -r for recursive scan I:\Python26> regards asit dhal -- http://mail.python.org/mailman/listinfo/python-list

fetch image

2009-01-05 Thread asit
import httplib class Server: #server class def __init__(self, host): self.host = host def fetch(self, path): http = httplib.HTTPConnection(self.host) http.request("GET", path) r = http.getresponse() print str(r.status) + " : " + r.reason serve

Re: ResponseNotReady exception

2009-01-03 Thread asit
On Jan 4, 1:59 am, "Chris Rebert" wrote: > On Sat, Jan 3, 2009 at 12:38 PM, asit wrote: > > import httplib > > > class Server: > >    #server class > >    def __init__(self, host): > >        self.host = host > >    def fetch(self, path)

ResponseNotReady exception

2009-01-03 Thread asit
import httplib class Server: #server class def __init__(self, host): self.host = host def fetch(self, path): http = httplib.HTTPConnection(self.host) http.putrequest("GET", path) r = http.getresponse() print str(r.status) + " : " + r.reason s

Re: best IDE

2008-11-26 Thread asit
On Nov 26, 11:09 pm, "Chris Rebert" <[EMAIL PROTECTED]> wrote: > On Wed, Nov 26, 2008 at 9:59 AM, asit <[EMAIL PROTECTED]> wrote: > > Which one is the best IDE for python > > This was recently discussed. To avoid needlessly rehashing said &

best IDE

2008-11-26 Thread asit
Which one is the best IDE for python -- http://mail.python.org/mailman/listinfo/python-list

Re: compare items in list to x

2008-11-02 Thread asit
27;33', '2']: y=int(y) #string '2' is converted to int 2 if x < y: print x, "is less than", y elif x > y: print x, "is greater than", y else:

Re: project in python

2008-10-29 Thread asit
On Oct 28, 10:02 am, alex23 <[EMAIL PROTECTED]> wrote: > On Oct 26, 2:51 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: > > > The more you spam people with your repetitive postings, the less likely it > > becomes that they are willing to answer you. > > In asit's defence, the Google Groups interface

XML-RPC

2008-10-26 Thread asit
what is XML-RPC System -- http://mail.python.org/mailman/listinfo/python-list

project in python

2008-10-25 Thread asit
I am a newbie and learned python to some extent. I want to do some project in python based on network programming or HTML/XML parsing. Can anyone suggest me about this ??? -- http://mail.python.org/mailman/listinfo/python-list

project in python

2008-10-25 Thread asit
I want to do a project in python. It should be something based on socket programming, HTML/XML parsing, etc plz suggest me -- http://mail.python.org/mailman/listinfo/python-list

project in python

2008-10-25 Thread asit
I want to do a project in python. It should be something based on socket programming, HTML/XML parsing, etc please suggest me -- http://mail.python.org/mailman/listinfo/python-list

Re: portable python

2008-10-24 Thread asit
On Oct 24, 11:18 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > On Fri, Oct 24, 2008 at 1:42 PM, asit <[EMAIL PROTECTED]> wrote: > > I code in both windows and Linux. As python is portable, the o/p > > should be same in both cases. But why the following code is

portable python

2008-10-24 Thread asit
I code in both windows and Linux. As python is portable, the o/p should be same in both cases. But why the following code is perfect in windows but error one in Linux ??? from socket import * import sys status={0:"open",10049:"address not available",10061:"closed", 10060:"timeout",10056:"alread

Re: dictionary

2008-10-24 Thread asit
On Oct 24, 8:01 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Fri, 24 Oct 2008 14:53:19 +, Peter Pearson wrote: > > On 24 Oct 2008 13:17:45 GMT, Steven D'Aprano wrote: > > >> What are programmers coming to these days? When I was their age, we > >> were expected to *read

Re: dictionary

2008-10-24 Thread asit
On Oct 24, 3:06 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > ["%s="%s" % (k,v) for k,v in d.items()] > > File "", line 1 > > ["%s="%s" % (k,v) for k,v in d.items()] > > ^ > > SyntaxError: EOL while scanning single-quoted string > > You have three q

dictionary

2008-10-24 Thread asit
what the wrong with the following code >>> d={"server":"mpilgrim","database":"master", ... "uid":"sa", ... "pwd":"secret"} >>> d {'pwd': 'secret', 'database': 'master', 'uid': 'sa', 'server': 'mpilgrim'} >>> ["%s="%s" % (k,v) for k,v in d.items()] File "", line 1 ["%s="%s" % (k,v) for

Re: mulithreaded server

2008-03-11 Thread asit
On Mar 11, 9:10 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Tue, 11 Mar 2008 08:24:54 -0700 (PDT), asit <[EMAIL PROTECTED]> wrote: > >import socket > >import sys > >import thread > > >p=1 > >PORT=11000 > >BUFSIZE=1024 > >

mulithreaded server

2008-03-11 Thread asit
import socket import sys import thread p=1 PORT=11000 BUFSIZE=1024 def getData(cSocket): global stdoutlock,cSocketlock while True: cSocketlock.acquire() data=cSocket.recv(BUFSIZE) if data=='q': data='client exited' cSocket.close()

Re: message entry box at center

2008-02-28 Thread asit
On Feb 28, 7:53 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > asit wrote: > > i want to show the entry button at the center of the window. How is it > > possible ?? > > from Tkinter import * > > > def callback(): > > print e.get() > > > mas

message entry box at center

2008-02-28 Thread asit
from Tkinter import * def callback(): print e.get() master=Tk() e=Entry(master) e.pack(anchor=CENTER) e.focus_set() b=Button(master,text="get",width=10,command=callback) b.pack(anchor=CENTER) master.mainloop() i want to show the entry button at the center of the window. How is it possible

class object using widget

2008-02-20 Thread asit
from Tkinter import * # get widget classes from tkMessageBox import askokcancel # get canned std dialog class Quitter(Frame): # subclass our GUI def __init__(self, parent=None): # constructor method Frame.__init__(se

inode number in windows XP

2008-01-25 Thread asit
why this program shows ambiguous behavior ?? import os import stat import time #import types file_name=raw_input("Enter file name : ") print file_name, "information" st=os.stat(file_name) print "mode", "=>", oct(stat.S_IMODE(st[stat.ST_MODE])) print "type","=>", if stat.S_ISDIR(st[stat.ST_MODE])

time.gmtime

2008-01-25 Thread asit
we know that time.gmtime(secs) takes a parameter secs. what does this secs suggest ??What is it's significance ?? -- http://mail.python.org/mailman/listinfo/python-list