Re: Plugin framework - Overcomplicating things?

2008-03-26 Thread Gabriel Genellina
En Thu, 27 Mar 2008 01:50:56 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribió: > All this comes to my question - am I overcomplicating this project? I > can understand the use of something like the trac component system if > I had multiple components and plugins that handled different areas

Re: counting using variable length string as base

2008-03-26 Thread Dan Bishop
On Mar 27, 1:15 am, Grimsqueaker <[EMAIL PROTECTED]> wrote: > Hi, I'm fairly new to Python and to this list. I have a problem that > is driving me insane, sorry if it seems simple to everyone, I've been > fighting with it for a while. :)) > > I want to take a variable length string and use it as a

Re: Python 2.2.1 and select()

2008-03-26 Thread Derek Martin
On Wed, Mar 26, 2008 at 07:11:15PM -0700, Noah Spurrier wrote: > >def set_nonblock(fd): > > flags = fcntl.fcntl(fd, fcntl.F_GETFL) > > fcntl.fcntl(fd, fcntl.F_SETFL, flags | os.O_NONBLOCK) > > > >Then in the function, after calling popen: > > set_nonblock(io.fromchild.fileno()) > >

counting using variable length string as base

2008-03-26 Thread Grimsqueaker
Hi, I'm fairly new to Python and to this list. I have a problem that is driving me insane, sorry if it seems simple to everyone, I've been fighting with it for a while. :)) I want to take a variable length string and use it as a base for counting, eg. given the string 'abc' the sequence would be:

Re: copy file over LAN

2008-03-26 Thread Astan Chee
Well, the solution seems to be something like (windows only) import os import os.path import shutil import sys import win32wnet def wnet_connect(host, username, password): unc = ''.join(['', host]) try: win32wnet.WNetAddConnection2(0, None, unc, None, username, password) excep

Re: copy file over LAN

2008-03-26 Thread Gabriel Genellina
En Thu, 27 Mar 2008 00:34:20 -0300, Astan Chee <[EMAIL PROTECTED]> escribió: > I have a file on another machine on the local network (my machine and > local machines are on windows) and I want to copy it locally. Now the > machine requires authentication and when I try to do a > import shutil > sh

Re: Line segments, overlap, and bits

2008-03-26 Thread castironpi
On Mar 26, 9:16 pm, Paul Rubin wrote: > Sean Davis <[EMAIL PROTECTED]> writes: > > OR, NOT, etc.).  Any suggestions on how to (1) set up the bit string > > and (2) operate on 1 or more of them?  Java has a BitSet class that > > keeps this kind of thing pretty clean and hi

Re: GUI toolkits with Tkinter's .pack() alternative

2008-03-26 Thread Alex9968
Guilherme Polo wrote: > 2008/3/26, Alex9968 <[EMAIL PROTECTED]>: > >> Hi all, >> >> I use Tkinter's Pack widget geometry manager (I really prefer it over >> using visual GUI designers), so my question is which other GUI toolkits >> have similar functionality. >> > > The geometry manager

Re: copy file over LAN

2008-03-26 Thread Teja
On Mar 27, 8:34 am, Astan Chee <[EMAIL PROTECTED]> wrote: > Hi, > I have afileon another machine on the localnetwork(my machine and > local machines are on windows) and I want tocopyit locally. Now the > machine requires authentication and when I try to do a > import shutil > shutil.copy(r'\\remote

Re: parsing json output

2008-03-26 Thread Gowri
Hi all, Thank you so much for all your help :) I really appreciate it. I discovered that my problem was because of my firewall and everything works now :) Regards, Gowri -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess.popen function with quotes

2008-03-26 Thread skunkwerk
On Mar 26, 8:05 am, Jeffrey Froman <[EMAIL PROTECTED]> wrote: > skunkwerk wrote: > > p = subprocess.Popen(['rename','-vn','s/(.*)\.htm$/ > > model.html/','*.htm'],stdout=subprocess.PIPE,stderr=subprocess.PIPE) > > print p.communicate()[0] > > > i change to print p.communicate()[1] in case the outpu

Re: A question on decorators

2008-03-26 Thread castironpi
On Mar 26, 10:02 pm, alex23 <[EMAIL PROTECTED]> wrote: > On Mar 27, 8:30 am, [EMAIL PROTECTED] wrote: > > > I want the * to precede the dot too.  Let's yack.  I want to compile > > Python.  Did you see my new post?  I like it.  Do you have any time > > you don't want?  Time sale.  Diez is still mad

Re: last mouse movment or keyboard hit

