[Tutor] What algorithm suits here

2011-07-13 Thread Amit Sethi
I have a list of dictionaries in this form. { message : xyz parent : 23 id : 25 } or { message : abc parent : None id : 25 } { message : cde parent : 28 id : 32 } { message : cde parent : 23 id : 35 } I want to make seperate the lists such that messages in same thread( The parent message a

Re: [Tutor] Editing html using python

2010-02-15 Thread Amit Sethi
Well ya I was kind of hoping to know about more tools and recommendations on how to edit broken html . Their were tags that I wanted to replace using beautifulSoup however i saw that the replacewith function was not available for many of the tags I wanted to replace . Also BeautifulSoup does not h

[Tutor] Editing html using python

2010-02-14 Thread Amit Sethi
Hi I need to edit html programmatically . Sadly the html might be broken at places . I was using BeautifulSoup but there were lots of problems and it is also not maintained can some one guide me to any tutorials on editing html using lxml . -- A-M-I-T S|S _

[Tutor] python wsgi

2009-11-18 Thread Amit Sethi
Hi , How do I run a python script using wsgi? I am not using any web framework I just wish to try out running a simple script. -- A-M-I-T S|S ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/

[Tutor] idiomatic way of merging two dictionaries

2009-11-03 Thread Amit Sethi
Hi , I am trying to merge(I am not sure if that is the right term) dictionaries like this dict1 ={'a':4,'b':3,'v':7,'h':4} dict2={'a':5,'v':4,'k':3} dict3 would be {'a':[4,5],'b':[3,4],'v':[7,4],'k':[0,3],'h':[4,0]} -- A-M-I-T S|S ___ Tutor maillist -

[Tutor] java for python programmers

2009-11-03 Thread Amit Sethi
Hi their is a book , python for java programmers is their a book on java for python programmers for some one who wants to move to java from python -- A-M-I-T S|S ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http

[Tutor] python zlib problem

2009-10-30 Thread Amit Sethi
Hi , For some weird reason or a huge screw up I did my python zlib library has been removed . This is part of standard lib(i think!!!) and it is used by setuptools and many other libraries .What is the safe way in which I can recover this library on ubuntu. My previous try somehow lead to removal o

[Tutor] Currency conversion module in python

2009-07-29 Thread Amit Sethi
Hi , Does anybody know of any currency conversion module in python -- A-M-I-T S|S ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] How to force stop a thread

2009-07-24 Thread Amit Sethi
Hi , I am trying to implement python threads in a gtk based app . Now the thing is that in the application I have to fetch a lot of data from various sources from web. During this time I wish to show a dialog that indicates it to the user . During the same time I want to fetch data as well . Now t

[Tutor] how to monitor if their data in a variable/object

2009-07-20 Thread Amit Sethi
Hi , I am writing a python gtk application in which I am required to fetch a large amount of data from web , now i want to create a wait dialog for the user to know that I am still fetching data .The question is how can i monitor that the required data has been fetched . I could have a variable tha

[Tutor] Very wierd namespace problem

