python noob

2009-10-20 Thread bostongeek21
i am brand new to the python and programming world just finished reading byte out of python which is an excellent book. As i am new to the programming world im kind of at a lose as to where to go from here? i am just learning so im not as experienced as most of you but i would like to get my feet

Re: help to convert c++ fonction in python

2009-10-20 Thread Robert Kern
Steven D'Aprano wrote: On Sat, 17 Oct 2009 19:48:46 -0400, geremy condra wrote: For the love of baby kittens, please, please, please tell me that you do not believe this securely encrypts your data. Surely that depends on your threat model? Well, let's let the OP off the hook immediately.

Re: File not closed on exception

2009-10-20 Thread arve.knud...@gmail.com
On Oct 19, 3:48 pm, Ethan Furman et...@stoneleaf.us wrote: arve.knud...@gmail.com wrote: Hi I thought that file objects were supposed to be garbage-collected and automatically closed once they go out of scope, at least that's what I've been told by more merited Python programmers. I'm

Re: The rap against while True: loops

2009-10-20 Thread Hendrik van Rooyen
On Monday, 19 October 2009 09:43:15 Steven D'Aprano wrote: On Mon, 19 Oct 2009 08:51:44 +0200, Hendrik van Rooyen wrote: The point I was trying to make subliminally, was that there is a relative cost of double lookup for all cases versus exceptions for some cases. - Depending on the

Re: Checking a Number for Palindromic Behavior

2009-10-20 Thread Steven D'Aprano
On Mon, 19 Oct 2009 13:29:52 -0700, Ethan Furman wrote: Your arguments are most persuasive. Consider me convinced. Even if the worst-case scenario is true (homework problem, ack!), either the poster will learn from the answer in which case all is well, or the poster will not, in which case

Re: File not closed on exception

2009-10-20 Thread Gabriel Genellina
En Tue, 20 Oct 2009 03:23:49 -0300, arve.knud...@gmail.com arve.knud...@gmail.com escribió: On Oct 19, 5:56 pm, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Mon, 19 Oct 2009 09:45:49 -0200, arve.knud...@gmail.com   arve.knud...@gmail.com escribió: I thought that file objects were

Re: pylab/matplotlib large plot memory management - bug? or tuning parameter needed?

2009-10-20 Thread Johan Grönqvist
bdb112 skrev: Summary: It is not straightforward to avoid memory leaks/consumption in pylab. If we define x = arange(1e6) # adjust size to make the increment visible, yet fast enough to plot # then repetition of plot(x,hold=0) # consumes increasing memory according to ubuntu system

Re: File not closed on exception

2009-10-20 Thread arve.knud...@gmail.com
On 20 Okt, 09:40, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Tue, 20 Oct 2009 03:23:49 -0300, arve.knud...@gmail.com   arve.knud...@gmail.com escribió: On Oct 19, 5:56 pm, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Mon, 19 Oct 2009 09:45:49 -0200,

Re: Frameworks

2009-10-20 Thread Bruno Desthuilliers
Emmanuel Surleau a écrit : Django : very strong integration, excellent documentation and support, huge community, really easy to get started with. And possibly a bit more mature and stable... One strong point in favour of Django: it follows Python's philosophy of batteries included, and

Re: Frameworks

2009-10-20 Thread Bruno Desthuilliers
flebber a écrit : (snip) In short it seems to me that Django and Web2py include more magic in assisting oneself to create you web/application, whilst Pylons and Werkzueg leave more control in the users hands hopefully leading to greater expression and power. I can't tell much about web2py -

Re: How about adding slice notation to iterators/generators?

2009-10-20 Thread Jaime Buelta
El 16/10/2009 3:29, Eloff escribió: I was just working with a generator for a tree that I wanted to skip the first result (root node.) And it occurs to me, why do we need to do: import sys from itertools import islice my_iter = islice(my_iter, 1, sys.maxint) When we could simply add

Re: efficient running median

2009-10-20 Thread denis
Yet another link: http://en.wikipedia.org/wiki/Median_filter -- Perreault + Hebert, Median Filtering in Constant Time, nice 6-page paper + 400 lines well-documented C code: http://nomis80.org/ctmf.html (for 2d images, dropping to 1d must be possible :) They're also in opencv, which I haven't

Re: The rap against while True: loops

