Re: Just finished reading of What’s New In Python 3.0

2011-03-11 Thread n00m
Fitzgerald had been an alcoholic since his college days, and became notorious during the 1920s for his extraordinarily heavy drinking, leaving him in poor health by the late 1930s. According to Zelda's biographer, Nancy Milford, Scott claimed that he had contracted tuberculosis, but Milford

Re: Use-cases for alternative iterator

2011-03-11 Thread Peter Otten
Steven D'Aprano wrote: The iter() built-in takes two different forms, the familiar iter(iterable) we all know and love, and an alternative form: iter(callable, sentinel) I've never seen this second form in actual code. Does anyone use it, and if so, what use-cases do you have? I found

Re: Purely historic question: VT200 text graphic programming

2011-03-11 Thread Anssi Saari
Grant Edwards invalid@invalid.invalid writes: C wasn't very widely used under VMS, and VMS had it's own screen formatting and form handling libraries. Just curious, what language was widely used in VMS? My VMS experience is limited to running Maple for a math course in the university in early

Re: Purely historic question: VT200 text graphic programming

2011-03-11 Thread GrayShark
On Fri, 11 Mar 2011 11:17:08 +0200, Anssi Saari wrote: Grant Edwards invalid@invalid.invalid writes: C wasn't very widely used under VMS, and VMS had it's own screen formatting and form handling libraries. Just curious, what language was widely used in VMS? My VMS experience is limited

Re: Purely historic question: VT200 text graphic programming

2011-03-11 Thread GrayShark
On Fri, 11 Mar 2011 00:26:37 -0800, Dennis Lee Bieber wrote: On Thu, 10 Mar 2011 19:55:02 + (UTC), Grant Edwards invalid@invalid.invalid declaimed the following in gmane.comp.python.general: vt200 terminals. The vt200 wasn't a TV. It was a character-based,

Re: Purely historic question: VT200 text graphic programming

2011-03-11 Thread Jorgen Grahn
On Thu, 2011-03-10, Martin Gregorie wrote: On Thu, 10 Mar 2011 20:31:11 +, Grant Edwards wrote: You tricked me by saying only DEC VAX/VMS programmers would know what it was. In fact, many, many Unix programmers knew about curses (and still do) and very few VMS programmers ever did. C

Re: Purely historic question: VT200 text graphic programming

2011-03-11 Thread Martin Gregorie
On Fri, 11 Mar 2011 04:39:02 -0600, GrayShark wrote: I think the order went the other way -- I think most of the ANSI sequences were inherited from the VT52/VT100 terminals. Are you implying ascii came after the VT52/VT110 terminals? VT52 is a ascii code based piece of shit, including

PyCon

2011-03-11 Thread Rita
Hello, I noticed the old presentations at PyCon aren't avaliable anymore. http://us.pycon.org/2010/ http://us.pycon.org/2009/ Does anyone know where else I can get these presentations? -- --- Get your facts first, then you can distort them as you please.-- --

Re: PyCon

2011-03-11 Thread Nick Stinemates
http://blip.tv/search?q=pycon http://blip.tv/search?q=pyconHTH Nick On Fri, Mar 11, 2011 at 4:45 AM, Rita rmorgan...@gmail.com wrote: Hello, I noticed the old presentations at PyCon aren't avaliable anymore. http://us.pycon.org/2010/ http://us.pycon.org/2009/ Does anyone know where else I

Python SIG for Healthcare IT

2011-03-11 Thread Brad Allen
For those seeking to work with Python-based tools in the healthcare IT industry, this SIG (special interest group) can provide a forum to discuss challenges and hopefully foster knowledge sharing and tools development. Relevant topics include tools for working with healthcare standard data

Re: Purely historic question: VT200 text graphic programming

2011-03-11 Thread Charles Turner
On 2011-03-10 14:55:02 -0500, Grant Edwards said: Eh? Those are viddotex/teletext systems aren't they? I thought the OP was talking about a character-based windowing and form-handling library used by applications that ran under VAX/VMS on vt200 terminals. The vt200 wasn't a TV. It was a

Re: Passing Functions

2011-03-11 Thread yoro
On Mar 11, 2:00 am, MRAB pyt...@mrabarnett.plus.com wrote: On 11/03/2011 01:13, yoro wrote: Hi, I am having an issue with passing values from one function to another - I am trying to fill a list in one function using the values contained in other functions as seen below: infinity =

Re: Just finished reading of What’s New In Python 3.0

