Re: Help: Guide needed in trying to delete/flush the content of a fifo file.

2010-11-15 Thread Ton
On Nov 16, 1:47 am, MRAB wrote: > On 15/11/2010 11:03, Ton wrote: > > > > > On Nov 14, 11:55 pm, MRAB  wrote: > >> On 14/11/2010 14:48, ton ph wrote:>  Hi python geeks, > >>>     I have  problem which i have been trying to find out for the past > >>> some days, i have a device which feeds info to

RE: Leo 4.8 rc1 released

2010-11-15 Thread Mikael B
> From: edream...@gmail.com > Subject: Leo 4.8 rc1 released > Date: Mon, 15 Nov 2010 09:06:01 -0800 > To: python-list@python.org > > Leo 4.8 release candidate 1 is now available at: > http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106 > > Leo is a text editor, data org

Re: Some syntactic sugar proposals

2010-11-15 Thread Ian Kelly
On 11/15/2010 10:26 PM, Steven D'Aprano wrote: t = foo()+bar()+baz() if pred(it) else baz()-foo()-bar() What does "it" mean here? "it" would mean the result of the expression foo()+bar()+baz(). What else could it mean? There are valid objections to the proposal, but the intended semantics

Re: Some syntactic sugar proposals

2010-11-15 Thread Steven D'Aprano
On Sun, 14 Nov 2010 22:39:05 -0800, Dmitry Groshev wrote: > Here are some proposals. They are quite useful at my opinion and I'm > interested for suggestions. It's all about some common patterns. First > of all: how many times do you write something like > t = foo() > t = t if pred(t) else

Re: Modifying Element In For List

2010-11-15 Thread Steven D'Aprano
On Mon, 15 Nov 2010 08:31:52 -0800, octopusgrabbus wrote: > My question concerns elementary list and pass by reference: What does pass-by-reference have to do with Python? Python doesn't use pass-by-reference... if you think it does, you have misunderstood something. Hint: if you think Python

Re: Komodo 6, why "Workspace Restore" after every restart?

2010-11-15 Thread John Doe
Eric Promislow wrote: > Komodo always asks you if you want to restore the last workspace > when it wasn't shut down cleanly the previous time. Why is shutting down in Windows XP more difficult for version 6? The only thing I have open is a single small Python file. Apparently version 6 is un

Re: Help: Guide needed in trying to delete/flush the content of a fifo file.

2010-11-15 Thread Cameron Simpson
On 15Nov2010 20:47, MRAB wrote: | On 15/11/2010 11:03, Ton wrote: | >Hi Mrab, | > Thanks for your immediate reply , can you please guide me with any | >tool or library function which i can flush my fifo content .. i use | >os.mkfifo() to make the fifo. Or is there any other way i could do | >this

Re: OO and game design questions

2010-11-15 Thread Aahz
In article , Martin Gregorie wrote: >On Tue, 19 Oct 2010 19:49:20 -0400, Dave Angel wrote: >> >> Thanks, that is what I was trying to say. In the same sense that >> emptying a list makes it quite small, if it's a general purpose object, >> you just want to remove all the attributes. > >I think a

Re: What was your strategy?

2010-11-15 Thread John Nagle
On 11/14/2010 2:59 PM, Seebs wrote: On 2010-11-14, Jorge Biquez wrote: I was wondering if you can share what was the strategy you followed to master Python (Yes I know I have to work hard study and practice a lot). I mean did you use special books, special sites, a plan to learn each subject in

Re: remote server and effective uid

2010-11-15 Thread Tim Harig
On 2010-11-15, Tim Arnold wrote: > On Nov 15, 10:41 am, Tim Harig wrote: >> On 2010-11-15, Tim Arnold wrote: >> >> > How can I enable the server process to write into the client's >> > directories? >> > If I change the inetd service to run as 'root', I guess that would >> > work, but then the cl

Re: Komodo 6, why "Workspace Restore" after every restart?

2010-11-15 Thread Eric Promislow
Komodo always asks you if you want to restore the last workspace when it wasn't shut down cleanly the previous time. The reason for this is that it's possible Komodo ended up in a state where it's hung due to a particular workspace configuration. This question lets you bring up Komodo in a possib

Re: Getting references to objects without incrementing reference counters

