Re: Exception Handling (C - extending python)

2011-10-25 Thread Ulrich Eckhardt
Am 23.10.2011 14:41, schrieb Stefan Behnel: That's just fine. If you are interested in the inner mechanics of the CPython runtime, reading the source is a very good way to start getting involved with the project. However, many extension module authors don't care about these inner mechanics and j

Re: spawnl issues with Win 7 access rights

2011-10-25 Thread Propad
On 25 Okt., 02:21, Miki Tebeka wrote: > Please use the subprocess module, it's the one who's actively > maintained.http://docs.python.org/library/subprocess.html#replacing-the-os-spawn... Thnx again for all the answers. As stated before, I'm limited in my options. One of them just might be to sw

[wanted] python-ldap for Python 2.3 / Win32

2011-10-25 Thread Gilles Lenfant
Hi, I have spent a couple of hours asking google, browsing Pypi, SF, and of course the official www.python-ldap.org site searching for a python-ldap installer for Python 2.3 on Windows 32 bits. Unsuccessfully :( As I need to add this to an ooold Plone site, it is not easy to upgrade to a newer

UnicodeError instead of UnicodeWarning

2011-10-25 Thread Michael Ströder
HI! For tracking the cause of a UnicodeWarning I'd like to make the Python interpreter to raise an UnicodeError exception with full stack trace. Is there a short trick to achieve this? Many thanks in advance. Ciao, Michael. -- http://mail.python.org/mailman/listinfo/python-list

Re: UnicodeError instead of UnicodeWarning

2011-10-25 Thread Chris Rebert
2011/10/25 Michael Ströder : > HI! > > For tracking the cause of a UnicodeWarning I'd like to make the Python > interpreter to raise an UnicodeError exception with full stack trace. Is there > a short trick to achieve this? from exceptions import UnicodeWarning from warnings import filterwarnings

Re: What is wrong with my code?

2011-10-25 Thread Anssi Saari
apometron writes: > Now it is another > thing, entirely. Rename1.py and Rename2.py works, but why Rename3.py > dont works? Well, Rename3.py works for me, even in Windows 7. Maybe you should test it again? -- http://mail.python.org/mailman/listinfo/python-list

Re: UnicodeError instead of UnicodeWarning

2011-10-25 Thread Peter Otten
Michael Ströder wrote: > For tracking the cause of a UnicodeWarning I'd like to make the Python > interpreter to raise an UnicodeError exception with full stack trace. Is > there a short trick to achieve this? You can control warning behaviour with the -W commandline option: $ cat unicodewarning

Re: Exception Handling (C - extending python)

2011-10-25 Thread Stefan Behnel
Ulrich Eckhardt, 25.10.2011 08:49: Am 23.10.2011 14:41, schrieb Stefan Behnel: That's just fine. If you are interested in the inner mechanics of the CPython runtime, reading the source is a very good way to start getting involved with the project. However, many extension module authors don't ca

Re: What is wrong with my code?

2011-10-25 Thread apometron
I did it very much times, Anssi. Beyond of run it on Python 2.7 latest build, what do you suggest? Do install Python 3.2 along the Python 2.7 installation could give me any problems? cheers, Apometron http://about.me/apometron On 10/25/2011 6:11 AM, Anssi Saari wrote: apometron writes: N

Re: [wanted] python-ldap for Python 2.3 / Win32

2011-10-25 Thread Michael Ströder
Gilles Lenfant wrote: > I have spent a couple of hours asking google, browsing Pypi, SF, and of > course the official www.python-ldap.org site searching for a python-ldap > installer for Python 2.3 on Windows 32 bits. Unsuccessfully :( In theory even recent python-ldap 2.4.3 should still work with

Re: [Tutor] What is wrong with my code?

2011-10-25 Thread Dave Angel
(Once again, please don't top-post. It makes your responses out of order) On 10/25/2011 04:24 AM, apometron wrote: I did it very much times, Anssi. Beyond of run it on Python 2.7 latest build, what do you suggest? Do install Python 3.2 along the Python 2.7 installation could give me any prob

Re: [Tutor] What is wrong with my code?

2011-10-25 Thread apometron
On 10/25/2011 7:34 AM, Dave Angel wrote: (Once again, please don't top-post. It makes your responses out of order) On 10/25/2011 04:24 AM, apometron wrote: I did it very much times, Anssi. Beyond of run it on Python 2.7 latest build, what do you suggest? Do install Python 3.2 along the Pyth

Strange classmethod mock behavior

2011-10-25 Thread Fabio Zadrozny
I'm trying to mock a classmethod in a superclass but when restoring it a strange behavior happens in subclasses (tested on Python 2.5) Anyone knows why this happens? (see test case below for details) Is there any way to restore that original method to have the original behavior? import unittest

Re: Strange classmethod mock behavior

2011-10-25 Thread Peter Otten
Fabio Zadrozny wrote: > I'm trying to mock a classmethod in a superclass but when restoring it > a strange behavior happens in subclasses (tested on Python 2.5) > > Anyone knows why this happens? (see test case below for details) > Is there any way to restore that original method to have the orig

Re: spawnl issues with Win 7 access rights

2011-10-25 Thread Tim Golden
On 25/10/2011 08:01, Propad wrote: Thnx again for all the answers. As stated before, I'm limited in my options. One of them just might be to switch to Python 2.5, rewrite the code that crashes using the subprocess module, and then somehow patch the library I use (which I'm not suposed to do, but.

webapp development in pure python

2011-10-25 Thread Laszlo Nagy
Hi, Anyone knows a framework for webapp development? I'm not talking about javascript/html compilers and ajax frameworks. I need something that does not require javascript knowledge, just pure Python. (So qooxdoo is not really an option, because it cannot be programmed in Python. You canno

Re: webapp development in pure python

2011-10-25 Thread Anurag Chourasia
Have you considered Django ? http://www.djangoproject.com/ Regards, Anurag On Tue, Oct 25, 2011 at 7:20 PM, Laszlo Nagy wrote: > > Hi, > > Anyone knows a framework for webapp development? I'm not talking about > javascript/html compilers and ajax frameworks. I

Re: webapp development in pure python

2011-10-25 Thread Arnaud Delobelle
On 25 October 2011 14:50, Laszlo Nagy wrote: > >  Hi, > > Anyone knows a framework for webapp development? I'm not talking about > javascript/html compilers and ajax frameworks. I need something that does > not require javascript knowledge, just pure Python. (So qooxdoo is not > really an option,

Re: webapp development in pure python

2011-10-25 Thread Martin P. Hellwig
On 10/25/11 15:13, Arnaud Delobelle wrote: On 25 October 2011 14:50, Laszlo Nagy wrote: Hi, Anyone knows a framework for webapp development? I'm not talking about javascript/html compilers and ajax frameworks. I need something that does not require javascript knowledge, just pure Python. (S

Re: Creating very similar functions with different parameters

2011-10-25 Thread Ian Kelly
On Mon, Oct 24, 2011 at 3:29 PM, Andrew Berg wrote: > I want to create a decorator with two different (but very similar) > versions of the wrapper function, but without copying giant chunks of > similar code. The main difference is that one version takes extra > parameters. > > def test_dec(func,

Re: Creating very similar functions with different parameters

2011-10-25 Thread 88888 Dihedral
Thanks for the debug modes in functional programing! Everything functional is true in CS at least in the theroy! -- http://mail.python.org/mailman/listinfo/python-list

Data acquisition

2011-10-25 Thread spintronic
Dear friends, I have a trouble with understanding the following. I have a very short script (shown below) which works fine if I "run" step by step (or line by line) in Python shell (type the first line/command -> press Enter, etc.). I can get all numbers (actually, there are no numbers but a long

Re: Data acquisition

2011-10-25 Thread Jean-Michel Pichavant
spintronic wrote: Dear friends, I have a trouble with understanding the following. I have a very short script (shown below) which works fine if I "run" step by step (or line by line) in Python shell (type the first line/command -> press Enter, etc.). I can get all numbers (actually, there are no

Re: webapp development in pure python

2011-10-25 Thread Laszlo Nagy
Anyone knows a framework for webapp development? I'm not talking about javascript/html compilers and ajax frameworks. I need something that does not require javascript knowledge, just pure Python. (So qooxdoo is not really an option, because it cannot be programmed in Python. You cannot even

Re: Data acquisition

2011-10-25 Thread Nick Dokos
spintronic wrote: > Dear friends, > > I have a trouble with understanding the following. I have a very short > script (shown below) which works fine if I "run" step by step (or line > by line) in Python shell (type the first line/command -> press Enter, > etc.). I can get all numbers (actually,

Re: Data acquisition

2011-10-25 Thread John Gordon
In <362e368f-829e-4477-bcfc-c0650d231...@j7g2000yqi.googlegroups.com> spintronic writes: > Any ideas? Why there is a difference when I run the script or do it > command by command? Are you running the same python program in both cases? Are you in the same directory in both cases? Does PYTHONP

Re: Data acquisition

2011-10-25 Thread spintronic
On Oct 25, 6:29 pm, Nick Dokos wrote: > Shot in the dark: could it be that you have to add delays to give the > instrument time to adjust? When you do it from the python shell, line by > line, there is a long delay between one line and the next. > > Nick Hi, Nick! Thanks! You are right but it wa

Re: Data acquisition

2011-10-25 Thread spintronic
On Oct 25, 6:43 pm, John Gordon wrote: Thanks, John! > Are you running the same python program in both cases? Yes, the same. > Are you in the same directory in both cases? > Does PYTHONPATH and/or sys.path have the same value in both cases? It looks that yes but how can it matter? All I need

Re: Data acquisition

2011-10-25 Thread spintronic
On Oct 25, 6:15 pm, Jean-Michel Pichavant wrote: > spintronic wrote: > > Dear friends, > > > I have a trouble with understanding the following. I have a very short > > script (shown below) which works fine if I "run" step by step (or line > > by line) in Python shell (type the first line/command -

Re: Data acquisition

2011-10-25 Thread John Gordon
In <86e6bfb8-17e1-4544-97ba-7299db8a8...@p16g2000yqj.googlegroups.com> spintronic writes: > > Are you in the same directory in both cases? > > Does PYTHONPATH and/or sys.path have the same value in both cases? > It looks that yes but how can it matter? All I need it is to import > the visa modu

Re: How to isolate a constant?

2011-10-25 Thread Alan Meyer
On 10/22/2011 8:46 PM, MRAB wrote: On 23/10/2011 01:26, Gnarlodious wrote: Say this: class tester(): _someList = [0, 1] def __call__(self): someList = self._someList someList += "X" return someList test = tester() But guess what, every call adds to the variable that I am trying to copy each t

Re: How to isolate a constant?

2011-10-25 Thread Ian Kelly
On Tue, Oct 25, 2011 at 1:50 PM, Alan Meyer wrote: >> Python will copy something only when you tell it to copy. A simple way >> of copying a list is to slice it: >> >> someList = self._someList[:] > > And another simple way: > >    ... >    someList = list(self._someList) >    ... I generally pre

Python developers interested in local communities, GroupServer

2011-10-25 Thread Steven Clift
My non-profit uses the GPL Python-based http://GroupServer.org platform to host local neighborhood online communities in the U.S., the UK, and New Zealand. We are users of GroupServer and not the owner of the project. We are plotting a future new features hackathon (in person in Minneapolis and pe

Re: [wanted] python-ldap for Python 2.3 / Win32

2011-10-25 Thread Waldemar Osuch
I did try to build it using my current setup but it failed with some linking errors. Oh well. Google gods were nicer to me. Here is a couple alternative links. Maybe they will work for you. http://web.archive.org/web/20081101060042/http://www.agescibs.org/mauro/ http://old.zope.org/Members/volke

Re: Data acquisition

2011-10-25 Thread Dietmar Schwertberger
Am 25.10.2011 19:22, schrieb spintronic: On Oct 25, 6:29 pm, Nick Dokos wrote: Shot in the dark: could it be that you have to add delays to give the instrument time to adjust? When you do it from the python shell, line by line, there is a long delay between one line and the next. Thanks! You a

Re: [wanted] python-ldap for Python 2.3 / Win32

2011-10-25 Thread Gilles Lenfant
So many thanks for your valuable help Waldemar, this is exactly what I needed. I have no Windows machine to compile with the source bundle all this, and must install this directly in a production server. I'll keep these precious links and files in a trunk. Many thanks again -- Gilles Lenfant -

Re: Data acquisition

2011-10-25 Thread Paul Simon
"spintronic" wrote in message news:362e368f-829e-4477-bcfc-c0650d231...@j7g2000yqi.googlegroups.com... > Dear friends, > > I have a trouble with understanding the following. I have a very short > script (shown below) which works fine if I "run" step by step (or line > by line) in Python shell (ty

How to pretty-print ctypes composite data types?

2011-10-25 Thread Grant Edwards
I'm using ctypes with a library that requires a handful of structure definitions. The actual definitions and usage aren't a problem. When it comes time to print out the values in a structure or array, there doesn't seem to be simple/general way to do that. Am I missing something? I presume one

Re: Strange classmethod mock behavior

2011-10-25 Thread Fabio Zadrozny
On Tue, Oct 25, 2011 at 10:08 AM, Peter Otten <__pete...@web.de> wrote: > Fabio Zadrozny wrote: > >> I'm trying to mock a classmethod in a superclass but when restoring it >> a strange behavior happens in subclasses (tested on Python 2.5) >> >> Anyone knows why this happens? (see test case below fo

Re: How to isolate a constant?

2011-10-25 Thread Ian Kelly
On Tue, Oct 25, 2011 at 6:08 PM, Dennis Lee Bieber wrote: > Where's the line form to split those who'd prefer the first vs the > second result in this sample : > unExpected = "What about a string" firstToLast = unExpected[:] Strings are immutable. That doesn't suffice to copy them, eve

Re: spawnl issues with Win 7 access rights

2011-10-25 Thread Terry Reedy
On 10/25/2011 8:19 AM, Tim Golden wrote: On 25/10/2011 08:01, Propad wrote: Thnx again for all the answers. As stated before, I'm limited in my options. One of them just might be to switch to Python 2.5, rewrite the code that crashes using the subprocess module, and then somehow patch the librar

Re: How to isolate a constant?

2011-10-25 Thread Mel
Dennis Lee Bieber wrote: > Where's the line form to split those who'd prefer the first vs the > second result in this sample : > unExpected = "What about a string" firstToLast = unExpected[:] repr(firstToLast) > "'What about a string'" explicitList = list(unExpected) repr

RE: webapp development in pure python

2011-10-25 Thread Sells, Fred
Quixote may be what you want, but it's been years since I've used it and I don't know if it is still alive and kicking. It was from MEMS if I remember correctly. Using django and Flex is one way to avoid html and javascript and it works great for datagrids. Fred. -- http://mail.python.org/mail

Re: webapp development in pure python

2011-10-25 Thread alex23
Laszlo Nagy wrote: > My Python module would connect to a database server and query > some data, then display it in a grid. This cannot be compiled into > javascript because of the database server connection. So what you want is for everything to happen server-side, with html output sent to the cl