2011-03-11 Thread Westley Martínez
On Thu, 2011-03-10 at 17:58 -0800, n00m wrote: http://docs.python.org/py3k/whatsnew/3.0.html What's the fuss abt it? Imo all is ***OK*** with 3k (in the parts I understand). I even liked print as a function **more** than print as a stmt Now I think that Py3k is better than all prev

Grabbing user's agent and OS type

2011-03-11 Thread Νικόλαος Κούρας
Hello, I use os.environ[HTTP_USER_AGENT] and is very convenient to retrieve the user's agent type but how could we also retrieve the user's OS type? OS type and agent type and version do appear in the same string. I somehow have to grab the 'OS' type(Windows) and the user's agent/

Creating a very simple revision system for photos in python

2011-03-11 Thread Thomas W
I`m thinking about creating a very simple revision system for photos in python, something like bazaar, mercurial or git, but for photos. The problem is that handling large binary files compared to plain text files are quite different. Has anybody done something like this or have any thoughts about

Re: Grabbing user's agent and OS type

2011-03-11 Thread Steven D'Aprano
On Fri, 11 Mar 2011 06:37:42 -0800, Νικόλαος Κούρας wrote: Hello, I use os.environ[HTTP_USER_AGENT] and is very convenient to retrieve the user's agent type but how could we also retrieve the user's OS type? sys.platform 'linux2' os.name 'posix' OS type and agent type and

Re: Purely historic question: VT200 text graphic programming

2011-03-11 Thread Tim Chase
On 03/11/2011 04:24 AM, GrayShark wrote: Oh yes, Cobol also worked on VMS (yikes! the columns just right issues!). IDENTIFICATION DIVISION. PROGRAM-ID. PAIN-PAIN-PAIN. PROCEDURE DIVISION. DISPLAY 'Thanks for dredging up painful memories'. DISPLAY 'I've

Re: Purely historic question: VT200 text graphic programming

2011-03-11 Thread GrayShark
Aw! to stray down memory lane. Well enough straying. Back to work. GrayShark -- http://mail.python.org/mailman/listinfo/python-list

Re: PyCon

2011-03-11 Thread Ken Seehart
On 3/11/2011 7:45 AM, Rita wrote: http://us.pycon.org/2010/ http://us.pycon.org/2009/ Try the wayback machine: http://replay.waybackmachine.org/20100701160843/http://us.pycon.org/2010/about/ -- http://mail.python.org/mailman/listinfo/python-list

How to get python class serializable and well parsed by JSON

2011-03-11 Thread Arthur Mc Coy
Hi people, I've created very nice post here: http://stackoverflow.com/questions/5274690/how-to-get-python-class-serializable-and-well-parsed-by-json-custom-encoder-deco Yes, there are solutions over the internet, but nothing works for my custom types. If you could answer, please read it. Be

Re: Purely historic question: VT200 text graphic programming

2011-03-11 Thread Grant Edwards
On 2011-03-11, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Thu, 10 Mar 2011 19:55:02 + (UTC), Grant Edwards invalid@invalid.invalid declaimed the following in gmane.comp.python.general: vt200 terminals. The vt200 wasn't a TV. It was a character-based, mostly-ANSI-escape-sequence,

Re: Purely historic question: VT200 text graphic programming

2011-03-11 Thread Grant Edwards
On 2011-03-11, Anssi Saari a...@sci.fi wrote: Grant Edwards invalid@invalid.invalid writes: C wasn't very widely used under VMS, and VMS had it's own screen formatting and form handling libraries. Just curious, what language was widely used in VMS? From what I remember, FORTRAN what

Re: Grabbing user's agent and OS type

2011-03-11 Thread Νικόλαος Κούρας
Thanks a lot Steven! The following code worked like a charm! ** agent = os.environ['HTTP_USER_AGENT'] # determination of user browser agent = agent.lower() if 'chrome' in agent: agent = 'Chrome' if 'firefox' in agent: agent = 'Firefox' if 'opera' in agent:

Re: Creating a very simple revision system for photos in python

2011-03-11 Thread Chris Hulan
On Mar 11, 9:56 am, Thomas W thomas.weh...@gmail.com wrote: I`m thinking about creating a very simple revision system for photos in python, something like bazaar, mercurial or git, but for photos. The problem is that handling large binary files compared to plain text files are quite different.

Re: Creating a very simple revision system for photos in python