2008-03-26 Thread Ron Eggler
Gabriel Genellina wrote: >>> En Wed, 26 Mar 2008 00:38:08 -0300, Ron Eggler <[EMAIL PROTECTED]> >>> escribió: >>> >>> >> I would like to get the time of the most recent human activity like a >>> >> cursor >>> >> movement or a key hit. >>> >> Does anyone know how I can get this back to start some a

Re: last mouse movment or keyboard hit

2008-03-26 Thread Ron Eggler
azrael wrote: > You can use wxPython. Take a look on the DemoFiles that you can > download also from the site. I remember that there has been a demo of > capturing mouse coordinates and also one example about capturing Which > key has been pressed at which time. > Just start the time, count the in

Re: SoC project: Python-Haskell bridge - request for feedback

2008-03-26 Thread Michał Janeczek
Hi, This is my second take on the project proposal. I have expanded on a few points, and hopefully also clarified a little bit. Please comment :) Regards, Michal Python-Haskell bridge = Description --- This project will seek to provide a comprehensive, high level

Plugin framework - Overcomplicating things?

2008-03-26 Thread [EMAIL PROTECTED]
As a side project and a learning experience and ultimately, a good tool for my department, I started developing a simple jabber bot for our work's conference server, with the intention of making it capable of running specific commands and utilities. I realize there are other bots out there, but I

Re: SoC project: Python-Haskell bridge - request for feedback

2008-03-26 Thread Michał Janeczek
Thanks for finding time to reply! On 26 Mar 2008 01:46:38 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > A few thoughts. The envisioned Python-Haskell bridge would have two > directions: 1) calling Haskell code from Python; 2) calling Python > code from Haskell. The proposal spend

copy file over LAN

2008-03-26 Thread Astan Chee
Hi, I have a file on another machine on the local network (my machine and local machines are on windows) and I want to copy it locally. Now the machine requires authentication and when I try to do a import shutil shutil.copy(r'\\remotemachine\c$\temp\filename',r'C:\folder\test.txt') and it gives

Re: Can my own objects support tuple unpacking?

2008-03-26 Thread Scott David Daniels
Patrick Toomey wrote: > ... I am trying to figure out how tuple unpacking behavior works > a,b,c,d = e > > Is a method called, such as __getitem__ for each index on the left > (0,1,2,3)? I thought this was logical, ... > > class Foo: > def __getitem__(self, index): > print index >

Re: Why does python behave so? (removing list items)

2008-03-26 Thread Carl Banks
On Mar 26, 11:30 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Wed, 26 Mar 2008 23:12:27 +0100, Thomas Dybdahl Ahle wrote: > > On Wed, 2008-03-26 at 23:04 +0100, Michał Bentkowski wrote: > >> Why does python create a reference here, not just copy the variable? > > > Python,

Re: Why does python behave so? (removing list items)

2008-03-26 Thread Steven D'Aprano
On Wed, 26 Mar 2008 23:12:27 +0100, Thomas Dybdahl Ahle wrote: > On Wed, 2008-03-26 at 23:04 +0100, Michał Bentkowski wrote: >> Why does python create a reference here, not just copy the variable? > > Python, like most other oo languages, will always make references for =, > unless you work on na

Can my own objects support tuple unpacking?

2008-03-26 Thread Patrick Toomey
Hello, So, I am new to python, but I always like to learn the ins and outs of a language by trying to understand how everything fits together. Anyway, I am trying to figure out how tuple unpacking behavior works. Specifically, what happens when I do the following: a,b,c,d = e Is a meth

Re: A question on decorators

2008-03-26 Thread alex23
On Mar 27, 8:30 am, [EMAIL PROTECTED] wrote: > I want the * to precede the dot too. Let's yack. I want to compile > Python. Did you see my new post? I like it. Do you have any time > you don't want? Time sale. Diez is still mad at me. I want > primitives to structure themselves so I can pic

genetic algors in practical application

2008-03-26 Thread castironpi
I want to go in to construction. However, 'I' means 'newsgroup' and 'want to go' means 'is'. If you had an army of two-micron spiders, could we build something? Use case is an American skyscraper. They have powerful tricks. Clearly they can withstand a force. These can withstand more combined,

Re: Line segments, overlap, and bits

2008-03-26 Thread Paul Rubin
Sean Davis <[EMAIL PROTECTED]> writes: > OR, NOT, etc.). Any suggestions on how to (1) set up the bit string > and (2) operate on 1 or more of them? Java has a BitSet class that > keeps this kind of thing pretty clean and high-level, but I haven't > seen anything like it for python. You could wr

Re: Not understanding lamdas and scoping

