Why can't I set sys.ps1 to a unicode string?

2010-08-11 Thread RG
More precisely, why does sys.ps1 not appear if I set it to a unicode string? This problem is hard for me to describe here because my newsreader is not properly unicode enabled, but here's the gist of it: Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) [GCC 4.2.1 (Apple Inc. build 5646)] on da

Beyond the moratorium

2010-08-11 Thread Vito 'ZeD' De Tullio
Hi all. I know, maybe I'm just lazily speculating, but I'm curious about what's next, in python, when GvR will stop the moratorium and will let changes in the language. I don't know what to expect... some syntax sugar about concurrent programming? static types? an erlang-style "bang" (!) proce

Re: urllib2 does not implement "with" Python 2.6

2010-08-11 Thread Paul Rubin
John Nagle writes: > "AttributeError: addinfourl instance has no attribute '__exit__'". > > I thought that all the file-like objects supported "with" in 2.6. > No? I guess not. Use contextlib.closing. -- http://mail.python.org/mailman/listinfo/python-list

Re: How does Python get the value for sys.stdin.encoding?

2010-08-11 Thread RG
In article , Benjamin Kaplan wrote: > On Wed, Aug 11, 2010 at 6:21 PM, RG wrote: > > I thought it was hard-coded into the Python executable at compile time, > > but that is apparently not the case: > > > > [...@mickey:~]$ python > > Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) > > [GCC 4.2.

urllib2 does not implement "with" Python 2.6

2010-08-11 Thread John Nagle
Somewhat to my surprise, in Python 2.6, with urllib2.urlopen(url) as fh : doesn't work. It fails with "AttributeError: addinfourl instance has no attribute '__exit__'". I thought that all the file-like objects supported "with" in 2.6. No? John Nagle -

Re: favicon.ico problem

2010-08-11 Thread Gabriel Genellina
En Tue, 10 Aug 2010 01:32:49 -0300, Navkirat Singh escribió: I am having this strange problem. I have programmed a very basic multiprocessing webserver using low level sockets. Each time the server receives a request it spawns a new process to handle the request. Now when through a web b

Re: How to capture all the environment variables from shell?

2010-08-11 Thread Cameron Simpson
On 12Aug2010 01:28, Nobody wrote: | On Wed, 11 Aug 2010 13:08:59 +1000, Cameron Simpson wrote: | > The reason .bashrc gets overused for envars, aside from ignorance and | > propagated bad habits, is that in a GUI desktop the setup sequence is | > often a bit backwards. A conventional terminal/cons

globbal | creating networks

2010-08-11 Thread apustilnik
Hi, i'd like to invite you to know this new way to keep in touch with friends, and meet new people! http://www.globbal.com.ar/login1.php Invite your friends to join, and start creating your own globbal networks! Are you ready to live a new experience? Are you ready to live globbal! Sign up now! --

Re: How does Python get the value for sys.stdin.encoding?

2010-08-11 Thread Benjamin Kaplan
On Wed, Aug 11, 2010 at 6:21 PM, RG wrote: > I thought it was hard-coded into the Python executable at compile time, > but that is apparently not the case: > > [...@mickey:~]$ python > Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) > [GCC 4.2.1 (Apple Inc. build 5646)] on darwin > Type "help", "

python ide for ubuntu

2010-08-11 Thread Bhanu Kumar
Hi All, Is there any good free python IDE available in Ubuntu? thanks, -Bhanu -- http://mail.python.org/mailman/listinfo/python-list

Re: Line-by-line processing when stdin is not a tty

2010-08-11 Thread RG
In article , Nobody wrote: > On Wed, 11 Aug 2010 10:32:41 +, Tim Harig wrote: > > >>> Usually you either > >>> need an option on the upstream program to tell it to line > >>> buffer explicitly > >> > >> once cat had an option -u doing exactly that but nowadays > >> -u seems to be ignored >

Deer Esurance

2010-08-11 Thread Carl Banks
If you're going to send me unsolicited email, the least you can do it include pics of Erin. Carl Banks -- http://mail.python.org/mailman/listinfo/python-list

How does Python get the value for sys.stdin.encoding?

2010-08-11 Thread RG
I thought it was hard-coded into the Python executable at compile time, but that is apparently not the case: [...@mickey:~]$ python Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information

Re: Line-by-line processing when stdin is not a tty