2011-03-11 Thread Tim Golden
On 11/03/2011 16:05, Chris Hulan wrote: On Mar 11, 9:56 am, Thomas Wthomas.weh...@gmail.com wrote: I`m thinking about creating a very simple revision system for photos in python, something like bazaar, mercurial or git, but for photos. The problem is that handling large binary files compared

Re: Purely historic question: VT200 text graphic programming

2011-03-11 Thread GrayShark
On Fri, 11 Mar 2011 15:58:20 +, Grant Edwards wrote: On 2011-03-11, Anssi Saari a...@sci.fi wrote: Grant Edwards invalid@invalid.invalid writes: C wasn't very widely used under VMS, and VMS had it's own screen formatting and form handling libraries. Just curious, what language was

Re: Grabbing user's agent and OS type

2011-03-11 Thread Benjamin Kaplan
2011/3/11 Νικόλαος Κούρας nikos.kou...@gmail.com: Thanks a lot Steven! The following code worked like a charm! ** agent = os.environ['HTTP_USER_AGENT'] # determination of user browser agent = agent.lower() if 'chrome' in agent:        agent = 'Chrome' if 'firefox' in

Re: How to get python class serializable and well parsed by JSON

2011-03-11 Thread Arthur Mc Coy
Common guys, help me, sweet heart to finish my job and go with my friend in the bar. Today we have a blues night :) Love it! Christina -- http://mail.python.org/mailman/listinfo/python-list

Re: Grabbing user's agent and OS type

2011-03-11 Thread Tim Chase
On 03/11/2011 09:59 AM, Νικόλαος Κούρας wrote: ** agent = os.environ['HTTP_USER_AGENT'] # determination of user browser agent = agent.lower() if 'chrome' in agent: agent = 'Chrome' if 'firefox' in agent: agent = 'Firefox' if 'opera' in agent: agent =

Re: How to get python class serializable and well parsed by JSON

2011-03-11 Thread Arthur Mc Coy
Currently trying to pick up my ava http://en.gravatar.com/christinasanders21 for StackOverflow, which site I found very good for my questions, didn't I? Yes, and there are problem when adding a picture. Web admins should be careful. Can anyone explain me my problem ? : Christina --

Re: Just finished reading of What’s New In Python 3.0

2011-03-11 Thread Nobody
On Thu, 10 Mar 2011 17:58:50 -0800, n00m wrote: http://docs.python.org/py3k/whatsnew/3.0.html What's the fuss abt it? Imo all is ***OK*** with 3k (in the parts I understand). Some of use Python 2.x as a general-purpose Unix scripting language. For that purpose, Python 3.x's obsession with

Re: Creating a very simple revision system for photos in python

2011-03-11 Thread Thomas W
On 11 Mar, 17:23, Tim Golden m...@timgolden.me.uk wrote: On 11/03/2011 16:05, Chris Hulan wrote: On Mar 11, 9:56 am, Thomas Wthomas.weh...@gmail.com  wrote: I`m thinking about creating a very simple revision system for photos in python, something like bazaar, mercurial or git, but

Re: Passing Functions

2011-03-11 Thread John Nagle
On 3/11/2011 5:49 AM, yoro wrote: I've found the error, I had to type in: for node in nodeTable: if node != 0 and Node.visited == False: That's just your first error. (Also, you shouldn't have anything but Node items in nodeTable, so you don't need the node != 0.) The biggest

Re: Compile time evaluation of dictionaries

2011-03-11 Thread John Nagle
On 3/10/2011 8:23 AM, Gerald Britton wrote: Today I noticed that an expression like this: one:%(one)s two:%(two)s % {one: is the loneliest number, two: can be as bad as one} could be evaluated at compile time, but is not: CPython barely evaluates anything at compile time.

Re: Grabbing user's agent and OS type

2011-03-11 Thread Νικόλαος Κούρας
On 11 Μαρ, 18:39, Tim Chase python.l...@tim.thechases.com wrote: On 03/11/2011 09:59 AM, Νικόλαος Κούρας wrote: ** agent = os.environ['HTTP_USER_AGENT'] # determination of user browser agent = agent.lower() if 'chrome' in agent:    agent = 'Chrome' if

Re: What do you use with Python for GUI programming and why?

2011-03-11 Thread Rafe Kettler
On Mar 10, 9:25 pm, Robert sigz...@gmail.com wrote: Is there a push to one toolkit or the other? -- Robert I've mainly used Tkinter for a few reasons: - It's what I already know - It's pretty simple - Most people who have Python have it too, so there's no crazy dependencies - It looks

