Re: Question on Manipulating List and on Python

2011-09-29 Thread Subhabrata Banerjee
On Sep 30, 12:52 am, "Prasad, Ramit" wrote: > -Original Message- > From: python-list-bounces+ramit.prasad=jpmorgan@python.org > [mailto:python-list-bounces+ramit.prasad=jpmorgan@python.org] On Behalf > Of Chris Angelico > Sent: Thursday, September 29, 2011 11:51 AM > To: python-l

Re: Motion Tracking with Python

2011-09-29 Thread alex23
On Sep 30, 3:31 pm, Chris Angelico wrote: > Unless someone's seriously considering porting the Linux > kernel to Python... Well, they've certainly asked: http://bytes.com/topic/python/answers/37048-reimplenting-linux-kernel-python And while not Linux kernels, there are two projects attempting to

Re: Suggested coding style

2011-09-29 Thread Chris Angelico
On Fri, Sep 30, 2011 at 4:14 PM, Westley Martínez wrote: > I'm one of the weirdos who is absolutely hostile to the format method > and continues to use % formatting.  I'm pretty sure it is because of my > C background (actually I learned Python before C, and thus learned % > formatting in Python).

Re: Motion Tracking with Python

2011-09-29 Thread alex23
On Sep 30, 12:16 pm, Derek Simkowiak wrote: > It's especially neat because my daughter and I worked together on this > project. We used it to track her two pet gerbils, as part of her science > fair project. She wrote her own (separate) Python script to read the > motion tracking log files, comput

Re: Suggested coding style

2011-09-29 Thread Westley Martínez
On Thu, Sep 29, 2011 at 07:07:28PM -0400, Devin Jeanpierre wrote: > > However, as you use the new format method you will come to appreciate > > it. It's an adult beverage with an acquired taste. ;-) > > Yeah. It's a much more difficult to read thing, but once you learn how > to write it it flows f

Re: Hermeneutics and computer science [was off-topic, now back on]

2011-09-29 Thread alex23
On Sep 30, 2:34 pm, Steven D'Aprano wrote: > alex23 wrote: > > I'm slowly seeing more and more interest in applying > > a discipline that arose out of the > > study of religious texts. > > Tell us more, please. Well, it's mostly from real world discussions and may actually be an artefact of my ho

Modifying external running process using python

2011-09-29 Thread bingbang
Hi all, Beginner here. I am trying to figure out how to modify a running process on a linux system using Python. Example: I have a python program that takes in as an argument a PID. My goal is to use this PID and get info about the running process with that PID. (1) Find where it is located in me

Re: Motion Tracking with Python

2011-09-29 Thread Chris Angelico
On Fri, Sep 30, 2011 at 12:16 PM, Derek Simkowiak wrote: > Like I say on the web page: "I’m convinced that Python is the best language > currently available for teaching kids how to program." Agreed. > There's no job Python can't handle. Ehhh... Not agreed. Not quite. Yes it's true in that Pyth

Re: Suggested coding style

2011-09-29 Thread alex23
On Sep 30, 3:14 pm, Ben Finney wrote: > alex23 writes: > > On Sep 29, 10:23 pm, rantingrick wrote: > > > GvR should be texting me every night in hopes that some of my API > > > genius will rub off on him. > > > Are you off your medication again? > > Please don't make personal attacks. If you don

Re: Benefit and belief

2011-09-29 Thread Ben Finney
alex23 writes: > I always enjoyed the possibly apocryphal claim that the design of VRML > was influenced by the story of Indra's Net. You see, folks? It's by “mingling in” other aspects of life with technical discussion that we can improve the technical discussion :-) > Maybe some religious tom

Re: Suggested coding style

2011-09-29 Thread Ben Finney
alex23 writes: > On Sep 29, 10:23 pm, rantingrick wrote: > > GvR should be texting me every night in hopes that some of my API > > genius will rub off on him. > > Are you off your medication again? Please don't make personal attacks. If you don't feel like addressing the content of his message

Re: Suggested coding style

2011-09-29 Thread Ian Kelly
On Thu, Sep 29, 2011 at 4:56 PM, rantingrick wrote: >> Agree that zfill seems to be redundant with str.format, although your >> suggested syntax is atrocious, especially since a syntax already >> exists that fits better in the already-complicated format specifier >> syntax. > > It's interesting th

