OT: Search for python in Norway

2006-05-31 Thread cyberco
Although the climate wouldn't make you think so, but searching for python is hot in Norway: http://www.google.com/trends?q=python&ctab=1&geo=all&date=all I wonder what the explanation could be. Btw: Java seems to be all the rage in India :) http://www.google.com/trends?q=java&ctab=1&geo=all&date

Which date will it be 'over x days'?

2006-09-18 Thread cyberco
I must be overlooking something since I can't find a simple way to calculate which date it will be over, say, 9 days. I checked the datetime, time and calendar modules, but none of them seem to have a function to calculate the time offset. -- http://mail.python.org/mailman/listinfo/python-list

ElementTree: namespace declaration in each element?

2006-11-19 Thread cyberco
The (excellent) ElementLibrary ads namespaces to each element when writing the tree back to a file. Say I do: tree = ET.parse('playlist.xml') tree.write(outFile) with the following XML: = http://xspf.org/ns/0/";> Kick off! = Writ

Re: ElementTree: namespace declaration in each element?

2006-11-19 Thread cyberco
> written by a "it's the bytes, not the data" guy, obviously ;-) hehehe...I figured it was. Wonder 'who' it was... ;) > the standard serializer in 1.2 doesn't support default namespaces, so > the quickest way to do this is to loop over all tags (use getiterator), > strip off the "{http://xspf.org

edit text in a file and save it again

2006-11-19 Thread cyberco
I must be overlooking something here... I'm trying to edit a line in a text file. I thought this was easy with fileinput, but all examples do not write the line back to the file but simply 'print' it. I want to open the file, edit the line and save it again. Is fileinput the right module for that?

Re: Is python for me?

2006-11-22 Thread cyberco
One resource you should always keep at hand is this extremely useful Quick Reference: http://rgruet.free.fr/PQR24/PQR2.4.html Study it carefully, there is a lot in there that can teach you about how Python works. Fire up IPython as well and start hacking! 2B -- http://mail.python.org/mailman/l

Re: Scaling pictures

2006-12-29 Thread cyberco
PIL is certainly a fine option, but I noticed that the scaled images (scaled with the ANTIALIAS filter) are not as good as you can get with, say, Photoshop. Maybe I'm just expecting too much, but I wish I could choose a higher quality rescaling algorithm. PIL still rocks though. On Dec 28, 2:32 pm

Re: Scaling pictures

2006-12-30 Thread cyberco
cyberco wrote: > PIL is certainly a fine option, but I noticed that the scaled images > (scaled with the ANTIALIAS filter) are not as good as you can get with, > say, Photoshop. Maybe I'm just expecting too much, but I wish I could > choose a higher quality rescaling algorithm

Re: Progress Box or Bar in Windows

2006-12-31 Thread cyberco
Go for wxPython, it'll fulfill all your GUI needs. Handsdown the best GUI toolkit I ever ran into. It can't get much simpler than: wx.MessageBox('hi') And there are tons of readymade dialogs and progressbars in the library. Check out the demo.py under the wxPython installation dir to see demos (a

Import in a separate thread

2006-02-25 Thread cyberco
I want to import a long list of modules in a separate thread to speed things up. How can I make the modules imported in that separate thread accessible outside the method? === import os # import rest in a separate thread def importRest(): import audio import socket

Re: Import in a separate thread

2006-02-25 Thread cyberco
Well, it is for the python implementation for Nokia Series 60 phones, and loading lots of modules in such constrained environments can certainly slow things down. The splashscreen idea is what I want to do, but that requires the loading to continue in a background thread. -- http://mail.python.or

Re: The best platform and editor for Python

2007-07-01 Thread cyberco
There is one tool you won't be able to live without: iPython (no, it's not an Apple product, but it would be worth waiting in line for 3 days for) http://ipython.scipy.org/moin/ -- http://mail.python.org/mailman/listinfo/python-list

PIL: reading bytes from Image

2007-03-10 Thread cyberco
I'm using web.py to send an image to the client. This works (shortened): print open(path, "rb").read() but this doesn't: img = Image.open(path) img.thumbnail((10,10)) print img.getdata() or print img.load() How do I get the bytes of the Image object? 'getdata()' seemed the way, but unfortuna

Re: PIL: reading bytes from Image

2007-03-11 Thread cyberco
Thanks, I've tried the StringIO option as follows: = img = Image.open('/some/path/img.jpg') img.thumbnail((640,480)) file = StringIO, StringIO() img.save(file, 'JPEG') = But it gives me: = exceptio

Re: uninstall python2.5 on debian

2007-09-21 Thread cyberco
On Sep 18, 9:03 am, "dimitri pater" <[EMAIL PROTECTED]> wrote: > Hello, > both python2.3 and python2.5 are installed on my Debian webserver. For > some reason, I would like to uninstall Python2.5 which was installed > from source (make install) and keep 2.3. > I have tried make uninstall and search

Re: building a GUI

2007-09-24 Thread cyberco
Try BoaConstructor and the wxPython library, both are wonderfull. If you don't mind using Java Swing, and there are good reasons for that, go for jython. It simplifies the java swingcode so much you don't have to use a graphical GUI builder anymore :) -- http://mail.python.org/mailman/listinfo/py

Re: PyS60