2010-08-11 Thread Nobody
On Wed, 11 Aug 2010 10:32:41 +, Tim Harig wrote: >>> Usually you either >>> need an option on the upstream program to tell it to line >>> buffer explicitly >> >> once cat had an option -u doing exactly that but nowadays >> -u seems to be ignored >> >> http://www.opengroup.org/onlinepubs/009695

Re: How to capture all the environment variables from shell?

2010-08-11 Thread Nobody
On Wed, 11 Aug 2010 13:08:59 +1000, Cameron Simpson wrote: > The reason .bashrc gets overused for envars, aside from ignorance and > propagated bad habits, is that in a GUI desktop the setup sequence is > often a bit backwards. A conventional terminal/console login means you > get a login shell th

Re: GUI automation tool (windows)

2010-08-11 Thread Ben Finney
Alex Barna writes: > I know that this question has been asked for several times, […] > So what happens to this field (Windows GUI automation [with Python]) ? Alex Barna writes: > It makes me doubt: is Python the correct language to do GUI > automation ? Your questions are definitely on-topic

Re: most popular gui framework for python

2010-08-11 Thread Ben Finney
Back9 writes: > Does anyone know of what is the most popular gui framework for python > application? The Python standard library comes with one, Tkinter http://docs.python.org/library/tkinter.html>. Recently the Tix extension is also available in the standard library http://docs.python.org/libr

Re: Microsoft lessening commitment to IronPython and IronRuby

2010-08-11 Thread Ben Finney
Jason Earl writes: > Which is more of a promise than Microsoft has given to Python. I am > not arguing for Mono, as I am not a fan. But if you honestly think > that Python doesn't infringe on some of Microsoft's patents you are > crazy. It's quite true that anyone can be sued, at any time, for a

Python Tkinter Simple Qn

2010-08-11 Thread ChrisChia
Hi i have the following problem with Python Tkinter. I switch to switch the image background (which i used Tkinter.Label with image arg to display on the GUI). How can I do that? the callback function which i have created doesn't seem to work... some advice? below is my code: import Tkinter as

Re: urgent requirement at Hyderabad

2010-08-11 Thread Steven D'Aprano
On Wed, 11 Aug 2010 14:25:08 -0700, Emile van Sebille wrote: > On 8/11/2010 12:39 PM MRAB said... >> Stefan Behnel wrote: >>> In case anyone wondered: Hyderabad is likely referring to some place >>> in Asia: >>> >>> http://en.wikipedia.org/wiki/Hyderabad_%28disambiguation%29 >>> >> And Berlin is l

Re: looping through possible combinations of McNuggets packs of 6,9 and 20

2010-08-11 Thread Steven D'Aprano
On Wed, 11 Aug 2010 13:14:35 -0700, Baba wrote: > level: beginner > > exercise: given that packs of McNuggets can only be bought in 6, 9 or 20 > packs, write an exhaustive search to find the largest number of > McNuggets that cannot be bought in exact quantity. Is this a trick question? I'd lik

Re: Win7. Why Don't Matplotlib, ... Show up in Control Panel Add-Remove?

2010-08-11 Thread Giacomo Boffi
"Martin v. Loewis" writes: > If you use the bdist_wininst, bdist_msi, or bdist_rpm distutils > commands, you get packages which support uninstallations very well. bdist_deb? -- Vorrei andare a lavorare in Sicilia, a max 15 km dal mare. Con chi devo parlare? Col capomafia distrettuale? Oppure b

Re: segfault with small pyqt script

2010-08-11 Thread Gelonida
Jusy FYI: I made further tests and can crash the python script even if I delete the linesassigning strings to variables a to f On 08/12/2010 01:07 AM, Gelonida wrote: > Hi Guys, > I'm desperate. I'm having a real application, which fails rather often > when finishing it. I'm not sure, whether an

segfault with small pyqt script

2010-08-11 Thread Gelonida
Hi Guys, I'm desperate. I'm having a real application, which fails rather often when finishing it. I'm not sure, whether any serious problem could be hidden behind it The script is a pyqt script, which segfaults most of the time on my ubuntu 10.4 linux 64 bit and I'm having trouble to understand w

Re: GUI automation tool (windows)

2010-08-11 Thread Alex Barna
I'm afraid that my first post has not been understood correctly and most of the following posts are OT, as Ben Finney indicated. The GUI automation has a long history, perhaps since the first windowing system was invented. For years I've been doing this using several different technologies/languag

