Wing IDE 3.2.2 released

2009-10-29 Thread Wingware
Hi, Wingware has released version 3.2.2 of Wing IDE, our integrated development environment for the Python programming language. This bug fix release includes the following: * Added Toggle Bookmark for unnamed bookmarks, visual indicator of bookmarks, and bookmark traversal menu in editor *

Bazaar 2.0.1 and 2.1.0b1 released

2009-10-29 Thread John Arbash Meinel
Our first post-2.0 releases of Bazaar have finally become official. Now that we are at 2.0, we decided to split a stable releases series and a development series. As such, 2.0.1 has only bugfixes relative to the 2.0 release, while new features and potential compatibility changes are contained only

CodeInvestigator 0.18.0

2009-10-29 Thread hans moleman
CodeInvestigator 0.18.0 was released on October 29. It mainly deals with bug fixes: - Simple statements all on the one line separated by a semicolon. - Generators and yield. It has one enhancement: - An Entry Point filter was added. It allows you the leave out the entry points you're not

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-29 Thread Gabriel Genellina
En Wed, 28 Oct 2009 21:06:03 -0300, Alf P. Steinbach al...@start.no escribió: The installer did manage to do the rest of that part correctly: file associations and PATHEXT variable. The Python installer from python.org does NOT add .py and .pyw to PATHEXT; the ActivePython one does.

Re: Copying a ZipExtFile

2009-10-29 Thread ryles
On Oct 28, 8:33 pm, ryles ryle...@gmail.com wrote: As for why the bytesToRead calculation in ZipExtFile.read() results in a long, I've not yet looked at it closely. Simple, actually: In ZipExtFile.__init__(): self.bytes_read = 0L In ZipExitFile.read(): bytesToRead =

Python newbie data structures question

2009-10-29 Thread codingJoe
Hi all! I am trying to choose the right data structure to do a value lookup with multiple keys. I want to lookup data by: key, key,{ values } My final product should be able to reference this datastructure from within a django template. Because my lookup needs only 80 values and will never

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-29 Thread Alf P. Steinbach
* Gabriel Genellina: En Wed, 28 Oct 2009 21:06:03 -0300, Alf P. Steinbach al...@start.no escribió: The installer did manage to do the rest of that part correctly: file associations and PATHEXT variable. The Python installer from python.org does NOT add .py and .pyw to PATHEXT; the

Re: Newbie advice

2009-10-29 Thread alex23
CSharpner csharp...@gmail.com wrote: Here's what I /want/ to do, but don't know where to begin: Welcome to the fun :) - Write web services in Python (I've done plenty of this in .NET, BTW). I'm a big fan of CherryPy: http://www.cherrypy.org/ It's very straightforward and easy to get into.

Re: Python newbie data structures question

2009-10-29 Thread alex23
On Oct 29, 4:31 pm, codingJoe tracy.monte...@gmail.com wrote: I am trying to choose the right data structure to do a value lookup with multiple keys. Hey Joe, Is something like this what you're after? from collections import defaultdict sports = defaultdict(list)

Re: Problem embedding Python.

2009-10-29 Thread Brandon Keown
On Oct 27, 7:48 pm, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Tue, 27 Oct 2009 06:36:18 -0300, Brandon Keown keown.bran...@gmail.com escribió: On Oct 27, 2:47 am, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: You didn't test for the fopen result; are you sure test.py exists in

Re: Web development with Python 3.1

2009-10-29 Thread Dotan Cohen
I think you're misunderstanding how Python and the web work together. Python is not PHP -- it was not designed to replace HTML, and it is in itself not a templating language. If you would like to use Python code embedded in HTML, the way PHP is typically used, you may want to look at Python

Re: Web development with Python 3.1

2009-10-29 Thread Dotan Cohen
2009/10/29 Albert Hopkins mar...@letterboxes.org: On Wed, 2009-10-28 at 16:38 +0200, Dotan Cohen wrote: return HttpResponse(unmaintanable_html % data) That's fine for single variables, but if I need to output a table of unknown rows?  I assume that return means the end of the script.

Re: problems on installing PyGTK in Windows XP

2009-10-29 Thread News123
Hi Yang, Did you modify the path environment variable to point to your gtk lib? This might be the problem. Below the steps, that I followed. General instructions are under http://www.pygtk.org/downloads.html In detail: Install the GTK+ bundle * Download the bundle

Re: Newbie advice

2009-10-29 Thread Diez B. Roggisch
CSharpner schrieb: Alright, I'm not new to programming, but I'm diving in head first into Python for the first time. I'm running on Windows 7, just installed Eclipse Java EE IDE for Web Developers and installed PyDev in it and installed Python 2.6. I've written my first Hello World program,

Re: Web development with Python 3.1

2009-10-29 Thread Bruno Desthuilliers
Dotan Cohen a écrit : Clearly. I was referring to stdout being send to the browser as the http response. s/browser/web server/ - it's the web server that reads your app's stdout and send it (as is or not FWIW) back to the client. As is, in my case. Actually, what use case is there for

Re: Web development with Python 3.1

2009-10-29 Thread Bruno Desthuilliers
Dotan Cohen a écrit : (snip) Yes, I like to separate HTML from code. However, often I need to output something in the middle of the page. How could I do that with a template? Perhaps learning to use some templating system could help ?-) I'd personnaly suggest either Mako (possibly one of

