Python mange with liste

2013-12-29 Thread Baladjy KICHENASSAMY
Hello guys, i need some help with is program I have a txt file test.txt where there is Name;Sexe;Answer(Y or N) example of txt file: -- *nam1;F*;Y nam2;M;N nam3;F;Y nam4;M;N halo;M;Y rock;M;N nam1;F;N _ so my program will ask

RE: Unit tests and coverage

2013-12-29 Thread Joseph L. Casale
As the script is being invoked with Popen, I lose that luxury and only gain the assertions tests but that of course doesn't show me untested branches. Should have read the docs more thoroughly, works quite nice. jlc -- https://mail.python.org/mailman/listinfo/python-list

Re: Python mange with liste

2013-12-29 Thread Piet van Oostrum
Bala Ji bala...@gmail.com writes: Hello guys, i need some help with is program I have a txt file test.txt where there is Name;Sexe;Answer(Y or N) example of txt file: -- nam1;F;Y nam2;M;N nam3;F;Y nam4;M;N halo;M;Y rock;M;N nam1;F;N

Re: Python mange with liste

2013-12-29 Thread Bala Ji
hello, thank you for your help i wrote this: x=nam1 y=F names = [(nam1, F, Y), (nam2, M, N)] l = len(names) for i in range(0,l): print names[i][0] print names[i][1] if x == names[i][0] and y == names[i][1]: message = right else:

Re: Python mange with liste

2013-12-29 Thread Bala Ji
Oh sorry it's a Y (in french it's O) sorry for the mistake Le dimanche 29 décembre 2013 00:30:23 UTC+1, Bala Ji a écrit : Hello guys, i need some help with is program I have a txt file test.txt where there is Name;Sexe;Answer(Y or N) example of txt file:

Re: Python mange with liste

2013-12-29 Thread Rustom Mody
On Sun, Dec 29, 2013 at 3:49 PM, Bala Ji bala...@gmail.com wrote: hello, thank you for your help i wrote this: x=nam1 y=F names = [(nam1, F, Y), (nam2, M, N)] l = len(names) for i in range(0,l): print names[i][0] print names[i][1] if x == names[i][0] and y

Re: Python mange with liste

2013-12-29 Thread Frank Millman
Bala Ji bala...@gmail.com wrote in message news:11c1b4ef-07a3-4424-b356-9a9cf635f...@googlegroups.com... hello, thank you for your help i wrote this: x=nam1 y=F names = [(nam1, F, Y), (nam2, M, N)] l = len(names) for i in range(0,l): print names[i][0] print names[i][1]

Re: Unit tests and coverage

2013-12-29 Thread Ned Batchelder
On 12/28/13 11:21 PM, Joseph L. Casale wrote: I have a script that accepts cmdline arguments and receives input via stdin. I have a unit test for it that uses Popen to setup an environment, pass the args and provide the stdin. Problem is obviously this does nothing for providing coverage. Given

Re: outsmarting context managers with coroutines

2013-12-29 Thread Burak Arslan
On 12/29/13 07:06, Ian Kelly wrote: On Sat, Dec 28, 2013 at 5:35 PM, Burak Arslan burak.ars...@arskom.com.tr wrote: On 12/29/13 00:13, Burak Arslan wrote: Hi, Have a look at the following code snippets: https://gist.github.com/plq/8164035 Observations: output2: I can break out of outer

Re: eclipse+pyDev code complete problem

2013-12-29 Thread Fabio Zadrozny
Hi there, Please create an issue in the PyDev tracker for that: https://sw-brainwy.rhcloud.com/tracker/PyDev/ Cheers, Fabio On Fri, Dec 27, 2013 at 4:54 PM, zhaoyunsong zhao_yuns...@163.com wrote: dear all, I am trying to configure eclipse + pydev as my ide, but there seems to be some

Re: outsmarting context managers with coroutines

2013-12-29 Thread Ian Kelly
On Sun, Dec 29, 2013 at 7:44 AM, Burak Arslan burak.ars...@arskom.com.tr wrote: On 12/29/13 07:06, Ian Kelly wrote: On Sat, Dec 28, 2013 at 5:35 PM, Burak Arslan burak.ars...@arskom.com.tr wrote: On 12/29/13 00:13, Burak Arslan wrote: Hi, Have a look at the following code snippets:

abrt: detected unhandled Python exception

2013-12-29 Thread smilesonisamal
Hi all, I am facing a script issue whenever i run my script in /var/log/messages and it gives error something as below: abrt: detected unhandled Python exception in x.py. Can anybody help me figuring out how do i know which line number has thrown the python exception? Regards Pradeep

Re: Python 3.3.2 Shell Message