2010-11-15 Thread John Nagle
On 11/14/2010 11:08 AM, Artur Siekielski wrote: Hi. I'm using CPython 2.7 and Linux. In order to make parallel computations on a large list of objects I want to use multiple processes (by using multiprocessing module). In the first step I fill the list with objects and then I fork() my worker pro

Re: Help: Guide needed in trying to delete/flush the content of a fifo file.

2010-11-15 Thread MRAB
On 15/11/2010 11:03, Ton wrote: On Nov 14, 11:55 pm, MRAB wrote: On 14/11/2010 14:48, ton ph wrote:> Hi python geeks, I have problem which i have been trying to find out for the past some days, i have a device which feeds info to my fifo continuosly, and a thread of mine reads the fifo c

Re: Some syntactic sugar proposals

2010-11-15 Thread John Nagle
On 11/14/2010 11:30 PM, alex23 wrote: On Nov 15, 4:39 pm, Dmitry Groshev wrote: First of all: how many times do you write something like Second, I saw a lot of questions about using dot notation for a "object-like" dictionaries and a lot of solutions like this: class dotdict(dict):

Re: Solution to: [Beginner question] Raster to ASCII conversion

2010-11-15 Thread MRAB
On 15/11/2010 20:14, Becky Kern wrote: Hi users, Found a solution to my Raster to ASCII conversion problem, so I thought I'd post. My raster was created in ArcGIS 9.3 as an ESRI GRID (folder with associated info folder). I needed to use the ListRasters method (see http://webhelp.esri.com/arcgisde

Re: HTMLWindow or HtmlWindow or perhaps HTMLwindo

2010-11-15 Thread Krister Svanlund
On Mon, Nov 15, 2010 at 9:09 PM, Ben James wrote: > On 15/11/2010 19:53, Boštjan Mejak wrote: >> >> Hello, I am wondering which of the 3 class names are prefered by PEP-8? >> >> class HTMLWindow(...) >> >> class HtmlWindow(...) >> >> class HTMLwindow(...) >> >> >> Thank you for your answer in adva

question on ConfigParser defaults

2010-11-15 Thread Neal Becker
import ConfigParser # New instance with 'bar' and 'baz' defaulting to 'Life' and 'hard' each config = ConfigParser.SafeConfigParser({'bar': 'Life', 'baz': 'hard'}) config.read('example.cfg') print config.get('Section1', 'foo') # -> "Python is fun!" config.remove_option('Section1', 'bar') config.r

Solution to: [Beginner question] Raster to ASCII conversion

2010-11-15 Thread Becky Kern
Hi users, Found a solution to my Raster to ASCII conversion problem, so I thought I'd post. My raster was created in ArcGIS 9.3 as an ESRI GRID (folder with associated info folder). I needed to use the ListRasters method (see http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=958&pid=905&topi

Re: HTMLWindow or HtmlWindow or perhaps HTMLwindo

2010-11-15 Thread Ben James
On 15/11/2010 19:53, Boštjan Mejak wrote: Hello, I am wondering which of the 3 class names are prefered by PEP-8? class HTMLWindow(...) class HtmlWindow(...) class HTMLwindow(...) Thank you for your answer in advance. PEP 8 says: Note: When using abbreviations in CapWords, capitalize

Re: HTMLWindow or HtmlWindow or perhaps HTMLwindo

