Re: Attack a sacred Python Cow

2008-07-23 Thread pluskid
On Jul 24, 1:41 pm, Jordan <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I'm a big Python fan who used to be involved semi regularly in > comp.lang.python (lots of lurking, occasional posting) but kind of > trailed off a bit. I just wrote a frustration inspired rant on my > blog, and I thought it w

Re: Parsing VHDL with python, where to start.

2008-07-23 Thread Svenn Are Bjerkem
On Jul 23, 1:03 pm, [EMAIL PROTECTED] (c d saunter) wrote: > How much of VHDL are you looking to parse? Are you just looking at files > intended for synthesis, or at simulation/testbench files as well? As a start I want to parse VHDL which is going to be synthesised, and I am limiting myself to t

Re: Doubt

2008-07-23 Thread ജഗന്നാഥ്
On Jul 24, 1:13 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > ജഗന്നാഥ് wrote: > > I am a Perl programmer new to Python. I have a small doubt. > > I suspect you mean "question", not "doubt". It's not quite the same thing. > > > How to convert the perl notation > > $a = ""; expression in Python ? >

Re: Attack a sacred Python Cow

2008-07-23 Thread Jordan
On Jul 24, 3:41 pm, Jordan <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I'm a big Python fan who used to be involved semi regularly in > comp.lang.python (lots of lurking, occasional posting) but kind of > trailed off a bit. I just wrote a frustration inspired rant on my > blog, and I thought it w

Attack a sacred Python Cow

2008-07-23 Thread Jordan
Hi everyone, I'm a big Python fan who used to be involved semi regularly in comp.lang.python (lots of lurking, occasional posting) but kind of trailed off a bit. I just wrote a frustration inspired rant on my blog, and I thought it was relevant enough as a wider issue to the Python community to po

Re: Undocumented Python 2.6 change: Py_None vs NULL when C implementation raises exception

2008-07-23 Thread Heikki Toivonen
Martin v. Löwis wrote: > Heikki Toivonen wrote: >> I tracked this down to the C code incorrectly returning Py_None when it >> should have returned NULL. Changing the C code to return NULL made it >> behave correctly in 2.6. > > Can you please be specific what function you are talking about? Perha

Re: PyOpenGL Tutorial?

2008-07-23 Thread arsyed
On Wed, Jul 23, 2008 at 4:07 PM, Clay Hobbs <[EMAIL PROTECTED]> wrote: > I need a tutorial for PyOpenGL (specifically, to be used with wxPython). > I searched with Google and didn't find one. Does anybody know where one > is? > > -- Ratfink > > -- > http://mail.python.org/mailman/listinfo/python-l

Re: tkinter for my python program !!

2008-07-23 Thread karthikbalaguru
On Jul 23, 11:38 pm, David <[EMAIL PROTECTED]> wrote: > > Further, finally when i invoke the python program by > > giving the necessary input file, i get the following > > errors . > > Does it have any relation with the python version installed ? > > yes > > > I am using Redhat 9.0 > > You may want

Re: interpreter vs. compiled

2008-07-23 Thread castironpi
On Jul 23, 12:08 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > >> Oh.  How is the stack represented? > > > As usual, as successive locations in memory. > > I have the impression that CPython uses the same stack C does. > > Actually, it doesn't (at least not for the evaluation stack). > > In CP

Re: problem doing unpickle in an exec statement

2008-07-23 Thread castironpi
On Jul 23, 6:01 pm, Danny Shevitz <[EMAIL PROTECTED]> wrote: > Howdy, > > In my app I need to exec user text that defines a function. I want this > function to unpickle an object. Pickle breaks because it is looking for > the object definition that isn't in the calling namespace. > > I have mocked

Re: Autocompletion and Interactive Tables in a Python IDE

