New Python Runtime

2009-03-26 Thread Adonis
I'd share (If its old news, its new to me) Adonis -- http://mail.python.org/mailman/listinfo/python-list

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

Re: Why no string return?

2008-03-11 Thread Adonis Vargas
sting for null so it should look like: if request: return x else: print "No String for you...False!" Hope this helps. Adonis -- http://mail.python.org/mailman/listinfo/python-list

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: converting JSON to string

2008-01-11 Thread Adonis Vargas
return str(primarykeys) Also there are Python modules for just this. Here is the very first link from Google: http://pypi.python.org/pypi/python-json I have used this one personally and have been very satisfied with it. There is another one (CJSON?) which is similar, but written in C, for when performance may be an issue. Hope this helps. Adonis -- http://mail.python.org/mailman/listinfo/python-list

Re: Pygame w/ GUI

2008-01-09 Thread Adonis Vargas
lse I should be looking at? > > Oh, and I'm running Python 2.5.1 > > Thanks for any thoughts. I do not have experience using pygame, but you can look at: http://pyui.sourceforge.net/ Creates an user interface with pygame as a possible back end. Hope this helps. Adonis -- 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: 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: 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: 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: Async XMLRPC and job processing

2007-10-17 Thread Adonis Vargas
he Queue module to create a sort of message queue so your data can be properly synchronized. Hope this helps. Adonis -- http://mail.python.org/mailman/listinfo/python-list

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: 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

Re: How to FTP a ASCII file

2007-07-02 Thread Adonis Vargas
OF from the open file object file using its readline() method to provide the data to be stored. Hope this helps. Adonis -- http://mail.python.org/mailman/listinfo/python-list

Re: Correct abstraction for TK

2007-07-02 Thread Adonis Vargas
tance, but if you prefer delegation, then that too can be done here. Also, by doing this it will simplify the moving to more robust graphic toolkits with little modification. Hope this helps. Adonis -- http://mail.python.org/mailman/listinfo/python-list

Re: ten small Python programs

2007-05-27 Thread Adonis Vargas
her languages (doing the same algorithm). Hope this helps. Adonis -- http://mail.python.org/mailman/listinfo/python-list

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: Minimal Linux system to run Python

2007-04-14 Thread Adonis Vargas
a Linux system. Hope this helps. Adonis -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing files

2007-03-19 Thread Adonis Vargas
l know...or you could post more code? > > Mike > Actually, I re-ran this in a terminal and it worked perfectly. I was using IDLE to write this code, kinda peculiar. Maybe something to do with IDLE and CSV (or writing to files) with lines > ~1000. A socket timing out maybe? Thanks anyways. Adonis -- http://mail.python.org/mailman/listinfo/python-list

Writing files

