Re: Interpreting os.lstat()

2007-07-19 Thread Martin v. Löwis
> (a) Running 'stat' is *not the same* as a system call. Why do you say that? It is *exactly* the same, at least on a POSIX system (on Windows, there is no stat, so the implementation has to map that to several system calls). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Script to POST to web page with cookies?

2007-07-19 Thread Miki
Hello Gille, > I need to write a script to automate fetching data from a web site: > 1. using the POST method, log on, with login/password saved as cookies > 2. download page and extract relevent information using regexes > 3. log off > 4. wait for a random number of minutes, and GOTO 1 > ... http

Re: Pickled objects over the network

2007-07-19 Thread Walker Lindley
Right, I could use Pyro, but I don't need RPC, I just wanted an easy way to send objects across the network. I'm sure both Pyro and Yami can do that and I may end up using one of them. For the initial version pickle will work because we have the networking issues figured out with it, just not the

Re: Open HTML file in IE

2007-07-19 Thread gravey
On Jul 19, 5:59 am, brad <[EMAIL PROTECTED]> wrote: > gravey wrote: > > Hello. > > > Apologies if this is a basic question, but I want to open a HTML > > file from my local drive (is generated by another Python script) > > in Internet Explorer. I've had a look at the webbrowser module and > > this

Re: How to check if an item exist in a nested list

2007-07-19 Thread Miles
Arash Arfaee wrote: > is there any way to check if "IndexError: list index out of > range" happened or going to happen and stop program from terminating? Use a try/except block to catch the IndexError http://docs.python.org/tut/node10.html#SECTION001030 try: do_something_0(M_l

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-19 Thread John Nagle
Juergen Erhard wrote: > On proving programs correct... from my CS study days I distinctly > remember thinking "sure, you can prove it correct, but you cannot do > actual useful stuff with it". We might have come a long way since > then (late 80s :P), but I don't hold out much hope (especially sinc

Re: really small values

2007-07-19 Thread [EMAIL PROTECTED]
On Jul 19, 5:11?pm, Zentrader <[EMAIL PROTECTED]> wrote: > On Jul 17, 2:13 pm, "Dee Asbury" <[EMAIL PROTECTED]> wrote: > > > In multiplying a value of xe^-325 with ye^-4, Python is returning zero. How > > do I get it to give me back my tiny value? > > > Thanks! > > Dee > > Also, Python's decimal cl

Pickled objects over the network