2013-12-29 Thread stanward
Hi Ned, I am running into the same problem described by Bart. I am teaching my kids to program using the Python For Kids book on a Mac OSX 10.8.5. I have installed Mac OS X 64-bit/32-bit Installer (3.3.3) for Mac OS X 10.6 and later (file: python-3.3.3-macosx10.6.dmg) and installed the

Tkinter problem: TclError couldn't connect to display :0

2013-12-29 Thread Michael Matveev
Hi, I use live Debian on VM and trying to compile this code. import Tkinter root = Tkinter.Tk() root.title(Fenster 1) root.geometry(100x100) root.mainloop() The shell gives out that kind of message: File test.py, line 5, in module root = Tkinter.Tk() File

Re: Python 3.3.2 Shell Message

2013-12-29 Thread stanward
Is there a PATH setting or something I can use to force the use of the ActiveTcl Tcl/Tk located in: /Library/Frameworks/Tcl.framework/Versions/8.5/Tcl and /Library/Frameworks/Tk.framework/Versions/8.5/Tk Correction. The ActiveTcl /Library directions are:

Sania Mirza Naked Pics at www.ZHAKKAS.com

2013-12-29 Thread hussainc1969
-- https://mail.python.org/mailman/listinfo/python-list

Re: abrt: detected unhandled Python exception

2013-12-29 Thread Chris Angelico
On Mon, Dec 30, 2013 at 6:35 AM, smilesonisa...@gmail.com wrote: Hi all, I am facing a script issue whenever i run my script in /var/log/messages and it gives error something as below: abrt: detected unhandled Python exception in x.py. Can anybody help me figuring out how do i know

Re: Tkinter problem: TclError couldn't connect to display :0