Re: Motion Tracking with Python

2011-09-29 Thread crazycga
On Thu, 29 Sep 2011 19:16:52 -0700, Derek Simkowiak wrote: > Hello, > I have a neat Python project I'd like to share. It does real-time motion > tracking, using the Python bindings to the OpenCV library: > > http://derek.simkowiak.net/motion-tracking-with-python/ > > There is a YouTube video sho

Re: Suggested coding style

2011-09-29 Thread Ian Kelly
On Thu, Sep 29, 2011 at 5:47 PM, rantingrick wrote: > Ah ha! Found the answer! > > py> "{0:010d}".format(1234) > 001234 > > py> "{0:0>10}".format(1234) > 001234 > > py> "{0:0>10}".format("1234") > 001234 > > py> "{0:@>10}".format("1234") > @@1234 > > I would skip using the "{int}{r

Re: Motion Tracking with Python

2011-09-29 Thread Micky Hulse
That's really cool! Thanks for sharing! :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Benefit and belief

2011-09-29 Thread Ian Kelly
On Thu, Sep 29, 2011 at 9:05 PM, alex23 wrote: > Strangely, calling the bible self-contradictory wasn't seen as > inflammatory... Well, that part is factual. Whether that makes it a joke is subjective. -- http://mail.python.org/mailman/listinfo/python-list

Hermeneutics and computer science [was off-topic, now back on]

2011-09-29 Thread Steven D'Aprano
alex23 wrote: > I'm slowly seeing more and more interest in applying > a discipline that arose out of the > study of religious texts. Tell us more, please. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Motion Tracking with Python

2011-09-29 Thread Derek Simkowiak
Hello, I have a neat Python project I'd like to share. It does real-time motion tracking, using the Python bindings to the OpenCV library: http://derek.simkowiak.net/motion-tracking-with-python/ There is a YouTube video showing the script in action. It's especially neat because my daughter an

Re: Benefit and belief [was Re: Suggested coding style]

2011-09-29 Thread alex23
Dennis Lee Bieber wrote: >         Well... We could try for equality in offense -- the Torah or the > Koran? Maybe the Tripitaka or Sutras? I always enjoyed the possibly apocryphal claim that the design of VRML was influenced by the story of Indra's Net. Maybe some religious tomes are just better

Re: Off-Topic Posts and Threads on the Python Mailing List

2011-09-29 Thread alex23
Chris Angelico wrote: > We may happen to have coincidental interest in (say) > music, but just because some group of us (or even all of us) all enjoy > music does not mean that it'd be on-topic to have a discussion of the > tetrachord of Mercury. As general discussion it would be, sure, but I don

Re: Suggested coding style

2011-09-29 Thread Chris Angelico
On Fri, Sep 30, 2011 at 12:50 PM, alex23 wrote: >> GvR should be texting me every night in hopes that some of my API genius >> will rub >> off on him. > > Are you off your medication again? > He's very much like jimontrack (aka Tranzit Jim - google him if you're curious), whose username people f

Re: A Trivial Question

2011-09-29 Thread alex23
On Sep 29, 8:06 am, Chris Rebert wrote: > Try this: > > def trial(): >     class Foo(object): >         def __init__(self): >             print("Hello, world!") >     Foo() > trial() While this will display "Hello, world!" in the way required, with a slight adjustment you end up with something po

Re: [OT] Off-Topic Posts and Threads on the Python Mailing List

2011-09-29 Thread Steven D'Aprano
Chris Angelico wrote: > On Fri, Sep 30, 2011 at 12:38 PM, Steven D'Aprano > wrote: >> Westley Martínez wrote: >> >>> On this mailing list, we're programmers, nothing else, >> >> Speak for yourself. >> > > I don't think he meant that the populace here is exclusively > programmers, but that *on th

Re: [OT] Benefit and belief

2011-09-29 Thread Steven D'Aprano
Devin Jeanpierre wrote: > I also didn't reprimand anyone, except maybe Steven. If you are more upset at my describing the Catholic Church as protecting child molesters than you are at the Church for actually protecting child molesters, then your priorities are completely screwed up and your repri

Re: Benefit and belief

