Re: How can I programmatically find the name of a method from within that method?

2007-08-08 Thread Peter Otten
Tony wrote: > On Aug 8, 9:28 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > >> No, just wrong. >> >> >> class A: >> >> ... def alpha(self): return dir(self)[-2] >> ... def gamma(self): return dir(self)[-1] >> ...>>> a = A() >> >>> a.alpha(), a.gamma() >> ('alpha', 'gamma') >> >>> a.beta = 4

Re: how to get output.

2007-08-08 Thread Diez B. Roggisch
indu_shreenath schrieb: > Hey, > I want to get the output of "DIR /AD /B" command to a varriable using > python. How can I do this? Using the subprocess-module. However, I'm not sure what DIR /AD /B does - but there are many functions in module os that might deliver what you want without invok

how to get output.

2007-08-08 Thread indu_shreenath
Hey, I want to get the output of "DIR /AD /B" command to a varriable using python. How can I do this? Thanks, Indu -- http://mail.python.org/mailman/listinfo/python-list

Re: Destruction of generator objects

2007-08-08 Thread Stefan Bellon
On Thu, 09 Aug, Graham Dumpleton wrote: > result = application(environ, start_response) > try: > for data in result: > if data:# don't send headers until body appears > write(data) > if not headers_sent: > write('') # send heade

Re: accessing parts of large files with File.seek()

2007-08-08 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
On Aug 8, 7:37 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Aug 8, 11:46 am, "mhearne808[insert-at-sign-here]gmail[insert-dot- > > > > here]com" <[EMAIL PROTECTED]> wrote: > > I'm having a problem with the File object's seek() method. > > Specifically, I cannot use it to seek to a locati

wxPython before MainLoop

2007-08-08 Thread [david]
I'd like to refresh the display before I start the main loop. I have code like this: app = App() app.Show() app.long_slow_init() app.MainLoop() The main frame partly loads at Show, but because the mainloop has not started yet, the display does not update until long_slow_init() finishes. Alter

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread Evan Klitzke
On 8/8/07, greg <[EMAIL PROTECTED]> wrote: > Istvan Albert wrote: > > A solution would be writing the code with a logging function to begin > > with, alas many times that is out of one's hand. > > If the code has been written with calls to a builtin > print function, the situation isn't much better

mmm-mode, python-mode and doctest-mode?

2007-08-08 Thread Edward Loper
> Anyone testing on xemacs? I tried it, and C-c C-c sent xemacs into an > infinite loop (apparantly). It works fine for me in XEmacs 21.4 (patch 17) (i386-debian-linux, Mule). If you could answer a few questions, it might help me track down the problem: - What version of xemacs are you runnin

Re: How can I programmatically find the name of a method from within that method?

2007-08-08 Thread faulkner
On Aug 8, 10:43 pm, faulkner <[EMAIL PROTECTED]> wrote: > On Aug 8, 12:45 am, kj7ny <[EMAIL PROTECTED]> wrote: > > > Is there a way that I can programmatically find the name of a method I > > have created from within that method? I would like to be able to log > > a message from within that method

Re: what's the point of pow()?

2007-08-08 Thread Paul Rubin
[EMAIL PROTECTED] writes: > it's a serious question: why does the builtin pow function exist? > for two argument pow we've got **. there's no add() for + or mul() > for * They are in the operator module and maybe pow could go there too. Actually there's a math.pow function that works differ

Re: Issues of state (was: Tkinter or wxpython?)

2007-08-08 Thread Paul Rubin
[EMAIL PROTECTED] (Cameron Laird) writes: > Others have answered this at other levels. In elementary terms, > there truly is a difference, Paul, and one that's widely reified: > a "desktop client-server" application typically listens through > one socket, which therefore constitutes an index of th

Re: How can I programmatically find the name of a method from within that method?

2007-08-08 Thread faulkner
On Aug 8, 12:45 am, kj7ny <[EMAIL PROTECTED]> wrote: > Is there a way that I can programmatically find the name of a method I > have created from within that method? I would like to be able to log > a message from within that method (def) and I would like to include > the name of the method from w

Re: accessing parts of large files with File.seek()

2007-08-08 Thread [EMAIL PROTECTED]
On Aug 8, 11:46 am, "mhearne808[insert-at-sign-here]gmail[insert-dot- here]com" <[EMAIL PROTECTED]> wrote: > I'm having a problem with the File object's seek() method. > Specifically, I cannot use it to seek to a location in a binary file > that is greater than 2^31 (2147483648). This seems unnece