Re: Line-by-line processing when stdin is not a tty

2010-08-11 Thread Cameron Simpson
On 11Aug2010 12:35, Tim Harig wrote: | > The buffering is a performance choice. Every write requires a context | > switch from userspace to kernel space, and availability of data in the | > pipe will wake up a downstream process blocked trying to read. | > It is far more efficient to do as few suc

Re: Queue cleanup

2010-08-11 Thread Paul Rubin
EW writes: > Well I can't really explain it but 1 Queue per task for what I'm > designing just doesn't feel right to me. It feels like it will lack > future flexibility. That makes no sense at all. Multiple readers and writers per queue are the way Python queues are designed to work. The norma

cx_Oracle 5.0.4 + Python 3.1.2 + Oracle Instant Client 10.2.04; DLL Load failed on import (Win/NT)

2010-08-11 Thread tormod
Hi, I've tried countless times to build & install cx_Oracle on Python 3.1.2, and failed every time, so I'd like to ask someone for help. I've included step-by-step (literally) description of my last try, with so much detail I could, to help clarify things. I can build without errors. I can instal

Re: urgent requirement at Hyderabad

2010-08-11 Thread Emile van Sebille
On 8/11/2010 12:39 PM MRAB said... Stefan Behnel wrote: In case anyone wondered: Hyderabad is likely referring to some place in Asia: http://en.wikipedia.org/wiki/Hyderabad_%28disambiguation%29 And Berlin is likely some place in Europe: http://en.wikipedia.org/wiki/Berlin_(disambiguation) :

Re: looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-11 Thread Thomas Jollans
On Wednesday 11 August 2010, it occurred to Baba to exclaim: > level: beginner > > exercise: given that packs of McNuggets can only be bought in 6, 9 or > 20 packs, write an exhaustive search to find the largest number of > McNuggets that cannot be bought in exact quantity. The MacDonald's at Nur

Re: python interview quuestions

2010-08-11 Thread Peter
On Aug 11, 8:50 pm, Tim Chase wrote: > On 08/11/10 01:24, Terry Reedy wrote: > > > On 8/10/2010 8:08 PM, Roy Smith wrote: > >> In any case, if the candidate were to submit somebody else's > >> work, it would come out pretty quickly as we discussed their > >> code.  I suppose one question I might a

Re: How to input values of the matrix from keyboard in python

2010-08-11 Thread Chris Rebert
On Wed, Aug 11, 2010 at 12:06 PM, Chris Rebert wrote: > On Wed, Aug 11, 2010 at 11:43 AM, Pramod wrote: >> Hi >> >>   I want to know the how we input values into the matrix (N*N size) >> from keyboard in python, >> >> Here I wrote Matrix programe in C++ >> >> This  asks values from key board and

Re: mi

2010-08-11 Thread Chris Rebert
On Wed, Aug 11, 2010 at 12:45 PM, Eric J. Van der Velden wrote: > Hello, > > I have these types, > > class A: >        def __init__(s): >                super().__init__() >                print("A") > class B(A): >        def __init__(s): >                super().__init__() >                print

Re: Line-by-line processing when stdin is not a tty

2010-08-11 Thread RG
In article , RG wrote: > In article , > Tim Harig wrote: > > > On 2010-08-11, RG wrote: > > > In article , > > > Tim Harig wrote: > > > > > >> On 2010-08-11, RG wrote: > > >> > I'm writing a system in a different language but want to use a Python > > >> > library. I know of lots of ways

Re: most popular gui framework for python

2010-08-11 Thread Peter
On Aug 12, 6:13 am, Thomas Jollans wrote: > On Wednesday 11 August 2010, it occurred to Back9 to exclaim: > > > Hi, > > > Does anyone know of what is the most popular gui framework for python > > application? > > I'd guess at Tkinter - it's part of the standard library. > Another quite popular opt

Re: looping through possible combinations of McNuggets packs of 6,9 and 20

2010-08-11 Thread News123
As said in the instructions. if you find six consecutive numbers, that can be bough in exact quantity, then you know, that all bigger numbers can also be bought in exact quantity. I would do a brute force approach first I would create one function, which will try to find out, whether one can

Re: Queue cleanup