2013-12-29 Thread Chris Angelico
On Mon, Dec 30, 2013 at 7:20 AM, Michael Matveev misch...@googlemail.com wrote: The shell gives out that kind of message: File test.py, line 5, in module root = Tkinter.Tk() File /usr/lib/python2.7/lib-tk/Tkinter.py, line 1712, in __init__ self.tk = _tkinter.create(screenName, baseName,

Re: Python 3.3.2 Shell Message

2013-12-29 Thread stanward
Is there a PATH setting or something I can use to force the use of the ActiveTcl Tcl/Tk located in: /Library/Frameworks/Tcl.framework/Versions/8.5/Tcl and /Library/Frameworks/Tk.framework/Versions/8.5/Tk Correction. The ActiveTcl /Library directions are:

Re: Python 3.3.2 Shell Message

2013-12-29 Thread stanward
Actively working on this... may try to create a symbolic link from /System/Library/Frameworks/Tcl.framework/Versions/Current to /Library/Frameworks/Tcl.framework/Versions/Current Symbolic link (ln -s) does not seem to have worked either. G. Tried

Re: Tkinter problem: TclError couldn't connect to display :0

2013-12-29 Thread Steven D'Aprano
Michael Matveev wrote: Hi, I use live Debian on VM and trying to compile this code. import Tkinter root = Tkinter.Tk() root.title(Fenster 1) root.geometry(100x100) root.mainloop() The shell gives out that kind of message: File test.py, line 5, in module root =

Re: Tkinter problem: TclError couldn't connect to display :0

2013-12-29 Thread Chris Angelico
On Mon, Dec 30, 2013 at 10:22 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: So you need to X-forward from the remote machine to the machine you are physically on, or perhaps it's the other way (X is really weird). I have no idea how to do that, but would love to know. With

Re: Tkinter problem: TclError couldn't connect to display :0

2013-12-29 Thread Steven D'Aprano
On Mon, 30 Dec 2013 10:30:11 +1100, Chris Angelico wrote: On Mon, Dec 30, 2013 at 10:22 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: So you need to X-forward from the remote machine to the machine you are physically on, or perhaps it's the other way (X is really weird). I

Re: Tkinter problem: TclError couldn't connect to display :0

2013-12-29 Thread Chris Angelico
On Mon, Dec 30, 2013 at 2:29 PM, Steven D'Aprano st...@pearwood.info wrote: On Mon, 30 Dec 2013 10:30:11 +1100, Chris Angelico wrote: On Mon, Dec 30, 2013 at 10:22 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: So you need to X-forward from the remote machine to the machine

Re: Python 3.3.2 Shell Message

2013-12-29 Thread Stan Ward
On Sunday, December 29, 2013 5:18:18 PM UTC-5, Stan Ward wrote: Note: I do not get the WARNING: The version of Tcl/Tk (8.5.9) in use may be unstable. message when I run python directly from bash (Mac Terminal), but I do get it in the IDLE.app Shell Window, run as follows, based on the

Re: Tkinter problem: TclError couldn't connect to display :0

2013-12-29 Thread Jason Swails
On Sun, Dec 29, 2013 at 10:29 PM, Steven D'Aprano st...@pearwood.infowrote: On Mon, 30 Dec 2013 10:30:11 +1100, Chris Angelico wrote: On Mon, Dec 30, 2013 at 10:22 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: So you need to X-forward from the remote machine to the

Re: Python 3.3.2 Shell Message

2013-12-29 Thread Ned Deily
In article 78312fc7-adf1-4324-82f3-c53a4622b...@googlegroups.com, stanw...@gmail.com wrote: I have installed Mac OS X 64-bit/32-bit Installer (3.3.3) for Mac OS X 10.6 and later (file: python-3.3.3-macosx10.6.dmg) and installed the ActiveTcl 8.6.1 for Mac OS X (10.5+, x86_64/x86) (file:

Re: Apache restart after source changes

2013-12-29 Thread diverman
In development environment I suggest to use build-in webserver from wsgiref module, see http://docs.python.org/2/library/wsgiref.html#examples Then it's easy to run webserver in console and killstart it with Ctrl+C keystroke. In production environment, use your prefered webserver like

[issue20079] Add support for glibc supported locales

2013-12-29 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +berker.peksag ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20079 ___ ___

[issue20092] type() constructor should bind __int__ to __index__ when __index__ is defined and __int__ is not

2013-12-29 Thread Ethan Furman
Ethan Furman added the comment: In issue19995, in msg206339, Guido exhorted: [Ethan claimed] it is possible to want a type that can be used as an index or slice but that is still not a number I'm sorry, but this requirement is absurd. An index

[issue19995] %c, %o, %x, %X accept non-integer values instead of raising an exception

2013-12-29 Thread Ethan Furman
Ethan Furman added the comment: Ran full test suite; some errors came up in test_format from the following test lines: testformat(%#x, 1.0, 0x1) testformat(%x, float(big), 123456___, 6) testformat(%o, float(big), 123456__, 6) testformat(%x,

[issue11798] Test cases not garbage collected after run

2013-12-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: It is used, see countTestCases(). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11798 ___ ___

[issue20084] smtplib: support for UTF-8 encoded headers (SMTPUTF8)

2013-12-29 Thread Freek Dijkstra
Freek Dijkstra added the comment: we want our message to get delivered regardless of whether or not smtputf8 is available. This is not possible if the user specifies an (sender or recipient) email address with non-ASCII characters and the first-hop mail system does not support SMTPUTF8.

[issue20092] type() constructor should bind __int__ to __index__ when __index__ is defined and __int__ is not

2013-12-29 Thread R. David Murray
R. David Murray added the comment: Ah, I see. A link to that issue would have been helpful :). To summarize for anyone like me who didn't follow that issue: __index__ means the object can be losslessly converted to an int (is a true int), while __int__ may be an approximate conversion. Thus

[issue20084] smtplib: support for UTF-8 encoded headers (SMTPUTF8)

2013-12-29 Thread R. David Murray
R. David Murray added the comment: Yeah, I've been doing a lot of reading of standards while trying to hide all the messy details from users of the new API I've added to the email package. I haven't gotten to smtplib yet :) But, this stuff is messy. If you want to understand a standard, you

[issue16778] Logger.findCaller needs to be smarter

2013-12-29 Thread Nick Coghlan
Nick Coghlan added the comment: I think we need to look seriously at the frame annotations idea discussed in other issues. Eliminating noise from tracebacks and correctly reporting user code rather than infrastructure could should be achievable through local state rather than needing global

[issue20092] type() constructor should bind __int__ to __index__ when __index__ is defined and __int__ is not

2013-12-29 Thread Ethan Furman
Ethan Furman added the comment: I have the following as part of the patch for that issue: - diff -r b668c409c10a Doc/reference/datamodel.rst --- a/Doc/reference/datamodel.rst Sat Dec 28 20:37:58 2013 +0100 +++

[issue9291] mimetypes initialization fails on Windows because of non-Latin characters in registry

2013-12-29 Thread Jason R. Coombs
Jason R. Coombs added the comment: The bug as reported against setuptools: https://bitbucket.org/pypa/setuptools/issue/127/unicodedecodeerror-when-install-in-windows -- nosy: +jason.coombs ___ Python tracker rep...@bugs.python.org

[issue20093] Wrong OSError message from os.rename() when dst is a non-empty directory

2013-12-29 Thread Dmitry Shachnev
Dmitry Shachnev added the comment: This is a result of http://hg.python.org/cpython/rev/6903f5214e99. Looks like we should check the error code and conditionally set the file name to either src or dst. -- nosy: +haypo, mitya57 ___ Python tracker

[issue16778] Logger.findCaller needs to be smarter

2013-12-29 Thread Vinay Sajip
Vinay Sajip added the comment: the frame annotations idea discussed in other issues If you mean #19585 and #18861, they seem to be related to exceptions - the logging use case is not exception-related. I couldn't find any other discussions about frame annotations. --

[issue19890] Typo in multiprocessing docs

2013-12-29 Thread Mike Short
Changes by Mike Short bmsh...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file33287/multiprocessing.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19890 ___

[issue19890] Typo in multiprocessing docs

2013-12-29 Thread Mike Short
Changes by Mike Short bmsh...@gmail.com: -- nosy: +Mike.Short ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19890 ___ ___ Python-bugs-list mailing

[issue20094] intermitent failures with test_dbm

2013-12-29 Thread Ethan Furman
New submission from Ethan Furman: Following errors occur about half the time: == ERROR: test_anydbm_creation (test.test_dbm.TestCase-dbm.ndbm) -- Traceback

[issue20094] intermitent failures with test_dbm

2013-12-29 Thread Ethan Furman
Ethan Furman added the comment: Actually, make that about 1/5 of the time. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20094 ___ ___

[issue11798] Test cases not garbage collected after run

2013-12-29 Thread Michael Foord
Michael Foord added the comment: Ah yes, I see - sorry. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11798 ___ ___ Python-bugs-list mailing

[issue19732] python fails to build when configured with --with-system-libmpdec

2013-12-29 Thread Matthias Klose
Matthias Klose added the comment: your current repo doesn't create and install the .so symlink, and thus won't be used for linking. Also the sphinx docs are missing, which were included in 2.3. -- ___ Python tracker rep...@bugs.python.org

[issue19940] ssl.cert_time_to_seconds() returns wrong results if local timezone is not UTC

2013-12-29 Thread gudge
gudge added the comment: Can you please provide some hints on how to handle http://bugs.python.org/issue19940#msg205860. The value of format_regex 1) Without locale set: re.compile('(?Pbjan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\\s+(?Pd3[0-1]|[1-2]\\d|0[1- 9]|[1-9]|

[issue20092] type() constructor should bind __int__ to __index__ when __index__ is defined and __int__ is not

2013-12-29 Thread R. David Murray
R. David Murray added the comment: Nah, splitting it doesn't seem worth it unless you think the patch won't make it in. (Not that I looked at it earlier, but he patch on the issue doesn't look like what you just posted here...and here there's a typo: shuld). --

[issue20092] type() constructor should bind __int__ to __index__ when __index__ is defined and __int__ is not

2013-12-29 Thread Ethan Furman
Ethan Furman added the comment: I updated it as I liked your wording better. :) Doing more testing to see if anything else needs fixing before I make the next patch for the tracker on that issue. -- ___ Python tracker rep...@bugs.python.org

[issue20031] unittest.TextTestRunner missing run() documentation.

2013-12-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 19464d77ec2e by Michael Foord in branch 'default': Closes issue 20031. Document unittest.TextTestRunner.run method. http://hg.python.org/cpython/rev/19464d77ec2e -- nosy: +python-dev resolution: - fixed stage: needs patch -

[issue18566] In unittest.TestCase docs for setUp() and tearDown() don't mention AssertionError

2013-12-29 Thread Michael Foord
Michael Foord added the comment: Yep, those docs are just wrong. I'm trying to think of a concise rewording. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18566 ___

[issue16778] Logger.findCaller needs to be smarter

2013-12-29 Thread Nick Coghlan
Nick Coghlan added the comment: My idea is to annotate the frames appropriately so they can be *displayed* differently when showing a traceback (either hiding them entirely or displaying additional information). This would be another use case - annotating the frame to say the logging module

[issue18310] itertools.tee() can't accept keyword arguments

2013-12-29 Thread Mark Lawrence
Mark Lawrence added the comment: Why has this been closed? I've just run into exactly the same problem. It states here http://docs.python.org/3/library/itertools.html#itertools.tee itertools.tee(iterable, n=2) - Return n independent iterators from a single iterable. -- nosy:

[issue18310] itertools.tee() can't accept keyword arguments

2013-12-29 Thread Mark Lawrence
Mark Lawrence added the comment: The docs for tee are the same going right back to its introduction in 2.4. The itertools count function takes start and step keywords, why can't tee take a keyword as it's documented to? -- ___ Python tracker

[issue19771] runpy should check ImportError.name before wrapping it

2013-12-29 Thread Anthony Kong
Changes by Anthony Kong anthony.hw.k...@gmail.com: -- nosy: +Anthony.Kong ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19771 ___ ___

[issue18310] itertools.tee() can't accept keyword arguments

2013-12-29 Thread Mark Lawrence
Mark Lawrence added the comment: It's just the docs that need changing to clarify the situation as (say) a,b,c = tee(range, 3) works perfectly. Sorry I didn't have the foresight to check this before :( -- components: +Documentation -Library (Lib) versions: +Python 2.7