Re: Something in the function tutorial confused me.

2007-08-08 Thread Steve Holden
greg wrote: > Steve Holden wrote: > >> For some reason your reply got right up my nose, > > I'm sorry about that. Sometimes it's hard to judge the > level of experience with Python that a poster has. In > discussions about this particular topic, often it turns > out that the person is a newcomer

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread greg
Istvan Albert wrote: > A solution would be writing the code with a logging function to begin > with, alas many times that is out of one's hand. If the code has been written with calls to a builtin print function, the situation isn't much better. You could monkeypatch the print function, but that's

Re: Something in the function tutorial confused me.

2007-08-08 Thread greg
Steve Holden wrote: > For some reason your reply got right up my nose, I'm sorry about that. Sometimes it's hard to judge the level of experience with Python that a poster has. In discussions about this particular topic, often it turns out that the person is a newcomer to Python who is using the

EXCELLENT advice on "foreign brides"

2007-08-08 Thread bstevens
You've seen them a million times: those fascinating web sites with thousands of pictures of foreign women, many of them incredibly beautiful, and every one of them saying she is "looking for a kind, gentle man who will love me," and likes "cooking, sewing, and making a cozy home" and "walking and h

Re: some import / namespace questions

2007-08-08 Thread Graham Dumpleton
On Aug 9, 1:11 am, stef mientki <[EMAIL PROTECTED]> wrote: > hello, > > I'm working on a rather strange program, > that is partially build dynamically, > and where users can create plugins, > without knowing any of the details of the core program. > > Of course this leads to some weird bugs, > so o

Re: Issues of state

2007-08-08 Thread greg
Paul Rubin wrote: > The high bandwidth and persistence is not needed for an http > connection, which just gets a form submission once in a while. Bandwidth isn't really the main issue. The point is that a lot of state is kept on both ends, making it much easier to implement a rich user interface.

what's the point of pow()?

2007-08-08 Thread richyjsm
it's a serious question: why does the builtin pow function exist? for two argument pow we've got **. there's no add() for + or mul() for * and three argument pow-with-modulo seems like specilaist usage that belongs in the standard lib, not in the core. I know about crypto and number theory

Re: Destruction of generator objects

2007-08-08 Thread Graham Dumpleton
On Aug 8, 8:28 am, Stefan Bellon <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm generating a binding from Python to C using SWIG. On the C side I > have iterators over some data structures. On the Python side I > currently use code like the following: > > def get_data(obj): > result = []

Re: Launch file from Python

2007-08-08 Thread [EMAIL PROTECTED]
On Aug 8, 2:39 pm, [EMAIL PROTECTED] wrote: > On Aug 8, 2:35 pm, Arnau Sanchez <[EMAIL PROTECTED]> wrote: > > > > > > > [EMAIL PROTECTED] escribió: > > > > That's just the exit status or run status, if I recall correctly. I > > > think 0 (i.e. False) means it didn't run properly and anything else i

Re: some import / namespace questions

2007-08-08 Thread Steve Holden
stef mientki wrote: > Marc 'BlackJack' Rintsch wrote: >> On Wed, 08 Aug 2007 17:11:19 +0200, stef mientki wrote: >> >> >>> Now it's not possible to import in the existing modules the main plugin, >>> like >>>from Main_User import * >>> because this will start the infinite loop. >>> >>

Re: How can I programmatically find the name of a method from within that method?

2007-08-08 Thread Tony
On Aug 8, 9:28 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > No, just wrong. > > >> class A: > > ... def alpha(self): return dir(self)[-2] > ... def gamma(self): return dir(self)[-1] > ...>>> a = A() > >>> a.alpha(), a.gamma() > ('alpha', 'gamma') > >>> a.beta = 42 > >>> a.alpha(), a.gamma(

Re: some import / namespace questions

2007-08-08 Thread stef mientki
Marc 'BlackJack' Rintsch wrote: > On Wed, 08 Aug 2007 17:11:19 +0200, stef mientki wrote: > > >> Now it's not possible to import in the existing modules the main plugin, >> like >>from Main_User import * >> because this will start the infinite loop. >> > > Which means there's code at t

RE: Jython - problem import os

2007-08-08 Thread Delaney, Timothy (Tim)
[EMAIL PROTECTED] wrote: > I'm using Jython in combination with Java, webservices and jboss4.0.4. > > The webservice is implemented in java and creates an PythonInterpreter > object which loads the jython scripts. > I wrote an jython script which uses a function from another jython > file called

Re: Destruction of generator objects

2007-08-08 Thread Stefan Bellon
On Wed, 08 Aug, MRAB wrote: > Simple! :-) Sorry, I forgot to mention that I am forced to using Python 2.4. -- Stefan Bellon -- http://mail.python.org/mailman/listinfo/python-list