2010-08-11 Thread EW
On Aug 11, 2:52 pm, Paul Rubin wrote: > EW writes: > > Well I cared because I thought garbage collection would only happen > > when the script ended - the entire script.  Since I plan on running > > this as a service it'll run for months at a time without ending.  So I > > thought I was going to

Re: mi

2010-08-11 Thread Thomas Jollans
On Wednesday 11 August 2010, it occurred to Eric J. Van der Velden to exclaim: > Hello, > > I have these types, > > class A: > def __init__(s): > super().__init__() > print("A") > class B(A): > def __init__(s): > super().__init__() >

Re: Line-by-line processing when stdin is not a tty

2010-08-11 Thread RG
In article , Tim Harig wrote: > On 2010-08-11, RG wrote: > > In article , > > Tim Harig wrote: > > > >> On 2010-08-11, RG wrote: > >> > I'm writing a system in a different language but want to use a Python > >> > library. I know of lots of ways to do this (embed a Python interpreter, > >>

Re: most popular gui framework for python

2010-08-11 Thread Thomas Jollans
On Wednesday 11 August 2010, it occurred to Back9 to exclaim: > Hi, > > Does anyone know of what is the most popular gui framework for python > application? I'd guess at Tkinter - it's part of the standard library. Another quite popular option is PyGtk. Other good ones include wxPython, PyQt, an

looping through possible combinations of McNuggets packs of 6, 9 and 20

2010-08-11 Thread Baba
level: beginner exercise: given that packs of McNuggets can only be bought in 6, 9 or 20 packs, write an exhaustive search to find the largest number of McNuggets that cannot be bought in exact quantity. exercise source: http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-

Re: python interview quuestions

2010-08-11 Thread Paul Rubin
geremy condra writes: > I can't recall who it was, but I remember being very impressed by a > company that did a variant of this a few years ago: they put > programming problems on the sides of pay phones, taxis, etc. with a > note that said 'If you can solve this, call us'. I have zero doubt > th

Re: python interview quuestions

2010-08-11 Thread geremy condra
On Wed, Aug 11, 2010 at 6:04 AM, Roy Smith wrote: > In article <4c6298c1$0$11101$c3e8...@news.astraweb.com>, >  Steven D'Aprano wrote: > >> Sounds ridiculous, but apparently there are vast hordes of people who can >> barely program "Hello World" applying for programming jobs. One figure >> bandie

Re: most popular gui framework for python

2010-08-11 Thread J.O. Aho
Back9 wrote: > Does anyone know of what is the most popular gui framework for python > application? Don't think it's the most popular, but I think it may be the one which works for quite a lot of different platforms, PyQt, works fine on my desktop as cellphone. -- //Aho -- http://mail.pytho

mi

2010-08-11 Thread Eric J. Van der Velden
Hello, I have these types, class A: def __init__(s): super().__init__() print("A") class B(A): def __init__(s): super().__init__() print("B") class C(A): def __init__(s): super().__init__()

Re: Is there a Python equivalent to Perl's File::Listing::parse_dir

2010-08-11 Thread Thomas Jollans
On Wednesday 11 August 2010, it occurred to John Nagle to exclaim: > This is especially useful for FTP sites. It sounds like you're trying to use HTTP to something a lot more easily done with FTP, without any reason not to use FTP. http://docs.python.org/library/ftplib.html#ftplib.FTP.dir -- ht

Re: Line-by-line processing when stdin is not a tty

2010-08-11 Thread Tim Harig
On 2010-08-11, RG wrote: > In article , > Tim Harig wrote: > >> On 2010-08-11, RG wrote: >> > I'm writing a system in a different language but want to use a Python >> > library. I know of lots of ways to do this (embed a Python interpreter, >> > fire up a python server) but by far the easies

Re: GUI automation tool (windows)

2010-08-11 Thread CM
On Aug 9, 8:10 am, Alex Barna wrote: > I know that this question has been asked for several times, but it > surprises that there is no tool under very active development and the > community activities are very low (mailing list posts). > > All the tools listed in: > > http://pycheesecake.org/wiki/

Re: Confused: Newbie Function Calls

2010-08-11 Thread Pinku Surana
On Aug 11, 12:39 pm, fuglyducky wrote: > On Aug 11, 9:31 am, Pinku Surana wrote: > > > > > > > On Aug 11, 12:07 pm, fuglyducky wrote: > > > > I am a complete newbie to Python (and programming in general) and I > > > have no idea what I'm missing. Below is a script that I am trying to > > > work