Win XP: How to hide command window for sub processes?

2009-10-29 Thread klausfpga
Hi, I have a Python script which wants to start a subprocess and wait for it to finish. However I would like to have NO command window popping up during execution. My main Python script is started with the .pyw suffix, thus I got rid of the main console and I just see my GUI. So far I tried

Re: Web development with Python 3.1

2009-10-29 Thread Dotan Cohen
As is, in my case. Actually, what use case is there for having Apache reprocess the HTML output of the script? compression, cache, whatever... Thanks. I actually did think of compression. It's not that it was unclear, but that it's innaccurate. outputting to stdout is an implementation

Re: Web development with Python 3.1

2009-10-29 Thread Bruno Desthuilliers
Dotan Cohen a écrit : What do you mean by in the middle of the page? Do you mean, for instance, the behavior of middle.php in the following PHP example: ?php include_once(beginning.inc.php); include_once(middle.php); include_once(end.inc.php); ? Is that what you are after? Yes, that is

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-29 Thread Dotan Cohen
What would be good is if there was a balancing book eg. one specifically targeting ubuntu, which is gaining popularity as we mail. Agreed 100%. I opened this thread as I am learning Python, but my platform is Kubuntu. Of the students in my faculty, about one third have already moved to Ubuntu

Re: Building Python on Solaris 10?

2009-10-29 Thread M.-A. Lemburg
Judy Booth wrote: Can anyone point me towards some instructions for building Python on Solaris 10? We need this for some of our test scripts and so far we cannot get this to build. We have tried both Python 2.6.4 and 3.1.1 and both fail with messages like this: Include/pyport.h:685:2:

Re: Web development with Python 3.1

2009-10-29 Thread Dotan Cohen
Perhaps this might better answer your questions: http://docs.djangoproject.com/en/dev/topics/templates/#id1 Actually, that example just proves my point! Look at this templating code: {% for entry in blog_entries %} h2{{ entry.title }}/h2 p{{ entry.body }}/p {% endfor %} Why would I

Re: Web development with Python 3.1

2009-10-29 Thread Bruno Desthuilliers
Dotan Cohen a écrit : Ok, here's a Django example without a template: # views.py def index(request): torvalds = request.GET.get(torvalds, No torvalds here) return HttpResponse(htmlbody%s/body/html % torvalds) Allright, but what if I need to output in the middle of the page? Say, one

Re: Python 2.6 Global Variables