Re: Destruction of generator objects

2007-08-08 Thread MRAB
On Aug 7, 11:28 pm, Stefan Bellon <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm generating a binding from Python to C using SWIG. On the C side I > have iterators over some data structures. On the Python side I > currently use code like the following: > > def get_data(obj): > result = []

Re: help a n00b with a Zope site-package install

2007-08-08 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > I am having a general problem getting Zope installed as part of my > linux distro. We have a general problem solving problems that lack any concrete description of what is not working. We need stacktraces and so forth. Maybe reading this helps: http://catb.org/~es

Re: Google Conspiracy Revealed!

2007-08-08 Thread Bill Sornson
[EMAIL PROTECTED] wrote: > http://www.nasaconspiracy.net/2007/06/content-generator-recognizing-generated.html > - Amazing Google Conspiracies Revealed from CIA, NSA and Government > conspiracies and Dr.Kevorkians magic pills. Ironically, forwarded to Gmail Abuse -- E-mail Address(es): [EMAIL PROT

Re: How to reset sys.exec_prefix?

2007-08-08 Thread Steve Holden
Bryan wrote: > Bryan wrote: >> Somehow on my linux box I scrood things up and I lost my python path info. >> >> If I check sys.exec_prefix or sys.prefix it shows '/usr/local/', where >> it should show '/usr/'. >> >> Is there a config file somewhere that I can change to fix this, or do I >> need t

Re: Release of Pmw.1.3

2007-08-08 Thread Laurent Pointal
Two problems when trying setup.py installation: * archive unzip into a ./src/Pmw directory - IMHO src is not a good name. * setup.py install failed: [EMAIL PROTECTED] src]# gunzip -c /home/laurent/nobackup/download/Pmw.1.3.tar.gz | tar -xv [EMAIL PROTECTED] src]# cd src [EMAIL PROTECTED] src]#

Re: testing

2007-08-08 Thread Ben Finney
nikolay marinov <[EMAIL PROTECTED]> writes: > Hi,there.I'm a young tester (4 months,still learning what is "testing > > software!?!"). I work on Linux and i write my tests with Python. [many more lines of quoted text] Is this a response to another message? I didn't see any parts of the message

Re: How to reset sys.exec_prefix?

2007-08-08 Thread Bryan
Bryan wrote: > Somehow on my linux box I scrood things up and I lost my python path info. > > If I check sys.exec_prefix or sys.prefix it shows '/usr/local/', where > it should show '/usr/'. > > Is there a config file somewhere that I can change to fix this, or do I > need to do a rebuild/reins

Re: How to avoid reverse code engineering of a python executable

2007-08-08 Thread Ben Finney
NicolasG <[EMAIL PROTECTED]> writes: > Now I want to proceed a little bit further asking how can I avoid > (or at least make it difficult) for some one to extract my code by > using reverse code engineer techniques? I came on pyobfuscate but I > would like more suggestions and guide to achieve th

How to reset sys.exec_prefix?

2007-08-08 Thread Bryan
Somehow on my linux box I scrood things up and I lost my python path info. If I check sys.exec_prefix or sys.prefix it shows '/usr/local/', where it should show '/usr/'. Is there a config file somewhere that I can change to fix this, or do I need to do a rebuild/reinstall? Hope not. Thanks, B

Re: 'Advanced' list comprehension? query

2007-08-08 Thread scottishguy
Thanks for some great explanations and alternatives! I'll go with the any() approach, as its nice and readable (my noShowList is quite small compared to myList). Thanks, John, for the 'make it obvious' tip. As an exercise, if I now wanted to show the entries where the 'noShowList' matches, what

help a n00b with a Zope site-package install

2007-08-08 Thread sdoty044
I am having a general problem getting Zope installed as part of my linux distro. Sadly, I have always used Python on Windows, and now I am have to do some work for Linux. My goal is to compile a SuSE linux distro of Python with all the same site-packages that I am using on Windows. The only thin