2008-03-26 Thread castironpi
On Mar 26, 5:03 pm, Joshua Kugler <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > On Mar 26, 5:02 pm, Joshua Kugler <[EMAIL PROTECTED]> wrote: > > >> I am trying to use lamdba to generate some functions, and it is not > >> working > >> the way I'd expect.  The code is below, followed by the r

Re: first interactive app

2008-03-26 Thread castironpi
On Mar 26, 5:11 pm, Miki <[EMAIL PROTECTED]> wrote: > Hello Tim, > > > > > > > I want to write a tiny interactive app for the following situation: > > I have books of many chapters that must be split into volumes before going > > to the printer. > > A volume can have up to 600 pages. We obviously b

Re: Line segments, overlap, and bits

2008-03-26 Thread George Sakkis
On Mar 26, 5:28 pm, Sean Davis <[EMAIL PROTECTED]> wrote: > I am working with genomic data. Basically, it consists of many tuples > of (start,end) on a line. I would like to convert these tuples of > (start,end) to a string of bits where a bit is 1 if it is covered by > any of the regions describ

[ANN] Twisted 8.0

2008-03-26 Thread Christopher Armstrong
http://twistedmatrix.com/ MASSACHUSETTS (DP) -- Version 8.0 of the Twisted networking framework has been released, Twisted Matrix Laboratories announced Wednesday. Enslaved by his new robotic overloads, Master of the Release Christopher Armstrong presented the new package to the Internet on March

Re: Line segments, overlap, and bits

2008-03-26 Thread castironpi
On Mar 26, 5:10 pm, [EMAIL PROTECTED] wrote: > Sean Davis>Java has a BitSet class that keeps this kind of thing > pretty clean and high-level, but I haven't seen anything like it for > python.< > > If you look around you can usually find Python code able to do most of > the things you want, like (y

Re: Why does python behave so? (removing list items)

2008-03-26 Thread castironpi
On Mar 26, 5:28 pm, [EMAIL PROTECTED] wrote: > Micha³ Bentkowski: > > > Why does python create a reference here, not just copy the variable? > > I think to increase performance, in memory used and running time (and > to have a very uniform way of managing objects). > > Bye, > bearophile A variable

Re: Not understanding lamdas and scoping

2008-03-26 Thread George Sakkis
On Mar 26, 6:03 pm, Joshua Kugler <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > On Mar 26, 5:02 pm, Joshua Kugler <[EMAIL PROTECTED]> wrote: > > >> I am trying to use lamdba to generate some functions, and it is not > >> working > >> the way I'd expect. The code is below, followed by the r

Re: A question on decorators

2008-03-26 Thread castironpi
On Mar 26, 6:02 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Wed, 26 Mar 2008 18:01:31 -0300, George Sakkis   > <[EMAIL PROTECTED]> escribió: > > > On Mar 26, 3:41 pm, Tim Henderson <[EMAIL PROTECTED]> wrote: > > >> I am using mysql, and sqlite is not appropriate for my situation since >

Re: Daylight savings time problem

2008-03-26 Thread Salsa
Yeah, I guess it would, but it doesn't feel like the "right" way to do it. Isn't there a way I can set tm_isdst to "-1"? Or at least slice the time_struct and then add another element to its end when passing it to mktime? Thanks for all your help! --- "D'Arcy J.M. Cain" <[EMAIL PROTECTED]>

Re: subtract dates with time module

2008-03-26 Thread Gabriel Genellina
En Wed, 26 Mar 2008 20:47:45 -0300, barronmo <[EMAIL PROTECTED]> escribió: > I'm trying to get the difference in dates using the time module rather > than datetime because I need to use strptime() to convert a date and > then find out how many weeks and days until that date. I'm a beginner > so a

Re: Python 2.2.1 and select()

2008-03-26 Thread Derek Martin
On Wed, Mar 26, 2008 at 09:49:51AM -0700, Noah Spurrier wrote: > On 2008-03-24 22:03-0400, Derek Martin wrote: > >That's an interesting thought, but I guess I'd need you to elaborate > >on how the buffering mode would affect the operation of select(). I > >really don't see how your explanation can

Re: Some notes on a high-performance Python application.

2008-03-26 Thread John Nagle
Heiko Wundram wrote: > Am Mittwoch, 26. März 2008 18:54:29 schrieb Michael Ströder: >> Heiko Wundram wrote: >>> Am Mittwoch, 26. März 2008 17:33:43 schrieb John Nagle: > I didn't say it was unusual or frowned upon (and I was also taught this at > uni > IIRC as a means to "easily" distribute syst

subtract dates with time module

2008-03-26 Thread barronmo
I'm trying to get the difference in dates using the time module rather than datetime because I need to use strptime() to convert a date and then find out how many weeks and days until that date. I'm a beginner so any help would be appreciated. Here is the code: def OBweeks(ptID): qry = 'SEL

