Re: Simplest way to do Python/Ajax with server and client on same machine?

2006-12-19 Thread Adonis Vargas
Kenneth McDonald wrote: > I'm doing some work with a Python program that works hand-in-hand with > the DOM on a local client (processing DOM events, issuing DOM > modification commands, etc.) I'm currently using cherrypy as the Python > server for this communication, and simple AJAX on the clien

Re: Confusion with calling function of a subclass

2006-12-21 Thread Adonis Vargas
Pyenos wrote: > class TREE: > def gettree(self):print self > TREE.gettree() # I get an error saying ># TypeError: unbound method gettree() must be called ># with TREE instance as first argument (got nothing instead > > > I still don't understand how to solve t

Re: Starting a child process and getting its stdout?

2006-12-28 Thread Adonis Vargas
cypher543 wrote: > This has been driving me insane for the last hour or so. I have search > everywhere, and nothing works. I am trying to use the subprocess module > to run a program and get its output line by line. But, it always waits > for the process to terminate and then return the output all

Re: Correct abstraction for TK

2007-07-02 Thread Adonis Vargas
[EMAIL PROTECTED] wrote: > I'm looking for a good example of how to correctly abstract TK code > from the rest of my program. I want to just get some user info and > then get 4 values from the GUI. Right now I've written it OOP per the > examples on python.org but it doesn't seem to be meshing very

Re: How to FTP a ASCII file

2007-07-02 Thread Adonis Vargas
[EMAIL PROTECTED] wrote: > Hi, > > My program has the following code to transfer a binary file > > f = open(pathanme+filename,'rb') > print "start transfer" > self.fthHandle.storbinary('STOR '+filename, f) > > How can I do an ASCII file transfer?? > -Ted > Taken fro

Re: bitwise shift?

2007-05-02 Thread Adonis Vargas
Tobiah wrote: > Wow, thunderbird displayed this to me as a true exponent, even > though it is an ascii message. anyone else get this? > > Yeah I can confirm Thunderbird 1.5.10 on Linux. Adonis -- http://mail.python.org/mailman/listinfo/python-list

Re: ten small Python programs

2007-05-27 Thread Adonis Vargas
Steve Howell wrote: > I've always thought that the best way to introduce new > programmers to Python is to show them small code > examples. You could try this wiki page: http://rosettacode.org/wiki/Main_Page It has a fair amount of Python examples as well as many more other languages (doing

Re: How to do python and RESTful

2007-09-05 Thread Adonis Vargas
self.wfile.write("put") def do_DELETE(self): self.wfile.write("delete") def main(server_class=BaseHTTPServer.HTTPServer, handler_class=REST): server_address = ('', 8000) httpd = server_class(server_address, handler_class) h

Writing files

2007-03-19 Thread Adonis Vargas
I am writing a program that walks a directory full of mp3s reads their ID3 data (using Mutagen), this part works perfectly. The problem is I write these tags to a CSV file through the CSV module. But when I read the file the file seems to be incomplete. Further inspecting it has seemed to have

Re: Writing files