2009-10-20 Thread Iain King
On Oct 19, 7:51 am, Hendrik van Rooyen hend...@microcorp.co.za wrote: On Sunday, 18 October 2009 11:31:19 Paul Rubin wrote: Hendrik van Rooyen hend...@microcorp.co.za writes: Standard Python idiom: if key in d:   d[key] += value else:   d[key] = value The issue is that uses

What am I doing wrong with SWIG in OS X Snow Leopard?

2009-10-20 Thread Zectbumo
Here are the steps I am doing that cause me to get the error ImportError: No module named _hi. I'm running OS X 10.6.1 What am I doing wrong? mkdir -p /tmp/my_swig_test cd /tmp/my_swig_test cat hi.c. #include stdio.h void hello(void) {printf(Hello World\n);} . gcc -shared -o libhi.dylib hi.c cat

InteractiveConsole executed in another thread.

2009-10-20 Thread Germán Diago
Hello. I have an application written in python (it's a wrapper for a c++ application). The application has : a window (an SDL window), and a GUI, which has the window embedded inside. I would like to use InteractiveConsole to send commands to the SDL window. I have an API that allows me to do

Re: Raw_input with readline in a daemon thread makes terminal text disappear

2009-10-20 Thread John O'Hagan
On Mon, 19 Oct 2009, Aahz wrote: In article mailman.1448.1255618675.2807.python-l...@python.org, John O'Hagan resea...@johnohagan.com wrote: I'm getting input for a program while it's running by using raw_input in a loop in separate thread. This works except for the inconvenience of not

structread

2009-10-20 Thread Lawrence D'Oliveiro
This routine is so useful, I wonder there's nothing like it in module struct, or anywhere else I'm aware of: def structread(fromfile, decode_struct) : reads sufficient bytes from fromfile to be unpacked according to decode_struct, and returns the unpacked results.

Re: File not closed on exception

2009-10-20 Thread Ulrich Eckhardt
arve.knud...@gmail.com wrote: On Oct 19, 3:48 pm, Ethan Furman et...@stoneleaf.us wrote: arve.knud...@gmail.com wrote: [...] def create(): f = file(tmp, w) raise Exception try: create() finally: os.remove(tmp) [...] When an exception is raised, the entire stack frame

Re: The rap against while True: loops

2009-10-20 Thread NiklasRTZ
On Oct 19, 2:51 am, Hendrik van Rooyen hend...@microcorp.co.za wrote: On Sunday, 18 October 2009 11:31:19 Paul Rubin wrote: Hendrik van Rooyen hend...@microcorp.co.za writes: Standard Python idiom: if key in d:   d[key] += value else:   d[key] = value The issue is that uses

Re: Is __mul__ sufficient for operator '*'?

2009-10-20 Thread Mick Krippendorf
Gabriel Genellina schrieb: http://docs.python.org/reference/datamodel.html#special-method-lookup-for-new-style-classes Ok. That explains a lot. And your explanation tells the rest. Thank you. In short, you have to define the __mul__ method on the type itself or any of its bases. I found this,

Re: File not closed on exception

2009-10-20 Thread Mel
arve.knud...@gmail.com wrote: I agree, but like I said, I've been told that this (implicit closing of files) is the correct style by more merited Python developers, so that made me think I was probably wrong .. It would be nice. The trouble is that CPython is not the only Python. Jython,

Separate namespace from file hierarchy?

2009-10-20 Thread Peng Yu
Suppose I have the dirname/both.py, which has the definitions of classes A and B. I can use this module in the following code. # import dirname.both a=dirname.both.A() b=dirname.both.B() When the definitions of A and B become too long, it is better that I

Re: File not closed on exception

2009-10-20 Thread Ethan Furman
arve.knud...@gmail.com wrote: On Oct 19, 3:48 pm, Ethan Furman et...@stoneleaf.us wrote: arve.knud...@gmail.com wrote: Hi I thought that file objects were supposed to be garbage-collected and automatically closed once they go out of scope, at least that's what I've been told by more

SQLObject 0.12.0

2009-10-20 Thread Oleg Broytman
Hello! I'm pleased to announce version 0.12.0, the first stable release of branch 0.12 of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be

Re: File not closed on exception

2009-10-20 Thread Bruno Desthuilliers
arve.knud...@gmail.com a écrit : On Oct 19, 4:14 pm, Grant Edwards inva...@invalid.invalid wrote: On 2009-10-19, arve.knud...@gmail.com arve.knud...@gmail.com wrote: I thought that file objects were supposed to be garbage-collected and automatically closed once they go out of scope, At some

Re: Separate namespace from file hierarchy?

2009-10-20 Thread Diez B. Roggisch
Peng Yu wrote: Suppose I have the dirname/both.py, which has the definitions of classes A and B. I can use this module in the following code. # import dirname.both a=dirname.both.A() b=dirname.both.B() When the definitions of A and B become too

Re: Separate namespace from file hierarchy?

2009-10-20 Thread yuky
On Oct 20, 3:51 pm, Peng Yu pengyu...@gmail.com wrote: Suppose I have the dirname/both.py, which has the definitions of classes A and B. I can use this module in the following code. # import dirname.both a=dirname.both.A() b=dirname.both.B() When the

Re: Separate namespace from file hierarchy?

2009-10-20 Thread Bruno Desthuilliers
yuky a écrit : (snip) Or there is other variant: import dirname.A as dirname a = dirname.A() I wouldn't recommand this variant, which is highly confusing. -- http://mail.python.org/mailman/listinfo/python-list

Re: pylab/matplotlib large plot memory management - bug? or tuning parameter needed?

2009-10-20 Thread Carl Banks
On Oct 19, 12:15 pm, bdb112 boyd.blackw...@gmail.com wrote: Summary: It is not straightforward to avoid memory leaks/consumption in pylab. If we define x = arange(1e6)     # adjust size to make the increment visible, yet fast enough to plot # then repetition of plot(x,hold=0)   # consumes

Decimal values in wx.slider

2009-10-20 Thread Wanderer
Is there way to get decimal values displayed in wx.slider? I would like to use a slider to set values like 3.11. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: a simple unicode question

2009-10-20 Thread Scott David Daniels
Mark Tolonen wrote: Is there a better way of getting the degrees? It seems your string is UTF-8. \xc2\xb0 is UTF-8 for DEGREE SIGN. If you type non-ASCII characters in source code, make sure to declare the encoding the file is *actually* saved in: # coding: utf-8 s = '''48° 13' 16.80

Re: Checking a Number for Palindromic Behavior

2009-10-20 Thread Benjamin Middaugh
Actually I was working on a program to test the so-called 196-algorithm as an extracurricular activity. MRAB was most helpful with pointing out what I should have already thought of. My previous attempts were hampered by my limited knowledge of python, and I had already mentally committed to

Re: Frameworks

2009-10-20 Thread Massimo Di Pierro
So does web2py allow for raw sql if there is an advanced procedure or query that needs to be performed that is outside the scope of the web2pr orm Yes db.executesql(whatever you want) http://www.web2py.com/examples/static/epydoc/web2py.gluon.sql.SQLDB-class.html Massimo --

Re: Frameworks

2009-10-20 Thread mdipierro
On Oct 19, 9:01 am, flebber flebber.c...@gmail.com wrote: In short it seems to me that Django and Web2py include more magic in assisting oneself to create you web/application, whilst Pylons and Werkzueg leave more control in the users hands hopefully leading to greater expression and power.

ctypes issues involving a pointer to an array of strings

2009-10-20 Thread Nathaniel Hayes
I am working on creating a python API for a dll for a daqboard we have here. I have the documentation for the library, as well as the C, Delphi and VB api. I have decided to use ctypes for the project, and most is working out alright. However I have run in to considerable headaches when dealing

Re: Checking a Number for Palindromic Behavior

2009-10-20 Thread MRAB
Benjamin Middaugh wrote: Actually I was working on a program to test the so-called 196-algorithm as an extracurricular activity. MRAB was most helpful with pointing out what I should have already thought of. My previous attempts were hampered by my limited knowledge of python, and I had

ctypes issues involving a pointer to an array of strings

2009-10-20 Thread Nathaniel Hayes
I am working on creating a python API for a dll for a daqboard we have here. I have the documentation for the library, as well as the C, Delphi and VB api. I have decided to use ctypes for the project, and most is working out alright. However I have run in to considerable headaches when dealing

Re: ctypes issues involving a pointer to an array of strings

2009-10-20 Thread MRAB
Nathaniel Hayes wrote: I am working on creating a python API for a dll for a daqboard we have here. I have the documentation for the library, as well as the C, Delphi and VB api. I have decided to use ctypes for the project, and most is working out alright. However I have run in to

Spam reported

2009-10-20 Thread Peter Pearson
Reported. -- To email me, substitute nowhere-spamcop, invalid-net. -- http://mail.python.org/mailman/listinfo/python-list

Spam reported

2009-10-20 Thread Peter Pearson
Reported. -- To email me, substitute nowhere-spamcop, invalid-net. -- http://mail.python.org/mailman/listinfo/python-list

Re: Checking a Number for Palindromic Behavior

2009-10-20 Thread rurpy
On 10/19/2009 03:24 PM, ru...@yahoo.com wrote: You think that was homework? Perhaps so but for the record here are some posts by some other people who suspected homework in the very recent past... Updated... 2009-10-20

unittest wart/bug for assertNotEqual

2009-10-20 Thread Zac Burns
Using the assertNotEqual method of UnitTest (synonym for failIfEqual) only checks if first == second, but does not include not (first != second) According to the docs: http://docs.python.org/reference/datamodel.html#specialnames There are no implied relationships among the comparison operators.

Re: Spam reported

2009-10-20 Thread Grant Edwards
On 2009-10-20, Peter Pearson ppear...@nowhere.invalid wrote: Reported to Google's groups-abuse. What are these postings supposed to mean? -- Grant Edwards grante Yow! I've read SEVEN at MILLION books!!

Re: Frameworks

2009-10-20 Thread mdipierro
One more clarification to avoid confusion. Django has admin and it is great. Web2py also has something called admin but that is not apples to apples. The closest thing to Django admin in web2py is called appadmin (it comes with it). For example consider the following complete program:

Re: a simple unicode question

2009-10-20 Thread George Trojan
Thanks for all suggestions. It took me a while to find out how to configure my keyboard to be able to type the degree sign. I prefer to stick with pure ASCII if possible. Where are the literals (i.e. u'\N{DEGREE SIGN}') defined? I found http://www.unicode.org/Public/5.1.0/ucd/UnicodeData.txt

Re: ctypes issues involving a pointer to an array of strings

2009-10-20 Thread MRAB
Nathaniel Hayes wrote: On Tue, Oct 20, 2009 at 12:12 PM, MRAB pyt...@mrabarnett.plus.com mailto:pyt...@mrabarnett.plus.com wrote: The digits in that pointer value look suspiciously like the character codes of a string rather than an actual address: \x42\x71\x61\x44 'BqaD'

Re: Poll on Eval in Python

2009-10-20 Thread TerryP
On Oct 20, 4:30 pm, Nobody nob...@nowhere.com wrote: One language's eval isn't the same as another's. E.g. there's a big difference between Lisp's eval (which takes an s-expression as an argument) and an eval which takes a string as an argument. The former is fine; the latter should be

Re: ftplib connection fails with multiple nics

2009-10-20 Thread Sean DiZazzo
On Oct 19, 10:23 pm, Tim Roberts t...@probo.com wrote: Sean DiZazzo half.ital...@gmail.com wrote: I'm trying to connect to an ftp site from a windows machine with two nics going to two different networks, but I keep getting the below exception: Traceback (most recent call last):  File

A stupid newbie question about output...

2009-10-20 Thread J
Can someone explain why this code results in two different outputs? for os in comp.CIM_OperatingSystem (): print os.Name.split(|)[0] + Service Pack, os.ServicePackMajorVersion osVer = os.Name.split(|)[0] + Service Pack, os.ServicePackMajorVersion print osVer the first print statement

Re: unittest wart/bug for assertNotEqual

2009-10-20 Thread Mark Dickinson
On Oct 20, 6:20 pm, Zac Burns zac...@gmail.com wrote: Using the assertNotEqual method of UnitTest (synonym for failIfEqual) only checks if first == second, but does not include not (first != second) It looks as though this is fixed in Python 2.7 (and also in 3.1):

Re: File not closed on exception

2009-10-20 Thread arve.knud...@gmail.com
On 20 Okt, 16:00, Bruno Desthuilliers bruno. 42.desthuilli...@websiteburo.invalid wrote: What's your problem with the with ??? No problem whatsoever, but I believe I wrote this utility function before the keyword was available, and it might be good to support older Python versions. But anyway

Re: list to tuple and vice versa

2009-10-20 Thread David C Ullrich
On Sun, 18 Oct 2009 14:33:17 +1100, Ben Finney wrote: Jabba Laci jabba.l...@gmail.com writes: Hi, I have some difficulties with list - tuple conversion: t = ('a', 'b') li = list(t) # tuple - list, works print li # ['a', 'b'] tu = tuple(li) # list - tuple, error print tu # what

Re: A stupid newbie question about output...

2009-10-20 Thread nn
On Oct 20, 2:23 pm, J dreadpiratej...@gmail.com wrote: Can someone explain why this code results in two different outputs? for os in comp.CIM_OperatingSystem ():  print os.Name.split(|)[0] + Service Pack, os.ServicePackMajorVersion  osVer = os.Name.split(|)[0] + Service Pack,

Re: A stupid newbie question about output...

2009-10-20 Thread Ethan Furman
J wrote: Can someone explain why this code results in two different outputs? for os in comp.CIM_OperatingSystem (): print os.Name.split(|)[0] + Service Pack, os.ServicePackMajorVersion osVer = os.Name.split(|)[0] + Service Pack, os.ServicePackMajorVersion print osVer the first print

Re: a splitting headache

2009-10-20 Thread David C Ullrich
On Thu, 15 Oct 2009 18:18:09 -0700, Mensanator wrote: All I wanted to do is split a binary number into two lists, a list of blocks of consecutive ones and another list of blocks of consecutive zeroes. But no, you can't do that. c = '001110' c.split('0') ['', '', '1', '', '', '',

Re: A stupid newbie question about output...

2009-10-20 Thread J
On Tue, Oct 20, 2009 at 14:53, Ethan Furman et...@stoneleaf.us wrote: osVer = %s Service Pack %d % (os.Name.split(|)[0],        os.ServicePackMajorVersion) This way, osVer is a string, and not a tuple. Thanks for the help... The tuple thing is a new concept to me... at least the vocabulary

Re: ftplib connection fails with multiple nics

2009-10-20 Thread Sean DiZazzo
On Oct 19, 10:23 pm, Tim Roberts t...@probo.com wrote: Sean DiZazzo half.ital...@gmail.com wrote: I'm trying to connect to an ftp site from a windows machine with two nics going to two different networks, but I keep getting the below exception: Traceback (most recent call last):  File

Re: File not closed on exception

2009-10-20 Thread Gabriel Genellina
En Tue, 20 Oct 2009 04:47:02 -0300, arve.knud...@gmail.com arve.knud...@gmail.com escribió: On 20 Okt, 09:40, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Tue, 20 Oct 2009 03:23:49 -0300, arve.knud...@gmail.com arve.knud...@gmail.com escribió: I agree, but like I said, I've been

Re: File not closed on exception

2009-10-20 Thread arve.knud...@gmail.com
On 20 Okt, 21:13, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Tue, 20 Oct 2009 04:47:02 -0300, arve.knud...@gmail.com   arve.knud...@gmail.com escribió: On 20 Okt, 09:40, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Tue, 20 Oct 2009 03:23:49 -0300, arve.knud...@gmail.com  

Re: help to convert c++ fonction in python

2009-10-20 Thread Aahz
In article mailman.1683.1255964347.2807.python-l...@python.org, geremy condra debat...@gmail.com wrote: And always apply ROT13 twice for extra security. Can't you tell? I'm already doing that! -- Aahz (a...@pythoncraft.com) * http://www.pythoncraft.com/ Member of the

Unicode again ... default codec ...

2009-10-20 Thread Stef Mientki
hello, As someone else already said, every time I think : now I understand it completely, and a few weeks later ... Form the thread how to write a unicode string to a file ? and my specific situation: - reading data from Excel, Delphi and other Windows programs and unicode Python - using

Re: help to convert c++ fonction in python

2009-10-20 Thread Mel
Aahz wrote: In article mailman.1683.1255964347.2807.python-l...@python.org, geremy condra debat...@gmail.com wrote: And always apply ROT13 twice for extra security. Can't you tell? I'm already doing that! Just don't flaunt the export restrictions by using ROT52. Mel. --

Re: help to convert c++ fonction in python

2009-10-20 Thread geremy condra
On Tue, Oct 20, 2009 at 3:54 PM, Aahz a...@pythoncraft.com wrote: In article mailman.1683.1255964347.2807.python-l...@python.org, geremy condra  debat...@gmail.com wrote: And always apply ROT13 twice for extra security. Can't you tell?  I'm already doing that! -- Aahz (a...@pythoncraft.com)

Re: ctypes issues involving a pointer to an array of strings

2009-10-20 Thread MRAB
Nathaniel Hayes wrote: On Tue, Oct 20, 2009 at 2:08 PM, MRAB pyt...@mrabarnett.plus.com mailto:pyt...@mrabarnett.plus.com wrote: Nathaniel Hayes wrote: On Tue, Oct 20, 2009 at 12:12 PM, MRAB pyt...@mrabarnett.plus.com mailto:pyt...@mrabarnett.plus.com

Re: A stupid newbie question about output...

2009-10-20 Thread Aahz
In article mailman.1745.1256065337.2807.python-l...@python.org, J dreadpiratej...@gmail.com wrote: The tuple thing is a new concept to me... at least the vocabulary is, I'll go look that up now and learn info on tuples. It's been ages since I did any python programming, and even back then it was

Re: help to convert c++ fonction in python

2009-10-20 Thread Aahz
In article hbl5qr$jc...@aioe.org, Mel mwil...@the-wire.com wrote: Aahz wrote: In article mailman.1683.1255964347.2807.python-l...@python.org, geremy condra debat...@gmail.com wrote: And always apply ROT13 twice for extra security. Can't you tell? I'm already doing that! Just don't flaunt

Simple audio

2009-10-20 Thread Peter Chant
What are recommendations for simple audio playback? I want to play back on linux (Slackware), which uses alsa. There seem to be many ways - but some are a couple of years old and won't compile, like pymedia, or seem not widely used and need pulseaudio (swmixer) which I have not installed. I

Re: A stupid newbie question about output...

2009-10-20 Thread J
On Tue, Oct 20, 2009 at 16:25, Aahz a...@pythoncraft.com wrote: In article mailman.1745.1256065337.2807.python-l...@python.org, J  dreadpiratej...@gmail.com wrote: The tuple thing is a new concept to me... at least the vocabulary is, I'll go look that up now and learn info on tuples. It's been

Re: help to convert c++ fonction in python

2009-10-20 Thread Gary Herron
geremy condra wrote: On Mon, Oct 19, 2009 at 2:25 AM, Tim Roberts t...@probo.com wrote: You wrote: For the love of baby kittens, please, please, please tell me that you do not believe this securely encrypts your data. The original poster asked to have two C++ functions

pyserial ser.write('string') TypeError in OS X

2009-10-20 Thread Rodrigo
Maybe this is not a bug at all, but i have installed python2.5. 3.01 and 3.1.1. In python 2.5 ser. write('this is a string') works just fine. On the other hand, with 3.01 and 3.1.1 (pyserial 2.5 rc1) when i do a ser.write('this is a string') i get the following error import serial ser =

convert pyc (python 2.4) to py

2009-10-20 Thread Peng Yu
I have a .pyc file generated by python 2.4. My current python is of version 2.6. I'm wondering how to generate the corresponding .py file from it. -- http://mail.python.org/mailman/listinfo/python-list

Re: SimpleXMLRPCServer clobbering sys.stderr? (2.5.2)

2009-10-20 Thread Gabriel Genellina
En Mon, 19 Oct 2009 00:09:10 -0300, Joseph Turian tur...@gmail.com escribió: I was having a mysterious problem with SimpleXMLRPCServer. (I am using Python 2.5.2) The request handlers were sometimes failing without any error message to the log output. Here's what I see: * If I use logging

Why does passing tuple as arg WITHOUT scattering work?

2009-10-20 Thread Alf P. Steinbach
Hi all. I'm just learning Python from scratch, on my own. Apologies if this question is too newbie... Or perhaps answered in some FAQ (where?). Here's my original code for simple starter program, using the ActivePython implementation in Windows XP Prof, Python version is 2.6: code import

Re: convert pyc (python 2.4) to py

2009-10-20 Thread Diez B. Roggisch
Peng Yu schrieb: I have a .pyc file generated by python 2.4. My current python is of version 2.6. I'm wondering how to generate the corresponding .py file from it. http://www.crazy-compilers.com/decompyle/ Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: unittest wart/bug for assertNotEqual

2009-10-20 Thread Zac Burns
I was with you right up to the last six words. Whether it's worth changing assertNotEqual to be something other than an alias of failIfEqual is an interesting question. Currently all the assert* and fail* variants are aliases of each other, which is easy to learn. This would introduce a

PySide PyQt

2009-10-20 Thread rm
Have you guys heard about PySide: http://www.pyside.org/ It is basically the same as PyQt (Qt bindings for Python), but licensed with the LGPL instead of GPL. The FAQ explains a bit more history. Looks like the end for PyQt if you ask me. -- http://mail.python.org/mailman/listinfo/python-list

PySide PyQt

2009-10-20 Thread rm
Have you guys heard about PySide: http://www.pyside.org/ It is basically the same as PyQt (Qt bindings for Python), but licensed with the LGPL instead of GPL. The FAQ explains a bit more history. Looks like the end for PyQt if you ask me. -- http://mail.python.org/mailman/listinfo/python-list

Re: Spam reported

2009-10-20 Thread Ned Deily
In article hbkski$7c...@reader1.panix.com, Grant Edwards inva...@invalid.invalid wrote: On 2009-10-20, Peter Pearson ppear...@nowhere.invalid wrote: Reported to Google's groups-abuse. What are these postings supposed to mean? I think some people don't recognize that this forum is distributed

Re: Frameworks

2009-10-20 Thread Emmanuel Surleau
Emmanuel Surleau a écrit : Django : very strong integration, excellent documentation and support, huge community, really easy to get started with. And possibly a bit more mature and stable... One strong point in favour of Django: it follows Python's philosophy of batteries included,

Re: pyserial ser.write('string') TypeError in OS X

2009-10-20 Thread Gabriel Genellina
En Tue, 20 Oct 2009 18:02:03 -0300, Rodrigo rodrigos...@gmail.com escribió: Maybe this is not a bug at all, but i have installed python2.5. 3.01 and 3.1.1. In python 2.5 ser. write('this is a string') works just fine. On the other hand, with 3.01 and 3.1.1 (pyserial 2.5 rc1) when i do a

Re: Separate namespace from file hierarchy?

2009-10-20 Thread Steven D'Aprano
On Tue, 20 Oct 2009 08:51:44 -0500, Peng Yu wrote: Suppose I have the dirname/both.py, which has the definitions of classes A and B. I can use this module in the following code. # import dirname.both a=dirname.both.A() b=dirname.both.B() Have you tried this, or are you

Struct on on x86_64 mac os x

2009-10-20 Thread Tommy Grav
I have created a binary file that saves this struct from some C code: struct recOneData { char label[3][84]; char constName[400][6]; double timeData[3]; long int numConst; double AU; double EMRAT; long int coeffPtr[12][3]; long int DENUM;

CAD - FEM | writing FEM meshes in abacus format || pythonOCC

2009-10-20 Thread jelle feringa
Hi, I'm wondering whether someone has experience / code / pointers on how to write FEM meshes to Abacus ( Simulia, whatever ). We're making good progress at the pythonOCC(.org) project in coupling CAD FEM and a next step would be to plug the generates meshes into a major FEM solver such as

Inconsistent raw_input behavior after Ctrl-C

2009-10-20 Thread Maxim Khitrov
Hello all, I ran into a rather strange problem when interrupting a raw_input call with Ctrl-C. This is with python 2.6.3 on Windows 7. When the call is interrupted, one of two things happen - either a KeyboardInterrupt exception is raised or raw_input raises EOFError, and KeyboardInterrupt is

Re: Spam reported

2009-10-20 Thread Ben Finney
Grant Edwards inva...@invalid.invalid writes: On 2009-10-20, Peter Pearson ppear...@nowhere.invalid wrote: Reported to Google's groups-abuse. What are these postings supposed to mean? That the posting which started the thread (which you may or may not have seen, so it's good that Peter

Re: Why does passing tuple as arg WITHOUT scattering work?

2009-10-20 Thread Rhodri James
On Tue, 20 Oct 2009 22:42:07 +0100, Alf P. Steinbach al...@start.no wrote: [snip] canvas.create_oval( bbox, fill = PeachPuff ) [snip] It worked nicely, and I thought this code was fairly perfect until I started studying the language reference. It seems that formally correct code

Re: unittest wart/bug for assertNotEqual

2009-10-20 Thread Steven D'Aprano
On Tue, 20 Oct 2009 14:45:49 -0700, Zac Burns wrote: My preference would be that failIfEqual checks both != and ==. This is practical, and would benefit almost all use cases. If != isn't not == (IEEE NaNs I hear is the only known use case) numpy uses == and != as element-wise operators:

Re: PySide PyQt

2009-10-20 Thread Robert Kern
On 2009-10-20 16:48 PM, rm wrote: Have you guys heard about PySide: http://www.pyside.org/ It is basically the same as PyQt (Qt bindings for Python), but licensed with the LGPL instead of GPL. The FAQ explains a bit more history. Looks like the end for PyQt if you ask me. Welcome to two

Regex

2009-10-20 Thread Someone Something
I'm trying to write a program that needs reg expressions in the following way. If the user types in *something* that means that the asterixes can be replaced by any string of letters. I haven't been able to find any reg expression tutorials that I can understand. Help? --

Re: a splitting headache

2009-10-20 Thread Mensanator
On Oct 20, 1:51 pm, David C Ullrich dullr...@sprynet.com wrote: On Thu, 15 Oct 2009 18:18:09 -0700, Mensanator wrote: All I wanted to do is split a binary number into two lists, a list of blocks of consecutive ones and another list of blocks of consecutive zeroes. But no, you can't do

Re: Why does passing tuple as arg WITHOUT scattering work?

2009-10-20 Thread MRAB
Alf P. Steinbach wrote: Hi all. I'm just learning Python from scratch, on my own. Apologies if this question is too newbie... Or perhaps answered in some FAQ (where?). Here's my original code for simple starter program, using the ActivePython implementation in Windows XP Prof, Python

Re: Why does passing tuple as arg WITHOUT scattering work?

2009-10-20 Thread Alf P. Steinbach
* Rhodri James: On Tue, 20 Oct 2009 22:42:07 +0100, Alf P. Steinbach al...@start.no wrote: [snip] canvas.create_oval( bbox, fill = PeachPuff ) [snip] It worked nicely, and I thought this code was fairly perfect until I started studying the language reference. It seems that formally

Re: Checking a Number for Palindromic Behavior

2009-10-20 Thread rurpy
On 10/20/2009 03:16 PM, Steven D'Aprano wrote: On Tue, 20 Oct 2009 10:18:55 -0700, rurpy wrote: 6) Please don't apply your abstract moral standards to the entire rest of the world, knowing nothing about the particular circumstances of the poster. Perhaps you should apply this rule to

Re: unittest wart/bug for assertNotEqual

2009-10-20 Thread Ethan Furman
Steven D'Aprano wrote: On Tue, 20 Oct 2009 14:45:49 -0700, Zac Burns wrote: My preference would be that failIfEqual checks both != and ==. This is practical, and would benefit almost all use cases. If != isn't not == (IEEE NaNs I hear is the only known use case) numpy uses == and != as

Re: Frameworks

2009-10-20 Thread Massimo Di Pierro
On Oct 20, 2009, at 4:59 PM, Emmanuel Surleau wrote: Compared to custom tags in, say, Mako? Having to implement a mini- parser for each single tag when you can write a stupid Python function is needless complication. I like Mako a lot and in fact web2py template took some inspiration

Re: Anyone have python 3.1.1 installed on Solaris 10 ? (sparc or x86)

2009-10-20 Thread Antoine Pitrou
Hello, Anyone have python 3.1.1 installed on Solaris 10 ? (sparc or x86) I've tried several times on sparc, I keep getting: [snip] If you don't get an answer on this list, I encourage you to file an issue on http://bugs.python.org Thank you Antoine. --

Re: Regex

2009-10-20 Thread Chris Rebert
On Tue, Oct 20, 2009 at 3:16 PM, Someone Something fordhai...@gmail.com wrote: I'm trying to write a program that needs reg expressions in the following way. If the user types in *something* that means that the asterixes can be replaced by any string of letters. I haven't been able to find any

Re: Inconsistent raw_input behavior after Ctrl-C

2009-10-20 Thread Maxim Khitrov
On Tue, Oct 20, 2009 at 6:09 PM, Maxim Khitrov mkhit...@gmail.com wrote: Hello all, I ran into a rather strange problem when interrupting a raw_input call with Ctrl-C. This is with python 2.6.3 on Windows 7. When the call is interrupted, one of two things happen - either a KeyboardInterrupt

Re: Why does passing tuple as arg WITHOUT scattering work?

2009-10-20 Thread Gabriel Genellina
En Tue, 20 Oct 2009 18:42:07 -0300, Alf P. Steinbach al...@start.no escribió: I'm just learning Python from scratch, on my own. Apologies if this question is too newbie... Or perhaps answered in some FAQ (where?). Welcome! I hope you'll enjoy the language. And no, it's not a trivial

odd mmap behavior

2009-10-20 Thread Brett
I'm trying to read and write from /dev/mem on a linux system using the mmap module. When I run this minimal example: --- import os, mmap MAP_MASK = mmap.PAGESIZE - 1 addr = 0x48088024 f = os.open(/dev/mem, os.O_RDWR | os.O_SYNC) m = mmap.mmap(f, mmap.PAGESIZE,

  1   2   >