Re: Issues of state (was: Tkinter or wxpython?)

2007-08-08 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: . . . >I'm not sure what you're getting at in this context. You can write a >desktop app where the window system communicates with a gui toolkit >th

Re: Seek the one billionth line in a file containing 3 billion lines.

2007-08-08 Thread Terry Reedy
"Marc 'BlackJack' Rintsch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On Wed, 08 Aug 2007 09:54:26 +0200, Méta-MCI \(MVP\) wrote: | | > Create a "index" (a file with 3,453,299,000 tuples : | > line_number + start_byte) ; this file has fix-length lines. | > slow, OK, but once. |

Re: A question on plugin design

2007-08-08 Thread Grzegorz Słodkowicz
Very insightful, thank you for your replies. I was initially thinking it would be simpler to implement my own system but perhaps using a ready-made one will be more elegant and potential plugin makers would find it more familiar. Cheers, Greg. -- http://mail.python.org/mailman/listinfo/python-

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread Martin v. Löwis
> I don't see how file() can be "removed", actually, unless the > file type itself is getting axed. Indeed, that's the case. Py3k won't use stdio for file input and output, but the io module. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I programmatically find the name of a method from within that method?

2007-08-08 Thread Peter Otten
Tony wrote: > Is this cheating? Isn't it harder to calculate the magic indices than just writing down the names twice? > class a: > def square(self, x): > print 'executing:', dir(self)[-1] > print x*x > def cube(self, x): > print '

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread Neil Cerutti
On 2007-08-08, Paul Rubin wrote: > Istvan Albert <[EMAIL PROTECTED]> writes: >> apply(), callable(), coerce(), file(), reduce(), reload() > > reduce() is really gone? Maybe itertools can get an > ireduce function or something like that? I don't see how file() can be "removed", actually, un

Re: Stop a thread on deletion

2007-08-08 Thread Sjoerd Op 't Land
Dear Cris, Thanks a lot. This works! (What you didn't know, there was already such a 'proxy' object in the design, so it isn't the hack it looks ;).) Thanks again, Sjoerd Op 't Land Chris Mellon schreef: > On 8/8/07, Sjoerd Op 't Land <[EMAIL PROTECTED]> wrote: >> Hello all, >> >> I'm using thr

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread Paul Rubin
Istvan Albert <[EMAIL PROTECTED]> writes: > apply(), callable(), coerce(), file(), reduce(), reload() reduce() is really gone? Maybe itertools can get an ireduce function or something like that? -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I programmatically find the name of a method from within that method?

2007-08-08 Thread Tony
On Aug 8, 8:25 am, Peter Otten <[EMAIL PROTECTED]> wrote: > kj7ny wrote: > > What is @checkPrivs (see example copied below from other post)? In > > fact... how does the thing work at all? > > @checkPrivs > > def add(a,b): > > return a+b > > @... is called a decorator and is just a fancy way of

Re: Launch file from Python

2007-08-08 Thread kyosohma
On Aug 8, 2:35 pm, Arnau Sanchez <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] escribió: > > > That's just the exit status or run status, if I recall correctly. I > > think 0 (i.e. False) means it didn't run properly and anything else is > > True, or ok. Something like that. > > The other way: 0 m

Re: Launch file from Python

2007-08-08 Thread Arnau Sanchez
[EMAIL PROTECTED] escribió: > That's just the exit status or run status, if I recall correctly. I > think 0 (i.e. False) means it didn't run properly and anything else is > True, or ok. Something like that. The other way: 0 means "ok" while everything else means error (at least in UNIX). The re

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread Neil Cerutti
On 2007-08-08, Istvan Albert <[EMAIL PROTECTED]> wrote: > On Aug 8, 2:00 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > >> I thought, in fact, that open was on more shaky ground. ;) > > yeah, that too ... OK, I had misremembered. The current docs say that open is preferred, and that file should rat

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread Istvan Albert
On Aug 8, 2:00 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > I thought, in fact, that open was on more shaky ground. ;) yeah, that too ... > I can't find any evidence of that in the PEPs. Do you have a reference? here is something: http://svn.python.org/view/python/branches/p3yk/Misc/NEWS?rev=

Google Conspiracy Revealed!

2007-08-08 Thread conspiracy . black3
http://www.nasaconspiracy.net/2007/06/content-generator-recognizing-generated.html - Amazing Google Conspiracies Revealed from CIA, NSA and Government conspiracies and Dr.Kevorkians magic pills. -- http://mail.python.org/mailman/listinfo/python-list