Re: Don't Want Visitor To See Nuttin'

2011-03-11 Thread Victor Subervi
On Fri, Mar 11, 2011 at 3:54 AM, Ian Kelly ian.g.ke...@gmail.com wrote: On Wed, Mar 9, 2011 at 2:01 PM, Victor Subervi victorsube...@gmail.com wrote: titleMaya 2012: Transform At the Source/title Yow. You're designing a Maya 2012 website to help some travel company bilk gullible people

Re: Don't Want Visitor To See Nuttin'

2011-03-11 Thread Victor Subervi
On Fri, Mar 11, 2011 at 4:26 AM, Dennis Lee Bieber wlfr...@ix.netcom.comwrote: On Thu, 10 Mar 2011 18:00:10 -0800 (PST), alex23 wuwe...@gmail.com declaimed the following in gmane.comp.python.general: He's comp.lang.python's version of Sisyphus. Or maybe Sisyphus' boulder...I forget where I

Re: Purely historic question: VT200 text graphic programming

2011-03-11 Thread Grant Edwards
On 2011-03-11, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Fri, 11 Mar 2011 11:17:08 +0200, Anssi Saari a...@sci.fi declaimed the following in gmane.comp.python.general: Grant Edwards invalid@invalid.invalid writes: C wasn't very widely used under VMS, and VMS had it's own screen

IDLE doesn't start

2011-03-11 Thread Ceonn Bobst
Hi,   I just installed Python 3.1.1 via link in the book Python Programming for the absolute beginner third edition. But IDLE won't start. When I try to open IDLE the Windows hourglass just flashes briefly but nothing happens after that. No error messages. My operating system is XP

Re: Purely historic question: VT200 text graphic programming

2011-03-11 Thread Martin Gregorie
On Fri, 11 Mar 2011 11:52:13 +, Jorgen Grahn wrote: On Thu, 2011-03-10, Martin Gregorie wrote: On Thu, 10 Mar 2011 20:31:11 +, Grant Edwards wrote: You tricked me by saying only DEC VAX/VMS programmers would know what it was. In fact, many, many Unix programmers knew about curses

Re: send function keys to a legacy DOS program

2011-03-11 Thread jr
On Mar 10, 7:58 pm, Justin Ezequiel justin.mailingli...@gmail.com wrote: Greetings, We have an old barcode program (MSDOS and source code unavailable.) I've figured out how to populate the fields (by hacking into one of the program's resource files.) However, we still need to hit the

Re: Purely historic question: VT200 text graphic programming

2011-03-11 Thread Martin Gregorie
On Fri, 11 Mar 2011 15:53:20 +, Grant Edwards wrote: I think the order went the other way -- I think most of the ANSI sequences were inherited from the VT52/VT100 terminals. Ah. I didn't mean to imply order, only that the vt200 used ANSI escape sequences with some extensions. I got

Re: Just finished reading of What’s New In Python 3.0

2011-03-11 Thread Dan Stromberg
On Thu, Mar 10, 2011 at 11:59 PM, n00m n...@narod.ru wrote: Fitzgerald had been an alcoholic since his college days, and became notorious during the 1920s for his extraordinarily heavy drinking, leaving him in poor health by the late 1930s. According to Zelda's biographer, Nancy Milford,

Re: send function keys to a legacy DOS program

2011-03-11 Thread Emile van Sebille
On 3/10/2011 4:58 PM Justin Ezequiel said... Greetings, We have an old barcode program (MSDOS and source code unavailable.) I've figured out how to populate the fields (by hacking into one of the program's resource files.) However, we still need to hit the following function keys in sequence.

Two random lists from one list

2011-03-11 Thread noydb
Hello All, I am just looking to see if there is perhaps a more efficient way of doing this below (works -- creates two random teams from a list of players). Just want to see what the experts come up with for means of learning how to do things better. Thanks for any responses! ### import random

Re: Two random lists from one list

2011-03-11 Thread Miki Tebeka
You can use sets: teamA = set(random.sample(players, 4)) teamB = set(players) - teamA HTH -- Miki Tebeka miki.teb...@gmail.com http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: What do you use with Python for GUI programming and why?

2011-03-11 Thread Miki Tebeka
I used wxPython in several occasion, was very happy with it. Free, great docs, great community. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get python class serializable and well parsed by JSON