2007-07-19 Thread Rustom Mody
Irmen de Jong wrote > In what way would Pyro be overkill where Yaml (also a module that you need > to install separately) wouldn't be? Sure they are the same to install and sure pyro can do the job (pyro is a nice package). But I got the impression that the questioner wanted to do the networking

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-19 Thread Juergen Erhard
On Thu, Jul 12, 2007 at 11:26:22AM -0700, Paul Rubin wrote: > > Guy Steele used to describe functional programming -- the evaluation > of lambda-calculus without side effects -- as "separation of Church > and state", a highly desirable situation ;-). > > (For non-FP nerds, the above is a pun refe

Using eggs or py2exe to distribute apps

2007-07-19 Thread Marcus
Hi, I'm to the stage where I need to deploy the app I built with wxPython. I've been able to successfully build it w/py2exe into a binary (about 10MB size in total). What I'd like to do is create an automatic updater, so that I can have users download updated versions of my *application code*

Re: Efficiently removing duplicate rows from a 2-dimensional Numeric array

2007-07-19 Thread Terry Reedy
"Alex Mont" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I have a 2-dimensional Numeric array with the shape (2,N) and I want to remove all duplicate rows from the array. For example if I start out with: [[1,2], [1,3], [1,2], [2,3]] I want to end up with [[1,2], [1,3], [2,3]]. ===

Re: subprocess (spawned by os.system) inherits open TCP/UDP/IP port

2007-07-19 Thread Jeff McNeil
What's unexpected about it? Child processes inherit all of the open file descriptors of their parent. A socket is simply another open file descriptor. When your parent process exits, your child still holds a valid, open file descriptor. import sys import socket import os import time s = socket

Re: Newbie: freebsd admin scripting

2007-07-19 Thread Muffin
Thx for the advise. -- http://mail.python.org/mailman/listinfo/python-list

subprocess (spawned by os.system) inherits open TCP/UDP/IP port

2007-07-19 Thread alf
Hi, I need a help with explaining following behavior. Although it is not python issue per say, python helped me to write sample programs and originally I encountered the issue using python software. So let's assume we have two following programs: [myhost] ~> cat ss.py import socket UDPSock=

[2.5] Script to POST to web page with cookies?

2007-07-19 Thread Gilles Ganault
Hello I need to write a script to automate fetching data from a web site: 1. using the POST method, log on, with login/password saved as cookies 2. download page and extract relevent information using regexes 3. log off 4. wait for a random number of minutes, and GOTO 1 I'm a bit confused with ho

Re: Python version changes, sys.executable does not

2007-07-19 Thread Jim Langston
"Jeffrey Froman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello All, > > I have two python versions installed, one in /usr/bin, and one in > /usr/local/bin. However, when invoking python without a full path, > I get the wrong executable with the right sys.executable string! >

Re: Python version changes, sys.executable does not

2007-07-19 Thread Jim Langston
"Jeffrey Froman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello All, > > I have two python versions installed, one in /usr/bin, and one in > /usr/local/bin. However, when invoking python without a full path, > I get the wrong executable with the right sys.executable string! >

Re: Data type conversion

2007-07-19 Thread Steve Holden
ervin ramonllari wrote: > Hello everybody, > > I'm trying to read some tables from a MS Access database and dump them > into a Postgres database. > When I read the attributes data types, I get some numeric values, i.e. > if the data type > of an attribute is TEXT, I get a value 202. I don't know

Re: How to check if an item exist in a nested list

2007-07-19 Thread zacherates
> One way is to check the length of each dimension. Does any body > know a simpler way? No need to check the length of the list: """ >>> foo = [0, 1, 2, [3, 4, 5, 6, 7, [8, 9, 10]]] >>> isInNested(0, foo) True >>> isInNested(11, foo) False >>> isInNested(3, foo) True >>> isInNested(8, foo) True ""

Re: Efficiently removing duplicate rows from a 2-dimensional Numeric array

2007-07-19 Thread Matt McCredie
Could you use a set of tuples? set([(1,2),(1,3),(1,2),(2,3)]) set([(1, 2), (1, 3), (2, 3)]) Matt On 7/19/07, Alex Mont <[EMAIL PROTECTED]> wrote: I have a 2-dimensional Numeric array with the shape (2,N) and I want to remove all duplicate rows from the array. For example if I start out wit

Efficiently removing duplicate rows from a 2-dimensional Numeric array

2007-07-19 Thread Alex Mont
I have a 2-dimensional Numeric array with the shape (2,N) and I want to remove all duplicate rows from the array. For example if I start out with: [[1,2], [1,3], [1,2], [2,3]] I want to end up with [[1,2], [1,3], [2,3]]. (Order of the rows doesn't matter, although order of the two el

Re: class C: vs class C(object):

2007-07-19 Thread Matt McCredie
>How about "broke" instead of "deprecated": > > > >>> class Old: >... def __init__(self): >... self._value = 'broke' >... value = property(lambda self: self._value) >... How is this broken? Properties are not supported for old-style classes. They may not support features introduced in n

Re: Converting between objects

2007-07-19 Thread Ben Finney
"Nathan Harmston" <[EMAIL PROTECTED]> writes: > I have being thinking about this and was wondering with built in types > you can do things like > > float(1) Calls the constructor for the 'float' type, passing the integer 1; the constructor returns a new float object. > str(200) Calls the const

Re: idiom for RE matching

2007-07-19 Thread Reddy
On 7/19/07, Gordon Airporte <[EMAIL PROTECTED]> wrote: I have some code which relies on running each line of a file through a large number of regexes which may or may not apply. For each pattern I want to match I've been writing gotit = mypattern.findall(line) Try to use iterator function f

Re: class C: vs class C(object):

2007-07-19 Thread Aahz
In article <[EMAIL PROTECTED]>, James Stroud <[EMAIL PROTECTED]> wrote: >Aahz wrote: >> In article <[EMAIL PROTECTED]>, >> Steven D'Aprano <[EMAIL PROTECTED]> wrote: >>> >>>It isn't wrong to use the old style, but it is deprecated, [...] >> >> >> Really? Can you point to some official documen

Re: class C: vs class C(object):

2007-07-19 Thread James Stroud
Aahz wrote: > In article <[EMAIL PROTECTED]>, > Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >>It isn't wrong to use the old style, but it is deprecated, [...] > > > Really? Can you point to some official documentation for this? AFAIK, > new-style classes still have not been integrated into t

Re: Itertools question: how to call a function n times?

2007-07-19 Thread jrbj
On Jul 19, 8:35 am, Matthew Wilson <[EMAIL PROTECTED]> wrote: > I want to write a function that each time it gets called, it returns a > random choice of 1 to 5 words from a list of words. > > I can write this easily using for loops and random.choice(wordlist) and > random.randint(1, 5). > > But I

Re: really small values

2007-07-19 Thread Zentrader
On Jul 17, 2:13 pm, "Dee Asbury" <[EMAIL PROTECTED]> wrote: > In multiplying a value of xe^-325 with ye^-4, Python is returning zero. How > do I get it to give me back my tiny value? > > Thanks! > Dee Also, Python's decimal class allows theoretically unlimited precision. I have extremely limited

Re: How to check if an item exist in a nested list

2007-07-19 Thread Will Maier
On Thu, Jul 19, 2007 at 02:43:13PM -0700, Arash Arfaee wrote: > One way is to check the length of each dimension. Does any body > know a simpler way? is there any way to check if "IndexError: list > index out of range" happened or going to happen and stop program > from terminating? If I understan

Re: How to check if an item exist in a nested list

2007-07-19 Thread Matt McCredie
Is there any way to check if an item in specific location in a multiple dimension nested exist? For example something like: if M_list[line][row][d] exist: do_something_0 else: do_something_1 Certainly: try: M_list[line][row][d] except IndexError: do_something_1 else: do_somethin

Re: Copy List

2007-07-19 Thread Jason
On Jul 19, 10:21 am, Falcolas <[EMAIL PROTECTED]> wrote: > On Jul 18, 6:56 am, "Rustom Mody" <[EMAIL PROTECTED]> wrote: > > > This is shallow copy > > If you want deep copy then > > from copy import deepcopy > > What will a "deep copy" of a list give you that using the slice > notation will not? W

How to check if an item exist in a nested list

2007-07-19 Thread Arash Arfaee
Hi All, Is there any way to check if an item in specific location in a multiple dimension nested exist? For example something like: if M_list[line][row][d] exist: do_something_0 else: do_something_1 One way is to check the length of each dimension. Does any body know a simpler way? is there

Re: idiom for RE matching

2007-07-19 Thread Roger Miller
On Jul 18, 6:52 pm, Gordon Airporte <[EMAIL PROTECTED]> wrote: > ... > I've also been assuming that using the re functions that create match > objects is slower/heavier than dealing with the simple list returned by > findall(). I've profiled it and these matches are the biggest part of > the runni

win32com ppt embedded object numbers reverting back to original numbers

2007-07-19 Thread Lance Hoffmeyer
Hey all, I have a script that takes numbers from XL and inserts them into an embedded MSGRAPH dataset in PPT. The problem is that when I reopen the modified document that has been saved as a new filename and activate the embedded datasheet the new numbers that were inserted disappear and the old,

Re: Pickled objects over the network

2007-07-19 Thread Irmen de Jong
Rustom Mody wrote: > Sure pyro may be the solution but it may also be overkill > Why not use safe_load from the yaml module? In what way would Pyro be overkill where Yaml (also a module that you need to install separately) wouldn't be? -irmen -- http://mail.python.org/mailman/listinfo/python-lis

Re: Converting between objects

2007-07-19 Thread Bjoern Schliessmann
Nathan Harmston wrote: > is there way I can define conversion functions like this: > > say i have a class A and a class B > > bobj = B() > aobj = a(bobj) > > in a neater way than just defining a set of methods > > def a(object_to_convert) > # if object_to_convert of type.. > # do s

Data type conversion

2007-07-19 Thread ervin ramonllari
Hello everybody, I'm trying to read some tables from a MS Access database and dump them into a Postgres database. When I read the attributes data types, I get some numeric values, i.e. if the data type of an attribute is TEXT, I get a value 202. I don't know how to convert this number into a vali

Re: Embedding/Extending Python in/with C++: non-static members?

2007-07-19 Thread dmoore
thanks for the responses Nick and "AnonMail" > I'm doing a similar thing, and I would imagine others are also. > > 1. In a python file, set up wrapper functions that the python user > actually uses (e.g FunctionA). Each function corresponds to a > particular C/C++ extension function that you are

Re: UDP broadcast over a specific interface

2007-07-19 Thread [EMAIL PROTECTED]
On Jul 19, 7:09 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Thu, 19 Jul 2007 12:32:02 -, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > >I am trying to send UDP broadcast packets over a specific interface > >and I > >am having trouble specifying the interface: > > >host='192.16

Converting between objects

2007-07-19 Thread Nathan Harmston
Hi, I have being thinking about this and was wondering with built in types you can do things like float(1) or str(200) is there way I can define conversion functions like this: say i have a class A and a class B bobj = B() aobj = a(bobj) in a neater way than just defining a set of methods de

Re: Pure Python equivalent of unix "file" command?

2007-07-19 Thread Will Maier
On Thu, Jul 19, 2007 at 03:29:35PM -0400, W3 wrote: > Just a quick one... Is there such a thing? Debian et al ship Python bindings[0] for file(1)[1]. file works by using a file (/etc/magic) with 'magic' numbers in it to figure out the type of a file. Googling 'python magic' will turn up a few inte

Pure Python equivalent of unix "file" command?

2007-07-19 Thread W3
Hi all, Just a quick one... Is there such a thing? Thanks, /Walter -- -- http://mail.python.org/mailman/listinfo/python-list

Re: Interpreting os.lstat()

2007-07-19 Thread Adrian Petrescu
On Jul 19, 4:27 am, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > Adrian Petrescu <[EMAIL PROTECTED]> writes: > > I checked the online Python documentation > > athttp://python.org/doc/1.5.2/lib/module-stat.html > > but it just says to "consult the documentation for your system.". > > The page you're

Re: A way to re-organize a list

2007-07-19 Thread Gordon Airporte
beginner wrote: > > What I want to do is to reorganize it in groups, first by the middle > element of the tuple, and then by the first element. I'd like the > output look like this: itertools.groupby has already been mentioned, but it has a very specific and complex behavior which may not be exa

Python version changes, sys.executable does not

2007-07-19 Thread Jeffrey Froman
Hello All, I have two python versions installed, one in /usr/bin, and one in /usr/local/bin. However, when invoking python without a full path, I get the wrong executable with the right sys.executable string! [EMAIL PROTE

Re: wxPython and threads

2007-07-19 Thread Nick Craig-Wood
Josiah Carlson <[EMAIL PROTECTED]> wrote: > Nick Craig-Wood wrote: > > I'd dispute that. If you are communicating between threads use a > > Queue and you will save yourself thread heartache. Queue has a non > > blocking read interface Queue.get_nowait(). > > If you have one producer and one co

Re: class C: vs class C(object):

2007-07-19 Thread Aahz
In article <[EMAIL PROTECTED]>, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >It isn't wrong to use the old style, but it is deprecated, [...] Really? Can you point to some official documentation for this? AFAIK, new-style classes still have not been integrated into the standard documentation.

Re: class C: vs class C(object):

2007-07-19 Thread Aahz
In article <[EMAIL PROTECTED]>, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > >To make a long story short: Python 2.2 introduced a new object model >which is more coherent and more powerful than the original one. The old >one was kept so far for compatibility reasons, but there's absolutely n

Re: help with create menu in wxpython

2007-07-19 Thread franciscodg
On 18 jul, 13:55, Stef Mientki <[EMAIL PROTECTED]> wrote: > better ask in the wx discussion group: >[EMAIL PROTECTED] > > cheers, > Stef Mientki thks -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython, searching, and threads

2007-07-19 Thread James Matthews
I have seen this thread for a while and i do not see it on the wxpython list so i am posting it there now and will post a reply if i still see this later! James On 7/19/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: On Jul 18, 3:15 pm, Benjamin <[EMAIL PROTECTED]> wrote: > Hello! I am writin

Re: Posted messages not appearing in this group

2007-07-19 Thread James Matthews
I am also having some issues. There is a post on the list that appeared 7 times because of this issue i think. On 7/19/07, David H Wild <[EMAIL PROTECTED]> wrote: In article <[EMAIL PROTECTED]>, Adrian Petrescu <[EMAIL PROTECTED]> wrote: > Maybe it has shown up and Google simply isn't showin

Re: Copy List

2007-07-19 Thread James Matthews
A slice still has some references to the old objects a deep copy is a totally new object! On 19 Jul 2007 17:04:00 GMT, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: On Thu, 19 Jul 2007 09:21:54 -0700, Falcolas wrote: > On Jul 18, 6:56 am, "Rustom Mody" <[EMAIL PROTECTED]> wrote: >> This

Re: Copy List

2007-07-19 Thread Marc 'BlackJack' Rintsch
On Thu, 19 Jul 2007 09:21:54 -0700, Falcolas wrote: > On Jul 18, 6:56 am, "Rustom Mody" <[EMAIL PROTECTED]> wrote: >> This is shallow copy >> If you want deep copy then >> from copy import deepcopy > > What will a "deep copy" of a list give you that using the slice > notation will not? Well, a d

Re: Itertools question: how to call a function n times?

2007-07-19 Thread Stargaming
Matthew Wilson schrieb: > I want to write a function that each time it gets called, it returns a > random choice of 1 to 5 words from a list of words. > > I can write this easily using for loops and random.choice(wordlist) and > random.randint(1, 5). > > But I want to know how to do this using it

Re: Posted messages not appearing in this group

2007-07-19 Thread David H Wild
In article <[EMAIL PROTECTED]>, Adrian Petrescu <[EMAIL PROTECTED]> wrote: > Maybe it has shown up and Google simply isn't showing it yet. Can > anyone confirm that a thread posted yesterday (July 18th, 2007) whose > title was something like "interpreting os.lstat() output" exists or > not? Tha

Re: Posted messages not appearing in this group

2007-07-19 Thread George Sakkis
On Jul 18, 6:50 am, Alex Popescu <[EMAIL PROTECTED]> wrote: > Sanjay gmail.com> writes: > > > > > Hi All, > > > I tried posting in this group twice since last week, but the messages > > did not appear in the forum. Don't know why. Trying this message > > again... > > > Sanjay > > Something similar

Re: Copy List

2007-07-19 Thread Falcolas
On Jul 18, 6:56 am, "Rustom Mody" <[EMAIL PROTECTED]> wrote: > This is shallow copy > If you want deep copy then > from copy import deepcopy What will a "deep copy" of a list give you that using the slice notation will not? -- http://mail.python.org/mailman/listinfo/python-list

Re: Itertools question: how to call a function n times?

2007-07-19 Thread Wojciech Muła
Matthew Wilson wrote: > I want to write a function that each time it gets called, it returns a > random choice of 1 to 5 words from a list of words. > > I can write this easily using for loops and random.choice(wordlist) and > random.randint(1, 5). > > But I want to know how to do this using iterto

Re: Itertools question: how to call a function n times?

2007-07-19 Thread Bruno Desthuilliers
Matthew Wilson a écrit : > I want to write a function that each time it gets called, it returns a > random choice of 1 to 5 words from a list of words. > > I can write this easily using for loops and random.choice(wordlist) and > random.randint(1, 5). > > But I want to know how to do this using i

Re: wxPython, searching, and threads

2007-07-19 Thread kyosohma
On Jul 18, 3:15 pm, Benjamin <[EMAIL PROTECTED]> wrote: > Hello! I am writing a search engine with wxPython as the GUI. As the > search thread returns items, it adds them to a Queue which is picked > up by the main GUI thread calling itself recursively with > wx.CallAfter. These are then added to a

Re: Break up list into groups

2007-07-19 Thread Matimus
> A little renaming of variables helps it be a bit more elegant I think ... > > def getgroups8(seq): > groups = [] > iseq = iter(xrange(len(seq))) > for start in iseq: > if seq[start] & 0x80: > for stop in iseq: > if seq[stop] & 0x80: >

Re: A way to re-organize a list

2007-07-19 Thread marduk
On Thu, 2007-07-19 at 15:05 +, beginner wrote: > Hi Everyone, > > I have a simple list reconstruction problem, but I don't really know > how to do it. > > I have a list that looks like this: > > l=[ ("A", "a", 1), ("A", "a", 2), ("A", "a", 3), ("A", "b", 1), ("A", > "b", 2), ("B", "a", 1), (

Re: Posted messages not appearing in this group

2007-07-19 Thread Adrian Petrescu
On Jul 18, 3:05 am, Sanjay <[EMAIL PROTECTED]> wrote: > Hi All, > > I tried posting in this group twice since last week, but the messages > did not appear in the forum. Don't know why. Trying this message > again... > > Sanjay I think I'm having the exact same problem. I posted a new thread last n

Itertools question: how to call a function n times?

2007-07-19 Thread Matthew Wilson
I want to write a function that each time it gets called, it returns a random choice of 1 to 5 words from a list of words. I can write this easily using for loops and random.choice(wordlist) and random.randint(1, 5). But I want to know how to do this using itertools, since I don't like manually d

Re: odbc module for python

2007-07-19 Thread Tim Golden
Steve Holden wrote: > Sean Davis wrote: >> What are the alternatives for accessing an ODBC source from python >> (linux 64-bit, python 2.5)? It looks like mxODBC is the only one >> available? >> > There is, I understand, a pyodbc module as well. Having never used it I > can't say how good it is.

Re: odbc module for python

2007-07-19 Thread Steve Holden
Sean Davis wrote: > What are the alternatives for accessing an ODBC source from python > (linux 64-bit, python 2.5)? It looks like mxODBC is the only one > available? > There is, I understand, a pyodbc module as well. Having never used it I can't say how good it is. regards Steve -- Steve Ho

Re: wxPython and threads

2007-07-19 Thread Josiah Carlson
Nick Craig-Wood wrote: > Josiah Carlson <[EMAIL PROTECTED]> wrote: >> Sending results one at a time to the GUI is going to be slow for any >> reasonably fast search engine (I've got a pure Python engine that does >> 50k results/second without breaking a sweat). Don't do that. Instead, >> h

Re: A way to re-organize a list

2007-07-19 Thread Carsten Haese
On Thu, 2007-07-19 at 15:05 +, beginner wrote: > Hi Everyone, > > I have a simple list reconstruction problem, but I don't really know > how to do it. > > I have a list that looks like this: > > l=[ ("A", "a", 1), ("A", "a", 2), ("A", "a", 3), ("A", "b", 1), ("A", > "b", 2), ("B", "a", 1), (

Re: Interpreting os.lstat()

2007-07-19 Thread Sion Arrowsmith
Adrian Petrescu <[EMAIL PROTECTED]> wrote: print os.stat.__doc__ >stat(path) -> stat result > >Perform a stat system call on the given path. > >I checked the online Python documentation at >http://python.org/doc/1.5.2/lib/module-stat.html Someone else has already pointed out that this is ho

Re: A way to re-organize a list

2007-07-19 Thread Alex Martelli
beginner <[EMAIL PROTECTED]> wrote: > Hi Everyone, > > I have a simple list reconstruction problem, but I don't really know > how to do it. > > I have a list that looks like this: > > l=[ ("A", "a", 1), ("A", "a", 2), ("A", "a", 3), ("A", "b", 1), ("A", > "b", 2), ("B", "a", 1), ("B", "b", 1)]

A way to re-organize a list

2007-07-19 Thread beginner
Hi Everyone, I have a simple list reconstruction problem, but I don't really know how to do it. I have a list that looks like this: l=[ ("A", "a", 1), ("A", "a", 2), ("A", "a", 3), ("A", "b", 1), ("A", "b", 2), ("B", "a", 1), ("B", "b", 1)] What I want to do is to reorganize it in groups, first

Re: Real-time Update

2007-07-19 Thread Alex Martelli
Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > "ReTrY" <[EMAIL PROTECTED]> wrote: > > > I'm writing a program with Tkinter GUI, When the program is running it > > need to be updated every five seconds (data comes from internet). How > > should I do that ? How to make a function in main loop ? >

Re: How do you debug when a unittest.TestCase fails?

2007-07-19 Thread Jean-Paul Calderone
On Thu, 19 Jul 2007 09:25:50 -0400, "Emin.shopper Martinian.shopper" <[EMAIL PROTECTED]> wrote: >After poking around the unittest source code, the best solution I could come >up with was to do import unittest; unittest.TestCase.run = lambda self,*args,**kw: >unittest.TestCase.debug(self) > >be

Re: Real-time Update

2007-07-19 Thread kyosohma
On Jul 18, 4:43 pm, [EMAIL PROTECTED] (Aahz) wrote: > In article <[EMAIL PROTECTED]>, > > ReTrY <[EMAIL PROTECTED]> wrote: > > >I'm writing a program with Tkinter GUI, When the program is running it > >need to be updated every five seconds (data comes from internet). How > >should I do that ? How

Re: Embedding/Extending Python in/with C++: non-static members?

2007-07-19 Thread [EMAIL PROTECTED]
On Jul 16, 9:45 am, dmoore <[EMAIL PROTECTED]> wrote: > Hi Folks: > > I have a question about the use of static members in Python/C > extensions. Take the simple example from the "Extending and Embedding > the Python Interpreter" docs: > > A simple module method: > > static PyObject * > spam_system

Re: Issue with CSV

2007-07-19 Thread Harry George
Rohan <[EMAIL PROTECTED]> writes: > Hello, > I'm working on a script which collects some data and puts into a csv > file which could be exported to excel. > so far so good, I'm able to do what I described. > When I run the script for the second time after a certain period of > time the results sho

Re: Real-time Update

2007-07-19 Thread kyosohma
On Jul 18, 3:24 am, ReTrY <[EMAIL PROTECTED]> wrote: > I'm writing a program with Tkinter GUI, When the program is running it > need to be updated every five seconds (data comes from internet). How > should I do that ? How to make a function in main loop ? I'm pretty sure the book "Programming Pyt

Re: How do you debug when a unittest.TestCase fails?

2007-07-19 Thread Emin.shopper Martinian.shopper
After poking around the unittest source code, the best solution I could come up with was to do import unittest; unittest.TestCase.run = lambda self,*args,**kw: unittest.TestCase.debug(self) before running my tests. That patches things so that I can use pdb.pm() when a test fails. Still, that s

Re: Posted messages not appearing in this group

2007-07-19 Thread kyosohma
On Jul 18, 5:50 am, Alex Popescu <[EMAIL PROTECTED]> wrote: > Sanjay gmail.com> writes: > > > > > Hi All, > > > I tried posting in this group twice since last week, but the messages > > did not appear in the forum. Don't know why. Trying this message > > again... > > > Sanjay > > Something similar

Re: UDP broadcast over a specific interface

2007-07-19 Thread Jean-Paul Calderone
On Thu, 19 Jul 2007 12:32:02 -, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >I am trying to send UDP broadcast packets over a specific interface >and I >am having trouble specifying the interface: > >host='192.168.28.255' >sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) >sock.bind((

Re: wxPython, searching, and threads

2007-07-19 Thread kyosohma
On Jul 18, 11:38 am, Benjamin <[EMAIL PROTECTED]> wrote: > Hello! I am writing a search engine with wxPython as the GUI. As the > search thread returns items, it adds them to a Queue which is picked > up by the main GUI thread calling itself recursively with > wx.CallAfter. These are then added to

UDP broadcast over a specific interface

2007-07-19 Thread [EMAIL PROTECTED]
I am trying to send UDP broadcast packets over a specific interface and I am having trouble specifying the interface: host='192.168.28.255' sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.bind(('',0)) sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) sock.setsockopt(socket.IP

Re: Implementaion of random.shuffle

2007-07-19 Thread Neil Cerutti
On 2007-07-19, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Wed, 18 Jul 2007 19:32:35 +, George Sakkis wrote: > >> On Jul 16, 10:51 pm, Steven D'Aprano >> <[EMAIL PROTECTED]> wrote: >>> On Mon, 16 Jul 2007 16:55:53 +0200, Hrvoje Niksic wrote: >>> > 2**19937 being a really huge number, it's i

Re: wxPython and threads

2007-07-19 Thread Nick Craig-Wood
Josiah Carlson <[EMAIL PROTECTED]> wrote: > Sending results one at a time to the GUI is going to be slow for any > reasonably fast search engine (I've got a pure Python engine that does > 50k results/second without breaking a sweat). Don't do that. Instead, > have your search thread create

Re: Open HTML file in IE

2007-07-19 Thread imageguy
On Jul 18, 3:20 am, gravey <[EMAIL PROTECTED]> wrote: > Hello. > > Apologies if this is a basic question, but I want to open a HTML > file from my local drive (is generated by another Python script) > in Internet Explorer. I've had a look at the webbrowser module and > this doesn't seem to be what

Re: wxPython and threads

2007-07-19 Thread Iain King
On Jul 18, 3:41 am, Benjamin <[EMAIL PROTECTED]> wrote: > I'm writing a search engine in Python with wxPython as the GUI. I have > the actual searching preformed on a different thread from Gui thread. > It sends it's results through a Queue to the results ListCtrl which > adds a new item. This work

Re: Log Memory Usage

2007-07-19 Thread Will Maier
On Thu, Jul 19, 2007 at 04:35:56AM -0500, Will Maier wrote: > On Thu, Jul 19, 2007 at 09:52:36AM +0100, Robert Rawlins - Think Blue wrote: > > I have a scheduled event which occurs every minute, i just need a > > code solution to give me the systems current memory consumptions > > details, is there

Re: Log Memory Usage

2007-07-19 Thread Will Maier
On Thu, Jul 19, 2007 at 09:52:36AM +0100, Robert Rawlins - Think Blue wrote: > I have a scheduled event which occurs every minute, i just need a > code solution to give me the systems current memory consumptions > details, is there perhaps something in the os module? I don't know of anything in th

Log Memory Usage

2007-07-19 Thread Robert Rawlins - Think Blue
Hello Guys, I have an embedded application with a suspected memory leak which I'm trying to confirm. You see, the application seems to crash unexpectedly and when looking at the resource consumption after the crash system memory has crept up to nearly 100%. However this takes quite a long t

Re: Interpreting os.lstat()

2007-07-19 Thread Hrvoje Niksic
Adrian Petrescu <[EMAIL PROTECTED]> writes: > I checked the online Python documentation at > http://python.org/doc/1.5.2/lib/module-stat.html > but it just says to "consult the documentation for your system.". The page you're looking for is at http://www.python.org/doc/current/lib/os-file-dir.ht

Re: Real-time Update

2007-07-19 Thread Hendrik van Rooyen
"ReTrY" <[EMAIL PROTECTED]> wrote: > I'm writing a program with Tkinter GUI, When the program is running it > need to be updated every five seconds (data comes from internet). How > should I do that ? How to make a function in main loop ? Short answer: use the after method to set up a periodic s

New Python opportunity in Boston

2007-07-19 Thread Sandy Kontos
Hello, My name is Sandy Kontos and I have a Python/Jython role here in Boston for 3-6 months. Should you have any interest in the Boston area please give either myself and/or Mo Bitahi a call at 781 449 0600 Thank you Sandy Sandy Kontos Overture Partners, LLC 75 Se

Re: Interprocess communication woes

2007-07-19 Thread Nick Craig-Wood
Murali <[EMAIL PROTECTED]> wrote: > After some investigation, I found out that this problem had nothing to > do with my GUI app not getting refreshed and I was able to reproduce > this problem with normal python scripts. Here is one such script > > #File test.py > from subprocess import Popen

Re: class C: vs class C(object):

2007-07-19 Thread Steven D'Aprano
On Thu, 19 Jul 2007 07:31:06 +, nvictor wrote: > Hi, > > I'm not an experienced developer, and I came across this statement by > reading a code. I search for explanation, but can't find anything > meaningful. I read the entire document written by python's creator > about the features of versi

Re: wxPython and threads

2007-07-19 Thread Josiah Carlson
Benjamin wrote: > I'm writing a search engine in Python with wxPython as the GUI. I have > the actual searching preformed on a different thread from Gui thread. > It sends it's results through a Queue to the results ListCtrl which > adds a new item. This works fine or small searches, but when the >

Re: class C: vs class C(object):

2007-07-19 Thread Lutz Horn
Hi, On Thu, 19 Jul 2007 09:40:24 +0200, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > there's absolutely no reason to use it no more since "new-style" classes > can do anything "Classic" classes did and much more. IOW, don't even > bother with old-style classes. Just for the records: the

Re: class C: vs class C(object):

2007-07-19 Thread Bruno Desthuilliers
nvictor a écrit : > Hi, > > I'm not an experienced developer, and I came across this statement by > reading a code. I search for explanation, but can't find anything > meaningful. I read the entire document written by python's creator > about the features of version 2.2 The one named unifying type

class C: vs class C(object):

2007-07-19 Thread nvictor
Hi, I'm not an experienced developer, and I came across this statement by reading a code. I search for explanation, but can't find anything meaningful. I read the entire document written by python's creator about the features of version 2.2 The one named unifying types and classes. But This docume

Direct Client -Sr.Software Engineer Python-San Jose CA -Locals only

2007-07-19 Thread Kan
Hello, We have requirement for Sr.Software Engineer in San Jose CA with very strong experinece in PYTHON AND LINUX . If your skills and experience matches with the same, send me your resume asap with contact # and rate to '[EMAIL PROTECTED]'. Locals only pls apply TECHNICAL SKILLS REQUIREMENTS:

Direct Client-Web Designer/Web Architect-Bay Area,CA

2007-07-19 Thread Kan
Hello, We have requirement for Web Designer/Web Architect in bay area CA. The person needs to have experience in building Commerce Site where Actual Shopping has been done. If your skills and experience matches with the same, send me your resume asap with contact # and rate to '[EMAIL PROTECTED]'.

  1   2   >