2009-07-17 Thread Amit Sethi
I am not able to understand this , perhaps it is an aspect of python I do not understand Now usually I would think that for a class class a: ... def __init__(self): ... pass ... def __something__(self): ... pass >>> b=a() >>> dir(b) ['__doc__', '__init__', '__

[Tutor] gtk.Notebook error

2009-07-13 Thread Amit Sethi
Hi , I am having problem with adding pages to gtk.Notebook : What I want is to be able to pass a random container widget to a new tab: thus my code is : class SmNotebook(gtk.Notebook): def __init__(self): gtk.Notebook.__init__(self) #set the tab proper

Re: [Tutor] getting image from url

2009-07-10 Thread Amit Sethi
I am sorry, I did not realize the problem was in the location .Ignore the message On Fri, Jul 10, 2009 at 9:19 PM, Emile van Sebille wrote: > On 7/10/2009 8:29 AM Amit Sethi said... >> >> Hi , I am trying to get  images from url >> >> Their is  a  mail rel

[Tutor] getting image from url

2009-07-10 Thread Amit Sethi
Hi , I am trying to get images from url Their is a mail relating to it here : "http://mail.python.org/pipermail/python-list/2001-October/108548.html"; but when i followed similar procedure : >>> import urllib >>>fp = >>>urllib.urlopen("http://en.wikipedia.org/wiki/File:Portrait_john_calvin.j

Re: [Tutor] intefaces in python

2009-06-29 Thread Amit Sethi
well dir(object) , how would that help . All the functions in base class would automatically be inherited by the objects of plug-in class ... so they would come in the list even if it was not implemented... On Mon, Jun 29, 2009 at 5:58 PM, Luke Paireepinart wrote: > Amit Sethi wrote: >

Re: [Tutor] intefaces in python

2009-06-29 Thread Amit Sethi
wait even in the above example i would have to run all the functions in __init__ that is plain stupid ... i was just brain storming On Mon, Jun 29, 2009 at 5:34 PM, Amit Sethi wrote: > I think ideally i want a compile Error just like java .. but from the > discussion here ... i wrot

Re: [Tutor] intefaces in python

2009-06-29 Thread Amit Sethi
2009 at 5:01 PM, Dave Angel wrote: > > Amit Sethi  wrote: > >> Well I want to implement plug-in like mechanism for an application . I want >> to define some minimum functions that any body writing a plugin has to >> implement. For that i thought an interface would be be

Re: [Tutor] intefaces in python

2009-06-29 Thread Amit Sethi
would love to hear if you think their is a better way to achieve this On Mon, Jun 29, 2009 at 2:49 PM, Alan Gauld wrote: > "Amit Sethi" wrote > >> class MyInterface(object): >> doSomething(line): >> raise NotImplementedError >> doSomethingElse(

Re: [Tutor] intefaces in python

2009-06-29 Thread Amit Sethi
:00 PM, Amit Sethi > wrote: > > Hi , I don't suppose python has a concept of interfaces. But can somebody > > tell me if their is a way i can implement something like a java > interface > > in python. > > Sure. Interfaces are just Java's compensation for not

[Tutor] intefaces in python

2009-06-28 Thread Amit Sethi
Hi , I don't suppose python has a concept of interfaces. But can somebody tell me if their is a way i can implement something like a java interface in python. -- A-M-I-T S|S ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo

[Tutor] taking image of gtk.drawing area

2009-06-19 Thread Amit Sethi
Hi , I am trying to take image of a gst video playing in the gtk.drawingarea i am using following code for it : def snap_shot(self,widget,data=None): global file_loc ,pixbuf self.pipeline.set_state(gst.STATE_PAUSED) pixbuf = gtk.gdk.Pixbuf( gtk.gdk.COLORSPACE_RGB, False,

[Tutor] Using C in python

2009-03-25 Thread amit sethi
what are the ways in which i can use C in python programs . I know there is SWIG bindings are there any other . Also Could anyone explain how Swig bindings work? -- A-M-I-T S|S ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listi

[Tutor] Designing Tools/books

2009-03-05 Thread amit sethi
Although this may not be the most appropriate place to ask this but i couldn't figure out where else i should be asking this question.I am getting habitual of starting projects and getting results quickly thanks to python .But I get stuck in documentation because i haven't asked the design question

Re: [Tutor] passing unknown no of arguments

2009-02-06 Thread amit sethi
>> AFAIK MS Silverlight allows you to run .NET languages in your browser, so for that i guess i would have to use ironpython and not Cpython which is what i normally use . Are there any big problems porting the code from one to other that i need to be worried about. On Fri, Feb 6, 2009 at 12:30

[Tutor] passing unknown no of arguments

2009-02-05 Thread amit sethi
How do you pass arguments of unknown no. of arguments to a function. Also how can i run my python scripts in a web browser. -- A-M-I-T S|S ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] fetching wikipedia articles

2009-01-23 Thread amit sethi
well thanks ... it worked well ... but robotparser is in urllib isn't there a module like robotparser in urllib2 On Fri, Jan 23, 2009 at 3:55 PM, Andre Engels wrote: > On Fri, Jan 23, 2009 at 10:37 AM, amit sethi > wrote: > > so is there a way around that problem ?? > &g

Re: [Tutor] fetching wikipedia articles

2009-01-23 Thread amit sethi
so is there a way around that problem ?? On Fri, Jan 23, 2009 at 2:25 PM, Andre Engels wrote: > On Fri, Jan 23, 2009 at 9:09 AM, amit sethi > wrote: > > Well that is interesting but why should that happen in case I am using a > > different User Agent because I trie

Re: [Tutor] fetching wikipedia articles

2009-01-23 Thread amit sethi
there a catch that i don't understand. On Thu, Jan 22, 2009 at 10:45 PM, Andre Engels wrote: > On Thu, Jan 22, 2009 at 6:08 PM, amit sethi > wrote: > > hi , I need help as to how i can fetch a wikipedia article i tried > changing > > my user agent but it did not work . Alt

[Tutor] fetching wikipedia articles

2009-01-22 Thread amit sethi
hi , I need help as to how i can fetch a wikipedia article i tried changing my user agent but it did not work . Although as far as my knowledge of robots.txt goes , looking at en.wikipedia.org/robots.txt it does not seem it should block a useragent (*, which is what i would normally use) from acces

Re: [Tutor] python reverse engineering tools

2008-11-21 Thread amit sethi
a beginner don't think can comment on its effectiveness. On Sat, Nov 22, 2008 at 6:17 AM, Alan Gauld <[EMAIL PROTECTED]>wrote: > > "amit sethi" <[EMAIL PROTECTED]> wrote > > Can somebody tell me about any python to UML reverse engineering tools . >>

[Tutor] python reverse engineering tools

2008-11-21 Thread amit sethi
Can somebody tell me about any python to UML reverse engineering tools . I was trying pynsource but it uses the old opengl namespace (this is what i assume the problem is from what i read from the openGL documentation) and thus it gives an import error from wxPython.ogl import * ImportError: No mod

[Tutor] sqlite3 lists to database conversion/ using python variables in sqlite3

2008-11-19 Thread amit sethi
Hi , i am trying to learn python and this is my first time with any databases . I am using sqlite3 to create a database of my music files and its metadata tags so here is what i wanted to do . Two list one of the attributes and one of their values ,how do i put it in the database.Here is a simple c

[Tutor] XML parsing with SAX

2008-10-22 Thread amit sethi
that xml.sax is good for reading a large xml file because it can read from a stream but what about writing the xml file back Thank you for your help. On Wed, Oct 22, 2008 at 1:49 PM, Alan Gauld <[EMAIL PROTECTED]>wrote: > "amit sethi" <[EMAIL PROTECTED]> wrote > > Ple

[Tutor] (no subject)

2008-10-21 Thread amit sethi
Hi can any body give me an example as to how i can use Incremental Parser in xml.sax -- A-M-I-T S|S ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] (no subject)

2008-07-26 Thread amit sethi
hi, Can somebody tell me about tools to convert stereo mp3 signal to mono wave signal . I tried using pymedia but i am not able to understand how to convert stereo signal to a mono signal . -- A-M-I-T S|S ___ Tutor maillist - Tutor@python.org http://

[Tutor] (no subject)

2008-07-19 Thread amit sethi
Hi list , Can someone give me an idea about the audio libraries in python . I tried using pymedia . What are the options available . -- A-M-I-T S|S ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] (no subject)

2008-06-18 Thread amit sethi
Hi , Could you please tell me , how i can traverse a two dimensional array , i am sorry , it must be pretty simple but I am new to python am not able to understand. -- A-M-I-T S|S ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/li

[Tutor] (no subject)

2008-06-09 Thread amit sethi
Hi , Are there any python bindings for sox(sound Exchange). -- A-M-I-T S|S ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] handling MIDI in python

2008-06-08 Thread amit sethi
Can someone tell me about the libraries that can handle MIDI files and also is their a way in which I can convert an mp3 and wav file into a Midi file within a python program -- A-M-I-T S|S ___ Tutor maillist - Tutor@python.org http://mail.python.org/

[Tutor] (no subject)

2008-06-06 Thread amit sethi
Hi, I am a student new to python . I had a project idea in mind that I want to implement in my break using python . Can anyone give me an idea of libraries available in python for transcribing music and signal processing. Good tutorials with examples would also help. If any body has experience in