2007-03-19 Thread Adonis Vargas
stopped writing to the file at a certain point. Something in my code? a bug? System: Linux 2.4.31 (Slackware), Python 2.5c1 Any help is greatly appreciated. Adonis -- code -- def _scan(self): outFile = file("mp3.dat", "wb") outCSV = csv.writer(outF

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: New to Tkinter GUI building

2007-02-28 Thread Adonis Vargas
GUI. > > TIA > Adam > To size the window use Tk's geometry method self.top.geometry("%dx%d%+d%+d" % (800, 600, 0, 0)) # (width, height, x, y) For the scrollbar to fill vertically, use the sticky grid option. self.scrlr1.grid(row=0, column=1, sticky

Re: Reg Google Web Toolkit and Python

2007-02-16 Thread Adonis Vargas
Data, which depending on your web application server could either be static or dynamic data. Then upon reception of the data, simply parse it and update a section or sections of your AJAX application (unless GWT has mechanisms to handle such things for you). Hope this helps. Adonis -- http:/

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: Convert from unicode chars to HTML entities

2007-01-28 Thread Adonis Vargas
point2name.get(ord(i)) entityCode = entity.name2codepoint.get(name) t +="&#" + str(entityCode) else: t += i print t Hope this helps. Adonis -- http://mail.python.org/mailman/listinfo/python-list

Re: Ip address

2007-01-28 Thread Adonis Vargas
rnal IP you can do: import urllib checkIP = urllib.urlopen("http://checkip.dyndns.org";).read() externalIP = checkIP.split()[-1].strip("") print externalIP Hope this helps. Adonis -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to document Python code...

2007-01-22 Thread Adonis Vargas
TML format, and/or serve it over web with its built-in HTTP server. pydoc: http://docs.python.org/lib/module-pydoc.html Hope this helps. Adonis -- http://mail.python.org/mailman/listinfo/python-list

Re: Starting a child process and getting its stdout?

2006-12-28 Thread Adonis Vargas
ess = subprocess.Popen(cmd, stdout=subprocess.PIPE) >>> print process.stdout.read() For more info on how to do stdin and other things check out: http://docs.python.org/lib/module-subprocess.html Hope this helps. Adonis -- http://mail.python.org/mailman/listinfo/python-list

Re: Confusion with calling function of a subclass

2006-12-21 Thread Adonis Vargas
x27;t understand how to solve this simple code. You first need to create an instance of the class: tree = TREE() tree.gettree() or TREE().gettree() Hope this helps. Adonis P.S. You should look into the tutorial http://docs.python.org/tut/tut.html it will answer a lot of your questions. -- h

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

2006-12-19 Thread Adonis Vargas
on version of Google Web Toolkit, offers a way to create AJAX apps using Python code. Hope this helps. Adonis -- http://mail.python.org/mailman/listinfo/python-list

Re: How to reverse tuples in a list?

2006-08-08 Thread Adonis
27;d like to say is something like > this: > y = [t.reverse() for t in y] > Even if reverse worked on tuples, it wouldn't work inside a > list comprehension. > > Yours, > Noah > Provided the data remains the same [(a, b), ...] Python 2.5a2 (r25a2:45740, May 24 2006,

Re: Configuring IDLE on Linux

2006-07-13 Thread Adonis
tya You must have the Tk libraries present in your system for Python to compile Tkinter. Go to your distribution's site and try to see if they offer a TCL/TK package and install it (being that it is Redhat they most definitely must have one). Then recompile Python. Hope this helps. Adonis -- http://mail.python.org/mailman/listinfo/python-list

Re: os.isfile() error

2006-05-06 Thread Adonis
ful/cat2all.py", line 13, in ? > if os.isfile(dpath+name): > AttributeError: 'module' object has no attribute 'isfile' > > > thank you Where 'if os.isfile()' it should be 'os.path.isfile()', the isfile method is not available in the os m

Re: Gettings subdirectories

2006-05-03 Thread Adonis
Florian Lindner wrote: > Hello, > how can I get all subdirectories of a given directories? os.listdir() gives > me all entries and I've found no way to tell if an object is a file or a > directory. > > Thanks, > > Florian Here is a quick hack: import os import os.path givenDir = "/" listing =

Re: --version?

2006-05-02 Thread Adonis
Paul Watson wrote: > Is there any chance that Python would support the --version command line > parameter? It seems that many open source programs use this switch to > report their version number. try at a command prompt: python -V Hope this helps. Adonis -- http://mail.python.or

Re: "Locate" command in Python

2006-04-10 Thread Adonis
t thats my assumption as it works fine on my system. Adonis -- http://mail.python.org/mailman/listinfo/python-list

Re: "Locate" command in Python

2006-04-09 Thread Adonis
t; Unix, but would be interesting if it was cross-platform. > > Thanks. > Here is a quick hack I just did, its very ugly, but does the job. First do locate -u to create a cache then just locate [term], its not so fancy as to remind you when the cache is too old, but hey. It require

Re: Tkinter, X-windows and ebay

2006-02-09 Thread Adonis
erver, then now it may mimic a "local" feel but all on your Linux server. Now they can run the X app and be able to achieve what you want. I am in no way an expert and some of my ideas might not be 100% accurate, but at my university this is how we have it set and it works perfectly (

Re: Newbie ? -- SGML metadata extraction

2006-01-16 Thread Adonis
2. > > Maybe I'm missing something. > If the data has closing tags this is easily achieved using a dom or sax parser, but here is a slightly modified version, very ugly but simple. hope this helps. Adonis --- from HTMLParser import HTMLParser data = """

Re: Newbie ? -- SGML metadata extraction

2006-01-16 Thread Adonis
ProvoWallis wrote: From what I gather here is a quickie, probably better solutions on the way but this accomplishes the idea I think. Some helpful links: http://docs.python.org/lib/module-sgmllib.html http://docs.python.org/lib/module-HTMLParser.html http://docs.python.org/lib/module-htmllib.

Re: Detect TKinter window being closed?

2005-12-02 Thread Adonis
def callback(): if tkMessageBox.askokcancel("Quit", "Do you really wish to quit?"): root.destroy() root = Tk() root.protocol("WM_DELETE_WINDOW", callback) root.mainloop() Hope this helps. Adonis -- http://mail.python.org/mailman/listinfo/python-list

Re: about list

2005-11-20 Thread Adonis
e this helps. Adonis -- http://mail.python.org/mailman/listinfo/python-list

Tkinter PhotoImage Question

2005-06-27 Thread Adonis
the argument list it works just fine? Any help is greatly appreciated. Adonis -- http://mail.python.org/mailman/listinfo/python-list

Python in the news, somewhat

2005-05-13 Thread Adonis
ZDNet has released this article that talks about open source scriptingg languages and mentions Python/Jython/IronPython, just wanted to share the info. http://news.zdnet.com/2100-9593_22-5705448.html?tag=st.num Adonis -- http://mail.python.org/mailman/listinfo/python-list

Re: Web Application Client Module

2005-04-12 Thread Adonis
bserver by only accessing data you need. go to cherrypy.org and right on the start page there should be a link labeled AJAX which is the buzzword being used for this kind of implementation. Hope this helps. Adonis -- http://mail.python.org/mailman/listinfo/python-list

Re: Lowest hassle Python web server?

2005-03-20 Thread Adonis
n look into CherryPy http://www.cherrypy.org/ Hope this helps Adonis -- http://mail.python.org/mailman/listinfo/python-list

Re: xmlrpc.server.work() does not seem to handle multiple requests

2005-02-18 Thread Adonis
://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81549 Hope this helps. Adonis -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: Pythonwin

2005-01-11 Thread Adonis
natively go to its folder in explorer and double click it to run. pythonwin is just a developing enviroment, and the execution of scripts within it is just for debugging use. Hope this helps. Adonis -- http://mail.python.org/mailman/listinfo/python-list

Question about Py C API implementation.

2004-12-16 Thread Adonis
immediately, any help is greatly appreciated. Adonis http://home.earthlink.net/~adonisv/flatten.py http://home.earthlink.net/~adonisv/flatten.c -- http://mail.python.org/mailman/listinfo/python-list

Re: Bug 834351 - Mouse wheel crashes program

2004-12-10 Thread Adonis
Gary Richardson wrote: Has this bug been fixed in 2.3.5 or 2.4? Does it exist in XP systems? #- from Tkinter import * def _onMouseWheel(event): print event root = Tk() root.bind('',_onMouseWheel) root.mainloop() Works for me... WinXP SP2 Python 2.4 final Adon