Re: urgent requirement at Hyderabad

2010-08-11 Thread MRAB
Stefan Behnel wrote: In case anyone wondered: Hyderabad is likely referring to some place in Asia: http://en.wikipedia.org/wiki/Hyderabad_%28disambiguation%29 And Berlin is likely some place in Europe: http://en.wikipedia.org/wiki/Berlin_(disambiguation) :-) -- http://mail.python.org/mailma

most popular gui framework for python

2010-08-11 Thread Back9
Hi, Does anyone know of what is the most popular gui framework for python application? TIA -- http://mail.python.org/mailman/listinfo/python-list

Re: Queue cleanup

2010-08-11 Thread MRAB
Paul Rubin wrote: EW writes: Well I cared because I thought garbage collection would only happen when the script ended - the entire script. Since I plan on running this as a service it'll run for months at a time without ending. So I thought I was going to have heaps of Queues hanging out in

How to give matrix input from keyboard or file in python

2010-08-11 Thread Pramod
I want to write the following programm in python . Main objective is input from keyoard to enter elements into the matrix . Thanks in advance #include #include #include using namespace std; int main() { double **a; int i,j,n; cout<<"Enter size of the matrix\n";

Re: Microsoft lessening commitment to IronPython and IronRuby

2010-08-11 Thread Jason Earl
On Tue, Aug 10 2010, Ben Finney wrote: > Steven D'Aprano writes: > >> On Tue, 10 Aug 2010 20:07:06 +1200, Gregory Ewing wrote: >> > Is there any way for a non-.NET program to access a .NET library? Or >> > is it necessary to drink the entire bottle of .NET kool-aid? >> >> http://www.mono-project.

Re: How to input values of the matrix from keyboard in python