Re: How to convert latex-based docs written with Python 2.5 to 2.6 framework

2008-03-26 Thread Gabriel Genellina
En Wed, 26 Mar 2008 16:37:21 -0300, Michael Ströder <[EMAIL PROTECTED]> escribió: > I had a look on how Doc/ is organized with Python 2.6. There are files > with > suffix .rst. Hmm... > > I'm maintaing existing docs for python-ldap which I might have to > convert to > the new concept in the

Re: what does ^ do in python

2008-03-26 Thread Gabriel Genellina
En Wed, 26 Mar 2008 16:14:07 -0300, David Anderson <[EMAIL PROTECTED]> escribió: > The right question was:HOw can we use/express pointers python as in C or > Pascal? I think you should read this article: http://effbot.org/zone/python-objects.htm and then: http://effbot.org/zone/call-by-object

Re: A question on decorators

2008-03-26 Thread Gabriel Genellina
En Wed, 26 Mar 2008 18:01:31 -0300, George Sakkis <[EMAIL PROTECTED]> escribió: > On Mar 26, 3:41 pm, Tim Henderson <[EMAIL PROTECTED]> wrote: > >> I am using mysql, and sqlite is not appropriate for my situation since >> some of the databases and tables I access are being accessed by other >> a

Re: A question on decorators

2008-03-26 Thread castironpi
On Mar 26, 3:23 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Tim Henderson schrieb: > > > > > > > Hello > > > I am writing an application that has a mysql back end and I have this > > idea to simplify my life when accessing the database. The idea is to > > wrap the all the functions dealing

Re: Why does python behave so? (removing list items)

2008-03-26 Thread bearophileHUGS
Michał Bentkowski: > Why does python create a reference here, not just copy the variable? I think to increase performance, in memory used and running time (and to have a very uniform way of managing objects). Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: memory allocation for Python list

2008-03-26 Thread bearophileHUGS
dmitrey: > As I have mentioned, I don't know final length of the list, but > usually I know a good approximation, for example 400. You may want to use collections.deque too, it doesn't produce a Python list, but it's quite fast in appending (it's a linked list of small arrays). Bye, bearophile --

Re: Filtering a Python list to uniques

2008-03-26 Thread Gabriel Genellina
En Wed, 26 Mar 2008 15:50:30 -0300, kellygreer1 <[EMAIL PROTECTED]> escribió: > On Mar 26, 5:45 am, hellt <[EMAIL PROTECTED]> wrote: >> On 26 ÍÁÒ, 02:30,kellygreer1<[EMAIL PROTECTED]> wrote: >> >> > What is the best way to filter a Python list to its unique members? > How come the Set() thing s

Re: Why does python behave so? (removing list items)

2008-03-26 Thread Dan Bishop
On Mar 26, 5:12 pm, Thomas Dybdahl Ahle <[EMAIL PROTECTED]> wrote: > On Wed, 2008-03-26 at 23:04 +0100, Michał Bentkowski wrote: > > Why does python create a reference here, not just copy the variable? > > Python, like most other oo languages, will always make references for =, > unless you work on

Re: Why does python behave so? (removing list items)