2010-11-15 Thread Krister Svanlund
""" CapitalizedWords (or CapWords, or CamelCase -- so named because of the bumpy look of its letters[4]). This is also sometimes known as StudlyCaps. Note: When using abbreviations in CapWords, capitalize all the letters of the abbreviation. Thus HTTPServerError is better

HTMLWindow or HtmlWindow or perhaps HTMLwindo

2010-11-15 Thread Boštjan Mejak
Hello, I am wondering which of the 3 class names are prefered by PEP-8? class HTMLWindow(...) class HtmlWindow(...) class HTMLwindow(...) Thank you for your answer in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: STARTTLS extension not supported by server

2010-11-15 Thread Paul Rubin
Michele Simionato writes: > Notice that this not a problem of the SMTP server, since with Python > 2.4 the script is connecting to the SMTP server Um, my guess is that 2.4 didn't attempt to use TLS at all, and your 2.7 installation doesn't have the TLS libraries installed or they're not configure

Re: remote server and effective uid

2010-11-15 Thread Tim Arnold
On Nov 15, 10:41 am, Tim Harig wrote: > On 2010-11-15, Tim Arnold wrote: > > > How can I enable the server process to write into the client's > > directories? > > If I change the inetd service to run as 'root', I guess that would > > work, but then the client couldn't remove the files put there a

Re: Some syntactic sugar proposals

2010-11-15 Thread Brian Blais
On Nov 15, 2010, at 1:39 AM, Dmitry Groshev wrote: >if x in range(a, b): #wrong! > it feels so natural to check it that way, but we have to write >if a <= x <= b > I understand that it's not a big deal, but it would be awesome to have > some optimisations - it's clearly possible to detect

Re: Some syntactic sugar proposals

2010-11-15 Thread Terry Reedy
On 11/15/2010 1:39 AM, Dmitry Groshev wrote: Here are some proposals. They are quite useful at my opinion and I'm interested for suggestions. It's all about some common patterns. First of all: how many times do you write something like t = foo() t = t if pred(t) else default_value Nev

Re: Getting references to objects without incrementing reference counters

2010-11-15 Thread Artur Siekielski
On Nov 15, 5:28 pm, Jean-Paul Calderone wrote: > On Nov 15, 10:42 am, de...@web.de (Diez B. Roggisch) wrote: > > > And circumvene a great deal of the dynamic features in python > > (which you don't need for this usecase, but still are there) > > Great as the features might be, when you don't need

Re: Modifying Element In For List

2010-11-15 Thread Duncan Booth
octopusgrabbus wrote: > I've written a function which is passed a list that contains rows read > from a csv file. The function traverses csv_rows, row by row, and > inspects the first element in each row. The function tests for '', and > if true, replaces that with a 0. > > I've used the standar

Leo 4.8 rc1 released

2010-11-15 Thread Edward K. Ream
Leo 4.8 release candidate 1 is now available at: http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106 Leo is a text editor, data organizer, project manager and much more. See: http://webpages.charter.net/edreamleo/intro.html The highlights of Leo 4.8: --

Re: [Beginner question] Error when converting raster to ASCII

2010-11-15 Thread Benjamin Kaplan
On Monday, November 15, 2010, Becky Kern wrote: > Hi again users, > > This is in response to my post from 11/14/2010 (see below) > >> Hi users, >> I'm using Python 2.5 (in concert with ArcGIS 9.3) to convert a raster to >> an ASCII file. I used the code (listed below) several weeks ago to >> succe

Modifying Element In For List

2010-11-15 Thread octopusgrabbus
My question concerns elementary list and pass by reference: I've written a function which is passed a list that contains rows read from a csv file. The function traverses csv_rows, row by row, and inspects the first element in each row. The function tests for '', and if true, replaces that with a

Re: Getting references to objects without incrementing reference counters

2010-11-15 Thread Jean-Paul Calderone
On Nov 15, 10:42 am, de...@web.de (Diez B. Roggisch) wrote: > And circumvene a great deal of the dynamic features in python > (which you don't need for this usecase, but still are there) > Great as the features might be, when you don't need them, it's clearly a bad thing to have them drag you down

[Beginner question] Error when converting raster to ASCII

2010-11-15 Thread Becky Kern
Hi again users, This is in response to my post from 11/14/2010 (see below) >* Hi users, *>* I'm using Python 2.5 (in concert with ArcGIS 9.3) to convert a raster to *>* an ASCII file. I used the code (listed below) several weeks ago to *>* successfully do the conversion, but when I tried to repli

Re: Getting references to objects without incrementing reference counters

2010-11-15 Thread Diez B. Roggisch
Artur Siekielski writes: > On Nov 15, 1:03 am, de...@web.de (Diez B. Roggisch) wrote: >> You don't say what data you share, and if all of it is needed for each >> child. So it's hard to suggest optimizations. > > Here is an example of such a problem I'm dealing with now: I'm > building large inde

Re: remote server and effective uid

2010-11-15 Thread Tim Harig
On 2010-11-15, Tim Arnold wrote: > How can I enable the server process to write into the client's > directories? > If I change the inetd service to run as 'root', I guess that would > work, but then the client couldn't remove the files put there after > the request. Python provides os.setuid() an

Re: What was your strategy?

2010-11-15 Thread Grant Edwards
On 2010-11-15, Paul Rubin wrote: > Python is a pretty easy language if you have a reasonable programming > background when you first start with it. I think the way it's currently > organized, it may not be so great for self-study if you're not already a > programmer. The way what is organized?

remote server and effective uid

2010-11-15 Thread Tim Arnold
Hi, I have a remote server on a FreeBSD box with clients connecting from linux, all running python2.7. I've setup the remote server as an inetd service (currently running as 'nobody'). Both client and server have access to the same file systems. How can I enable the server process to write into th

Re: What was your strategy?

2010-11-15 Thread brf256
I used "a non programmers tutorial to python" by Josh coglatti. Its a free wikibook too. Then I carried on to "the guide to python". Hope this helps and good luck! - Braden Faulkner - Braden Faulkner -- http://mail.python.org/mailman/listinfo/python-list

STARTTLS extension not supported by server

2010-11-15 Thread Michele Simionato
I have a CentOS machine with Python 2.4 and I wanted to install Python 2.7 on it. The installation went fine but now I have a problem with a script sending email via TLS authentication. If I do something like import smtplib smtpO = smtplib.SMTP() smtpO.ehlo() smtpO.starttls() I get the following

Re: Getting references to objects without incrementing reference counters

2010-11-15 Thread Artur Siekielski
On Nov 15, 1:03 am, de...@web.de (Diez B. Roggisch) wrote: > You don't say what data you share, and if all of it is needed for each > child. So it's hard to suggest optimizations. Here is an example of such a problem I'm dealing with now: I'm building large index of words in memory, it takes 50% o

Re: is there an Python equivalent for the PHP super globals like $_POST, $_COOKIE ?

2010-11-15 Thread Roy Smith
In article , r0g wrote: > > My latest gig, however, has had me doing PHP for the past 3 months or > > so. > > That's terrible, you have my fullest sympathy in these difficult times. Actually, in a sick sort of way, it's fun. We regularly have PHP bashing sessions in the office when somebody

Re: Getting references to objects without incrementing reference counters

2010-11-15 Thread Artur Siekielski
On Nov 14, 10:04 pm, Jean-Paul Calderone wrote: > It might be interesting to try with Jython or PyPy.  Neither of these > Python runtimes uses reference counting at all. I have to use CPython because of C extensions I use (and because I use Python 2.7 features). -- http://mail.python.org/mailman

Re: another newbie question

2010-11-15 Thread Neil Cerutti
On 2010-11-14, Roy Smith wrote: > Then, there are people who try to program in proportional > fonts. The mind boggles. For a (thankfully short) while some > years ago, people were publishing programming books with the > code samples in proportional fonts. Blech. I kinda like it, but as a Vim u

Re: Some syntactic sugar proposals

2010-11-15 Thread Tim Chase
On 11/15/2010 12:39 AM, Dmitry Groshev wrote: x in range optimisation I've often thought this would make a nice O(1)-test lookup on an xrange() generator. I don't have strong use-cases for it, but a bit of well-tested code in the standard library would save me from doing the math (along wit

DDE using Python

2010-11-15 Thread Santosh Srinivas
Hello Group, I want to connect to an application on my desktop that I understand provides access to few topics and data via DDE. But, I don't know the topic names. Is there any way that I can connect and find out what the available options are? Thanks. S -- http://mail.python.org/mailman/listi

Re: Some syntactic sugar proposals

2010-11-15 Thread Mark Wooding
Dmitry Groshev writes: > First of all: how many times do you write something like > t = foo() > t = t if pred(t) else default_value > ? Of course we can write it as > t = foo() if pred(foo()) else default_value > but here we have 2 foo() calls instead of one. Why can't we write just >

Re: distutils, cygwin, ' not a regular file

2010-11-15 Thread Christoph Michalke
In-Reply-To: <8faqj0fno...@mid.individual.net> References: <8faqj0fno...@mid.individual.net> In message <8faqj0fno...@mid.individual.net>, on Tue, 14 Sep 2010 20:50:04 -0600, Wed Sep 15 04:50:04 2010, Paul Watson wrote: > $ python setup.py sdist > [...] > reading manifest file 'MANIFEST' > [...]

Re: strange behavor....

2010-11-15 Thread Mark Wooding
Arnaud Delobelle writes: > >>> exec "a=2" in d > assigning 2 to 'a' > >>> d['a'] > 2 > > >>> exec "global a; a = 3" in d > >>> d['a'] > 3 Oooh, now isn't that an interesting wrinkle? I've been careful (without drawing attention) to restrict my arguments to variables inside functions, largely be

Re: Some syntactic sugar proposals

2010-11-15 Thread Hrvoje Niksic
Dmitry Groshev writes: > which looks almost like a natural language. But there is some > pitfalls: > if x in range(a, b): #wrong! > it feels so natural to check it that way, but we have to write > if a <= x <= b For the record, you have to write: if a <= x < b: Ranges are open on t

Re: Help: Guide needed in trying to delete/flush the content of a fifo file.

2010-11-15 Thread Ton
On Nov 14, 11:55 pm, MRAB wrote: > On 14/11/2010 14:48, ton ph wrote:> Hi python geeks, > >    I have  problem which i have been trying to find out for the past > > some days, i have a device which feeds info to my fifo continuosly, and > > a thread of mine reads the > > fifo continuosly. Now when

Re: strange behavor....

2010-11-15 Thread Mark Wooding
Steven D'Aprano writes: > > def foo(): > > l = [] > > for i in xrange(10): > > (lambda j: l.append((lambda: i, lambda: j)))(i) > > print [(f(), g()) for f, g in l] > > Here's a slightly less condensed version that demonstrates the same > behaviou

Re: is there an Python equivalent for the PHP super globals like $_POST, $_COOKIE ?

2010-11-15 Thread r0g
On 12/11/10 01:25, Roy Smith wrote: In article, r0g wrote: On 11/11/10 14:22, Stef Mientki wrote: I can't find how th get to PHP's equivalent of $_Post and $_Cookie ? PHP is mostly a one-trick pony. It's meant to be run as a web scripting language with Apache (or, I suppose, something el

Re: Some syntactic sugar proposals

2010-11-15 Thread Dmitry Groshev
On Nov 15, 12:03 pm, alex23 wrote: > On Nov 15, 5:50 pm, Dmitry Groshev wrote: > > > On Nov 15, 10:30 am, alex23 wrote: > > > Personally, I like keeping object attribute references separate from > > > dictionary item references. > > > Your Python doesn't - dot notation is just a sugar for __dict

Re: Komodo 6, why "Workspace Restore" after every restart?

2010-11-15 Thread John Doe
alex23 wrote: > John Doe wrote: >> Google Groups spews a massive amount of sewage onto UseNet >> everyday. Google Groups is your news server. You should be >> ashamed > > Get over yourself. You too, and stop using the spammers den while you are at it. -- See also googled gro

Re: Some syntactic sugar proposals

2010-11-15 Thread alex23
On Nov 15, 5:50 pm, Dmitry Groshev wrote: > On Nov 15, 10:30 am, alex23 wrote: > > Personally, I like keeping object attribute references separate from > > dictionary item references. > > Your Python doesn't - dot notation is just a sugar for __dict__ lookup > with default metaclass. That's a gr

import site fails - Please Help

2010-11-15 Thread Helmut Jarausch
Hi, I'm completely puzzled and I hope someone can shed some light on it. After cloning a running system, booting the new machine from a rescue CD, chroot to the new root partition, I get the following strange error from python upon startup python -v > import site failed st= os.stat(path) sta

Re: Komodo 6, why "Workspace Restore" after every restart?

2010-11-15 Thread alex23
John Doe wrote: > Google Groups spews a massive amount of sewage onto UseNet > everyday. Google Groups is your news server. You should be > ashamed, and I want to help. Get over yourself. -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess pipe

2010-11-15 Thread Nobody
On Sun, 14 Nov 2010 19:47:55 +, Tim Harig wrote: > On 2010-11-14, Camille Harang wrote: >> # pg_dump prompts for password so I inject it in stdin. >> pgsql.stdin.write('MY_PASSWORD' + '\n') > > For security reasons, some programs use direct access to the TTY system > for password entry rathe

Re: Komodo 6, why "Workspace Restore" after every restart?

2010-11-15 Thread John Doe
alex23 wrote: > John Doe wrote: >> UseNet would be better off if Google Groups didn't exist, IMO. > > I'm sorry, are you cranky because you didn't get the answer you > wanted when you posted in a less relevant forum? Do you realize the harm your filthy news server is doing to UseNet? Ma