2011-09-29 Thread alex23
On Sep 30, 9:37 am, MRAB wrote: > rantingrick: > """Since, like the bible the zen is self contradicting, any argument > utilizing > the zen can be defeated utilizing the zen.""" > > alex23: > """And like the Bible, the Zen was created by humans as a joke. If you're > taking it too seriously, that'

Re: [OT] Off-Topic Posts and Threads on the Python Mailing List

2011-09-29 Thread Chris Angelico
On Fri, Sep 30, 2011 at 12:38 PM, Steven D'Aprano wrote: > Westley Martínez wrote: > >> On this mailing list, we're programmers, nothing else, > > Speak for yourself. > I don't think he meant that the populace here is exclusively programmers, but that *on this list* we are here because we're prog

Re: [OT] Off-Topic Posts and Threads on the Python Mailing List

2011-09-29 Thread Steven D'Aprano
Westley Martínez wrote: > On this mailing list, we're programmers, nothing else, Speak for yourself. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Python without a tty

2011-09-29 Thread Ben Finney
ron writes: > On Sep 29, 5:21 am, Steven D'Aprano +comp.lang.pyt...@pearwood.info> wrote: > > I have a Python script which I would like to test without a tty attached > > to the process. I could run it as a cron job, but is there an easier way? > > Have you tried GNU Screen? It let's you run pr

Re: [OT] Off-Topic Posts and Threads on the Python Mailing List

2011-09-29 Thread Ben Finney
Westley Martínez writes: > I'm kind of new to the whole mailing list thing, but they seem to be a > lot more lenient than internet forums about most things. Note that a mailing list *is* an internet forum: it is a forum for discussion, conducted on the internet. Mailing lists have been internet

Re: Benefit and belief

2011-09-29 Thread rantingrick
On Sep 29, 6:40 pm, Ethan Furman wrote: > Okay, that's what I get for skimming -- it was alex23, not rr.  My > apologies, rr, for the misattribution. Oh don't worry Ethan, this is not the first time I've been falsely accused, misquoted, and kicked in the testicles, and i'm quite sure with this fi

Re: Suggested coding style

2011-09-29 Thread rantingrick
On Sep 29, 5:12 pm, Ian Kelly wrote: > On Thu, Sep 29, 2011 at 6:23 AM, rantingrick wrote: > > A specific method for padding a string with ONLY zeros is ludicrous > > and exposes the narrow mindedness of the creator. The only thing worse > > than "zfill" as a string method is making zfill into bu

Re: Suggested coding style

2011-09-29 Thread rantingrick
On Sep 29, 6:07 pm, Devin Jeanpierre wrote: > > However, as you use the new format method you will come to appreciate > > it. It's an adult beverage with an acquired taste. ;-) > > Yeah. It's a much more difficult to read thing, but once you learn how > to write it it flows faster. > > Of course,

Re: [OT] Benefit and belief

2011-09-29 Thread Ethan Furman
Ethan Furman wrote: Ben Finney wrote: But whoever takes that joke and says it's deliberately hurtful is being presumptuous and censorious and unreasonable. If they then castigate the joker for supposedly hurting someone's feelings, it's at that point the atmosphere turns hostile to discussion.

Re: [OT] Benefit and belief

2011-09-29 Thread MRAB
On 30/09/2011 00:21, Ethan Furman wrote: Ben Finney wrote: But whoever takes that joke and says it's deliberately hurtful is being presumptuous and censorious and unreasonable. If they then castigate the joker for supposedly hurting someone's feelings, it's at that point the atmosphere turns hos

Re: [OT] Benefit and belief

2011-09-29 Thread Ethan Furman
Ben Finney wrote: But whoever takes that joke and says it's deliberately hurtful is being presumptuous and censorious and unreasonable. If they then castigate the joker for supposedly hurting someone's feelings, it's at that point the atmosphere turns hostile to discussion. Um, wasn't it Rantin

Re: Python without a tty

2011-09-29 Thread ron
On Sep 29, 5:21 am, Steven D'Aprano wrote: > I have a Python script which I would like to test without a tty attached > to the process. I could run it as a cron job, but is there an easier way? > > I am running Linux. > > -- > Steven Have you tried GNU Screen? It let's you run processes under vi

Re: [OT] Benefit and belief

2011-09-29 Thread Chris Angelico
On Fri, Sep 30, 2011 at 9:03 AM, Devin Jeanpierre wrote: > But anyway, no, we don't agree on what it means to be friendly or what > a hostile atmosphere is. I've noticed that people tend to be a lot > harsher here than what I'm used to, so perhaps your attitude to it is > more common on mailing-li

Re: Suggested coding style

2011-09-29 Thread Devin Jeanpierre
> However, as you use the new format method you will come to appreciate > it. It's an adult beverage with an acquired taste. ;-) Yeah. It's a much more difficult to read thing, but once you learn how to write it it flows faster. Of course, I never managed to learn how to write it... I would sugg

Re: [OT] Benefit and belief

2011-09-29 Thread Devin Jeanpierre
> There we disagree. The hurt feelings of someone who attaches their identity > to a text should not restrain our discourse. Yes, we do. > That would eliminate just about every joke: a huge range of jokes *depend* > for their humour on connecting seemingly-unrelated ideas. So by your logic, > we

Re: Suggested coding style

2011-09-29 Thread rantingrick
On Sep 29, 5:12 pm, Ian Kelly wrote: > On Thu, Sep 29, 2011 at 6:23 AM, rantingrick wrote: > > A specific method for padding a string with ONLY zeros is ludicrous > > and exposes the narrow mindedness of the creator. The only thing worse > > than "zfill" as a string method is making zfill into bu

Re: [OT] Off-Topic Posts and Threads on the Python Mailing List

2011-09-29 Thread Chris Rebert
On Thu, Sep 29, 2011 at 2:33 PM, Westley Martínez wrote: > I'm kind of new to the whole mailing list thing, but they seem to be a > lot more lenient than internet forums about most things.  I've noticed > that sometimes Off-topic posts can get a little out of hand.  I guess > it's not really a big

Re: Suggested coding style

2011-09-29 Thread Ian Kelly
On Thu, Sep 29, 2011 at 6:23 AM, rantingrick wrote: > A specific method for padding a string with ONLY zeros is ludicrous > and exposes the narrow mindedness of the creator. The only thing worse > than "zfill" as a string method is making zfill into built-in > function! The ONLY proper place for z

Re: [OT] Benefit and belief

2011-09-29 Thread Ben Finney
On 29-Sep-2011, Devin Jeanpierre wrote: > >> This was a technical discussion, and calling the bible a joke was not > >> necessary at all. It creates a hostile atmosphere. > > > > I disagree. It was not an attack on any person nor group of people. If > > we are to be required to avoid jokes not dire

Re: [OT] Off-Topic Posts and Threads on the Python Mailing List

2011-09-29 Thread Chris Angelico
On Fri, Sep 30, 2011 at 7:33 AM, Westley Martínez wrote: > On this mailing list, we're programmers, > nothing else, and so we shouldn't mingle other things into the list. > Think of it as using global variables or even a goto.  That's > essentially what OT is. Not a bad analogy, that... but I acc

Re: [OT] Benefit and belief

2011-09-29 Thread Ben Finney
MRAB writes: > On 29/09/2011 04:05, Ben Finney wrote: > > But the topic of keeping this forum safe for technical discussion > > entails that it must be safe for *any* idea to be the butt of a > > joke, be it a religious text or the Zen of Python, and that is very > > much on-topic. > > Even if it

[OT] Off-Topic Posts and Threads on the Python Mailing List

2011-09-29 Thread Westley Martínez
I'm kind of new to the whole mailing list thing, but they seem to be a lot more lenient than internet forums about most things. I've noticed that sometimes Off-topic posts can get a little out of hand. I guess it's not really a big deal, but it bothers me, and the trolls just love to feed on it.

Re: Suggested coding style

2011-09-29 Thread Ben Finney
Passiday writes: > Oh, my. Who could expect this topic would iterate to some whining > about religion (please don't respond on this remark of mine). That's an unreasonable request. If you make a provocative remark (I doubt you chose to use “whining” without knowing how dismissive it is), it's di

Re: [OT] Benefit and belief

2011-09-29 Thread Westley Martínez
On Thu, Sep 29, 2011 at 02:49:05PM -0400, Devin Jeanpierre wrote: > >> This was a technical discussion, and calling the bible a joke was not > >> necessary at all. It creates a hostile atmosphere. > > > > I disagree. It was not an attack on any person nor group of people. If > > we are to be requir

TestFixtures 2.1.0 Released!

2011-09-29 Thread Chris Withers
Hi All, Another release of TestFixtures, getting things closer to where I want them to be. The only change was: - Add a "strict mode" to `compare`. When used, it ensures that the values compared are not only equal but also of the same type. This mode is not used by default, and the defaul

Re: [OT] Benefit and belief

2011-09-29 Thread Petite Abeille
On Sep 29, 2011, at 9:37 PM, Navkirat Singh wrote: > I am looking for the python mailing list. . ? Have you guys seen it > somewhere? I think I accidently reached the cry-me-a-river list? The portal can be reactivated by intoning Bobby Brown Goes Down in unison. -- http://mail.python.org/mailm

RE: Question on Manipulating List and on Python

2011-09-29 Thread Prasad, Ramit
-Original Message- From: python-list-bounces+ramit.prasad=jpmorgan@python.org [mailto:python-list-bounces+ramit.prasad=jpmorgan@python.org] On Behalf Of Chris Angelico Sent: Thursday, September 29, 2011 11:51 AM To: python-list@python.org Subject: Re: Question on Manipulating List

Re: [OT] Benefit and belief

2011-09-29 Thread Ethan Furman
Petite Abeille wrote: On Sep 29, 2011, at 8:49 PM, Devin Jeanpierre wrote: It could certainly be _interpreted_ as an attack (and was interpreted that way), and that's really all that's necessary for a hostile environment. In other news: http://alt.textdrive.com/assets/public/non/nq050616.gi

Re: [OT] Benefit and belief

2011-09-29 Thread Navkirat Singh
Hi, I am looking for the python mailing list. . ? Have you guys seen it somewhere? I think I accidently reached the cry-me-a-river list? Regards, Nav On Sep 30, 2011 1:03 AM, "Petite Abeille" wrote: > > On Sep 29, 2011, at 8:49 PM, Devin Jeanpierre wrote: > >> It could certainly be _interpreted_

RE: options for plotting points on geographic map

2011-09-29 Thread Prasad, Ramit
>I see there is pymaps, a Python wrapper for Google Maps. I may try >that but it seems to be barely documented and would require making a >webpage with javascript to display the map, whereas I'd probably >prefer a desktop app for this--though I'd consider a web page (it's >probably easier than I t

Re: [OT] Benefit and belief

2011-09-29 Thread Petite Abeille
On Sep 29, 2011, at 8:49 PM, Devin Jeanpierre wrote: > It could certainly be _interpreted_ as an attack > (and was interpreted that way), and that's really all that's necessary > for a hostile environment. In other news: http://alt.textdrive.com/assets/public/non/nq050616.gif -- Tout le monde

Re: [OT] Benefit and belief

2011-09-29 Thread Devin Jeanpierre
>> This was a technical discussion, and calling the bible a joke was not >> necessary at all. It creates a hostile atmosphere. > > I disagree. It was not an attack on any person nor group of people. If > we are to be required to avoid jokes not directed at people, then *that* > is an atmosphere hos

Re: Counting the number of call of a function

2011-09-29 Thread Chris Rebert
On Thu, Sep 29, 2011 at 10:08 AM, Laurent Claessens wrote: >   Hello > > >   Is it possible to count the number of time a function is called ? > Of course, if I've access to the source code, it's easy. > > I tried the following : > > def foo(): >    print "foo !" > > > class wraper(object): >    d

Re: Counting the number of call of a function

2011-09-29 Thread MRAB
On 29/09/2011 18:08, Laurent Claessens wrote: Hello Is it possible to count the number of time a function is called ? Of course, if I've access to the source code, it's easy. I tried the following : def foo(): print "foo !" class wraper(object): def __init__(self,fun): globals()[fun]=self.r

Re: Counting the number of call of a function

2011-09-29 Thread Chris Angelico
On Fri, Sep 30, 2011 at 3:08 AM, Laurent Claessens wrote: > class wraper(object): >    def __init__(self,fun): >        globals()[fun]=self.replacement >    def replacement(*args): >        print "I'm replaced" > > foo() > X=wraper(foo) > foo() > > I was hoping that globals()[foo] would be replace

Re: Counting the number of call of a function

2011-09-29 Thread Chris Angelico
On Fri, Sep 30, 2011 at 3:08 AM, Laurent Claessens wrote: > def foo(): >    print "foo !" > > > class wraper(object): >    def __init__(self,fun): >        globals()[fun]=self.replacement >    def replacement(*args): >        print "I'm replaced" > > foo() > X=wraper(foo) > foo() Are you able to

Counting the number of call of a function

2011-09-29 Thread Laurent Claessens
Hello Is it possible to count the number of time a function is called ? Of course, if I've access to the source code, it's easy. I tried the following : def foo(): print "foo !" class wraper(object): def __init__(self,fun): globals()[fun]=self.replacement def replac

Re: Suggested coding style

2011-09-29 Thread Chris Angelico
On Fri, Sep 30, 2011 at 2:42 AM, Westley Martínez wrote: > But maybe I'm just batty as you all think I am. Yes, I'm afraid so. Bonkers. Off your head. But let me tell you a secret... All the best people are. > Well, I once thought that a print function made a lot of sense.  In C, > printf is a f

Re: options for plotting points on geographic map

2011-09-29 Thread Miki Tebeka
Probably the google maps routes will be faster (maybe using embedded webkit window). However it requires internet connection. See also http://www.scipy.org/Cookbook/Matplotlib/Maps HTH -- Miki Tebeka http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Question on Manipulating List and on Python

2011-09-29 Thread John Gordon
In <71c71a9d-928d-4ebe-af64-674c31bc1...@e9g2000vby.googlegroups.com> Subhabrata Banerjee writes: > Hi John, > The actual code is till now is: > def name_debugger(n): > open_file=3Dopen("/python27/name1.txt") > for line in open_file: > line_word=3Dline.split() > #print l

Re: Question on Manipulating List and on Python

2011-09-29 Thread Chris Angelico
On Fri, Sep 30, 2011 at 2:36 AM, Subhabrata Banerjee wrote: > And Python seems faster than C++/Java. It is indeed. I also experience > it. > Python compared to Java? Difficult to compare. Python to C++? Impossible to compare. But performance depends MASSIVELY on algorithmic quality; if you code t

Re: Question on Manipulating List and on Python

2011-09-29 Thread David
> word1=line_word[0] > if word1==001: You are comparing a string and an integer assuming you are reading a text file. integers word1=int(line_word[0]) if word1=1: strings word1=line_word[0] if word1=="001:" -- http://mail.python.org/mailman/listinfo/python-list

Re: Question on Manipulating List and on Python

2011-09-29 Thread Laurent Claessens
Le 29/09/2011 18:27, John Gordon a écrit : In Subhabrata Banerjee writes: (i) I have a file of lists. Now, the first digit starts with a number or index, like, [001, "Obama", "USA", "President"] [002 "Major", "UK", "PM"] [003 "Singh", "INDIA", "PM"] What about creating a dictiona

Re: Suggested coding style

2011-09-29 Thread Westley Martínez
On Thu, Sep 29, 2011 at 05:23:30AM -0700, rantingrick wrote: > On Sep 29, 5:37 am, Passiday wrote: > > What is so bad about breaking code in obscure places? We changed print > to a function which broke just about every piece of code every written > in this language. (BTW, print should ALWAYS hav

Re: Question on Manipulating List and on Python

2011-09-29 Thread Subhabrata Banerjee
On Sep 29, 9:27 pm, John Gordon wrote: > In > Subhabrata Banerjee writes: > > > (i) I have a file of lists. Now, the first digit starts with a number > > or index, like, > > [001, "Obama", "USA", "President"] > > [002  "Major", "UK", "PM"] > > [003  "Singh", "INDIA", "PM"] > > Initially, I am r

Re: Question on Manipulating List and on Python

2011-09-29 Thread Chris Rebert
On Thu, Sep 29, 2011 at 9:11 AM, Subhabrata Banerjee wrote: > Dear Group, > > I have two questions one on list manipulation and other on Python. > > (i) I have a file of lists. Now, the first digit starts with a number > or index, like, > > [001, "Obama", "USA", "President"] > [002  "Major", "UK",

Re: Suggested coding style

2011-09-29 Thread Westley Martínez
On Thu, Sep 29, 2011 at 08:37:53PM +1000, Steven D'Aprano wrote: > Westley Martínez wrote: > > > Perhaps you should spend a little less time on the mailing list and a > > little more time in church. > > Is that meant as punishment for Rick or for the churchgoers? > > Hopefully neither, probabl

Re: Question on Manipulating List and on Python

2011-09-29 Thread John Gordon
In Subhabrata Banerjee writes: > (i) I have a file of lists. Now, the first digit starts with a number > or index, like, > [001, "Obama", "USA", "President"] > [002 "Major", "UK", "PM"] > [003 "Singh", "INDIA", "PM"] > Initially, I am reading the file and taking as > for line in file: >

Question on Manipulating List and on Python

2011-09-29 Thread Subhabrata Banerjee
Dear Group, I have two questions one on list manipulation and other on Python. (i) I have a file of lists. Now, the first digit starts with a number or index, like, [001, "Obama", "USA", "President"] [002 "Major", "UK", "PM"] [003 "Singh", "INDIA", "PM"] Initially, I am reading the file and t

Re: Python without a tty

2011-09-29 Thread Bradley Cloete
> It doesn't appear so to me. > > [steve@sylar ~]$ tty > /dev/pts/16 > [steve@sylar ~]$ setsid tty > /dev/pts/16 > > [steve@sylar ~]$ python -c "import sys,os; print > os.isatty(sys.stdout.fileno())" > True > [steve@sylar ~]$ setsid python -c "import sys,os; print > os.isatty(sys.stdout.fileno())"

Re: Python without a tty

2011-09-29 Thread Martin P. Hellwig
On 29/09/2011 10:21, Steven D'Aprano wrote: I have a Python script which I would like to test without a tty attached to the process. I could run it as a cron job, but is there an easier way? I am running Linux. Well you could double fork and drop the parent, that would lose the tty which is

Re: Installing Python 2.6.7 on Windows

2011-09-29 Thread Brian Curtin
On Wed, Sep 28, 2011 at 19:10, Nobody wrote: > On Wed, 28 Sep 2011 15:21:25 -0700, Ned Deily wrote: > > > No, it was a deliberate decision. After a release is in security-fix > > mode only, we don't build Windows or Mac OS X installers for them. > > But you continue to offer the installers for t

Re: [OT] Benefit and belief

2011-09-29 Thread MRAB
On 29/09/2011 04:05, Ben Finney wrote: Devin Jeanpierre writes: Forget money, or even the love of money. The idea that one mustn't criticise another person's beliefs is the root of all evil. This was a technical discussion, and calling the bible a joke was not necessary at all. It creates a

Re: Python without a tty

2011-09-29 Thread Roy Smith
In article <4e84388c$0$29965$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > I have a Python script which I would like to test without a tty attached > to the process. I could run it as a cron job, but is there an easier way? I'm not sure what you mean by "without a tty attached

Re: Suggested coding style

2011-09-29 Thread rantingrick
On Sep 29, 7:23 am, rantingrick wrote: > A specific method for padding a string with ONLY zeros is ludicrous > and exposes the narrow mindedness of the creator. The only thing worse > than "zfill" as a string method is making zfill into built-in > function! The ONLY proper place for zfill is as a

Re: Python without a tty

2011-09-29 Thread Ben Finney
Steven D'Aprano writes: > I have a Python script which I would like to test without a tty > attached to the process. I could run it as a cron job, but is there an > easier way? > > I am running Linux. You could crib from the ‘python-daemon’ library implementation http://pypi.python.org/pypi/pyth

Re: Suggested coding style

2011-09-29 Thread rantingrick
On Sep 29, 5:37 am, Passiday wrote: > Here's a summary of what I take from this longwinded thread: > Read the Zen of Pthon for some fun:http://www.python.org/dev/peps/pep-0020 > Read the PEP-8 for some good > guidelines:http://www.python.org/dev/peps/pep-0008 That's the point of all this, yes.

Re: Python without a tty

2011-09-29 Thread Alain Ketterlin
Steven D'Aprano writes: > Alain Ketterlin wrote: >>> I have a Python script which I would like to test without a tty attached >>> to the process. I could run it as a cron job, but is there an easier way? >> Isn't os.setsid() what you're looking for?[...] > It doesn't appear so to me. [...] > [

Re: Python without a tty

2011-09-29 Thread Hans Mulder
On 29/09/11 12:52:22, Steven D'Aprano wrote: [steve@sylar ~]$ python -c "import sys,os; print os.isatty(sys.stdout.fileno())" True > If I run the same Python command (without the setsid) as a cron job, I get False emailed to me. That's the effect I'm looking for. In that case, all you need t

Re: Python without a tty

2011-09-29 Thread Hans Mulder
On 29/09/11 11:21:16, Steven D'Aprano wrote: I have a Python script which I would like to test without a tty attached to the process. I could run it as a cron job, but is there an easier way? There is module on Pypi called python-daemon; it implements PEP-3143. This module detaches the process

Re: Python without a tty

2011-09-29 Thread Steven D'Aprano
Alain Ketterlin wrote: > Steven D'Aprano writes: > >> I have a Python script which I would like to test without a tty attached >> to the process. I could run it as a cron job, but is there an easier way? >> >> I am running Linux. > > Isn't os.setsid() what you're looking for? It makes the calli

Re: Suggested coding style

2011-09-29 Thread Passiday
Oh, my. Who could expect this topic would iterate to some whining about religion (please don't respond on this remark of mine). Here's a summary of what I take from this longwinded thread: Read the Zen of Pthon for some fun: http://www.python.org/dev/peps/pep-0020 Read the PEP-8 for some good gui

Re: Suggested coding style

2011-09-29 Thread Steven D'Aprano
Westley Martínez wrote: > Perhaps you should spend a little less time on the mailing list and a > little more time in church. Is that meant as punishment for Rick or for the churchgoers? -- Steven -- http://mail.python.org/mailman/listinfo/python-list

red bull hats, monster energy hats, red bull t shirts, monster energy t shirts, snapback hats on www.theworldhats.com

2011-09-29 Thread red bull hats red bull hats
www.theworldhats.com are promoting the products: red bull hats:http://www.theworldhats.com/category-130-b0-Red-Bull- Hats.html snapback hats: http://www.theworldhats.com/category-230-b0-Snapback-Hats.html monster energy hats: http://www.theworldhats.com/category-128-b0-Monster-Energy-Hats.htm

Re: Python without a tty

2011-09-29 Thread Alain Ketterlin
Steven D'Aprano writes: > I have a Python script which I would like to test without a tty attached > to the process. I could run it as a cron job, but is there an easier way? > > I am running Linux. Isn't os.setsid() what you're looking for? It makes the calling process have no controlling term

Re: Python without a tty

2011-09-29 Thread Thomas Jollans
On 29/09/11 11:21, Steven D'Aprano wrote: > I have a Python script which I would like to test without a tty attached > to the process. I could run it as a cron job, but is there an easier way? > > I am running Linux. > ./program /dev/null 2>&1 -- http://mail.python.org/mailman/listinfo/python

Python without a tty

2011-09-29 Thread Steven D'Aprano
I have a Python script which I would like to test without a tty attached to the process. I could run it as a cron job, but is there an easier way? I am running Linux. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: A trivial question

2011-09-29 Thread jitendra gupta
HI The class Foo you have defined is local NameSpace for trial functioon, for details http://docs.python.org/tutorial/classes.html def trial(): class Foo(object): def __init__(self): print("Hello, world!") lacalClass = Foo() >>>trial "Hello, world!" Thanks Jitendra On Thu, Sep 29, 2011 at

A trivial question

2011-09-29 Thread Tayfun Kayhan
I accidentally wrote such a code (below) while trying to write sth else for my application but i am now just wondering much how to run the class Foo, if it is possible. Is not it weird that Python does not give any error when I run it ? Sorry for that it's pretty unimportant question according t

Re: Suggested coding style

2011-09-29 Thread Ian Kelly
On Thu, Sep 29, 2011 at 12:57 AM, Ian Kelly wrote: > On Thu, Sep 29, 2011 at 12:24 AM, Westley Martínez wrote: >> Perhaps you should spend a little less time on the mailing list and a >> little more time in church. > > You must not like churchgoers very much if you want to inflict > rantingrick o

Re: Suggested coding style

2011-09-29 Thread Ian Kelly
On Thu, Sep 29, 2011 at 12:24 AM, Westley Martínez wrote: > Perhaps you should spend a little less time on the mailing list and a > little more time in church. You must not like churchgoers very much if you want to inflict rantingrick on them... -- http://mail.python.org/mailman/listinfo/python-