2007-03-19 Thread Adonis Vargas
[EMAIL PROTECTED] wrote: >> >> -- code -- >> >> def _scan(self): >> outFile = file("mp3.dat", "wb") >> outCSV = csv.writer(outFile) >> output = list() >> for root, dirs, files in os.walk(self.directory): >> files = [x for x in files if x.endswi

Re: Minimal Linux system to run Python

2007-04-14 Thread Adonis Vargas
Chaz Ginger wrote: > I have a need for the minimal Linux system to run Python. Basically I > want the system to boot up and instead of starting up Init/etc. I would > love it to run python (and a python script I have written). > > Before embarking on doing it myself I was wondering if anyone knew

Re: is there some module update(install tools)?

2007-09-24 Thread Adonis Vargas
packages automatically? > > thanks in advance! setuptools is for you http://peak.telecommunity.com/DevCenter/setuptools Once installed, its easy as easy_install Hope this helps. Adonis Vargas -- http://mail.python.org/mailman/listinfo/python-list

Re: Async XMLRPC and job processing

2007-10-17 Thread Adonis Vargas
Sean Davis wrote: > I would like to set up a server that takes XMLRPC requests and > processes them asynchronously. The XMLRPC server part is trivial in > python. The job processing part is the part that I am having trouble > with. I have been looking at how to use threadpool, but I can't see >

Re: Best way to document Python code...

2007-01-22 Thread Adonis Vargas
Scott Huey wrote: > I am working on a Python module and I would like to prepare some API > documentaiton. I managed to find epydoc after some searching online. > > Is there a standard way to document the API for Python modules? Is > epydoc the best way to go if there is no standard? Are there othe

Re: Ip address

2007-01-28 Thread Adonis Vargas
Scripter47 wrote: > How do i get my ip address? > > in cmd.exe i just type "ipconfig" then it prints: > ... > IP-address . . . . . . . . . . . . . . . . . : 192.168.1.10 > ... > how can i do that in python?? > If you want to get your external IP you can do: import urllib checkIP

Re: Convert from unicode chars to HTML entities

2007-01-28 Thread Adonis Vargas
Steven D'Aprano wrote: > I have a string containing Latin-1 characters: > > s = u"© and many more..." > > I want to convert it to HTML entities: > > result => > "© and many more..." > > Decimal/hex escapes would be acceptable: > "© and many more..." > "© and many more..." > > I can look up tab

Re: Convert from unicode chars to HTML entities

2007-01-28 Thread Adonis Vargas
Adonis Vargas wrote: [...] > > Its *very* ugly, but im pretty sure you can make it look prettier. > > import htmlentitydefs as entity > > s = u"© and many more..." > t = "" > for i in s: > if ord(i) in entity.codepoint2name: &

Re: Reg Google Web Toolkit and Python

2007-02-16 Thread Adonis Vargas
Shadab Sayani wrote: > Hi , > We have a project where I need to read files store > them in database in the backend.We have done this in > python.Now we decided to use Ajax technique for user > interface.For that we found that GWT is one of the > best toolkits.Now I got a doubt can I interface GWT >

Re: New to Tkinter GUI building

2007-02-28 Thread Adonis Vargas
Adam wrote: > I think my main questions are: > 1. How can I get the Window to be sized the way I want it? > 2. How can I get the Scrollbars to fill the side of the text box > instead of being small? (like .pack(fill= tk.Y) > > > I have only posted the code relevant to the GUI. > > TIA > Adam >

Re: New to Tkinter GUI building

2007-03-01 Thread Adonis Vargas
Adam wrote: > On Feb 28, 9:13 pm, Adonis Vargas <[EMAIL PROTECTED]> > wrote: >> Adam wrote: >> >> >> >>> I think my main questions are: >>> 1. How can I get the Window to be sized the way I want it? >>> 2. How can I get the Scrollb

Re: Determine whether program was started by clicking icon or command line

2007-11-29 Thread Adonis Vargas
ythonw the application has an extension of .pyw and .py files are run by the regular python executable. This the default behavior, unless for some odd reason you modified this through the registry or through explorer to do otherwise. Adonis Vargas -- http://mail.python.org/mailman/listinfo/python-list

Re: How can i find a file size on the web ?

2007-12-02 Thread Adonis Vargas
urllib response = urllib.urlopen("http://www.roche.com/rochea_z_sp.pdf";) print response.info() Hope this helps. Adonis Vargas -- http://mail.python.org/mailman/listinfo/python-list

Re: python from any command line?

2007-12-09 Thread Adonis Vargas
ath variables, select edit variable and append ;C:\Python25 to it. And thats it reopen a new command prompt the type python and it should just fire up. Hope this helps. Adonis Vargas -- http://mail.python.org/mailman/listinfo/python-list

Re: searching a value of a dict (each value is a list)

2007-12-09 Thread Adonis Vargas
misbehave since you are rebinding the name. Hope this helps. Adonis Vargas -- http://mail.python.org/mailman/listinfo/python-list

Re: Pygame w/ GUI

2008-01-09 Thread Adonis Vargas
PatrickMinnesota wrote: > I know this isn't strictly a Python question, but I'm betting some > here might be able to give me a hint. > > I have a few graphical programs doing some 2D data visualization using > simple Pygame code for pseudo real-time animation. It's running > under windows XP rig

Re: converting JSON to string

2008-01-11 Thread Adonis Vargas
Gowri wrote: > Hello, > > I actually have two questions: > 1. Are there any libraries which convert XML to JSON? > 2. I am currently doing the above using the DOM parser and creating a > JSON array > > > for node in doc.getElementsByTagName("book"): > isbn = node.getAttribute("is

Re: loading dictionary from a file

2008-02-06 Thread Adonis Vargas
reopen as needed. import cPickle data = {'k1': 'v1', 'k2': 'v2'} output = open('output.dat', 'wb') cPickle.dump(data, output) output.close() data1 = cPickle.load(open('output.dat', 'rb')) print type(data1) print data1 Hope this helps. Adonis Vargas -- http://mail.python.org/mailman/listinfo/python-list

Re: Why no string return?

2008-03-11 Thread Adonis Vargas
gargonx wrote: > Say i have the two methods: > > def ReturnMethod(request, x): > if request is True: > return x > else: print "No String for you...False!" > > def SendMethod(request): > xstring = "Some text" > ReturnMethod(request, xstring) > > SendMethod(True) > > W

Re: Python regex

2008-03-13 Thread Adonis Vargas
drew > > Have you looked into this library: http://cthedot.de/cssutils/ May help you, if you are trying to achieve something. If your doing it as an exercise then I can not help you, I avoid regex like the plague (but thats just me). Hope this helps. Adonis Vargas -- http://mail.python.org/mailman/listinfo/python-list