Re: how to knock a page out of file cache

2009-10-20 Thread Paul Rubin
birdsong writes: > Does anybody know of a system call that will 'knock' the file out of > file cache? Can madvise or fadvise do this? I don't think so. Best I can think of is unmount and remount the file system. And I don't know if even that is guaranteed if you don't physically remove/unplug

mysql select some sort of caching

2009-10-20 Thread Threader Slash
-- Forwarded message -- From: David Sfiligoi To: python-list@python.org Date: Tue, 20 Oct 2009 21:41:10 -0500 Subject: mysql select some sort of caching Hi I am normally an SQLlite person because it just works... but I decided to keep inproving my skills set and do my new project u

win32com lotus notes: not opened

2009-10-20 Thread Threader Slash
Hi Everybody, Hope someone can point me some direction... I got python linking to lotus notes, under Eclipse IDE. The code is: import pythoncom import pywintypes from win32com.client import Dispatch session=Dispatch("Lotus.NotesSession") session print pythoncom.CreateGuid() try: session.In

Re: a simple unicode question

2009-10-20 Thread Mark Tolonen
"George Trojan" wrote in message news:hbktk6$8b...@news.nems.noaa.gov... 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}') d

Re: help to convert c++ fonction in python

2009-10-20 Thread Paul Rudin
Gary Herron writes: > geremy condra wrote: >> And always apply ROT13 twice for extra security. >> > +1 for "quote of the week" Even if it's at least 30 years old :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Frameworks

2009-10-20 Thread Emmanuel Surleau
> 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

how to knock a page out of file cache

2009-10-20 Thread birdsong
Can anyone recommend a way to read a file ensuring that it is not coming from file cache on Linux? I'm trying to write a metric script for measuring http connect + read times from a web server over localhost. I want to plot both file cache read times and non-cached files. I thought of simply ope

Re: The rap against "while True:" loops