2010-08-11 Thread MRAB
Pramod wrote: Hi I want to know the how we input values into the matrix (N*N size) from keyboard in python, Here I wrote Matrix programe in C++ This asks values from key board and print on the console N*N matrix ; [snip] Read from the keyboard using raw_input() (in Python 2, or input()

Re: How to input values of the matrix from keyboard in python

2010-08-11 Thread Chris Rebert
On Wed, Aug 11, 2010 at 11:43 AM, Pramod wrote: > Hi > >   I want to know the how we input values into the matrix (N*N size) > from keyboard in python, > > Here I wrote Matrix programe in C++ > > This  asks values from key board and print on the console N*N matrix ; > > Thanks in advance > >

Re: passing file from command line startup

2010-08-11 Thread MRAB
Bradley Hintze wrote: Hi all, Is there a way that I can startup my script and pass it a file? For example: ~$ python myscript.py mytext.txt and then access mytext.txt in myscript.py? As a long shot, for myscript.py I tried def __init__(fle): print fle expecting the full path to mytext.t

Re: passing file from command line startup

2010-08-11 Thread Robert Kern
On 8/11/10 1:47 PM, Bradley Hintze wrote: Hi all, Is there a way that I can startup my script and pass it a file? For example: ~$ python myscript.py mytext.txt and then access mytext.txt in myscript.py? As a long shot, for myscript.py I tried def __init__(fle): print fle expecting the

Re: passing file from command line startup

2010-08-11 Thread Peter Otten
Bradley Hintze wrote: > Hi all, > > Is there a way that I can startup my script and pass it a file? For > example: > > ~$ python myscript.py mytext.txt > > and then access mytext.txt in myscript.py? > > As a long shot, for myscript.py I tried > > def __init__(fle): > print fle > > expect

Re: urgent requirement at Hyderabad

2010-08-11 Thread Edward A. Falk
In article , Stefan Behnel wrote: >In case anyone wondered: Hyderabad is likely referring to some place in Asia: It's one of the high-tech cities in India. A lot of out-sourcing winds up there. -- -Ed Falk, f...@despams.r.us.com http://thespamdiaries.blogspot.com/ -- http://m

Re: Queue cleanup

2010-08-11 Thread Paul Rubin
EW writes: > Well I cared because I thought garbage collection would only happen > when the script ended - the entire script. Since I plan on running > this as a service it'll run for months at a time without ending. So I > thought I was going to have heaps of Queues hanging out in memory, > unr

passing file from command line startup

2010-08-11 Thread Bradley Hintze
Hi all, Is there a way that I can startup my script and pass it a file? For example: ~$ python myscript.py mytext.txt and then access mytext.txt in myscript.py? As a long shot, for myscript.py I tried def __init__(fle): print fle expecting the full path to mytext.txt to be printed but tha

How to input values of the matrix from keyboard in python

2010-08-11 Thread Pramod
Hi I want to know the how we input values into the matrix (N*N size) from keyboard in python, Here I wrote Matrix programe in C++ This asks values from key board and print on the console N*N matrix ; Thanks in advance #include using namespace std; int main() { double **a;

Re: Queue cleanup

2010-08-11 Thread EW
On Aug 11, 2:16 pm, Paul Rubin wrote: > EW writes: > > I thought about doing it that way and I could do it that way but it > > still seems like there should be a way to clean up Queues on my own. > > If I did it this way then I guess I'd be relying on garbage collection > > when the script ended

Re: Line-by-line processing when stdin is not a tty

2010-08-11 Thread RG
In article , Tim Harig wrote: > On 2010-08-11, RG wrote: > > I'm writing a system in a different language but want to use a Python > > library. I know of lots of ways to do this (embed a Python interpreter, > > fire up a python server) but by far the easiest to implement is to have > > the

Re: How to swallow traceback message

2010-08-11 Thread Peter Otten
Back9 wrote: > I run my py app to display a file's contents, and it is normally very > long. > So I use it like below: > > python myapp.py input_file | more > to see them step by step. > > But when I try to exit it, normally I use Ctrl+ C key to quit it. > Problem is every time I do like it, it

Is there a Python equivalent to Perl's File::Listing::parse_dir

2010-08-11 Thread John Nagle
Perl has a function which will take a remote directory page, in the form that most web sites return for a file directory, and parse it into a useful form: http://www.xav.com/perl/site/lib/File/Listing.html This is especially useful for FTP sites. Is there a Python equivalent of this?

Re: Queue cleanup

2010-08-11 Thread Paul Rubin
EW writes: > I thought about doing it that way and I could do it that way but it > still seems like there should be a way to clean up Queues on my own. > If I did it this way then I guess I'd be relying on garbage collection > when the script ended to clean up the Queues for me. Oh, I see. As lo

Re: How to swallow traceback message

2010-08-11 Thread Tim Harig
On 2010-08-11, Back9 wrote: > On Aug 11, 11:19 am, Tim Harig wrote: >> On 2010-08-11, Back9 wrote: >> > But when I try to exit it, normally I use Ctrl+ C key to quit it. >> > Problem is every time I do like it, it shows Traceback message and it >> > makes my app not professional. >> >> You have

Re: Queue cleanup

2010-08-11 Thread EW
On Aug 11, 1:55 pm, MRAB wrote: > EW wrote: > > [snip] > > > > > So here the P2 thread has ended and gone away but I still have his > > Queue lingering. > > > So on a thread I can use is_alive() to check status and use join() to > > clean up but I don't see any analogous functionality for Queues.

Re: Line-by-line processing when stdin is not a tty

2010-08-11 Thread Tim Harig
On 2010-08-11, RG wrote: > I'm writing a system in a different language but want to use a Python > library. I know of lots of ways to do this (embed a Python interpreter, > fire up a python server) but by far the easiest to implement is to have > the main program spawn a Python interpreter and

Re: Queue cleanup

2010-08-11 Thread MRAB
EW wrote: [snip] So here the P2 thread has ended and gone away but I still have his Queue lingering. So on a thread I can use is_alive() to check status and use join() to clean up but I don't see any analogous functionality for Queues. How do I kill them? I thought about putting a suicide mess

Re: Is ElementTree development still active?

2010-08-11 Thread Terry Reedy
On 8/11/2010 12:21 PM, Pinku Surana wrote: I checked the svn repo at effbot.org, but it appears to have no updates since 2007. Has development moved elsewhere? It is now in the stdlib (19.11) as xml.etree.ElementTree http://svn.python.org/view/python/branches/py3k/Modules/_elementtree.c?revisio

Re: Confused: Newbie Function Calls

2010-08-11 Thread Terry Reedy
Rather than patch your code, I think you should see a better approach. from textwrap import dedent # removes common whitespace prefix lines = [] def add_header(ss): "Add header to sequence of string lines" ss.append(dedent("""\ # No initial blank line my multi-line string here

Re: Queue cleanup

2010-08-11 Thread EW
On Aug 11, 1:18 pm, Paul Rubin wrote: > EW writes: > > I also might have different consumer threads do > > different tasks (for example one might write to a log and one might > > write to SQL) so that again means I can't plan for a set ratio of > > consumers to producers  So it's unknown. > >

Re: mysqldb - parameter issue

2010-08-11 Thread bruce
hey dennis... umm.. given that i'm building the ins var/string to insert into the execute... i can't just place the triple quotes around it.. are you saying that the execute should have quotes placed around it within the execute so it would be something like execute("\""+sel""\""... or are you

Re: Queue cleanup

2010-08-11 Thread Paul Rubin
EW writes: > I also might have different consumer threads do > different tasks (for example one might write to a log and one might > write to SQL) so that again means I can't plan for a set ratio of > consumers to producers So it's unknown. > > So this means that instead of having 1 Queue tha

Re: Confused: Newbie Function Calls

2010-08-11 Thread Dave Angel
fuglyducky wrote: I am a complete newbie to Python (and programming in general) and I have no idea what I'm missing. Below is a script that I am trying to work with and I cannot get it to work. When I call the final print function, nothing prints. However, if I print within the individual functio

Re: Line-by-line processing when stdin is not a tty

2010-08-11 Thread RG
In article , Peter Otten <__pete...@web.de> wrote: > Grant Edwards wrote: > > > On 2010-08-11, Tim Harig wrote: > >> On 2010-08-11, RG wrote: > >>> When stdin is not a tty, Python seems to buffer all the input through > >>> EOF before processing any of it: > >>> > >>> [...@mickey:~]$ cat | pyt

Re: Queue cleanup

2010-08-11 Thread EW
On Aug 11, 12:55 pm, EW wrote: > Hi > > I'm writing a multithreaded app that relies on Queues to move data > between the threads.  I'm trying to write my objects in a general way > so that I can reuse them in the future so I need to write them in such > a way that I don't know how many producer an

Re: Line-by-line processing when stdin is not a tty

2010-08-11 Thread RG
In article , Cameron Simpson wrote: > On 11Aug2010 00:11, RG wrote: > | When stdin is not a tty, Python seems to buffer all the input through > | EOF before processing any of it: > | > | [...@mickey:~]$ cat | python > | print 123 > | print 456 > | 123 > | 456 > | > | Is there a way to get P

Re: Confused: Newbie Function Calls

2010-08-11 Thread EW
On Aug 11, 12:39 pm, fuglyducky wrote: > On Aug 11, 9:31 am, Pinku Surana wrote: > > > > > > > On Aug 11, 12:07 pm, fuglyducky wrote: > > > > I am a complete newbie to Python (and programming in general) and I > > > have no idea what I'm missing. Below is a script that I am trying to > > > work

Queue cleanup

2010-08-11 Thread EW
Hi I'm writing a multithreaded app that relies on Queues to move data between the threads. I'm trying to write my objects in a general way so that I can reuse them in the future so I need to write them in such a way that I don't know how many producer and how many consumer threads I might need.

Re: Confused: Newbie Function Calls

2010-08-11 Thread Jean-Michel Pichavant
fuglyducky wrote: I am a complete newbie to Python (and programming in general) and I have no idea what I'm missing. Below is a script that I am trying to work with and I cannot get it to work. When I call the final print function, nothing prints. However, if I print within the individual functio

Re: Confused: Newbie Function Calls

2010-08-11 Thread Wieland Hoffmann
On 11.08.2010 18:07, fuglyducky wrote: > Am I missing something??? Thanks in advance Assign the returned value of your functions to something (like sample_string) and it will work: > > # Global variable > sample_string = "" > > def gen_header(sa

Re: Confused: Newbie Function Calls

2010-08-11 Thread fuglyducky
On Aug 11, 9:31 am, Pinku Surana wrote: > On Aug 11, 12:07 pm, fuglyducky wrote: > > > > > I am a complete newbie to Python (and programming in general) and I > > have no idea what I'm missing. Below is a script that I am trying to > > work with and I cannot get it to work. When I call the final

Re: Confused: Newbie Function Calls

2010-08-11 Thread EW
This will work: sample_string="" def gen_header(sample_string=""): HEADER = """ mymultilinestringhere """ sample_string+= HEADER return sample_string def gen_nia(sample_string=""): NIA = """ ano

Re: Confused: Newbie Function Calls

2010-08-11 Thread Pinku Surana
On Aug 11, 12:07 pm, fuglyducky wrote: > I am a complete newbie to Python (and programming in general) and I > have no idea what I'm missing. Below is a script that I am trying to > work with and I cannot get it to work. When I call the final print > function, nothing prints. However, if I print w

Re: Confused: Newbie Function Calls

2010-08-11 Thread Robert Kern
On 8/11/10 11:07 AM, fuglyducky wrote: I am a complete newbie to Python (and programming in general) and I have no idea what I'm missing. Below is a script that I am trying to work with and I cannot get it to work. When I call the final print function, nothing prints. However, if I print within t

Re: Confused: Newbie Function Calls

2010-08-11 Thread Michael Torrie
On 08/11/2010 10:07 AM, fuglyducky wrote: > I am a complete newbie to Python (and programming in general) and I > have no idea what I'm missing. Below is a script that I am trying to > work with and I cannot get it to work. When I call the final print > function, nothing prints. However, if I print

Is ElementTree development still active?

2010-08-11 Thread Pinku Surana
I checked the svn repo at effbot.org, but it appears to have no updates since 2007. Has development moved elsewhere? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: type enforcement in _ssl.sslwrap

2010-08-11 Thread Eric Snow
On Aug 11, 5:34 am, Steven D'Aprano wrote: > On Tue, 10 Aug 2010 10:40:54 -0700, Eric Snow wrote: > > ssl.SSLSocket.__init__ makes a call to _ssl.sslwrap (in the C module). > > That in turn makes a call to PyArg_ParseTuple, which casts the first arg > > of _ssl.sslwrap into a PySocketModule.Sock_T

Confused: Newbie Function Calls

2010-08-11 Thread fuglyducky
I am a complete newbie to Python (and programming in general) and I have no idea what I'm missing. Below is a script that I am trying to work with and I cannot get it to work. When I call the final print function, nothing prints. However, if I print within the individual functions, I get the approp

Re: regex to remove lines made of only whitespace

2010-08-11 Thread Chris Withers
Steven D'Aprano wrote: def strip_blank_lines(lines): for line in lines: if not line.isspace(): yield line text = ''.join(strip_blank_lines(lines.split('\n'))) The final version I have is: def strip_blank_lines(text): result = [] for line in text.split('\n'):

Re: How to swallow traceback message

2010-08-11 Thread Michael Torrie
On 08/11/2010 09:32 AM, Back9 wrote: > I should have mentioned that I already use try/except > KeyboardInterrupt statement. > But it does not seem to work as I expected. If you want anyone to help further, you will need to say a) what you are expecting it to do and b) what it is actually doing. --

Re: How to swallow traceback message

2010-08-11 Thread Back9
On Aug 11, 11:19 am, Tim Harig wrote: > On 2010-08-11, Back9 wrote: > > > python myapp.py input_file | more > > to see them step by step. > > > But when I try to exit it, normally I use Ctrl+ C key to quit it. > > Problem is every time I do like it, it shows Traceback message and it > > makes my

Re: How to swallow traceback message

2010-08-11 Thread Jean-Michel Pichavant
Back9 wrote: Hi, I run my py app to display a file's contents, and it is normally very long. So I use it like below: python myapp.py input_file | more to see them step by step. But when I try to exit it, normally I use Ctrl+ C key to quit it. Problem is every time I do like it, it shows Traceb

Re: How to swallow traceback message

2010-08-11 Thread Eknath Venkataramani
See Exception Handling On Wed, Aug 11, 2010 at 11:09 AM, Back9 wrote: > Hi, > > I run my py app to display a file's contents, and it is normally very > long. > So I use it like below: > > python myapp.py input_file | more > to see them step by ste

Re: urgent requirement at Hyderabad

2010-08-11 Thread Chris Withers
sushma wrote: We are looking for Python Developers/programmers with 1+ years of experience. Send resume to sush...@millenniumsoft.com So urgent you can't even be bothered to describe the job or post the advert in the correct place on the python job board. Good luck with that ;-) Chris --

Re: How to swallow traceback message

2010-08-11 Thread Tim Harig
On 2010-08-11, Back9 wrote: > python myapp.py input_file | more > to see them step by step. > > But when I try to exit it, normally I use Ctrl+ C key to quit it. > Problem is every time I do like it, it shows Traceback message and it > makes my app not professional. You have three options.

  1   2   >