2008-07-23 Thread s0suk3
On Jul 23, 4:28 pm, Anthony <[EMAIL PROTECTED]> wrote: > Hi, I'm a FoxPro programmer, but I want to learn python before it's > too late. I do a lot of statistical programming, so I import SPSS > into python. In my opinion, the best features of Visual FoxPro 9.0 > were: > a) Intellisense (tells yo

Re: Broken examples

2008-07-23 Thread Terry Reedy
norseman wrote: I'm only talking about IPC related. I have googled, yahooed, and so forth for several months now. ALL examples I've come across have failed including those pertinent in the Python doc area. Outline: cd somedir ls -1 *.xls >thislist #ls hyphen one python pro

Recursion Performance Question

2008-07-23 Thread B
Hey I found some (VERY) old C++ code of mine that recursively built a tree of the desktop window handles (on windows) using: (they are stored in an STL vector) void FWL(HWND hwnd, int nFlag) // Recursive Function { hwnd = GetWindow(hwnd, nFlag); if(hwnd == NULL)

Re: os.walk question

2008-07-23 Thread B
Lanny wrote: How would one make a list of the files in the top directory using os.walk. I need to pick a random file from said list. Thanks. -- Posted on news://freenews.netfront.net - Complaints to [EMAIL PROTECTED] -- how about: import os x = os.walk('/') (root,dirs,files) = x.next

Re: fill in 3D array

2008-07-23 Thread Robert Kern
[EMAIL PROTECTED] wrote: On Jul 23, 9:18 pm, Robert Kern <[EMAIL PROTECTED]> wrote: [EMAIL PROTECTED] wrote: Hi, I am a python newbie, trying to convert my IDL scripts to python. I am kind of stuck at the moment. I am reading in a 1-D data file with 2000 data points. I need to put them in a 3-D

Broken examples

2008-07-23 Thread norseman
I'm only talking about IPC related. I have googled, yahooed, and so forth for several months now. ALL examples I've come across have failed including those pertinent in the Python doc area. Outline: cd somedir ls -1 *.xls >thislist #ls hyphen one python process.py

Re: fill in 3D array

2008-07-23 Thread knielsen73
On Jul 23, 9:18 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi, > > > I am a python newbie, trying to convert my IDL scripts to python. I am > > kind of stuck at the moment. I am reading in a 1-D data file with 2000 > > data points. I need to put them in a 3-D array wi

Re: Request Help Debugging Program

2008-07-23 Thread Samir
On Jul 23, 9:14 pm, mzdude <[EMAIL PROTECTED]> wrote: > On Jul 23, 6:30 pm, Samir <[EMAIL PROTECTED]> wrote: > > > Hi Everyone, > > > def findSumOfDivisor(n): > > >     return sum(divisor)                # fine using function sum() > > >         sum = findSumOfDivisor(i)      # then find the sum o

Re: fill in 3D array

2008-07-23 Thread Robert Kern
[EMAIL PROTECTED] wrote: Hi, I am a python newbie, trying to convert my IDL scripts to python. I am kind of stuck at the moment. I am reading in a 1-D data file with 2000 data points. I need to put them in a 3-D array with size [10,10,20]. I have defined the field array as arr = zeros((10,10,20)

Re: Request Help Debugging Program

2008-07-23 Thread mzdude
On Jul 23, 6:30 pm, Samir <[EMAIL PROTECTED]> wrote: > Hi Everyone, > > > def findSumOfDivisor(n): >     return sum(divisor)                # fine using function sum() > >         sum = findSumOfDivisor(i)      # then find the sum of its divisors oops redefine what sum is. >>> x = [1,2] >>> sum

fill in 3D array

2008-07-23 Thread knielsen73
Hi, I am a python newbie, trying to convert my IDL scripts to python. I am kind of stuck at the moment. I am reading in a 1-D data file with 2000 data points. I need to put them in a 3-D array with size [10,10,20]. I have defined the field array as arr = zeros((10,10,20)) but don't know how to rea

Re: Proper way to query user and group database on a Unix host?

2008-07-23 Thread Mike MacCana
On Wed, 2008-07-23 at 09:13 +0200, Fredrik Lundh wrote: > http://mail.python.org/mailman/listinfo/python-list Thanks - in the midst of trying to filter out search results for every damn python 'user group' 'yahoo group' 'interest group' etc, I seem to have missed this. Thanks to the other pos

Re: Run as Service

2008-07-23 Thread misceverything
Jay/Larry - Thanks for the suggestions! -- http://mail.python.org/mailman/listinfo/python-list

Re: Web Server

2008-07-23 Thread misceverything
Thanks, guys..I think I am going to go the route Fredrik suggested. Thanks for all your help! -- http://mail.python.org/mailman/listinfo/python-list

Re: fromfile error on windows, not mac

2008-07-23 Thread jadamwil
On Jul 23, 3:30 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Manu Hack wrote: > > by the way, anyone could explain why changing to single quote makes a > > difference? > > >  >>> "rb" == 'rb' > > True > > There's no difference between single quotes and double quotes in Python. >     My guess is c

Re: Is this a valid use of 'import'?

2008-07-23 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Frank Millman wrote: > from Utils.client import * Besides the objections that others have mentioned, I HATE seeing wildcard imports. -- http://mail.python.org/mailman/listinfo/python-list

problem doing unpickle in an exec statement

2008-07-23 Thread Danny Shevitz
Howdy, In my app I need to exec user text that defines a function. I want this function to unpickle an object. Pickle breaks because it is looking for the object definition that isn't in the calling namespace. I have mocked up a simple example that shows the problem. Run this first code (from

Re: Request Help Debugging Program

2008-07-23 Thread Niklas Norrthon
On 24 Juli, 00:30, Samir <[EMAIL PROTECTED]> wrote: > from math import sqrt > > def findSumOfDivisor(n): [...] >     return sum(divisor)                # return the sum of the > divisors > for i in range(2,10):                  # loop through integers 2 > through 9 [...] >         sum = findSumOfD

Re: Undocumented Python 2.6 change: Py_None vs NULL when C implementation raises exception

2008-07-23 Thread Martin v. Löwis
Heikki Toivonen wrote: > I was debugging M2Crypto function written in C which changed behavior > between Python 2.6 and earlier Python versions. In an error condition > the function was supposed to raise exception type A, but with 2.6 it > raised type B, and further, there was no string value for t

Request Help Debugging Program

2008-07-23 Thread Samir
Hi Everyone, In order to get a better command of Python, I have been trying to solve the puzzles on the Project Euler web site. I've made my way down to problem 21: http://projecteuler.net/index.php?section=problems&id=21 I've created a function (findSumOfDivisor), that when passed an integer, w

Re: Segv in mmap.move()

2008-07-23 Thread Terry Reedy
[EMAIL PROTECTED] wrote: Does anyone recognize this little Python crasher? I'll file a bug report unless someone notices it as an already documented bug. I found some open mmap bugs, but it wasn't obvious to me that this problem was one of those... Python 2.5.2 (r252:60911, Apr 21 2008, 11:12

Re: software engineering foundations?

2008-07-23 Thread Aahz
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: > >There are software construction skills which are entirely distinct from the >language in which you are programming. We can tout object-oriented, >structured programming, test-driven development or other software >engineering techniques

Importing different versions of a module

2008-07-23 Thread mercado mercado
Thank you Fredrik. This is exactly what I was looking for. > cannot you just insert the appropriate directory in sys.path the first > thing you do in the scripts? e.g. > > import os, sys > > lib = "lib_dev" # change this for prod/rss.py > > sys.path.insert(0, > os.path.j

Autocompletion and Interactive Tables in a Python IDE

2008-07-23 Thread Anthony
Hi, I'm a FoxPro programmer, but I want to learn python before it's too late. I do a lot of statistical programming, so I import SPSS into python. In my opinion, the best features of Visual FoxPro 9.0 were: a) Intellisense (tells you what classes/methods are available and what variables go into a

Re: Using variables across modules

2008-07-23 Thread Aaron Scott
> first read this to learn how objects and variables work in Python: > >      http://effbot.org/zone/python-objects.htm > > and then read this to learn how from-import works, and when you're > supposed to use it: > >      http://effbot.org/zone/import-confusion.htm > > hope this helps! > Awesome.

Re: Taking the floating point distances and plotting histogram

2008-07-23 Thread Fredrik Lundh
aditya shukla wrote: I have a program whose output is stored in a text file , say test.txt eg. 0\9\10\11|0.50|c:\windows\apppatch/AcLayers.dll 0\9\10\11|0.50|c:\windows\apppatch/AcRedir.dll 0\9\10|0.66|c:\windows\apppatch/AcSpecfc.dll 0\9|0.83|c:\windows\apppatch/iebrshim.dll After reading this

Re:Taking the floating point distances and plotting histogram

2008-07-23 Thread aditya shukla
Hello folks:- I have a program whose output is stored in a text file , say test.txt eg. 0\9\10\11|0.50|c:\windows\apppatch/AcLayers.dll 0\9\10\11|0.50|c:\windows\apppatch/AcRedir.dll 0\9\10|0.66|c:\windows\apppatch/AcSpecfc.dll 0\9|0.83|c:\windows\apppatch/iebrshim.dll After reading this text fil

Re: Raw Strings (I Think)

2008-07-23 Thread Lanny
> my guess is that the real problem is that you get back filenames with > spaces in them, which gets treated as multiple arguments by os.system. > > using os.startfile will fix this: > > >>> import glob, os, random > >>> file = random.choice(glob.glob("\\music\\*.mp3")) > >>> file > '\\music\\Madr

Re: Raw Strings (I Think)

2008-07-23 Thread Carsten Haese
Lanny wrote: No, it doesn't. Instead of guessing what the cause might be, please show us your code and show us the error message you're getting, so that we can determine what the cause really is. Ok, sorry. Heres my code: > [...] And the error message you're getting is...? -- Carsten Haese

Re: Raw Strings (I Think)

2008-07-23 Thread Fredrik Lundh
Lanny wrote: No, it doesn't. Instead of guessing what the cause might be, please show us your code and show us the error message you're getting, so that we can determine what the cause really is. Ok, sorry. Heres my code: import glob import random import os songs = glob.glob('C:\###\###\###

Re: fromfile error on windows, not mac

2008-07-23 Thread Fredrik Lundh
Manu Hack wrote: by the way, anyone could explain why changing to single quote makes a difference? >>> "rb" == 'rb' True There's no difference between single quotes and double quotes in Python. My guess is cargo cult debugging. -- http://mail.python.org/mailman/listinfo/python-list

Re: Raw Strings (I Think)

2008-07-23 Thread Lanny
> No, it doesn't. Instead of guessing what the cause might be, please show > us your code and show us the error message you're getting, so that we can > determine what the cause really is. Ok, sorry. Heres my code: import glob import random import os songs = glob.glob('C:\###\###\###\*.mp3') p

Re: Raw Strings (I Think)

2008-07-23 Thread Fredrik Lundh
Lanny wrote: I've used glob.glob to get a list of files in a directory and now I want to use os.system to execute one of those files, the problem is that python automatically puts a escape charater infront of the back slashes so the os.system gets X:\\\\\\ and is useless, No, it doesn'

Re: tkinter for my python program !!

2008-07-23 Thread Jason Scheirer
On Jul 23, 11:38 am, David <[EMAIL PROTECTED]> wrote: > > Further, finally when i invoke the python program by > > giving the necessary input file, i get the following > > errors . > > Does it have any relation with the python version installed ? > > yes > > > I am using Redhat 9.0 > > You may want

Re: concatenate the elements in each list of a list of lists

2008-07-23 Thread Niklas Norrthon
On 23 Juli, 17:33, antar2 <[EMAIL PROTECTED]> wrote: > I already asked a similar question, but encounter problems with > python... > How can I concatenate the elements in each list of a list of lists > > list_of_listsA = > > [['klas*', '*', '*'], > ['mooi*', '*', '*', '*'], > ['arm*', '*', '*(haar)

Re: interpreter vs. compiled

2008-07-23 Thread Fredrik Lundh
castironpi wrote: Compiling a program is different than running it. A JIT compiler is a kind of compiler and it makes a compilation step. I am saying that Python is not a compiler and in order to implement JIT, it would have to change that fact. good thing Python don't have to listen to you,

Re: need thumbnail from video

2008-07-23 Thread Mike Driscoll
On Jul 22, 8:54 am, John Fabiani <[EMAIL PROTECTED]> wrote: > Hi, > I need a py tool that will provide a thumbnail (bmp?) from a video (avi, > wmv) that will be cross platform (linux, windows).  Research has provided > pymedia for Linux but I haven't found anything for windows.  Hopefully, > someon

Re: Raw Strings (I Think)

2008-07-23 Thread Carsten Haese
Lanny wrote: I've used glob.glob to get a list of files in a directory and now I want to use os.system to execute one of those files, the problem is that python automatically puts a escape charater infront of the back slashes No, it doesn't. Instead of guessing what the cause might be, please s

Re: Doubt

2008-07-23 Thread Fredrik Lundh
ജഗന്നാഥ് wrote: I am a Perl programmer new to Python. I have a small doubt. I suspect you mean "question", not "doubt". It's not quite the same thing. How to convert the perl notation $a = ""; expression in Python ? How to represent the loop for ($a = $b; $a<=$c;$a++){ } in Python Start

Re: Raw Strings (I Think)

2008-07-23 Thread Mike Driscoll
On Jul 24, 10:02 am, "Lanny" <[EMAIL PROTECTED]> wrote: > I've used glob.glob to get a list of files in a directory > and now I want to use os.system to execute one of > those files, the problem is that python automatically > puts a escape charater infront of the back slashes > so the os.system get

Re: repr(string)

2008-07-23 Thread Fredrik Lundh
David C. Ullrich wrote: I've been saving data in a file with one line per field. Now some of the fields may become multi-line strings... I was about to start escaping and unescaping linefeeds by hand, when I realized that repr() and eval() should do. Hence the question: If s is a string, is rep

Re: fromfile error on windows, not mac

2008-07-23 Thread Manu Hack
On Wed, Jul 23, 2008 at 3:37 PM, jadamwil <[EMAIL PROTECTED]> wrote: > I found the problem: I thought it was opening in binary mode on BOTH > windows and the mac, but on windows I passed "rb" with double quotes, > not 'rb' with single quotes to the open file function. Changing it to > 'rb' fixed i

PyOpenGL Tutorial?

2008-07-23 Thread Clay Hobbs
I need a tutorial for PyOpenGL (specifically, to be used with wxPython). I searched with Google and didn't find one. Does anybody know where one is? -- Ratfink -- http://mail.python.org/mailman/listinfo/python-list

Raw Strings (I Think)

2008-07-23 Thread Lanny
I've used glob.glob to get a list of files in a directory and now I want to use os.system to execute one of those files, the problem is that python automatically puts a escape charater infront of the back slashes so the os.system gets X:\\\\\\ and is useless, I think I need to convert my st

Re: lxml, comparing nodes

2008-07-23 Thread Fredrik Lundh
code_berzerker wrote: Your requirements for a single Element are simple enough to write it in three to five lines of Python code (depending on your definition of equality). Checking this equality recursively is another two to three lines. Not complex enough to be considered a wheel in the first

Re: Doubt

2008-07-23 Thread Paddy
On Jul 23, 3:51 pm, ജഗന്നാഥ് <[EMAIL PROTECTED]> wrote: > Friends > > I am a Perl programmer new to Python. I have a small doubt. > How to convert the perl notation > $a = ""; expression in Python ? > > How to represent the loop > for ($a = $b; $a<=$c;$a++){ > > } in Python > > Jagan > Linguist Th

Re: Using variables across modules

2008-07-23 Thread Fredrik Lundh
Aaron Scott wrote: I'm having some trouble understanding how Python handles variables across multiple modules. I've dug through the documentation, but I still find myself at a loss. When you import a module, are you creating an instance of the variables within? For instance, if I have one file,

Re: Undocumented Python 2.6 change: Py_None vs NULL when C implementation raises exception

2008-07-23 Thread Fredrik Lundh
Heikki Toivonen wrote: I was debugging M2Crypto function written in C which changed behavior between Python 2.6 and earlier Python versions. In an error condition the function was supposed to raise exception type A, but with 2.6 it raised type B, and further, there was no string value for the ex

Re: fromfile error on windows, not mac

2008-07-23 Thread jadamwil
I found the problem: I thought it was opening in binary mode on BOTH windows and the mac, but on windows I passed "rb" with double quotes, not 'rb' with single quotes to the open file function. Changing it to 'rb' fixed it. On Jul 23, 8:25 am, Tommy Nordgren <[EMAIL PROTECTED]> wrote: > One questi

Re: Using variables across modules

2008-07-23 Thread Jerry Hill
On Wed, Jul 23, 2008 at 3:06 PM, Aaron Scott <[EMAIL PROTECTED]> wrote: > ... which is what I was expecting, but not what I want. Obviously, > each import is creating its own instance of the variable. What I need > is a way to change myvar from within "bar.py" so that PrintVar() > returns the new v

Re: Doubt

2008-07-23 Thread Sean DiZazzo
On Jul 23, 7:51 am, ജഗന്നാഥ് <[EMAIL PROTECTED]> wrote: > Friends > > I am a Perl programmer new to Python. I have a small doubt. > How to convert the perl notation > $a = ""; expression in Python ? > > How to represent the loop > for ($a = $b; $a<=$c;$a++){ > > } in Python > > Jagan > Linguist On

Re: Using variables across modules

2008-07-23 Thread Aaron Scott
> Just wirte test code ! variables.py: myvar = 5 print myvar foo.py: from variables import * def PrintVar(): print myvar bar.py: from variables import * from foo import * print myvar myvar = 2 print myvar PrintVar() "python bar.py"

Re: Using variables across modules

2008-07-23 Thread Uwe Schmitt
Aaron Scott schrieb: > I'm having some trouble understanding how Python handles variables > across multiple modules. I've dug through the documentation, but I > still find myself at a loss. > > When you import a module, are you creating an instance of the > variables within? For instance, if I ha

Inserting cookies into a web session

2008-07-23 Thread John Gordon
I'm developing a web application that needs a semi-persistent way to store information. I've looked at some options such as writing entries to a database table or creating small textfiles, but I'm not thrilled with anything I've come up with so far. Then a coworker suggested that I could just ins

Re: tkinter for my python program !!

2008-07-23 Thread David
Further, finally when i invoke the python program by giving the necessary input file, i get the following errors . Does it have any relation with the python version installed ? yes I am using Redhat 9.0 You may want to install a current Linux distro. -- http://mail.python.org/mailman/list

Undocumented Python 2.6 change: Py_None vs NULL when C implementation raises exception

2008-07-23 Thread Heikki Toivonen
I was debugging M2Crypto function written in C which changed behavior between Python 2.6 and earlier Python versions. In an error condition the function was supposed to raise exception type A, but with 2.6 it raised type B, and further, there was no string value for the exception. I tracked this d

Using variables across modules

2008-07-23 Thread Aaron Scott
I'm having some trouble understanding how Python handles variables across multiple modules. I've dug through the documentation, but I still find myself at a loss. When you import a module, are you creating an instance of the variables within? For instance, if I have one file, "variables.py", which

Segv in mmap.move()

2008-07-23 Thread [EMAIL PROTECTED]
Does anyone recognize this little Python crasher? I'll file a bug report unless someone notices it as an already documented bug. I found some open mmap bugs, but it wasn't obvious to me that this problem was one of those... Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42) [GCC 4.2.3 (Ubuntu 4.2.3

Re: interpreter vs. compiled

2008-07-23 Thread Martin v. Löwis
>> Oh. How is the stack represented? > > As usual, as successive locations in memory. > I have the impression that CPython uses the same stack C does. Actually, it doesn't (at least not for the evaluation stack). In CPython, when a Python function starts, the maximum depth of the evaluation sta

Re: Python Written in C?

2008-07-23 Thread Marc 'BlackJack' Rintsch
On Wed, 23 Jul 2008 09:42:29 -0700, castironpi wrote: > On Jul 23, 9:11 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> On Wed, 23 Jul 2008 14:10:22 +0200, mk wrote: >> > Marc 'BlackJack' Rintsch wrote: >> >> I can't even remember when I deleted something from a list in the past. >> >>

Re: lxml, comparing nodes

2008-07-23 Thread code_berzerker
On Jul 23, 6:29 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Your requirements for a single Element are simple enough to write it in three > to five lines of Python code (depending on your definition of equality). > Checking this equality recursively is another two to three lines. Not complex >

Wrapping std::set in Boost::Python

2008-07-23 Thread Eric First
All: Has anybody had success at wrapping std::set using Boost::Python? Any ideas, snippets of code, etc... would be very helpful. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: concatenate the elements in each list of a list of lists

2008-07-23 Thread Michael Schneider
Am Wed, 23 Jul 2008 08:33:57 -0700 wrote antar2: > I already asked a similar question, but encounter problems with > python... > How can I concatenate the elements in each list of a list of lists > > list_of_listsA = > > [['klas*', '*', '*'], > ['mooi*', '*', '*', '*'], > ['arm*', '*', '*(haar)'

Europe's Best Computer Enthusiast Website, Eurotechzone is now Open!

2008-07-23 Thread Eurotechzone
http://www.eurotechzone.com Catering to the computer enthusiasts from all over the world, Eurotechzone is Europe’s first multi-lingual website on hardware news&reviews. In this site you will find: • The hottest news from IT Bussiness world • The Reviews of the newest electronic compone

Re: Python Written in C?

2008-07-23 Thread castironpi
On Jul 23, 9:11 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Wed, 23 Jul 2008 14:10:22 +0200, mk wrote: > > Marc 'BlackJack' Rintsch wrote: > >> I can't even remember when I deleted something from a list in the past. > > > Still, doesn't that strike you as.. workaround? > > No, I fi

Re: concatenate the elements in each list of a list of lists

2008-07-23 Thread Chris
On Jul 23, 5:33 pm, antar2 <[EMAIL PROTECTED]> wrote: > I already asked a similar question, but encounter problems with > python... > How can I concatenate the elements in each list of a list of lists > > list_of_listsA = > > [['klas*', '*', '*'], > ['mooi*', '*', '*', '*'], > ['arm*', '*', '*(haar

Re: interpreter vs. compiled

2008-07-23 Thread castironpi
On Jul 22, 11:38 pm, Tim Roberts <[EMAIL PROTECTED]> wrote: > castironpi <[EMAIL PROTECTED]> wrote: > > >You're saying the VM can't compile code.  That makes sense, it's not a > >compiler. > > I wouldn't say "can't".  The current CPython VM does not compile code.  It > COULD.  The C#/.NET VM does.

Re: lxml, comparing nodes

2008-07-23 Thread Stefan Behnel
code_berzerker wrote: > I'd like to know if there is any built in mechanism in lxml that lets > you check equality of two nodes from separate documents. No, because, as you state yourself, equality is not something that everyone defines the same way. > I'd like it > to ignore attribute order and

Re: Undefined calling conventions in Python.h

2008-07-23 Thread Martin v. Löwis
> 1>application.obj : error LNK2031: unable to generate p/invoke for > "extern "C" void __clrcall Py_Exit(int)" (?Py_Exit@@[EMAIL PROTECTED]); > calling convention missing in metadata The main problem here is the __clrcall hint: apparently, you are using Managed C++ resp. C++/CLI, i.e. the Microso

Re: Strange problem ....

2008-07-23 Thread karthikbalaguru
On Jul 23, 1:31 pm, "Simon Brunning" <[EMAIL PROTECTED]> wrote: > 2008/7/23 karthikbalaguru <[EMAIL PROTECTED]>: > > > I use Redhat 9.0, python-2.2.2-26, python-devel-2.2.2-26 and > > db4-4.0.14-20. > > > File "/usr/local/SDK/bin/../core/bin/processorlib.py", line 88 > >yield ProcessorObjectIn

RE: Get dict value but not as reference.

2008-07-23 Thread Robert Rawlins
> Use the pop() method of the dictionary, like this: Ah, of course! Pop! I have seen this before I think Jerry, seems to do the trick nicely. Thank you. Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: lxml, comparing nodes

2008-07-23 Thread Sebastian "lunar" Wiesner
code_berzerker <[EMAIL PROTECTED]>: > I'd like to know if there is any built in mechanism in lxml that lets > you check equality of two nodes from separate documents. I'd like it > to ignore attribute order and so on. It would be even better if there > was built in method for checking equality of

Re: Proper way to query user and group database on a Unix host?

2008-07-23 Thread Sebastian "lunar" Wiesner
Guilherme Polo <[EMAIL PROTECTED]>: > On Wed, Jul 23, 2008 at 9:16 AM, Sebastian lunar Wiesner > <[EMAIL PROTECTED]> wrote: >> Chris Brannon <[EMAIL PROTECTED]>: >> >> Iirc since Python 2.5 these tuples are named ... >> >>> Instead, do this: >>> >>> import grp >>> groupname = 'users' >>> groupuser

Re: Get dict value but not as reference.

2008-07-23 Thread Jerry Hill
On Wed, Jul 23, 2008 at 11:49 AM, Robert Rawlins <[EMAIL PROTECTED]> wrote: > I have a dictionary, and I want to get one of the values from it, but rather > than returning it as a reference I want to actually detach/remove the > element from the dictionary. Like so: Use the pop() method of the dic

Get dict value but not as reference.

2008-07-23 Thread Robert Rawlins
Guys, This feels like a strange question but it's not something I've done before, I'm sure it's quite simple. I have a dictionary, and I want to get one of the values from it, but rather than returning it as a reference I want to actually detach/remove the element from the dictionary. Like

Re: Proper way to query user and group database on a Unix host?

2008-07-23 Thread Guilherme Polo
On Wed, Jul 23, 2008 at 9:16 AM, Sebastian lunar Wiesner <[EMAIL PROTECTED]> wrote: > Chris Brannon <[EMAIL PROTECTED]>: > > Iirc since Python 2.5 these tuples are named ... > >> Instead, do this: >> >> import grp >> groupname = 'users' >> groupusers = grp.getgrnam(groupname)[3] > ... thus this lin

lxml, comparing nodes

2008-07-23 Thread code_berzerker
I'd like to know if there is any built in mechanism in lxml that lets you check equality of two nodes from separate documents. I'd like it to ignore attribute order and so on. It would be even better if there was built in method for checking equality of whole documents (ignoring document order). Pl

concatenate the elements in each list of a list of lists

2008-07-23 Thread antar2
I already asked a similar question, but encounter problems with python... How can I concatenate the elements in each list of a list of lists list_of_listsA = [['klas*', '*', '*'], ['mooi*', '*', '*', '*'], ['arm*', '*', '*(haar)']] wanted result: list_of_listsA = [['klas* * *'] ['mooi* * * *']

Re: repr(string)

2008-07-23 Thread Guilherme Polo
On Wed, Jul 23, 2008 at 12:04 PM, David C. Ullrich <[EMAIL PROTECTED]> wrote: > I've been saving data in a file with one line per field. > Now some of the fields may become multi-line strings... > > I was about to start escaping and unescaping linefeeds > by hand, when I realized that repr() and ev

Re: Doubt

2008-07-23 Thread Stephen Johnson
You don't need a mailing list, you need to read the tutorial. Those are completely trivial questions. http://docs.python.org/tut/tut.html -Steve Johnson On Jul 23, 2008, at 10:51 AM, ജഗന്നാഥ് wrote: Friends I am a Perl programmer new to Python. I have a small doubt. How to convert the perl

Re: Doubt

2008-07-23 Thread Guilherme Polo
On Wed, Jul 23, 2008 at 11:51 AM, ജഗന്നാഥ് <[EMAIL PROTECTED]> wrote: > Friends > > I am a Perl programmer new to Python. I have a small doubt. > How to convert the perl notation > $a = ""; expression in Python ? a = "" > > How to represent the loop > for ($a = $b; $a<=$c;$a++){ > } in Python >

repr(string)

2008-07-23 Thread David C. Ullrich
I've been saving data in a file with one line per field. Now some of the fields may become multi-line strings... I was about to start escaping and unescaping linefeeds by hand, when I realized that repr() and eval() should do. Hence the question: If s is a string, is repr(s) guaranteed not to cont

Re: How do I compare files?

2008-07-23 Thread Clay Hobbs
On Tue, 2008-07-22 at 17:29 -0700, Matimus wrote: > On Jul 22, 4:27pm, Clay Hobbs <[EMAIL PROTECTED]> wrote: > > I am making a program that (with urllib) that downloads two jpeg files > > and, if they are different, displays the new one. I need to find a way > > to compare two files in Python. How

Re: Function editing with Vim throws IndentError

2008-07-23 Thread Matimus
On Jul 22, 2:02 pm, ptn <[EMAIL PROTECTED]> wrote: > Hi everybody, > > I have a weird problem.  Say I have a .py file with some functions in > it, like this: > >     # (...) >     def foo(): >         print("bar") > > When I open it and add a line to one of the functions, > >     # (...) >     def

Doubt

2008-07-23 Thread ജഗന്നാഥ്
Friends I am a Perl programmer new to Python. I have a small doubt. How to convert the perl notation $a = ""; expression in Python ? How to represent the loop for ($a = $b; $a<=$c;$a++){ } in Python Jagan Linguist -- http://mail.python.org/mailman/listinfo/python-list

Re: python.exe crash and ctypes use

2008-07-23 Thread Thomas Heller
waldek schrieb: > Hi, > > I have module A.py and B.dll which exports C functions by cdecl_ > > In A.py I pass callback (py callable) to dll. Next, thread inside dll > simply calls my callback (in a loop). After few secs I got crash of > python.exe. > > How to debug it? > > I'm using winxp and

Re: Python Written in C?

2008-07-23 Thread Marc 'BlackJack' Rintsch
On Wed, 23 Jul 2008 14:10:22 +0200, mk wrote: > Marc 'BlackJack' Rintsch wrote: >> I can't even remember when I deleted something from a list in the past. > > Still, doesn't that strike you as.. workaround? No, I find it actually safer; I don't have to care where modifications of the list might

Re: python.exe crash and ctypes use

2008-07-23 Thread Diez B. Roggisch
waldek wrote: > Hi, > > I have module A.py and B.dll which exports C functions by cdecl_ > > In A.py I pass callback (py callable) to dll. Next, thread inside dll > simply calls my callback (in a loop). After few secs I got crash of > python.exe. > > How to debug it? > > I'm using winxp and p

Re: Python Written in C?

2008-07-23 Thread Grant Edwards
On 2008-07-23, mk <[EMAIL PROTECTED]> wrote: >> Actually, all of the compilers I'm familiar with (gcc and a >> handful of cross compilers for various microprocessors) >> translate from high-level languages (e.g. C, C++) into >> assembly, which is then assembled into relocatable object >> files, whi

python.exe crash and ctypes use

2008-07-23 Thread waldek
Hi, I have module A.py and B.dll which exports C functions by cdecl_ In A.py I pass callback (py callable) to dll. Next, thread inside dll simply calls my callback (in a loop). After few secs I got crash of python.exe. How to debug it? I'm using winxp and py 2.5.2 ===

  1   2   >