2009-10-20 Thread Lawrence D'Oliveiro
In message , kj wrote: > I use "while True"-loops often, and intend to continue doing this > "while True" ... My practice with regard to loops is to use constructs such as "while (condition) { ... }" and "do ... while (condition)" where "condition" is the ONLY terminating condition (i.e. no "br

Re: a simple unicode question

2009-10-20 Thread Martin v. Löwis
> Where are the literals (i.e. u'\N{DEGREE SIGN}') defined? I found > http://www.unicode.org/Public/5.1.0/ucd/UnicodeData.txt > Is that the place to look? Correct - you are supposed to fill in a Unicode character name into the \N escape. The specific list of names depends on the version of the UCD

Re: a simple unicode question

2009-10-20 Thread Nobody
On Tue, 20 Oct 2009 17:56:21 +, George Trojan wrote: > 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

Re: Poll on Eval in Python

2009-10-20 Thread Nobody
On Tue, 20 Oct 2009 11:08:00 -0700, TerryP wrote: > On Oct 20, 4:30 pm, Nobody 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. >>

Re: Unicode again ... default codec ...

2009-10-20 Thread Gabriel Genellina
En Tue, 20 Oct 2009 17:13:52 -0300, Stef Mientki escribió: 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 wxPython, which forces unicode - writing to Excel and oth

Re: InteractiveConsole executed in another thread.

2009-10-20 Thread Gabriel Genellina
En Tue, 20 Oct 2009 07:02:29 -0300, Germán Diago escribió: 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 com

Re: mysql select some sort of caching

2009-10-20 Thread Gabriel Genellina
En Tue, 20 Oct 2009 23:41:10 -0300, David Sfiligoi escribió: whatever prior date I put in the table's last task date colum somehow they are not seen by the SELECT query sqlcur.execute("SELECT `url`d` from `url_snapshot` WHERE `url` = %s and `lastsnapshotdate` < %s",(url,currentdate)) that que

Re: mysql select some sort of caching

2009-10-20 Thread Stephen Hansen
On Tue, Oct 20, 2009 at 7:41 PM, David Sfiligoi wrote: > So normally I would open a connection and instentiate a cursor for my > queries once at a global level(like find out if the current date is > > than the last task date). Then go in an infinite loop that wait for data > to arrive in the queu

Re: Struct on on x86_64 mac os x

2009-10-20 Thread Gabriel Genellina
En Tue, 20 Oct 2009 18:51:21 -0300, Tommy Grav escribió: 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;

Re: [ANN] "Python for Bioinformatics" available and in stock

2009-10-20 Thread Sebastian Bassi
On Mon, Oct 19, 2009 at 5:53 AM, Piter_ wrote: > Great. > I've been waiting it. > Any place in Europe to get it? Go here: http://www.crcpress.com/product/isbn/9781584889298 And then look at the bottom of the page and choose your country, I know they have offices in London. > P.S. Is anyone writi

Re: "Python for Bioinformatics" available and in stock

2009-10-20 Thread Sebastian Bassi
On Mon, Oct 19, 2009 at 5:43 AM, Bearophile wrote: > A more pythonic code is: ... > Note the use of xrange and names_with_underscores. In Python names are > usually lower case and their parts are separated by underscores. Regarding underscore (and code notation in general) I wrote in the book (pa

Re: Inconsistent raw_input behavior after Ctrl-C

2009-10-20 Thread Gabriel Genellina
En Tue, 20 Oct 2009 19:09:00 -0300, Maxim Khitrov escribió: 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 ra

mysql select some sort of caching

2009-10-20 Thread David Sfiligoi
Hi I am normally an SQLlite person because it just works... but I decided to keep inproving my skills set and do my new project using a MySQL database backend because of the architecture decision I made(horizontal scalable system via message queues). The project is architected around a rabbitmq

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

2009-10-20 Thread ryles
On Oct 19, 1:00 pm, Dave Crouse wrote: > Anyone have python 3.1.1 installed on Solaris 10 ? (sparc or x86) > > I've tried several times  on sparc, I keep getting: > > gcc -lintl -o python \ > Modules/python.o \ > libpython3.1.a -lsocket -lnsl -lintl -lrt -ldl -lm > Undefined first referenced > sym

Re: Simple audio

2009-10-20 Thread Simon Forman
On Tue, Oct 20, 2009 at 4:04 PM, Peter Chant wrote: > 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

Re: PySide > PyQt

2009-10-20 Thread rm
On Oct 20, 6:14 pm, Robert Kern wrote: > 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.  

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

2009-10-20 Thread Ethan Furman
MRAB wrote: 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,

Re: The rap against "while True:" loops

2009-10-20 Thread Tim Rowe
2009/10/20 Hendrik van Rooyen : > So if you want to sum stuff where there are a lot of keys, but only a few > values per key - say between one and ten, then it would be faster to look > before you leap. > > On the other hand, if there are relatively few keys and tens or hundreds of > values per ke

Re: Regex

2009-10-20 Thread Chris Rebert
> On Tue, Oct 20, 2009 at 8:06 PM, Steven D'Aprano > wrote: >> On Tue, 20 Oct 2009 16:20:14 -0700, Chris Rebert wrote: >> > On Tue, Oct 20, 2009 at 3:16 PM, Someone Something >> > wrote: >> >> I'm trying to write a program that needs reg expressions in the >> >> following way. If the user types i

Re: Regex

2009-10-20 Thread Chris Rebert
On Tue, Oct 20, 2009 at 5:06 PM, Steven D'Aprano wrote: > On Tue, 20 Oct 2009 16:20:14 -0700, Chris Rebert wrote: >> On Tue, Oct 20, 2009 at 3:16 PM, Someone Something >> wrote: >>> I'm trying to write a program that needs reg expressions in the >>> following way. If the user types in "*something

Re: Regex

2009-10-20 Thread Someone Something
how can I implement this in python? On Tue, Oct 20, 2009 at 8:06 PM, Steven D'Aprano < ste...@remove.this.cybersource.com.au> wrote: > On Tue, 20 Oct 2009 16:20:14 -0700, Chris Rebert wrote: > > > On Tue, Oct 20, 2009 at 3:16 PM, Someone Something > > wrote: > >> I'm trying to write a program th

Re: Regex

2009-10-20 Thread Steven D'Aprano
On Tue, 20 Oct 2009 16:20:14 -0700, Chris Rebert wrote: > On Tue, Oct 20, 2009 at 3:16 PM, Someone Something > 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 str

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, mmap.

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 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 question. import

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 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 > exception is

Re: Regex

2009-10-20 Thread Chris Rebert
On Tue, Oct 20, 2009 at 3:16 PM, Someone Something 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 reg > expression

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. -- http://mail.python.org/mailman

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 from

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

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

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 version

Re: a splitting headache

2009-10-20 Thread Mensanator
On Oct 20, 1:51 pm, David C Ullrich 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 that. > > >>>

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? -- http://mail.python.org/

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 mon

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: 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 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 should apply the s

Re: Spam reported

2009-10-20 Thread Ben Finney
Grant Edwards writes: > On 2009-10-20, Peter Pearson 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 isn't quoting the original spam) has been rep

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 rais

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 abaq

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;

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

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 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 ser.write('this is a string

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 > > "batte

Re: Spam reported

2009-10-20 Thread Ned Deily
In article , Grant Edwards wrote: > On 2009-10-20, Peter Pearson 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 through several channels (e.g. Usenet, python.org mailing list, gmane.o

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

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

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

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 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 to write the

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

2009-10-20 Thread Diez B. Roggisch
Rodrigo schrieb: 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 se

Re: unittest wart/bug for assertNotEqual

2009-10-20 Thread Steven D'Aprano
On Tue, 20 Oct 2009 10:20:54 -0700, Zac Burns wrote: > 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 The

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

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 = s

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 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 converted to Python.

Re: A stupid newbie question about output...

2009-10-20 Thread J
On Tue, Oct 20, 2009 at 16:25, Aahz wrote: > In article , > J   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 fairly >>simple stuf

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: help to convert c++ fonction in python

2009-10-20 Thread Aahz
In article , Mel wrote: >Aahz wrote: >> In article , >> geremy condra 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. s/flaunt/flout/ HTH, HAND ;-) -- Aahz (a...@pytho

Re: A stupid newbie question about output...

2009-10-20 Thread Aahz
In article , J 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 fairly >simple stuff (this was about 9 years ago)... so I'm relearning b

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 > wrote: Nathaniel Hayes wrote: On Tue, Oct 20, 2009 at 12:12 PM, MRAB mailto:pyt...@mrabarnett.plus.com>

Re: help to convert c++ fonction in python

2009-10-20 Thread geremy condra
On Tue, Oct 20, 2009 at 3:54 PM, Aahz wrote: > In article , > geremy condra   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/ Sorry, couldn't read it thro

Re: help to convert c++ fonction in python

2009-10-20 Thread Mel
Aahz wrote: > In article , > geremy condra 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. -- http://mail.python.org/mailman/listinfo/python-list

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

Re: help to convert c++ fonction in python

2009-10-20 Thread Aahz
In article , geremy condra 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 Groucho Marx Fan Club -- http://mail.python.org/mailman/listinfo/pyth

Re: File not closed on exception

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

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 escribió: On 20 Okt, 09:40, "Gabriel Genellina" wrote: En Tue, 20 Oct 2009 03:23:49 -0300, arve.knud...@gmail.com escribió: > I agree, but like I said, I've been told that this (implicit closing > of files) is the correct style b

Re: ftplib connection fails with multiple nics

2009-10-20 Thread Sean DiZazzo
On Oct 19, 10:23 pm, Tim Roberts wrote: > Sean DiZazzo 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 "ftp.pyo", line 70, in conn

Re: A stupid newbie question about output...

2009-10-20 Thread J
On Tue, Oct 20, 2009 at 14:53, Ethan Furman 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 is, I'll go

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

Re: A stupid newbie question about output...

2009-10-20 Thread nn
On Oct 20, 2:23 pm, 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.ServicePackMajorVe

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 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: File not closed on exception

2009-10-20 Thread arve.knud...@gmail.com
On 20 Okt, 16:00, Bruno Desthuilliers 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 : explicitely releasing resources such as

Re: unittest wart/bug for assertNotEqual

2009-10-20 Thread Mark Dickinson
On Oct 20, 6:20 pm, Zac Burns 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): http://svn.python.org/view?view=rev&revisi

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 s

Re: ftplib connection fails with multiple nics

2009-10-20 Thread Sean DiZazzo
On Oct 19, 10:23 pm, Tim Roberts wrote: > Sean DiZazzo 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 "ftp.pyo", line 70, in conn

Re: Poll on Eval in Python

2009-10-20 Thread TerryP
On Oct 20, 4:30 pm, Nobody 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 prohibited by

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 > 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' It looks like t

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 Is

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

2009-10-20 Thread Grant Edwards
On 2009-10-20, Peter Pearson 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!! visi.c

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. Th

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 http://groups.google.com/group/comp.lang.python/browse_frm/thread/f7a8

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

Spam reported

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

Re: Poll on Eval in Python

2009-10-20 Thread Nobody
On Wed, 14 Oct 2009 23:48:11 +0200, Kazimir Majorinc wrote: >> (note: exec in python is more in spirit of eval then C-style exec >> functions) > > I thought about that, but decided not to ask about it > in poll, because I wanted to compare opinions on eval > specifically, not on all similar featu

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 considera

Re: re.sub question (regular expressions)

2009-10-20 Thread Chris Seberino
On Oct 16, 9:51 am, MRAB wrote: > What do you mean "blow up"? It worked for me in Python v2.6.2. My bad. False alarm. This was one of those cases where a bug in another area appears like a bug in a different area. Thank for the help. cs -- http://mail.python.org/mailman/listinfo/python-list

Re: Checking a Number for Palindromic Behavior

2009-10-20 Thread Ethan Furman
Steven D'Aprano wrote: 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 wi

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 already

  1   2   >