2011-03-11 Thread Sophie Sperner
Ok, guys. I used my bro account. Now I'm here. By the way is anybody going to be in Paris Sunday night ? I invite you if you would help :))) Kiss, well yet 30 minutes at work and I'm free... Sophie -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating a very simple revision system for photos in python

2011-03-11 Thread Dan Stromberg
On Fri, Mar 11, 2011 at 6:56 AM, Thomas W thomas.weh...@gmail.com wrote: I`m thinking about creating a very simple revision system for photos in python, something like bazaar, mercurial or git, but for photos. The problem is that handling large binary files compared to plain text files are

Re: Two random lists from one list

2011-03-11 Thread Chris Hulan
On Mar 11, 1:21 pm, noydb jenn.du...@gmail.com wrote: Hello All, I am just looking to see if there is perhaps a more efficient way of doing this below (works -- creates two random teams from a list of players).  Just want to see what the experts come up with for means of learning how to do

Re: Two random lists from one list

2011-03-11 Thread Peter Otten
noydb wrote: Hello All, I am just looking to see if there is perhaps a more efficient way of doing this below (works -- creates two random teams from a list of players). Just want to see what the experts come up with for means of learning how to do things better. Thanks for any

Re: Two random lists from one list

2011-03-11 Thread Dan Stromberg
Catenate the lists into a new list. Then randomize the order of the new list by iterating over each element in turn, swapping it with a random element elsewhere in the same list (optionally including swapping it with itself - that's easier and still gives good randomization). This gives linear

Re: Two random lists from one list

2011-03-11 Thread Tim Chase
On 03/11/2011 12:21 PM, noydb wrote: I am just looking to see if there is perhaps a more efficient way of doing this below (works -- creates two random teams from a list of players). Just want to see what the experts come up with for means of learning how to do things better. ### import random

Re: How to get python class serializable and well parsed by JSON

2011-03-11 Thread Gennadiy Zlobin
I can not open your link. Are you sure you provided the correct link? - Gennadiy gennad.zlo...@gmail.com On Fri, Mar 11, 2011 at 10:36 PM, Arthur Mc Coy 1984docmc...@gmail.comwrote: Currently trying to pick up my ava http://en.gravatar.com/christinasanders21 for StackOverflow, which site I

Using MSW GUI DLLS: PYWIN32, WMI, WINSHELL

2011-03-11 Thread Ray Pasco
I'm using MSW DLL calls thru the 3 packages listed as well as ctypes calls on Win7 64-bit. I believe all the packages were developed in the XP days. Some calls just don't seem to work consistently on Win7. Specifically, I'm trying to reposition and resize application

How to use python JSON custom parser in example ?

2011-03-11 Thread Sophie Sperner
Hi all, I reuploaded my message. http://stackoverflow.com/questions/5277180/how-to-use-python-json-custom-parser-in-example From now no brother accounts. Huh :) Sophie -- http://mail.python.org/mailman/listinfo/python-list

Re: IDLE doesn't start

2011-03-11 Thread Gennadiy Zlobin
It seems that you have already had Python 2.2 installed in the directory C:/IBMTOOLS/Python22 Can you open the console and type there next commands and provide the output? echo %TCL_LIBRARY% echo %TK_LIBRARY% echo %PYTHONPATH% You can unset environment variable in 'my computer' properties, more

Re: IDLE doesn't start

2011-03-11 Thread Kev Dwyer
Ceonn Bobst wrote: snip When I open a command prompt, and type: c:\python32\python.exe -m idlelib.idle The message that comes is as follows: Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\Ceonnc:\python32\python.exe -m

Re: Purely historic question: VT200 text graphic programming

2011-03-11 Thread Grant Edwards
On 2011-03-11, Martin Gregorie martin@address-in-sig.invalid wrote: BTW, there was no such thing as a VT-200 - there was a VT-220 text terminal (which I think the OP was remembering) and the VT-240 and 241 terminals, which were totally different graphics terminals that accepted Tektronics

Re: Tk MouseWheel Support

2011-03-11 Thread Dick Holmes
On Thu, 10 Mar 2011 21:56:52 +0100, Alexander Kapps alex.ka...@web.de wrote: snip Can you post your code please (if it's too long, strip it down to the smallest program which still shows the problem.) First, thanks to MRAB for showing me how to get the wheel working. In the following code

Re: Use-cases for alternative iterator

2011-03-11 Thread Terry Reedy
On 3/11/2011 1:43 AM, Steven D'Aprano wrote: The iter() built-in takes two different forms, the familiar iter(iterable) we all know and love, and an alternative form: iter(callable, sentinel) E.g.: T = -1 def func(): ... global T ... T += 1 ... return T ... it = iter(func, 3)

Re: IDLE doesn't start

2011-03-11 Thread Terry Reedy
On 3/11/2011 12:58 PM, Ceonn Bobst wrote: Someone told me: “You certainly have a TCL_LIBRARY environment variable set on your system, it should be removed”. Someone else posted this week about the same problem (though from a different cause) and solution. How do I remove TCL_LIBRARY, or

Re: Creating a very simple revision system for photos in python

2011-03-11 Thread John Nagle
On 3/11/2011 6:56 AM, Thomas W wrote: I`m thinking about creating a very simple revision system for photos in python, something like bazaar, mercurial or git, but for photos. The problem is that handling large binary files compared to plain text files are quite different. Has anybody done