2007-09-26 Thread cyberco
I have used PyS60 quite a lot a while ago, but what is it you exactly wanted to know? One thing I can tell you is that it's a pity that it only runs on Series 60 phones and that the security restrictions of third edition devices severely limited the options for developers. 2B -- http://mail.pyth

Re: pydev code completion problem

2007-10-14 Thread cyberco
Confirmed (with exactly the same software). Please discuss this issue at the PyDev discussion forum: http://sourceforge.net/forum/forum.php?forum_id=293649 2B -- http://mail.python.org/mailman/listinfo/python-list

Re: Eclipse Plugins

2007-10-26 Thread cyberco
> PyDev is open source, and the developer is pretty responsive, so if you > could describe what is missing there is a good chance it would get > implemented. I even fixed two bugs myself, my first ever real Java > contribution... > > -- > Heikki Toivonen I can second that. I'm a happy PyDev user

Re: The Python Papers: Submit your Quotes

2007-01-11 Thread cyberco
"Like silence in music, whitespace is where Python Power shows" "The odd thing is that Python results in what I call YoYo-code. After writing some code I always discover a shorter, more elegant and more readable way of doing the same thing in Python. The same happens after adding more functionalit

Re: nokia pys60 contacts + calendar

2007-02-03 Thread cyberco
You can most likely find an answer on Nokia's Python forum: http://discussion.forum.nokia.com/forum/forumdisplay.php?f=102 And if there's no answer there you should post the question there :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python cheatsheets

2007-02-06 Thread cyberco
> If you have a good color printer, try > PQRChttp://www.limsi.fr/Individu/pointal/python/pqrc/ That is a very usefull document to use besides Richard Gruets quick ref. The only disadvantage is that it's a PDF document, pity there's no HTML version. 2B -- http://mail.python.org/mailman/listinf

Re: Best Free and Open Source Python IDE

2007-02-08 Thread cyberco
Go for BOA if you're going to use wxPython, whose python text editor is excellent as well. -- http://mail.python.org/mailman/listinfo/python-list

Re: New Pythin user looking foe some good examples to study

2007-02-13 Thread cyberco
http://www.daniweb.com/code/python.html http://www.pythonchallenge.com/ -- http://mail.python.org/mailman/listinfo/python-list

wxPython: non-GUI thread launching new frame? Delegates?

2007-02-20 Thread cyberco
In my wxPython app a non-GUI thread (that reads info from the network) tries to open a frame to show the new info. This results in my app hanging (which is not too surprising). Coming from a C# environment I wonder if there is some sort of delegate mechanism in wxPython to do this sort of thing. 2

Re: wxPython: non-GUI thread launching new frame? Delegates?

2007-02-20 Thread cyberco
Ah! Great tip, thanks! Now instead of calling: parent.onRequest(param) I call: wx.CallAfter(lambda x: parent.onRequest(x), param) Way cool. 2B > This is rather out of date. wxPython provides a wx.CallAfter function, > which will call the passed callable on the next spin through the event > l

Re: wxPython: non-GUI thread launching new frame? Delegates?

2007-02-21 Thread cyberco
Oh boyI must have hit an all time programmers-low with this That was plain stupid. 2B > You don't need the lambda - you can use: > > wx.CallAfter(parent.OnRequest, param) -- http://mail.python.org/mailman/listinfo/python-list

Re: Tip: 'Open IPython here' in Windows context menu

2007-02-27 Thread cyberco
Great! That really helps me, thanks. 2B -- http://mail.python.org/mailman/listinfo/python-list

Re: why there is no pythonscript insine web browsers?

2007-11-13 Thread cyberco
> > That is, why not just have a Python interpreter and some safe subset > > of the Python standard library run with the browser? I mean, aside > > It's not just the library (at a start you'd need to strip out > modules os, popen, and subprocess), but you'd also need to block out > exec, ev

Re: python about mobile game?

2006-05-01 Thread cyberco
http://sourceforge.net/projects/pys60 -- http://mail.python.org/mailman/listinfo/python-list

mod_python + apache + winxp => nogo

2006-04-07 Thread cyberco
And I thought this would be trivial...getting mod_python to run within apache on windows XP. = mod_python 3.2.8 apache 2.0.55 python2.4 winxp = After adding: "LoadModule python_module modules/mod_python.so" to apache's httpd.conf, apache refuses to start, saying: "cannot

Re: mod_python + apache + winxp => nogo

2006-04-09 Thread cyberco
Thanks Jim, I indeed did not look in the mailinglist archive (you have to subscribe for that and Google didn't cache it yet). The problem was indeed the missing .DLL's. After adding them to my 'PATH' variable apache was at least able to start. Unfortunately things still don't work. When I try to l

Re: mod_python + apache + winxp => nogo

2006-04-09 Thread cyberco
Win32) mod_python/3.2.5b Python/2.4.2 configured -- resuming normal operations [Sun Apr 09 22:16:38 2006] [notice] mod_python: Creating 8 session mutexes based on 0 max processes and 250 max threads. Cheers, cyberco -- http://mail.python.org/mailman/listinfo/python-list

Re: mod_python + apache + winxp => nogo

2006-04-09 Thread cyberco
yep -- http://mail.python.org/mailman/listinfo/python-list