2008-03-26 Thread Jarek Zgoda
Michał Bentkowski pisze: > Why does python create a reference here, not just copy the variable? Because Python works like that -- it uses names and values idiom. If you change value, all names will be bound to the same changed value. j=range(0,6) k=j del j[0] j > [1, 2, 3, 4,

Re: Why does python behave so? (removing list items)

2008-03-26 Thread Waldemar Osuch
On Mar 26, 4:04 pm, "Michał Bentkowski" <[EMAIL PROTECTED]> wrote: > Why does python create a reference here, not just copy the variable? > > >>> j=range(0,6) > >>> k=j > >>> del j[0] > >>> j > [1, 2, 3, 4, 5] > >>> k > > [1, 2, 3, 4, 5] > > Shouldn't k remain the same? http://www.effbot.org/zone/

Re: first interactive app

2008-03-26 Thread Miki
Hello Tim, > I want to write a tiny interactive app for the following situation: > I have books of many chapters that must be split into volumes before going > to the printer. > A volume can have up to 600 pages. We obviously break the book into volumes > only at chapter breaks. Since some chapter

Re: Line segments, overlap, and bits

2008-03-26 Thread bearophileHUGS
Sean Davis>Java has a BitSet class that keeps this kind of thing pretty clean and high-level, but I haven't seen anything like it for python.< If you look around you can usually find Python code able to do most of the things you want, like (you can modify this code to add the boolean operations):

Re: Why does python behave so? (removing list items)

2008-03-26 Thread Thomas Dybdahl Ahle
On Wed, 2008-03-26 at 23:04 +0100, Michał Bentkowski wrote: > Why does python create a reference here, not just copy the variable? Python, like most other oo languages, will always make references for =, unless you work on native types (numbers and strings). Instead use one of: k = j[:] or k = [

Re: py2exe socket.gaierror (10093)

2008-03-26 Thread Thomas Heller
Knut schrieb: >> The script can't resolve the server name. Try to do it by hand using >> nslookup or even ping (you may want to add a few print statements inside >> the script to see the exact host name it is trying to connect to, in case >> it isn't what you expect) >> If you can't resolve the hos

Re: Newbie: unsigned shift right

2008-03-26 Thread Mark Dickinson
On Mar 26, 5:42 pm, Sal <[EMAIL PROTECTED]> wrote: > Is there any way to do an unsigned shift right in Python? When I enter > (-1>>1) the answer is -1. What I'm looking for is the equivalent of an > unsigned shift in C or the ">>>" operator in Java. What answer were you hoping for, and why? 2**31

Why does python behave so? (removing list items)

2008-03-26 Thread Michał Bentkowski
Why does python create a reference here, not just copy the variable? >>> j=range(0,6) >>> k=j >>> del j[0] >>> j [1, 2, 3, 4, 5] >>> k [1, 2, 3, 4, 5] Shouldn't k remain the same? -- Michał Bentkowski [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Not understanding lamdas and scoping

2008-03-26 Thread Joshua Kugler
George Sakkis wrote: > On Mar 26, 5:02 pm, Joshua Kugler <[EMAIL PROTECTED]> wrote: > >> I am trying to use lamdba to generate some functions, and it is not >> working >> the way I'd expect. The code is below, followed by the results I'm >> getting. More comments below that. >> >> (...) >> >> S

Re: py2exe socket.gaierror (10093)

2008-03-26 Thread Knut
> The script can't resolve the server name. Try to do it by hand using > nslookup or even ping (you may want to add a few print statements inside > the script to see the exact host name it is trying to connect to, in case > it isn't what you expect) > If you can't resolve the host name using nslook

Newbie: unsigned shift right

2008-03-26 Thread Sal
Is there any way to do an unsigned shift right in Python? When I enter (-1>>1) the answer is -1. What I'm looking for is the equivalent of an unsigned shift in C or the ">>>" operator in Java. -- http://mail.python.org/mailman/listinfo/python-list

RE: Do any of you recommend Python as a first programming language?