Re: What do you use with Python for GUI programming and why?

2011-03-11 Thread Fred Pacquier
Robert sigz...@gmail.com said : Is there a push to one toolkit or the other? If you are just now getting started, I would honestly suggest you save a whole lot of time and dive straight into PyQt. I've tried most 'em over the years (including some now discontinued), and in my experience Qt is

enhanced map function

2011-03-11 Thread Patrick
Hi, The build-in map functions looks quite nice but it requests the iterables to be of the same length or otherwises will file with None (most of time fails the function). Just wondering if there are already enhancement work done with it? I did some simple code but it will handle list without

Calling C++ Modules in Python

2011-03-11 Thread Patrick
Hi, I saw in the Beginner document that •Is easily extended by adding new modules implemented in a compiled language such as C or C++. . While to my investigation, it seems not that easy or did I miss something? boost python (C++ libraries need to be re-compiled with written wrappers again?).

Re: Calling C++ Modules in Python

2011-03-11 Thread Benjamin Kaplan
On Mar 11, 2011 4:23 PM, Patrick zxpat...@gmail.com wrote: Hi, I saw in the Beginner document that •Is easily extended by adding new modules implemented in a compiled language such as C or C++. . While to my investigation, it seems not that easy or did I miss something? boost python (C++

Re: Calling C++ Modules in Python

2011-03-11 Thread Sophie Sperner
Hi Patrick, I'm using SWIG in my project. C++ code is wrapped and can be used in python as custom module. You should create a swig module.i file to describe headers upon which that module will be built. You should be certain about what you are going to use - boost library, swig or something

Re: What do you use with Python for GUI programming and why?

2011-03-11 Thread Dan Stromberg
On Fri, Mar 11, 2011 at 12:54 PM, Fred Pacquier xne...@fredp.lautre.netwrote: Robert sigz...@gmail.com said : Is there a push to one toolkit or the other? If you are just now getting started, I would honestly suggest you save a whole lot of time and dive straight into PyQt. I've tried most

Re: What do you use with Python for GUI programming and why?

2011-03-11 Thread OKB (not okblacke)
Robert wrote: Is there a push to one toolkit or the other? I use Dabo, which wraps wxPython. -- --OKB (not okblacke) Brendan Barnwell Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail. --author unknown --

Re: Calling C++ Modules in Python

2011-03-11 Thread Dan Stromberg
On Fri, Mar 11, 2011 at 1:15 PM, Patrick zxpat...@gmail.com wrote: Hi, I saw in the Beginner document that •Is easily extended by adding new modules implemented in a compiled language such as C or C++. . While to my investigation, it seems not that easy or did I miss something? boost

PEP for module naming conventions

2011-03-11 Thread Tim Johnson
I need to be better informed on naming conventions for modules. For instance, I need to create a new module and I want to make sure that the module name will not conflict with any future or current python system module names. There may be a PEP for this, if so, a URL to such a PEP would suffice

Re: Calling C++ Modules in Python

2011-03-11 Thread Patrick
Thanks Sophie for the information. Yes, right now I am not certain about what I am going to use for I was hoping for a non-intrusive way to expose existing C++ libraries to python. However, both solutions (BOOST, SWIG) listed here require the recompilation of libraries?! It is ok for small

Re: PEP for module naming conventions

2011-03-11 Thread David Marek
Hi, Have you read PEP 8? http://python.org/dev/peps/pep-0008/ I don't think it's possible to be sure that the name of your module won't conflict with system module name (if you'll follow conventions). You can find the list of all PEPs at http://python.org/dev/peps/ -- David Marek

Re: Re: Calling C++ Modules in Python

2011-03-11 Thread zxpatric
Dan, Thanks for the info. Really I was hoping for a non-intrusive way to expose existing C++ libraries to python. However, both solutions (BOOST, SWIG) listed here require the recompilation of libraries?! Seems Cython is doing the similar way? It is ok for small applications but will be

Inserting record into postgresql database

2011-03-11 Thread Meszaros, Stacy
Hello all, I am using python 2.6 and the psycopg2 module for the postgres connection The following code is supposed to insert a record into a table with a bytea field. (bytearray) I am having difficulty getting to field inserted properly. The snippet below inserts the first 8 bit hex value,

Re: Re: Calling C++ Modules in Python

2011-03-11 Thread Dan Stromberg
I've not tried Boost, but I don't think SWIG or Cython require modified libraries. You just compile your wrapper, and then import it. On Fri, Mar 11, 2011 at 2:16 PM, zxpat...@gmail.com wrote: Dan, Thanks for the info. Really I was hoping for a non-intrusive way to expose existing C++

Re: PEP for module naming conventions

2011-03-11 Thread Tim Johnson
* David Marek dav...@atrey.karlin.mff.cuni.cz [110311 13:20]: Hi, Have you read PEP 8? http://python.org/dev/peps/pep-0008/ I don't think it's possible to be sure that the name of your module won't conflict with system module name (if you'll follow conventions). You can find the list of

Re: What do you use with Python for GUI programming and why?

2011-03-11 Thread Octavian Rasnita
From: OKB (not okblacke) brennospamb...@nobrenspambarn.net Robert wrote: Is there a push to one toolkit or the other? I use Dabo, which wraps wxPython. -- What's the advantage of using Dabo instead of wxPython directly? Thanks. Octavian --

How should I handle socket receiving?

2011-03-11 Thread Hans
I'm thinking to write a code which to: 1. establish tons of udp/tcp connections to a server 2. send packets from each connections 3. receive packets from each connections and then do something based on received content and connection statues. 4. repeat step 2 and step 3. my question is how should

OT: processes, terminals and file descriptors on *nix (was: Re: attach to process by pid?)

2011-03-11 Thread Alexander Kapps
On 11.03.2011 03:18, Nobody wrote: On Thu, 10 Mar 2011 23:55:51 +0100, Alexander Kapps wrote: I think he wants to attach to another process's stdin/stdout and read/write from/to them. I don't know if this is possible but it would be a great addition for psutil. It's not even a meaningful

Re: How should I handle socket receiving?

2011-03-11 Thread Dan Stromberg
On Fri, Mar 11, 2011 at 3:30 PM, Hans hans...@gmail.com wrote: I'm thinking to write a code which to: 1. establish tons of udp/tcp connections to a server 2. send packets from each connections 3. receive packets from each connections and then do something based on received content and

Re: OT: processes, terminals and file descriptors on *nix (was: Re: attach to process by pid?)

2011-03-11 Thread Dan Stromberg
On Fri, Mar 11, 2011 at 3:49 PM, Alexander Kapps alex.ka...@web.de wrote: On 11.03.2011 03:18, Nobody wrote: On Thu, 10 Mar 2011 23:55:51 +0100, Alexander Kapps wrote: I think he wants to attach to another process's stdin/stdout and read/write from/to them. I don't know if this is

Re: Inserting record into postgresql database

2011-03-11 Thread MRAB
On 11/03/2011 22:08, Meszaros, Stacy wrote: Hello all, I am using python 2.6 and the psycopg2 module for the postgres connection The following code is supposed to insert a record into a table with a bytea field. (bytearray) I am having difficulty getting to field inserted properly. The

Re: Purely historic question: VT200 text graphic programming

2011-03-11 Thread Martin Gregorie
On Fri, 11 Mar 2011 19:32:53 +, Grant Edwards wrote: On 2011-03-11, Martin Gregorie martin@address-in-sig.invalid wrote: BTW, there was no such thing as a VT-200 - there was a VT-220 text terminal (which I think the OP was remembering) and the VT-240 and 241 terminals, which were

Re: enhanced map function

2011-03-11 Thread Steven D'Aprano
On Fri, 11 Mar 2011 13:00:23 -0800, Patrick wrote: Hi, The build-in map functions looks quite nice but it requests the iterables to be of the same length or otherwises will file with None (most of time fails the function). Just wondering if there are already enhancement work done with it?

Re: my computer is allergic to pickles

2011-03-11 Thread Bob Fnord
Peter Otten __pete...@web.de wrote: Bob Fnord wrote: I started by using cPickle to save the instance of the class that contained this dict, but the pickling process started to write the file but ate so much memory that my computer (4 GB RAM) crashed so badly that I had to press the

Re: my computer is allergic to pickles

2011-03-11 Thread Bob Fnord
Miki Tebeka miki.teb...@gmail.com wrote: From looking at the shelve info in the library reference, I get the impression it's tricky to change the values in the dict for existing keys and be sure they get changed on disk. You can use writeback=True or call sync at the right places.

Re: How should I handle socket receiving?

2011-03-11 Thread n00m
I'm abs not sure but maybe you'll need to put each client into separate thread; like this def Client_func(s2, cn): while 1: data = cn.recv(4096) if not data: s2.shutdown(1) return s2.sendall(data) cn, addr = s1.accept() s2 =

Re: What do you use with Python for GUI programming and why?

2011-03-11 Thread OKB (not okblacke)
Octavian Rasnita wrote: From: OKB (not okblacke) brennospamb...@nobrenspambarn.net Robert wrote: Is there a push to one toolkit or the other? I use Dabo, which wraps wxPython. -- What's the advantage of using Dabo instead of wxPython directly? Dabo gives you a much

Re: What do you use with Python for GUI programming and why?

2011-03-11 Thread Robert
On 2011-03-11 01:14:01 -0500, Dan Stromberg said: You're probably best off with Pyjamas.  Then you get something that runs on the web and on the desktop, from the same code - similar to GWT, but for Python.  The desktop version runs overtop of CPython, the web version is AJAX and is

Re: Calling C++ Modules in Python

2011-03-11 Thread Terry Reedy
On 3/11/2011 4:15 PM, Patrick wrote: Hi, I saw in the Beginner document that •Is easily extended by adding new modules implemented in a compiled language such as C or C++. . While to my investigation, it seems not that easy or did I miss something? boost python (C++ libraries need to be

Re: Purely historic question: VT200 text graphic programming

2011-03-11 Thread rzed
Anssi Saari a...@sci.fi wrote in news:vg3hbba6mp7@pepper.modeemi.fi: Grant Edwards invalid@invalid.invalid writes: C wasn't very widely used under VMS, and VMS had it's own screen formatting and form handling libraries. Just curious, what language was widely used in VMS? My VMS

organizing many python scripts, in a large corporate environment.

2011-03-11 Thread Phat Fly Alanna
We've been doing a fair amount of Python scripting, and now we have a directory with almost a hundred loosely related scripts. It's obviously time to organize this, but there's a problem. These scripts import freely from each other and although code reuse is generally a good thing it makes it

organizing many python scripts, in a large corporate environment.

2011-03-11 Thread bukzor
We've been doing a fair amount of Python scripting, and now we have a directory with almost a hundred loosely related scripts. It's obviously time to organize this, but there's a problem. These scripts import freely from each other and although code reuse is generally a good thing it makes it

Re: attach to process by pid?

2011-03-11 Thread John Nagle
On 3/9/2011 5:38 PM, Miki Tebeka wrote: Is there any way to attach to an already running process by pid? I want to send commands from python to an application that is already running. I don't want to give the command name to subprocess.Popen. We probably need more information. What do you mean

Re: organizing many python scripts, in a large corporate environment.

2011-03-11 Thread eryksun ()
I'm not an expert at Python packaging, but assuming a structure such as folder1 \ __init__.py module1.py folder2 \ __init__.py module2.py Then from the root folder I can run python -m folder1.module1 and within module1, I can import from module2,

Re: Compile time evaluation of dictionaries

2011-03-11 Thread Steven D'Aprano
On Thu, 10 Mar 2011 11:23:32 -0500, Gerald Britton wrote: Today I noticed that an expression like this: one:%(one)s two:%(two)s % {one: is the loneliest number, two: can be as bad as one} could be evaluated at compile time, but is not: [...] Any idea why Python works this way?  I see

[issue11244] Negative tuple elements produce inefficient code.

2011-03-11 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: fold-0.patch looks good to me, but why do you include tests only for the float case (-0.0) and not the integer case (-0)? Style nitpick: def negzero(): return -(1.0-1.0) should be on two source lines, not one. --

  1   2   3   >