2009-10-29 Thread Bruno Desthuilliers
Ronn Ross a écrit : (please don't top-post - fixed) On Oct 28, 2009, at 20:50, mattofak matto...@gmail.com wrote: Hi All; I'm new to Python and moving from C, which is probably a big source of my confusion. I'm struggling with something right now though and I hope you all can help. I have a

Trying to contact Nathaniel Wilson

2009-10-29 Thread Steven D'Aprano
Hi, Nathaniel, if you are there, you emailed me privately regarding sorting in Python. I have tried to reply, but your mail server has bounced my email due to policy reasons. Do you have another email address I can send to? -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: logging from several independent classes

2009-10-29 Thread Sandy
All named loggers (including A, B etc.) inherit from the root logger, obtained by doing root_logger = logging.getLogger() or root_logger = logging.getLogger() Somehow I missed this in the docs. Thanks Vinay. -- http://mail.python.org/mailman/listinfo/python-list

RE: Python 2.6 Global Variables

2009-10-29 Thread VYAS ASHISH M-NTB837
Dear all How do I write a code that gets executed 'every x' minutes? I know how to do it 'after x' minutes, I do the following: def doAtTimerFire(): The things I want to do 'after x' minutes go here. And then from main code, I do this: tmr = threading.Timer(timeInSeconds,

Re: Win XP: How to hide command window for sub processes?

2009-10-29 Thread Rüdiger Ranft
klausfpga schrieb: Hi, I have a Python script which wants to start a subprocess and wait for it to finish. However I would like to have NO command window popping up during execution. You need to specify the hide parameter for windows. import subprocess kwargs = {} if

Re: Python 2.6 Global Variables

2009-10-29 Thread Chris Rebert
On Thu, Oct 29, 2009 at 3:25 AM, VYAS ASHISH M-NTB837 ashish.v...@motorola.com wrote: Dear all How do I write a code that gets executed 'every x' minutes? I know how to do it 'after x' minutes, I do the following: def doAtTimerFire():         The things I want to do 'after x' minutes go

ANN: Jump 0.9.5.1 released!

2009-10-29 Thread Olli Wang
I am proud to announce that Jump 0.9.5.1 is released! You can find the Jump project at http://gitorious.org/jump, and its documentation at http://gitorious.org/jump/pages/Home. Jump is a build tool for distributing Jython applications in a really easy step. Features: * Distributing Jython

Re: Win XP: How to hide command window for sub processes?

2009-10-29 Thread Chris Rebert
On Thu, Oct 29, 2009 at 3:25 AM, Rüdiger Ranft _r...@web.de wrote: klausfpga schrieb: Hi, I have a Python script which wants to start a subprocess and wait for it to finish. However I would like to have NO command window popping up during execution. You need to specify the hide parameter

Another (simple) unicode question

2009-10-29 Thread Rustom Mody
Construct http://construct.wikispaces.com/ is a kick-ass binary file structurer (written by a 21 year old!) I thought of trying to port it to python3 but it barfs on some unicode related stuff (after running 2to3) which I am unable to wrap my head around. Can anyone direct me to what I should

How to run a repeating timer every n minutes?

2009-10-29 Thread VYAS ASHISH M-NTB837
Dear All How do I write a code that gets executed 'every x' minutes? I know how to do it 'after x' minutes, I do the following: def doAtTimerFire(): The things I want to do 'after x' minutes go here. And then from main code, I do this: tmr = threading.Timer(timeInSeconds,

Re: How to run a repeating timer every n minutes?

2009-10-29 Thread Wesley Brooks
I use the wx.Timer for this: import wx timer = wx.Timer(self, -1) # update gui every 1/4 second (250ms) timer.Start(250) Bind(wx.EVT_TIMER, OnUpdateValues) In the above I'm running the OnUpdateValues function every 250ms. Regards, Wesley Brooks 2009/10/29 VYAS ASHISH M-NTB837

Re: How to run a repeating timer every n minutes?

2009-10-29 Thread Martin P. Hellwig
VYAS ASHISH M-NTB837 wrote: cut You might want to start a thread with a continues loop that primarily sleeps (time.sleep) but wakes up at regular intervals and executes what needs to be. -- MPH http://blog.dcuktec.com 'If consumed, best digested with added seasoning to own preference.' --

Re: Win XP: How to hide command window for sub processes?

2009-10-29 Thread Martin P. Hellwig
Chris Rebert wrote: On Thu, Oct 29, 2009 at 3:25 AM, Rüdiger Ranft _r...@web.de wrote: klausfpga schrieb: Hi, I have a Python script which wants to start a subprocess and wait for it to finish. However I would like to have NO command window popping up during execution. You need to specify

Re: Win XP: How to hide command window for sub processes?

2009-10-29 Thread Chris Rebert
On Thu, Oct 29, 2009 at 4:37 AM, Martin P. Hellwig martin.hell...@dcuktec.org wrote: Chris Rebert wrote: On Thu, Oct 29, 2009 at 3:25 AM, Rüdiger Ranft _r...@web.de wrote: klausfpga schrieb: Hi, I have a Python script which wants to start a subprocess and wait for it to finish. However

Re: How to run a repeating timer every n minutes?

2009-10-29 Thread Frank Millman
Ashish Vyas wrote: Dear All How do I write a code that gets executed 'every x' minutes? [...] Regards, Ashish Vyas Here is one way - import threading class Timer(threading.Thread): def __init__(self): threading.Thread.__init__(self) self.event = threading.Event()

Re: cool-compiling python 3

2009-10-29 Thread Lie Ryan
Rustom Mody wrote: I guess this is a bit OT but anyhow. I just finished compiling compiling python 3 on ubuntu and discovered that my laptop has a builtin toaster :-; Yeah I know this is not a python issue and probably modern laptops are meant to run wondrous beautiful elephantaneous

Re: Win XP: How to hide command window for sub processes?

2009-10-29 Thread Martin P. Hellwig
Chris Rebert wrote: cut Except for here: http://msdn.microsoft.com/en-us/library/ms682425%28VS.85%29.aspx I was referring to the following bits of the subprocess module used in the above code: Me too actually :-) subprocess.mswindows subprocess.STARTUPINFO() subprocess.STARTF_USESHOWWINDOW

Re: Win XP: How to hide command window for sub processes?

2009-10-29 Thread Chris Rebert
On Thu, Oct 29, 2009 at 4:57 AM, Martin P. Hellwig martin.hell...@dcuktec.org wrote: Chris Rebert wrote: cut Except for here: http://msdn.microsoft.com/en-us/library/ms682425%28VS.85%29.aspx I was referring to the following bits of the subprocess module used in the above code: Me too

RE: How to run a repeating timer every n minutes?

2009-10-29 Thread VYAS ASHISH M-NTB837
Thanks a lot, this helps. -Original Message- From: python-list-bounces+ntb837=motorola@python.org [mailto:python-list-bounces+ntb837=motorola@python.org] On Behalf Of Frank Millman Sent: Thursday, October 29, 2009 5:19 PM To: python-list@python.org Subject: Re: How to run a

Re: Another (simple) unicode question

2009-10-29 Thread John Machin
On Oct 29, 10:02 pm, Rustom Mody rustompm...@gmail.com wrote: Constructhttp://construct.wikispaces.com/is a kick-ass binary file structurer (written by a 21 year old!) I thought of trying to port it to python3 but it barfs on some unicode related stuff (after running 2to3) which I am unable to

Re: Web development with Python 3.1

2009-10-29 Thread Bruno Desthuilliers
Dotan Cohen a écrit : 2009/10/29 Albert Hopkins mar...@letterboxes.org: On Wed, 2009-10-28 at 16:38 +0200, Dotan Cohen wrote: return HttpResponse(unmaintanable_html % data) That's fine for single variables, but if I need to output a table of unknown rows? I assume that return means the end

RE: Copying a ZipExtFile

2009-10-29 Thread Moore, Mathew L
On October 28, 2009 8:33 PM, ryles wrote: snip with io.BytesIO() as memio: shutil.copyfileobj(f, memio) zip = zipfile.ZipFile(file=memio) # Can't use zip.extract(), because I want to ignore paths # within archive. src =

Re: Newbie advice

2009-10-29 Thread CSharpner
On Oct 29, 3:00 am, alex23 wuwe...@gmail.com wrote: CSharpner csharp...@gmail.com wrote: Here's what I /want/ to do, but don't know where to begin: Welcome to the fun :) - Write web services in Python (I've done plenty of this in .NET, BTW). I'm a big fan of

Re: Newbie advice

2009-10-29 Thread CSharpner
On Oct 29, 4:25 am, Diez B. Roggisch de...@nospam.web.de wrote: CSharpner schrieb: Alright, I'm not new to programming, but I'm diving in head first into Python for the first time.  I'm running on Windows 7, just installed Eclipse Java EE IDE for Web Developers and installed PyDev in it

Re: Web development with Python 3.1

2009-10-29 Thread Bruno Desthuilliers
Dotan Cohen a écrit : Perhaps this might better answer your questions: http://docs.djangoproject.com/en/dev/topics/templates/#id1 Actually, that example just proves my point! Which one ? Look at this templating code: {% for entry in blog_entries %} h2{{ entry.title }}/h2 p{{

Re: Another (simple) unicode question

2009-10-29 Thread Carl Banks
On Oct 29, 4:02 am, Rustom Mody rustompm...@gmail.com wrote: Constructhttp://construct.wikispaces.com/is a kick-ass binary file structurer (written by a 21 year old!) I thought of trying to port it to python3 but it barfs on some unicode related stuff (after running 2to3) which I am unable to

Re: Another (simple) unicode question

2009-10-29 Thread Scott David Daniels
John Machin wrote: On Oct 29, 10:02 pm, Rustom Mody rustompm...@gmail.com wrote:... I thought of trying to port it to python3 but it barfs on some unicode related stuff (after running 2to3) which I am unable to wrap my head around. Can anyone direct me to what I should read to try to

ImportError: No module named _md5 - please help

2009-10-29 Thread user7304
Hi, I am trying to run a python script and got this error. import _md5 ImportError: No module named _md5 Googling the problem suggested that I install the 'py25-hashlib'. the following does not work for me 'sudo port install py25-hashlib' , trying to install MacPorts raised many problems. My

annotate a traceback

2009-10-29 Thread Robin Becker
I want to annotate a traceback in routine A which is raised in B. Useful information in A is not available in B I propose to use something like def A(info): try: B() except: t,v,b=sys.exc_info() v.args = (' '.join(map(str,v.args))+', info=%r' % info,)

ImportError: No module named _md5 - Please help

2009-10-29 Thread wadi wadi
Hi, I am trying to run a python script and got this error. import _md5 ImportError: No module named _md5 Googling the problem suggested that I install the 'py25-hashlib'. the following does not work for me 'sudo port install py25-hashlib' , trying to install MacPorts raised many problems. My

Re: list comprehension problem

2009-10-29 Thread Gary Herron
mk wrote: Hello everyone, print hosts hosts = [ s.strip() for s in hosts if s is not '' and s is not None and s is not '\n' ] print hosts ['9.156.44.227\n', '9.156.46.34 \n', '\n'] ['9.156.44.227', '9.156.46.34', ''] Why does the hosts list after list comprehension still contain '' in last

Re: ImportError: No module named _md5 - Please help

2009-10-29 Thread Diez B. Roggisch
Hi, please don't post this to comp.lang.python *and* the python mailinglist. Both are synchronized, so your post shows up twice on both. I am trying to run a python script and got this error. import _md5 ImportError: No module named _md5 I've never seen this import. Normally, it should be

Re: annotate a traceback

2009-10-29 Thread Diez B. Roggisch
Robin Becker wrote: I want to annotate a traceback in routine A which is raised in B. Useful information in A is not available in B I propose to use something like def A(info): try: B() except: t,v,b=sys.exc_info() v.args = ('

Re: list comprehension problem

2009-10-29 Thread Diez B. Roggisch
mk wrote: Hello everyone, print hosts hosts = [ s.strip() for s in hosts if s is not '' and s is not None and s is not '\n' ] print hosts ['9.156.44.227\n', '9.156.46.34 \n', '\n'] ['9.156.44.227', '9.156.46.34', ''] Why does the hosts list after list comprehension still contain ''

Re: Web development with Python 3.1

2009-10-29 Thread Ethan Furman
Bruno Desthuilliers wrote: Dotan Cohen a écrit : I don't want to learn some templating language that duplicates what Python already has built in! Then use Mako - it uses plain Python to manage the presentation logic. And if you go for Mako, then you might as well switch to Pylons. Great

Re: ImportError: No module named _md5 - Please help

2009-10-29 Thread wadi wadi
I can't alter the import statement as the error log is pointing to one of the installed python files 'hashlib.py' /python/2.6.2/lib/python2.6/hashlib.py and I don't have the right permissions to alter the python installation. Any idea? On 10/29/09, Diez B. Roggisch de...@nospam.web.de wrote:

Recommended number of threads? (in CPython)

2009-10-29 Thread mk
Hello everyone, I wrote run-of-the-mill program for concurrent execution of ssh command over a large number of hosts. (someone may ask why reinvent the wheel when there's pssh and shmux around -- I'm not happy with working details and lack of some options in either program) The program has

Re: ImportError: No module named _md5 - please help

2009-10-29 Thread Falcolas
On Oct 29, 9:13 am, user7304 wadie...@gmail.com wrote: Hi, I am trying to run a python script and got this error. import _md5 ImportError: No module named _md5 Googling the problem suggested that I install the 'py25-hashlib'. the following does not work for me 'sudo port install

Re: How to run a repeating timer every n minutes?

2009-10-29 Thread mk
Frank Millman wrote: class Timer(threading.Thread): def __init__(self): threading.Thread.__init__(self) self.event = threading.Event() def run(self): while not self.event.is_set(): The things I want to do go here.

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-29 Thread osmium
Richard Heathfield wrote: A man who cannot express what he needs to express /without/ resorting to .pdf format is computer-illiterate. What format do you suggest? I have some ideas on what I would have used, but you seem to love these veiled references that there is a better way, if the OP

Re: Recommended number of threads? (in CPython)

2009-10-29 Thread Falcolas
On Oct 29, 9:56 am, mk mrk...@gmail.com wrote: Hello everyone, I wrote run-of-the-mill program for concurrent execution of ssh command over a large number of hosts. (someone may ask why reinvent the wheel when there's pssh and shmux around -- I'm not happy with working details and lack of

Re: list comprehension problem

2009-10-29 Thread MRAB
Diez B. Roggisch wrote: mk wrote: Hello everyone, print hosts hosts = [ s.strip() for s in hosts if s is not '' and s is not None and s is not '\n' ] print hosts ['9.156.44.227\n', '9.156.46.34 \n', '\n'] ['9.156.44.227', '9.156.46.34', ''] Why does the hosts list after list comprehension

Re: list comprehension problem

2009-10-29 Thread Falcolas
On Oct 29, 9:31 am, Diez B. Roggisch de...@nospam.web.de wrote: mk wrote: Hello everyone, print hosts hosts = [ s.strip() for s in hosts if s is not '' and s is not None and s is not '\n' ] print hosts ['9.156.44.227\n', '9.156.46.34 \n', '\n'] ['9.156.44.227', '9.156.46.34', '']

PyQT4 user group

2009-10-29 Thread Chris
Hi! I'm starting to learn and use PyQT4 at work. Is there a good user group or forum out there that I should know about? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-29 Thread Ethan Furman
Mark Hammond wrote: On 29/10/2009 11:06 AM, Alf P. Steinbach wrote: So I suggest switching to some other more light-weight installer technology. Thanks for the suggestion, but I expect we will stick with MSI even with its shortcomings. Using MSI files has significant other advantages,

Re: ImportError: No module named _md5 - Please help

2009-10-29 Thread Diez B. Roggisch
wadi wadi wrote: I can't alter the import statement as the error log is pointing to one of the installed python files 'hashlib.py' /python/2.6.2/lib/python2.6/hashlib.py and I don't have the right permissions to alter the python installation. Any idea? Which is something different from

Re: ftpilb.FTP.stor...() freeze mystery

2009-10-29 Thread Anthra Norell
Gabriel Genellina wrote: En Wed, 28 Oct 2009 08:05:22 -0300, Anthra Norell anthra.nor...@bluewin.ch escribió: Gabriel Genellina wrote: En Tue, 27 Oct 2009 07:53:36 -0300, Anthra Norell anthra.nor...@bluewin.ch escribió: I am trying to upload a bunch of web pages to a hosting service.[...] I

Re: How to run a repeating timer every n minutes?

2009-10-29 Thread Diez B. Roggisch
mk wrote: Frank Millman wrote: class Timer(threading.Thread): def __init__(self): threading.Thread.__init__(self) self.event = threading.Event() def run(self): while not self.event.is_set(): The things I want to do go here.

Re: PyQT4 user group

2009-10-29 Thread Diez B. Roggisch
Chris wrote: Hi! I'm starting to learn and use PyQT4 at work. Is there a good user group or forum out there that I should know about? The PyQt Mailinglist. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: list comprehension problem

2009-10-29 Thread Bruno Desthuilliers
Falcolas a écrit : (snip) I'd also recommend trying the following filter, since it is identical to what you're trying to do, and will probably catch some additional edge cases without any additional effort from you. [s.strip() for s in hosts if s.strip()] The problem with this expression is

Re: list comprehension problem

2009-10-29 Thread Bruno Desthuilliers
mk a écrit : Hello everyone, print hosts ['9.156.44.227\n', '9.156.46.34 \n', '\n'] Just for the record, where did you get this hosts list from ? (hint : depending on the answer, there might be a way to avoid having to filter out the list) --

Re: PSP problem showing images

2009-10-29 Thread Alfons Nonell-Canals
Anybody of you have any idea? Alfons Nonell-Canals wrote: Hi Lawrence, Yes, I've tried it! I've saw the code, copyed the src path ans pasted into the browser and it works. I think it not works only unther a psp hostname/directory, for this reason I thought the problem is in the apache2

Re: Web development with Python 3.1

2009-10-29 Thread Diez B. Roggisch
Dotan Cohen wrote: Perhaps this might better answer your questions: http://docs.djangoproject.com/en/dev/topics/templates/#id1 Actually, that example just proves my point! Look at this templating code: {% for entry in blog_entries %} h2{{ entry.title }}/h2 p{{ entry.body }}/p

Re: PyQT4 user group

2009-10-29 Thread denis
For detailed questions, try http://stackoverflow.com/questions/tagged/pyqt or pyqt4 (the or may have to be escaped as %20or%20 in some browsers.) -- http://mail.python.org/mailman/listinfo/python-list

Re: ImportError: No module named _md5 - Please help

2009-10-29 Thread Sean DiZazzo
On Oct 29, 8:49 am, wadi wadi wadie...@gmail.com wrote: I can't alter the import statement as the error log is pointing to one of the installed python files 'hashlib.py' /python/2.6.2/lib/python2.6/hashlib.py and I don't have the right permissions to alter the python installation. Any idea?

Re: ImportError: No module named _md5 - please help

2009-10-29 Thread wadi wadi
Hi Garrick, My python script depends on another framework that is implemented in python. The error is originating from the framework code note my script and I cannot change the framework. Also, it works on other machines. So my guess is that I have no choice I need to install the 'py25-hashlib'

Are *.pyd's universal?

2009-10-29 Thread Bakes
Can I use a pyd compiled on linux in a Windows distribution? Or must I recompile it for windows users? -- http://mail.python.org/mailman/listinfo/python-list

Re: Web development with Python 3.1

2009-10-29 Thread Bruno Desthuilliers
Diez B. Roggisch a écrit : The point is that using templates allows you to express your rendering-logic in terms of the desired output language (HTML in this case). Well, for Django, Mako, Cheetah and quite a few others, this might not be _that_ true - you can use any of the templating

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-29 Thread Alf P. Steinbach
* Martin P. Hellwig: Alf P. Steinbach wrote: * tm: On 28 Okt., 07:52, Alf P. Steinbach al...@start.no wrote: [Cross-posted comp.programming and comp.lang.python] Looking at your topic '(Python in Windows)', without taking a glimpse at your actual introduction, I have the following to say: I

Re: Newbie advice

2009-10-29 Thread Bryan
On Oct 28, 9:53 pm, CSharpner csharp...@gmail.com wrote: Alright, I'm not new to programming, but I'm diving in head first into Python for the first time.  I'm running on Windows 7, just installed Eclipse Java EE IDE for Web Developers and installed PyDev in it and installed Python 2.6.  I've

Re: ImportError: No module named _md5 - please help

2009-10-29 Thread Robert Kern
On 2009-10-29 11:39 AM, wadi wadi wrote: Hi Garrick, My python script depends on another framework that is implemented in python. The error is originating from the framework code note my script and I cannot change the framework. Also, it works on other machines. So my guess is that I have no

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-29 Thread Alf P. Steinbach
* James Harris: On 28 Oct, 08:58, Alf P. Steinbach al...@start.no wrote: * tm: On 28 Okt., 07:52, Alf P. Steinbach al...@start.no wrote: [Cross-posted comp.programming and comp.lang.python] Looking at your topic '(Python in Windows)', without taking a glimpse at your actual introduction, I

Re: Python 2.6 Global Variables

2009-10-29 Thread AK Eric
2/ in Python, global really means module-level - there's nothing like a true global namespace. Isn't that __main__? import __main__ __main__.foo = asdfasdf print foo # asdfasdf Not advocating, but it does serve the purpose. -- http://mail.python.org/mailman/listinfo/python-list

Re: Are *.pyd's universal?

2009-10-29 Thread Jerry Hill
On Thu, Oct 29, 2009 at 12:44 PM, Bakes ba...@ymail.com wrote: Can I use a pyd compiled on linux in a Windows distribution? No. Or must I recompile it for windows users? Yes. -- http://mail.python.org/mailman/listinfo/python-list

Re: ImportError: No module named _md5 - Please help

2009-10-29 Thread Diez B. Roggisch
wadi wadi wrote: Sorry for the confusion. In summary I have the same issue shown here with its solution. It seems to be a common problem. http://recurser.com/articles/2009/06/06/python-25-importerror-no-module-named-_md5-on-os-x/ However, their solution does not work with me as I am

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-29 Thread Ethan Furman
Alf P. Steinbach wrote: * James Harris: You get way too deep into Python in places (for a beginner's course in programming). For example, from now on I’ll always use from __future__ in any program that uses print. Sorry, but I think that hiding such concerns is a real disservice. The

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-29 Thread Richard Heathfield
In 7ktsj6f3bciq...@mid.individual.net, osmium wrote: Richard Heathfield wrote: A man who cannot express what he needs to express /without/ resorting to .pdf format is computer-illiterate. What format do you suggest? Firstly, I want to make clear that I'm not objecting to the OP's use of

Re: Are *.pyd's universal?

2009-10-29 Thread Christian Heimes
Bakes wrote: Can I use a pyd compiled on linux in a Windows distribution? Or must I recompile it for windows users? On Linux and several other Unices the suffix is .so and not .pyd. The compiled extensions depend on the Python version, operating system as well as platform and architecture.

Re: Bug(s) in Python 3.1.1 Windows installation

2009-10-29 Thread Ethan Furman
Alf P. Steinbach wrote: * Ethan Furman: Mark Hammond wrote: On 29/10/2009 11:06 AM, Alf P. Steinbach wrote: So I suggest switching to some other more light-weight installer technology. Thanks for the suggestion, but I expect we will stick with MSI even with its shortcomings. Using

Checking if a function invocation will throw a TypeError?

2009-10-29 Thread Andrey Fedorov
Is there a standard function that will check whether certain *args, and **kwargs satisfy a argspec of a function (s.t. it does not throw a TypeError). Say: def foo(a,b=1): pass check(foo, 1,2) # True check(foo, 1) # True check(foo) # False check(foo, 1, a=2) # False Cheers, Andrey --

disutils, project structure developing - n00b question

2009-10-29 Thread Wells
So I have my project partitioned like so: ./setup.py ./pymlb/ ./pymlb/fetcher.py ./demos ./demos/demo.py In demo.py I have: from pymlb import fetcher However, it fails b/c pymlb is up a folder. It's also NOT installed as a module in my module directory because it's a development effort and I

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-29 Thread osmium
Richard Heathfield wrote: if the OP had just been smarter. Er, no, I didn't have that in mind at all. In some cultures, implying that someone is illiterate suggests not smart. There is a formal disconnect there but possibly you can see how someone might infer that. At least I found out

Python2.6 + win32com crashes with unicode bug

2009-10-29 Thread GerritM
I have automated image generation with Python, win32com and Visio5.0. This works well upto Python2.5 but fails with Python 2.6. Short term solution is to return to 2.5 :-(. I have reproduced the bug below with a minimum of Python lines. Below the problem the working example from 2.5 kind

Re: disutils, project structure developing - n00b question

2009-10-29 Thread Simon Forman
On Thu, Oct 29, 2009 at 2:42 PM, Wells we...@submute.net wrote: So I have my project partitioned like so: ./setup.py ./pymlb/ ./pymlb/fetcher.py ./demos ./demos/demo.py In demo.py I have: from pymlb import fetcher However, it fails b/c pymlb is up a folder. It's also NOT installed as

Re: disutils, project structure developing - n00b question

2009-10-29 Thread Simon Forman
On Thu, Oct 29, 2009 at 3:45 PM, Simon Forman sajmik...@gmail.com wrote: In order for from pymlb import fetcher no work you must make the s/no/to/ D'oh! -- http://mail.python.org/mailman/listinfo/python-list

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-29 Thread Alf P. Steinbach
* Ethan Furman: Alf P. Steinbach wrote: * James Harris: You get way too deep into Python in places (for a beginner's course in programming). For example, from now on I’ll always use from __future__ in any program that uses print. Sorry, but I think that hiding such concerns is a real

Re: Feedback wanted on programming introduction (Python in Windows)

2009-10-29 Thread Alf P. Steinbach
* Richard Heathfield: The best way is the simplest technology that will do the job properly. If that truly is PDF, okay, use PDF. But it is hard for me to envisage circumstances where Web content is best presented in that way. Google docs sharing. It made a mess of my *Word* documents. g

  1   2   3   >