2008-03-26 Thread Carnell, James E
I vote a strong yes! I went through a MIS major and learned java first. This was a disaster for me typing these long nonsense lines (I didn't understand how classes and their members worked). Next was C and we had to use a command line and notepad to do all our programs. I really didn't learn much

Re: _tkinter fails when installing Python 2.4.4

2008-03-26 Thread Diez B. Roggisch
jgelfand schrieb: > On Mar 26, 7:02 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> I think the actual problem is that the linking doesn't find the >> XftGlyphExtends. I can only guess, but it might be related to >> 64-bit-problems. Make sure you have the library that contains the >> XftGlyphE

Line segments, overlap, and bits

2008-03-26 Thread Sean Davis
I am working with genomic data. Basically, it consists of many tuples of (start,end) on a line. I would like to convert these tuples of (start,end) to a string of bits where a bit is 1 if it is covered by any of the regions described by the (start,end) tuples and 0 if it is not. I then want to d

Re: Not understanding lamdas and scoping

2008-03-26 Thread George Sakkis
On Mar 26, 5:02 pm, Joshua Kugler <[EMAIL PROTECTED]> wrote: > I am trying to use lamdba to generate some functions, and it is not working > the way I'd expect. The code is below, followed by the results I'm > getting. More comments below that. > > (...) > > So, is there some scoping issue with

Re: Daylight savings time problem

2008-03-26 Thread D'Arcy J.M. Cain
On Wed, 26 Mar 2008 20:45:47 - Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2008-03-26, Salsa <[EMAIL PROTECTED]> wrote: > > >I'm sorry, but could you be more specific? How exactly should I use UTC? > > In my experience, using local time for timestamps is always a > big mistake, so I pre

Re: Daylight savings time problem

2008-03-26 Thread D'Arcy J.M. Cain
On Wed, 26 Mar 2008 13:23:23 -0700 (PDT) Salsa <[EMAIL PROTECTED]> wrote: >I'm sorry, but could you be more specific? How exactly should I use UTC? Pardon me. I misread. I thought that you were creating the files. I see that you are reading files created by someone else. Still, would "os.e

Re: A question on decorators

2008-03-26 Thread George Sakkis
On Mar 26, 3:41 pm, Tim Henderson <[EMAIL PROTECTED]> wrote: > I am using mysql, and sqlite is not appropriate for my situation since > some of the databases and tables I access are being accessed by other > applications which are already written and live. I am not using the > SQLAlchemy or SQLObj

Not understanding lamdas and scoping

2008-03-26 Thread Joshua Kugler
I am trying to use lamdba to generate some functions, and it is not working the way I'd expect. The code is below, followed by the results I'm getting. More comments below that. patterns = ( ('[sxz]$', '$','es'), ('[^aeioudgkprt]h$', '$', 'es'), ('[^aeiou]y$', 'y$', 'ies'), ('$',

Re: Daylight savings time problem

2008-03-26 Thread Grant Edwards
On 2008-03-26, Salsa <[EMAIL PROTECTED]> wrote: >I'm sorry, but could you be more specific? How exactly should I use UTC? In my experience, using local time for timestamps is always a big mistake, so I presume he meant don't use local time in the file names -- put the UTC date/time in the fil

RE: Do any of you recommend Python as a first programming language?

2008-03-26 Thread Delaney, Timothy (Tim)
Steven D'Aprano wrote: > On Sat, 22 Mar 2008 21:11:51 -0700, sturlamolden wrote: > >> Yes. And because Python is a "scripting language" > > > Python is a programming language. It can be used for scripting, but > that's not all it can do. Describing it as a "scripting language" is > like describ

Python / C++ embed halfway working - question about constructors

2008-03-26 Thread jpw
I am running my C++ / Python App on a MacBook Pro with 2.5 installed I have had some success in that I can load a module, get the class, get the reference, but when the python class calls another python class I don't ever seem to get the object back from the constructor. I am doing the following

Re: Daylight savings time problem

2008-03-26 Thread Salsa
I'm sorry, but could you be more specific? How exactly should I use UTC? -- Fabio Durieux Lopes - Salsa - Original Message From: D'Arcy J.M. Cain <[EMAIL PROTECTED]> To: Fabio Durieux Lopes <[EMAIL PROTECTED]> Cc: python-list@python.org Sent: Wednesday, March 26, 2008 4:49:57 PM Subj

Re: A question on decorators

2008-03-26 Thread Diez B. Roggisch
Tim Henderson schrieb: > Hello > > I am writing an application that has a mysql back end and I have this > idea to simplify my life when accessing the database. The idea is to > wrap the all the functions dealing with a particular row in a > particular in a particular table inside a class. So if y

first interactive app

2008-03-26 Thread Tim Arnold
hi, I want to write a tiny interactive app for the following situation: I have books of many chapters that must be split into volumes before going to the printer. A volume can have up to 600 pages. We obviously break the book into volumes only at chapter breaks. Since some chapters make a natural

PyODBC Stored proc calling

2008-03-26 Thread Michael Owings
This is probably pretty late to be replying but I had the same problem. As it turns out, you just need to be sure you use the correct syntax to call the sproc: db_cur.execute( "{call test_bed(?)}", ('test data string') ) -- Teleoperate a roving mobile robot from the web: http://www.swampgas.com

Re: what does ^ do in python

2008-03-26 Thread Dan Stromberg
On Wed, 26 Mar 2008 19:45:34 +0100, Heiko Wundram wrote: > Am Mittwoch, 26. März 2008 19:04:44 schrieb David Anderson: >> HOw can we use express pointers as in C or python? > > There's no such thing as a pointer in Python, so you can't "express" > them either. Was this what you were trying to ask

Re: Running a python program as main...

2008-03-26 Thread Rick Dooling
On Mar 26, 9:12 am, waltbrad <[EMAIL PROTECTED]> wrote: > On his command line he types: > > C:\...\PP3E>Launcher.py > > and this begins the program. Doesn't work for me. I have to type: > > C:\...\PP3E>python Launcher.py > > Is this a typo on his part or has he configured his settings in such a >

Re: Daylight savings time problem

2008-03-26 Thread D'Arcy J.M. Cain
On Wed, 26 Mar 2008 19:37:16 - "Fabio Durieux Lopes" <[EMAIL PROTECTED]> wrote: >I'm trying to execute some operations based on a file's time. The > file's time is actually the file's name (e.g. FILE1_20080326170558). >So I do this: >fileTimeInSecs = time.mktime(time.strptime(timeS

How to convert latex-based docs written with Python 2.5 to 2.6 framework

2008-03-26 Thread Michael Ströder
HI! I had a look on how Doc/ is organized with Python 2.6. There are files with suffix .rst. Hmm... I'm maintaing existing docs for python-ldap which I might have to convert to the new concept in the long run. What's the recommended procedure for doing so? Any pointer? Ciao, Michael. -- http

Re: A question on decorators

2008-03-26 Thread Tim Henderson
Mike Driscoll said: > Besides, you should use sqlite rather than pickle databases. It's > especially easy since sqlite is included with Python 2.5. I am using mysql, and sqlite is not appropriate for my situation since some of the databases and tables I access are being accessed by other applicati

Re: Filtering a Python list to uniques

2008-03-26 Thread Jerry Hill
On Wed, Mar 26, 2008 at 2:50 PM, kellygreer1 <[EMAIL PROTECTED]> wrote: > How come the Set() thing seems to work for some people and I get the > 'unhashable' error? > > How do you test for 'membership' on a dictionary? > > # where tmp is the non-unique list > # dct is a dictionary where each u

Daylight savings time problem

2008-03-26 Thread Fabio Durieux Lopes
Hi, I'm trying to execute some operations based on a file's time. The file's time is actually the file's name (e.g. FILE1_20080326170558). So I do this: fileTimeInSecs = time.mktime(time.strptime(timeString, "%Y%m%d%H%M")) timeString contains the date part of the file's name. Fun

distutils crashing: $MACOSX_DEPLOYMENT_TARGET mismatch

2008-03-26 Thread Justin S Bayer
Hi group, When starting a distutils script (which I mostly consider as a black box) distutils crashes with the following traceback: Traceback (most recent call last): File "pyrexcompile.py", line 50, in cmdclass = {'build_ext': build_ext}) File "/sw/lib/python2.5/distutils/core.py", line

Re: A question on decorators

2008-03-26 Thread Mike Driscoll
On Mar 26, 2:10 pm, Tim Henderson <[EMAIL PROTECTED]> wrote: > Hello > > I am writing an application that has a mysql back end and I have this > idea to simplify my life when accessing the database. The idea is to > wrap the all the functions dealing with a particular row in a > particular in a par

Re: what does ^ do in python

2008-03-26 Thread David Anderson
ANd... By express I mean... Dereferencing... Habits from my native language where the verb express also means this On Wed, Mar 26, 2008 at 4:14 PM, David Anderson <[EMAIL PROTECTED]> wrote: > Err even I cant understand what I wrote... > The right question was:HOw can we use/express pointers pyth

A question on decorators

2008-03-26 Thread Tim Henderson
Hello I am writing an application that has a mysql back end and I have this idea to simplify my life when accessing the database. The idea is to wrap the all the functions dealing with a particular row in a particular in a particular table inside a class. So if you have a table that looks like thi

Re: what does ^ do in python

2008-03-26 Thread David Anderson
Err even I cant understand what I wrote... The right question was:HOw can we use/express pointers python as in C or Pascal? But thx to Heiko, He got what I mean =) On Wed, Mar 26, 2008 at 3:46 PM, Tim Chase <[EMAIL PROTECTED]> wrote: > >> HOw can we use express pointers as in C or python? > > > >

Re: Py2exe embed my modules to libary.zip

2008-03-26 Thread Gabriel Genellina
En Wed, 26 Mar 2008 15:38:16 -0300, Tzury Bar Yochay <[EMAIL PROTECTED]> escribió: >> and then when my application execute code how can I set path to >> d3dx module to "library.zip/d3dx.py". >> I'm not sure is this properly set question. > > use the module zipimport > http://docs.python.org/

Re: Beta testers needed for a high performance Python application server

2008-03-26 Thread Manlio Perillo
Il Wed, 26 Mar 2008 00:22:38 -0700, John Nagle ha scritto: > Graham Dumpleton wrote: >> Yes that is a viable option, as still are existing fastcgi solutions >> for Apache, lighttpd and nginx. > > Fast cgi is a good technology, Well, not really so good: http://twistedmatrix.com/pipermail/twi

Re: Beta testers needed for a high performance Python application server

2008-03-26 Thread Manlio Perillo
Il Tue, 25 Mar 2008 20:31:39 +, Minor Gordon ha scritto: > Hello all, > > I'm looking for beta testers for a high performance, event-driven Python > application server I've developed. > > About the server: the front end and other speed-critical parts of the > server are written in portable,

Re: Filtering a Python list to uniques

2008-03-26 Thread kellygreer1
On Mar 26, 5:45 am, hellt <[EMAIL PROTECTED]> wrote: > On 26 ÍÁÒ, 02:30,kellygreer1<[EMAIL PROTECTED]> wrote: > > > What is the best way to filter a Python list to its unique members? > > I tried some method using Set but got some "unhashable" error. > > > lstone = [ 1, 2, 3, 3, 4, 5, 5, 6 ] > > #

Re: what does ^ do in python

2008-03-26 Thread Tim Chase
>> HOw can we use express pointers as in C or python? > > Traceback (most recent call last): >File "", line 1, in >File "parser.py", line 123, in parse_text > tree = language.parse_text(text) >File "english.py", line 456, in parse_text > tree = self.parse_sentence(sentence)

Re: what does ^ do in python

2008-03-26 Thread Michael Wieher
On Wed, Mar 26, 2008 at 1:36 PM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Wed, 26 Mar 2008 15:04:44 -0300, David Anderson <[EMAIL PROTECTED]> > escribió: > > > HOw can we use express pointers as in C or python? > > File "english.py", line 345, in parse_sentence > raise ParserError,

Re: what does ^ do in python

2008-03-26 Thread Heiko Wundram
Am Mittwoch, 26. März 2008 19:04:44 schrieb David Anderson: > HOw can we use express pointers as in C or python? There's no such thing as a pointer in Python, so you can't "express" them either. Was this what you were trying to ask? -- Heiko Wundram -- http://mail.python.org/mailman/listinfo/p

Re: Py2exe embed my modules to libary.zip

2008-03-26 Thread Tzury Bar Yochay
> and then when my application execute code how can I set path to > d3dx module to "library.zip/d3dx.py". > I'm not sure is this properly set question. use the module zipimport http://docs.python.org/lib/module-zipimport.html -- http://mail.python.org/mailman/listinfo/python-list

Re: what does ^ do in python

2008-03-26 Thread Gabriel Genellina
En Wed, 26 Mar 2008 15:04:44 -0300, David Anderson <[EMAIL PROTECTED]> escribió: > HOw can we use express pointers as in C or python? Traceback (most recent call last): File "", line 1, in File "parser.py", line 123, in parse_text tree = language.parse_text(text) File "english.py

Re: Py2exe embed my modules to libary.zip

2008-03-26 Thread Gabriel Genellina
En Wed, 26 Mar 2008 14:55:43 -0300, <[EMAIL PROTECTED]> escribió: > Does anybody have any idea how can I embed my modules to libary.zip > and use it from my application.For example if user write this code in > my TextEntry ( or something like that, textentry is created with > wxpython ) : > > impo

Re: Some notes on a high-performance Python application.

2008-03-26 Thread Heiko Wundram
Am Mittwoch, 26. März 2008 18:54:29 schrieb Michael Ströder: > Heiko Wundram wrote: > > Am Mittwoch, 26. März 2008 17:33:43 schrieb John Nagle: > >> ... > >> > >> Using MySQL as a queueing engine across multiple servers is unusual, > >> but it works well. It has the nice feature that the queue

Re: naive packaging question

2008-03-26 Thread Carl Banks
On Mar 26, 12:33 pm, Scott Sharkey <[EMAIL PROTECTED]> wrote: > Here's the directory structure that I've got so far: > > project top level directory >setup.py >company eventually, we'll have other modules > __init__.py > error.py

Re: Tkinter menus from keyboard

2008-03-26 Thread MartinRinehart
Eric Brunel wrote: > BTW, this "standard" is not universal at all: e.g, there is no such > convention on Macs. Thanks for the info. It's standard on Windows and Linux/KDE. GNOME, anyone? -- http://mail.python.org/mailman/listinfo/python-list

Re: what does ^ do in python

2008-03-26 Thread David Anderson
HOw can we use express pointers as in C or python? On Tue, Mar 25, 2008 at 7:36 PM, Tim Chase <[EMAIL PROTECTED]> wrote: > > In most of the languages ^ is used for 'to the power of'. > > > > No, not in most languages. In most languages (C, C++, Java, C#, Python, > > Fortran, ...), ^ is the xor op

Py2exe embed my modules to libary.zip

2008-03-26 Thread vedrandekovic
Hello, Does anybody have any idea how can I embed my modules to libary.zip and use it from my application.For example if user write this code in my TextEntry ( or something like that, textentry is created with wxpython ) : import d3dx # directpython module frame=d3dx.Frame(u"My frame") # create

Re: Some notes on a high-performance Python application.

2008-03-26 Thread Michael Ströder
Heiko Wundram wrote: > Am Mittwoch, 26. März 2008 17:33:43 schrieb John Nagle: >> ... >> >> Using MySQL as a queueing engine across multiple servers is unusual, >> but it works well. It has the nice feature that the queue ordering >> can be anything you can write in a SELECT statement. So we p

  1   2   >