tokenize module after installation

2007-08-08 Thread vedrandekovic
Hi, I have one more question about installation. After installation my program that uses tokenize module,when I run myprogram.exe (vgsveki.exe): Traceback (most recent call last): File "vgsveki.py", line 307, in kompajlati File "vgsveki.py", line 302, in kompajlati_proces File "vgsveki.py"

Re: Launch file from Python

2007-08-08 Thread kyosohma
On Aug 8, 1:11 pm, jocago <[EMAIL PROTECTED]> wrote: > The application, however, never runs. I'll give the sub-process a > shot. Thanks. Well, that's a problem. I suppose the best thing to try is use some smaller sets of flags and see if they work. Instead of your long string, try something small

Re: Tkinter or wxpython?

2007-08-08 Thread Chris Mellon
On 8/8/07, Kevin Walzer <[EMAIL PROTECTED]> wrote: > Chris Mellon wrote: > > >> What do you mean here? Things like keyboard accelerators, menu > >> placement, and so on? Those things are already natively implemented by > >> Tk, and the developer just needs to invoke them. Sometimes some > >> condit

Re: Tkinter or wxpython?

2007-08-08 Thread Kevin Walzer
Chris Mellon wrote: >> What do you mean here? Things like keyboard accelerators, menu >> placement, and so on? Those things are already natively implemented by >> Tk, and the developer just needs to invoke them. Sometimes some >> conditional code is required for stuff like keyboard accelerators (t

WinPdb?

2007-08-08 Thread Dick Moores
The only debugging I've done so far is to put in print statements where I want to see what's happening. But it's often "through a glass darkly". However, I just discovered that my excellent (IMO) Python editor, Ulipad, comes with WinPdb, and I'm thinking it's about time I learned how to use a deb

Re: Launch file from Python

2007-08-08 Thread jocago
On Aug 8, 1:36 pm, [EMAIL PROTECTED] wrote: > On Aug 8, 12:28 pm, [EMAIL PROTECTED] wrote: > > > Good afternoon from someone who is trying to learn Python. > > > I would like to launch an app from within a Python script. From the > > examples I have found, I should be able to do this with os.system

Re: Something in the function tutorial confused me.

2007-08-08 Thread Neil Cerutti
On 2007-08-08, Steve Holden <[EMAIL PROTECTED]> wrote: > Carsten Haese wrote: >> On Wed, 2007-08-08 at 08:52 -0400, Steve Holden wrote: > [...] >> The problem is your ambiguous use of the word "assignment." In >> the sense of the Language Reference, "any assignment to y" is >> a simple assignment t

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread Neil Cerutti
On 2007-08-08, Istvan Albert <[EMAIL PROTECTED]> wrote: > On Aug 6, 6:49 am, Neil Cerutti <[EMAIL PROTECTED]> wrote: >> Incidentally, from the second link I find it shocking that the >> keyword parameter "file" shadows a builtin. It seems to >> endorse a bad practice. > > I believe that the "file"

RE: 'Advanced' list comprehension? query

2007-08-08 Thread John Krukoff
John Krukoff wrote: > > [EMAIL PROTECTED] wrote: > > Hi, > > > > I'm playing around with list comprehension, and I'm trying to find the > > most aesthetic way to do the following: > > > > I have two lists: > > > > noShowList = ['one', 'two', 'three'] > > > > myList = ['item one', 'item four', 'thr

RE: 'Advanced' list comprehension? query

2007-08-08 Thread John Krukoff
[EMAIL PROTECTED] wrote: > Hi, > > I'm playing around with list comprehension, and I'm trying to find the > most aesthetic way to do the following: > > I have two lists: > > noShowList = ['one', 'two', 'three'] > > myList = ['item one', 'item four', 'three item'] > > I want to show all the ite

Re: This bit of code hangs Python Indefinitely

2007-08-08 Thread Paddy
> You could possibly make a case that before Queue.put blocks it should check > whether the program has more than just the one thread and if not it should > raise an RTFMException. Cute :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Launch file from Python

2007-08-08 Thread kyosohma
On Aug 8, 12:28 pm, [EMAIL PROTECTED] wrote: > Good afternoon from someone who is trying to learn Python. > > I would like to launch an app from within a Python script. From the > examples I have found, I should be able to do this with os.system. > > I use this: > os.system("xplanet-1.2.0/xplanet.e

Re: the one python book

2007-08-08 Thread Dick Moores
At 10:22 AM 8/5/2007, vasudevram wrote: > > On Aug 4, 7:23 am, "dhr" <[EMAIL PROTECTED]> wrote: > > > > > newbie question: > > > > > Is there a 'K&R" type of Python book? The book that you'd better have on > > > your shelf if you are going into Python? > > > >Python in a Nutshell, the Python Cookbo

Doctest in Python implementations

2007-08-08 Thread Paddy
Hi, I'm wanting to update the Wikipedia entry on doctest with information on which current python implementations support the doctest module. So, does Doctest come with ironpython, jython, python for Nokia phones (what is that called)? Thanks. -- http://mail.python.org/mailman/listinfo/python-li

Launch file from Python

2007-08-08 Thread jocago
Good afternoon from someone who is trying to learn Python. I would like to launch an app from within a Python script. From the examples I have found, I should be able to do this with os.system. I use this: os.system("xplanet-1.2.0/xplanet.exe -fontsize 24 -label -target earth -lat 33.65 -lon -84.

Removing tags with BeautifulSoup

2007-08-08 Thread sebzzz
Hi, I'm in the process of cleaning some html files with BeautifulSoup and I want to remove all traces of the tables. Here is the bit of the code that deals with tables: def remove(soup, tagname): for tag in soup.findAll(tagname): contents = tag.contents parent = tag.parent

Re: Tkinter or wxpython?

2007-08-08 Thread Chris Mellon
On 8/8/07, Kevin Walzer <[EMAIL PROTECTED]> wrote: > Chris Mellon wrote: > > On 8/8/07, Kevin Walzer <[EMAIL PROTECTED]> wrote: > > > Using Tile, of course, loses you the first major benefit of Tk - that > > it's already included in the standard library. So in this sense it's > > still "ugly old sc

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread Istvan Albert
On Aug 8, 12:08 pm, Paul Boddie <[EMAIL PROTECTED]> wrote: > However, for every enthusiast of one approach, there > will always be an enthusiast for another (see point #6): True. For example I for one also like the way the current print adds a newline, the vast majority of the time that is exact

Re: 'Advanced' list comprehension? query

2007-08-08 Thread Jason
On Aug 8, 10:00 am, [EMAIL PROTECTED] wrote: > Hi, > > I'm playing around with list comprehension, and I'm trying to find the > most aesthetic way to do the following: > > I have two lists: > > noShowList = ['one', 'two', 'three'] > > myList = ['item one', 'item four', 'three item'] > > I want to s

accessing parts of large files with File.seek()

2007-08-08 Thread mhearne808[insert-at-sign-here]gmail[insert-dot-here]com
I'm having a problem with the File object's seek() method. Specifically, I cannot use it to seek to a location in a binary file that is greater than 2^31 (2147483648). This seems unnecessarily limiting, as it is common these days to have files larger than 2 GB. Is there some LargeFile object out

Re: 'Advanced' list comprehension? query

2007-08-08 Thread [EMAIL PROTECTED]
On Aug 8, 10:00 am, [EMAIL PROTECTED] wrote: > Hi, > > I'm playing around with list comprehension, and I'm trying to find the > most aesthetic way to do the following: > > I have two lists: > > noShowList = ['one', 'two', 'three'] > > myList = ['item one', 'item four', 'three item'] > > I want to s

Re: SciPy's site is down

2007-08-08 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Can anyone else not reach scipy.org? It's working for me. Of course, I'm 50 feet away from it. But I can also reach it from elsewhere, too. > Am trying to install scipy and > numpy. Further, is there an equivalent of numpy that will install > correctly on Python 2.5 on

Re: Tkinter or wxpython?

2007-08-08 Thread Kevin Walzer
Chris Mellon wrote: > On 8/8/07, Kevin Walzer <[EMAIL PROTECTED]> wrote: > Using Tile, of course, loses you the first major benefit of Tk - that > it's already included in the standard library. So in this sense it's > still "ugly old school look and feel" vs "no external dependencies", > which is

Re: 'Advanced' list comprehension? query

2007-08-08 Thread Peter Otten
[EMAIL PROTECTED] wrote: > I'm playing around with list comprehension, and I'm trying to find the > most aesthetic way to do the following: > > I have two lists: > > noShowList = ['one', 'two', 'three'] > > myList = ['item one', 'item four', 'three item'] > > I want to show all the items from

Re: 'Advanced' list comprehension? query

2007-08-08 Thread BartlebyScrivener
On Aug 8, 11:00 am, [EMAIL PROTECTED] wrote: > Hi, > > I'm playing around with list comprehension, and I'm trying to find the > most aesthetic way to do the following: > > I have two lists: > > noShowList = ['one', 'two', 'three'] > > myList = ['item one', 'item four', 'three item'] > > I want to s

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread Paul Boddie
On 8 Aug, 16:26, Istvan Albert <[EMAIL PROTECTED]> wrote: > On Aug 6, 6:11 am, Paul Rubin wrote: > > > Why on earth did they make this change? It just seems gratuitous. > > Having print a function (with parameters) makes is very easy to modify > where the output goes. I

Re: This bit of code hangs Python Indefinitely

2007-08-08 Thread Steve Holden
brad wrote: > Marc 'BlackJack' Rintsch wrote: > >> Why did you put an upper bound to the queue? > > For clarity. Explicit is better than implicit, right? In our design, the > queue should only have x number of things, so why not show that? Other > than that, the limit is arbitrary and is not ne

Re: some import / namespace questions

2007-08-08 Thread Marc 'BlackJack' Rintsch
On Wed, 08 Aug 2007 17:11:19 +0200, stef mientki wrote: > Now it's not possible to import in the existing modules the main plugin, > like >from Main_User import * > because this will start the infinite loop. Which means there's code at the module level. Tell the users to put that into a fun

'Advanced' list comprehension? query

2007-08-08 Thread pyscottishguy
Hi, I'm playing around with list comprehension, and I'm trying to find the most aesthetic way to do the following: I have two lists: noShowList = ['one', 'two', 'three'] myList = ['item one', 'item four', 'three item'] I want to show all the items from 'myList' that do not contain any of the s

Re: twisted - locking threads when deferToThread is used

2007-08-08 Thread Ladislav Andel
And here is the code: from twisted.internet import reactor, defer, threads from siptest import siptest_f from twisted.internet.threads import deferToThread test_opts = {'username':'test','transport':'udp','localport':'5085','password':'test'} domain = ['sip.1und1.de', 'sip.babble.net'] class

Re: twisted - locking threads when deferToThread is used

2007-08-08 Thread Ladislav Andel
Chris Mellon wrote: > On 8/8/07, Chris Mellon <[EMAIL PROTECTED]> wrote: > >> On 8/8/07, Ladislav Andel <[EMAIL PROTECTED]> wrote: >> >>> Hi, >>> I'm writing an application which will be periodically testing servers. >>> I will have a global list of these servers(domain names) and need to d

Re: Something in the function tutorial confused me.

2007-08-08 Thread Steve Holden
Carsten Haese wrote: > On Wed, 2007-08-08 at 08:52 -0400, Steve Holden wrote: [...] > > The problem is your ambiguous use of the word "assignment." In the sense > of the Language Reference, "any assignment to y" is a simple assignment > that always modifies a namespace and never modifies an object

Re: Tkinter or wxpython?

2007-08-08 Thread Chris Mellon
On 8/8/07, Kevin Walzer <[EMAIL PROTECTED]> wrote: > Cameron Laird wrote: > > > > While those with an artistic eye > > assure me the simplest Tkinter programs look worse > > that corresponding ones built with any other toolkit, > > they behave the most coherently in regards to resizing > > and so o

Re: Seek the one billionth line in a file containing 3 billion lines.

2007-08-08 Thread Chris Mellon
On 8/8/07, Steve Holden <[EMAIL PROTECTED]> wrote: > Chris Mellon wrote: > > On 8/8/07, Ben Finney <[EMAIL PROTECTED]> wrote: > >> Sullivan WxPyQtKinter <[EMAIL PROTECTED]> writes: > >> > >>> On Aug 8, 2:35 am, Paul Rubin wrote: > Sullivan WxPyQtKinter <[EMAIL PROTEC

Re: Seek the one billionth line in a file containing 3 billion lines.

2007-08-08 Thread Steve Holden
Chris Mellon wrote: > On 8/8/07, Ben Finney <[EMAIL PROTECTED]> wrote: >> Sullivan WxPyQtKinter <[EMAIL PROTECTED]> writes: >> >>> On Aug 8, 2:35 am, Paul Rubin wrote: Sullivan WxPyQtKinter <[EMAIL PROTECTED]> writes: > This program: > for i in range(1000

Re: Tkinter or wxpython?

2007-08-08 Thread Kevin Walzer
Cameron Laird wrote: > > While those with an artistic eye > assure me the simplest Tkinter programs look worse > that corresponding ones built with any other toolkit, > they behave the most coherently in regards to resizing > and so on. > "Look worse" can be addressed through extensive means: th

Re: parsing a dbIII file

2007-08-08 Thread korovev76
On 7 Ago, 17:47, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > On 8/7/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > I have to parse a file (that is a dbIII file) whose stucture look like > > this: > > |string|, |string|, |string that may contain commas inside|, 1, 2, 3, | > > other string| > >

Re: Stop a thread on deletion

2007-08-08 Thread Chris Mellon
On 8/8/07, Sjoerd Op 't Land <[EMAIL PROTECTED]> wrote: > Hello all, > > I'm using threading for generating video content. The trouble is how to > kill the thread, because there are multiple (simultaneous) owners of a > thread. Ideally, a flag would be set when the reference count of the > thread b

some import / namespace questions

2007-08-08 Thread stef mientki
hello, I'm working on a rather strange program, that is partially build dynamically, and where users can create plugins, without knowing any of the details of the core program. Of course this leads to some weird bugs, so one of the things I want to view/log is the order (and even better the way)

SciPy's site is down

2007-08-08 Thread a . harrowell
Can anyone else not reach scipy.org? Am trying to install scipy and numpy. Further, is there an equivalent of numpy that will install correctly on Python 2.5 on WinVista? -- http://mail.python.org/mailman/listinfo/python-list

Re: This bit of code hangs Python Indefinitely

2007-08-08 Thread Duncan Booth
brad <[EMAIL PROTECTED]> wrote: > Chris Mellon wrote: > >> ... the producer is designed to block if >> the queue is full. You can use the put_nowait method to have it raise >> an exception instead of blocking. > > I assumed that the behavior would have been the other way around. I > should not

testing

2007-08-08 Thread nikolay marinov
Hi,there.I'm a young tester (4 months,still learning what is "testing > software!?!"). I work on Linux and i write my tests with Python. > Our assignment is to build a module from our 'BIG' program that > have to be able to edit xls files, without using MSExcel, OpenOffice > or something lik

Stop a thread on deletion

2007-08-08 Thread Sjoerd Op 't Land
Hello all, I'm using threading for generating video content. The trouble is how to kill the thread, because there are multiple (simultaneous) owners of a thread. Ideally, a flag would be set when the reference count of the thread becomes zero, causing the run() loop to quit. Example: import th

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread Istvan Albert
On Aug 6, 6:11 am, Paul Rubin wrote: > Why on earth did they make this change? It just seems gratuitous. Having print a function (with parameters) makes is very easy to modify where the output goes. Say you want to have some prints go to one particular file, today you

Re: making a opc client in Python and use opc server Events

2007-08-08 Thread getgroup
On 7 août, 07:17, [EMAIL PROTECTED] wrote: > On 28 juin, 16:55, [EMAIL PROTECTED] wrote: > > > > > > > On 4 juin, 11:32, [EMAIL PROTECTED] wrote: > > > > Hi all > > > I have a sample code to implementopcclientinPython. i use a > > > file .py making by makepy with pythonwin for Com Interface. > > >

Re: twisted - locking threads when deferToThread is used

2007-08-08 Thread Chris Mellon
On 8/8/07, Chris Mellon <[EMAIL PROTECTED]> wrote: > On 8/8/07, Ladislav Andel <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm writing an application which will be periodically testing servers. > > I will have a global list of these servers(domain names) and need to do > > few tasks. > > 1) DNS checks -

Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread Istvan Albert
On Aug 6, 6:49 am, Neil Cerutti <[EMAIL PROTECTED]> wrote: > Incidentally, from the second link I find it shocking that the > keyword parameter "file" shadows a builtin. It seems to endorse a > bad practice. I believe that the "file" builtin has been removed as well so it won't shadow anything.

Re: twisted - locking threads when deferToThread is used

2007-08-08 Thread Chris Mellon
On 8/8/07, Ladislav Andel <[EMAIL PROTECTED]> wrote: > Hi, > I'm writing an application which will be periodically testing servers. > I will have a global list of these servers(domain names) and need to do > few tasks. > 1) DNS checks - I will use asynchronous twisted-names for it > - in case there

  1   2   >