Re: Hold wxframe (GUI)

2014-03-26 Thread Jaydeep Patil
On Wednesday, 26 March 2014 10:34:26 UTC+5:30, Jaydeep Patil wrote: I constructed Two frames. One frame consist of GUI which consist of one Ok button. Afer click on OK button another GUI calls. But after Second gui calling, It wont stop further procesees. I need to stop futher

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-26 Thread alex23
On 25/03/2014 12:39 PM, Mark H Harris wrote: my version semantically is how it is perceived by the user Could you please stop claiming to have insight into the comprehension of anyone other than yourself? Hasty generalisations don't help your argument. --

Re: gdb python how to output integer for examine memory

2014-03-26 Thread dieter
Wesley nisp...@gmail.com writes: ... Actually, I can now see the varialbe names at Python level and C level. I just want to verify x command to monitor the memory content. So, in my origin post, I can get variable i's address, and see the value is 1, then, I wanna have a try x command, the

Can we hold execution python programming till GUI event close on?

2014-03-26 Thread Jaydeep Patil
Hi... I have one wxframe. after click on that frame another frame opens and rest part is executed. I need ti stop the next execution after secong gui calls up. please suggest. -- https://mail.python.org/mailman/listinfo/python-list

Re: unicode as valid naming symbols

2014-03-26 Thread Antoon Pardon
On 25-03-14 23:47, Ethan Furman wrote: On 03/25/2014 12:29 PM, Mark H Harris wrote: On 3/25/14 2:24 PM, MRAB wrote: It's explained in PEP 3131. Basically, a name should to start with a letter (this has been extended to include Chinese characters, etc) or an underscore. λ is a classified as

Re: [newbie] confusion concerning fetching an element in a 2d-array

2014-03-26 Thread Jean Dubois
Op dinsdag 25 maart 2014 20:58:10 UTC+1 schreef Dave Angel: Jean Dubois jeandubois...@gmail.com Wrote in message: Op dinsdag 25 maart 2014 15:42:13 UTC+1 schreef Dave Angel: If your instructor wanted you to copy examples, he would have given you one. please Dave leave that belittling

Re: [newbie] confusion concerning fetching an element in a 2d-array

2014-03-26 Thread Jean Dubois
Op dinsdag 25 maart 2014 20:15:27 UTC+1 schreef Joel Goldstick: Jean, be aware there is also python tutor list you might like.  This is sometimes a tough crowd here. Don't be discouraged. It can be a badge of honor sometimes thanks for the suggestions, I already subscribed to the python

Re: unicode as valid naming symbols

2014-03-26 Thread Antoon Pardon
On 26-03-14 03:56, MRAB wrote: On 2014-03-25 22:47, Ethan Furman wrote: On 03/25/2014 12:29 PM, Mark H Harris wrote: On 3/25/14 2:24 PM, MRAB wrote: It's explained in PEP 3131. Basically, a name should to start with a letter (this has been extended to include Chinese characters, etc) or an

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-26 Thread Antoon Pardon
On 26-03-14 01:24, Terry Reedy wrote: The other fact that Chris noted, that '{}' would have been valid but with different meanings in Py1/2 versus Py3, was a factor on the cost side. We generally try to avoid such ambiguities. Except for this last point, I was in favor of the switch. In

Re: YADTR (Yet Another DateTime Rant)

2014-03-26 Thread Mark Lawrence
On 26/03/2014 01:19, Ethan Furman wrote: On 03/25/2014 05:58 PM, Roy Smith wrote: One of my roles on this newsgroup is to periodically whine about stupidities in the Python datetime module. This is one of those times. I have some code which computes how long ago the sun set. Being a nice

Re: Hold wxframe (GUI)

2014-03-26 Thread Mark Lawrence
On 26/03/2014 06:03, Jaydeep Patil wrote: Hi all, I need to hold the other execution part after next GUI calls? How can do that? Anybody can help me? I suggest you try a specific mailing list for wxpython, it's available at gmane.comp.python.wxpython amongst other places. Also would

calling Python script from another Python script (Windows, multiple installation problem)

2014-03-26 Thread Martin Landa
Hi all, I am trying to fix a bug in the project which I am working for. The program starts on Windows via bat file which calls a Python script to set up the environment including GUI and allow to launch program-specific tools. Some of the tools are written in C, some in Python. These commands

Fwd: Basic asyncio usage

2014-03-26 Thread Piotr Husiatyński
Hi, I have posted the same question to python-tutor list *, but I'm trying my luck here as advised. I'm trying to get more familiar with asyncio library. Using python 3.4, I wrote simple echo server (see attachement for the code). I know that instead of using bare bone send/recv I could use some

Re: calling Python script from another Python script (Windows, multiple installation problem)

2014-03-26 Thread Vlastimil Brom
2014-03-26 10:40 GMT+01:00 Martin Landa landa.mar...@gmail.com: Hi all, I am trying to fix a bug in the project which I am working for. The program starts on Windows via bat file which calls a Python script to set up the environment including GUI and allow to launch program-specific tools.

Dynamically reference member of array

2014-03-26 Thread Ben Collier
Hi all, I know that I can dynamically reference a variable with locals()[i], for instance, but I'd like to know how to do this with a variable in an object. If I have an object called device, with variables called attr1, attr2 .. attr50, how could I dynamically reference these? It's fairly

Dynamically reference variable in object

2014-03-26 Thread Ben Collier
Sorry, subject was wrong. Please see below: On Wednesday, 26 March 2014 11:43:49 UTC, Ben Collier wrote: Hi all, I know that I can dynamically reference a variable with locals()[i], for instance, but I'd like to know how to do this with a variable in an object. If I have an

FIXED: Dynamically reference variables in object

2014-03-26 Thread Ben Collier
Hi all, I know that I can dynamically reference a variable with locals()[i], for instance, but I'd like to know how to do this with a variable in an object. If I have an object called device, with variables called attr1, attr2 .. attr50, how could I dynamically reference these? It's fairly

Re: FIXED: Dynamically reference variables in object

2014-03-26 Thread Antoon Pardon
On 26-03-14 12:49, Ben Collier wrote: Hi all, I know that I can dynamically reference a variable with locals()[i], for instance, but I'd like to know how to do this with a variable in an object. If I have an object called device, with variables called attr1, attr2 .. attr50, how could I

Re: FIXED: Dynamically reference variables in object

2014-03-26 Thread Chris Angelico
On Wed, Mar 26, 2014 at 10:49 PM, Ben Collier bmcoll...@gmail.com wrote: I know that I can dynamically reference a variable with locals()[i], for instance, but I'd like to know how to do this with a variable in an object. If I have an object called device, with variables called attr1, attr2

Re: calling Python script from another Python script (Windows, multiple installation problem)

2014-03-26 Thread Martin Landa
Hi, it should be possible to specify the path of the desired python interpreter along with the executed script as an argument to Popen(...). This should make the selection of the used python explicit. Or are there any other disadvantages of the current approach, which you are

Re: calling Python script from another Python script (Windows, multiple installation problem)

2014-03-26 Thread Martin Landa
Dne středa, 26. března 2014 13:29:47 UTC+1 Martin Landa napsal(a): not really, I am just searching for a better solution based on virtualenv or something similar... particularly I am using something like if sys.platform == win32: # get full path including file extension

Re: calling Python script from another Python script (Windows, multiple installation problem)

2014-03-26 Thread Chris Angelico
On Wed, Mar 26, 2014 at 11:49 PM, Martin Landa landa.mar...@gmail.com wrote: # get full path including file extension for scripts fcmd = get_real_command(args[0]) What's that function do? ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: calling Python script from another Python script (Windows, multiple installation problem)

2014-03-26 Thread Martin Landa
Dne středa, 26. března 2014 13:54:02 UTC+1 Chris Angelico napsal(a): On Wed, Mar 26, 2014 at 11:49 PM, Martin Landa landa.mar...@gmail.com wrote: # get full path including file extension for scripts fcmd = get_real_command(args[0]) this function returns a full

Re: YADTR (Yet Another DateTime Rant)

2014-03-26 Thread Skip Montanaro
It's not clear to me what the correct str should be. I think the desired format changes depending on the relative magnitude of the timedelta object. For small values (less than a day), I agree, the behavior is, well, odd. You can get around that easily enough: d = datetime.timedelta(seconds=-2)

Re: [Python-Dev] [RELEASED] Python 3.4.0

2014-03-26 Thread Daniel Pimentel (d4n1)
Good job men :D 2014-03-17 14:18 GMT-03:00 Alioune Dia dia.aliou...@gmail.com: yeah , asyncio is a great module, congrat for all jobs you are doing --Ad | Dakar 2014-03-17 18:11 GMT+01:00 Giampaolo Rodola' g.rod...@gmail.com: The what's new looks truly amazing, with pathlib and asyncio

Re: YADTR (Yet Another DateTime Rant)

2014-03-26 Thread Antoon Pardon
On 26-03-14 01:58, Roy Smith wrote: One of my roles on this newsgroup is to periodically whine about stupidities in the Python datetime module. This is one of those times. I have some code which computes how long ago the sun set. Being a nice pythonista, I'm using a timedelta to represent

Re: YADTR (Yet Another DateTime Rant)

2014-03-26 Thread Chris Angelico
On Thu, Mar 27, 2014 at 1:02 AM, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: There is a difference between how people say things and what is useful. I remember when I was studying logarithms, a negative number like -5.73 was written down as ̅6.27 (with a bar only over the six). That

Re: Errors on text.get()

2014-03-26 Thread eneskristo
On Tuesday, March 25, 2014 2:15:11 PM UTC-7, enesk...@gmail.com wrote: Exception in Tkinter callback Traceback (most recent call last): File C:\Python33\lib\tkinter\__init__.py, line 1475, in __call__ return self.func(*args) File C:/Users/User/PycharmProjects/Cesarian

Re: YADTR (Yet Another DateTime Rant)

2014-03-26 Thread Marko Rauhamaa
Antoon Pardon antoon.par...@rece.vub.ac.be: On 26-03-14 01:58, Roy Smith wrote: previous sunset: -1 day, 22:25:26.295993 The idea of str() is that it's supposed to return a human-friendly representation of a value. Humans do not say things like, The sun set 1 day ago plus 22 hours and 25

Re: YADTR (Yet Another DateTime Rant)

2014-03-26 Thread Roy Smith
On Wednesday, March 26, 2014 9:37:06 AM UTC-4, Skip Montanaro wrote: The problem gets more challenging once you get into magnitudes one day: e = datetime.timedelta(days=-4, seconds=3605) e datetime.timedelta(-4, 3605) print e -4 days, 1:00:05 Hmmm... It's printing just what we

Re: YADTR (Yet Another DateTime Rant)

2014-03-26 Thread Skip Montanaro
On Wed, Mar 26, 2014 at 10:04 AM, Roy Smith r...@panix.com wrote: No, what you said was negative four days, positive 3605 seconds. My apologies for not showing all my work, professor. I use datetime and timedelta objects all the time. I did the arithmetic to go from 3605 to one hour, five

Re: YADTR (Yet Another DateTime Rant)

2014-03-26 Thread Roy Smith
On Mar 26, 2014, at 11:39 AM, Skip Montanaro wrote: The point of my post was that there is no obvious one best way to present negative timedeltas in a human readable form. I agree that there are a number of possible representations which might make sense. But, using negative days and

Re: YADTR (Yet Another DateTime Rant)

2014-03-26 Thread Marko Rauhamaa
Skip Montanaro s...@pobox.com: Note though, that the ISO8601 representation isn't without its own flaws (which might explain why Tim avoided it BITD): * It doesn't appear to provide a way to represent fractions of a second (though perhaps all the fields can be fractional) * How many days

Delayed evaluation of expressions [was Re: Time we switched to unicode?]

2014-03-26 Thread Steven D'Aprano
On Wed, 26 Mar 2014 00:30:21 -0400, Terry Reedy wrote: On 3/25/2014 8:12 PM, Steven D'Aprano wrote: On Tue, 25 Mar 2014 19:55:39 -0400, Terry Reedy wrote: On 3/25/2014 11:18 AM, Steven D'Aprano wrote: The thing is, we can't just create a ∑ function, because it doesn't work the way the

Re: YADTR (Yet Another DateTime Rant)

2014-03-26 Thread Skip Montanaro
On Wed, Mar 26, 2014 at 10:58 AM, Marko Rauhamaa ma...@pacujo.net wrote: Fractions of seconds are supported -- the other fields can't be fractional. Actually, it appears that whatever the last value you give can be fractionated. From the Wikipedia page you referenced: The smallest value used

Re: unicode as valid naming symbols

2014-03-26 Thread Ian Kelly
On Wed, Mar 26, 2014 at 2:52 AM, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: On 26-03-14 03:56, MRAB wrote: Or as a root operator, e.g. 3 √ x (the cube root of x). Personally I would think such an operator is too limited to include in a programming language. This kind of notation is

Re: YADTR (Yet Another DateTime Rant)

2014-03-26 Thread Marko Rauhamaa
Skip Montanaro s...@pobox.com: There is a good reason that the internal units of timedelta objects are days, seconds, and microseconds. They are well-defined outside of a calendar context. So, I guess Roy is back to square one. He can always roll his own timedelta subclass and give it a

Re: Delayed evaluation of expressions [was Re: Time we switched to unicode?]

2014-03-26 Thread Rustom Mody
On Wednesday, March 26, 2014 9:35:53 PM UTC+5:30, Steven D'Aprano wrote: On Wed, 26 Mar 2014 00:30:21 -0400, Terry Reedy wrote: On 3/25/2014 8:12 PM, Steven D'Aprano wrote: On Tue, 25 Mar 2014 19:55:39 -0400, Terry Reedy wrote: On 3/25/2014 11:18 AM, Steven D'Aprano wrote: The thing is,

Re: Delayed evaluation of expressions [was Re: Time we switched to unicode?]

2014-03-26 Thread Rustom Mody
On Wednesday, March 26, 2014 11:02:04 PM UTC+5:30, Rustom Mody wrote: On Wednesday, March 26, 2014 9:35:53 PM UTC+5:30, Steven D'Aprano wrote: On Wed, 26 Mar 2014 00:30:21 -0400, Terry Reedy wrote: One passes an unquoted expression in code by quoting it with either lambda, paired quote

Re: YADTR (Yet Another DateTime Rant)

2014-03-26 Thread Grant Edwards
On 2014-03-26, Skip Montanaro s...@pobox.com wrote: On Wed, Mar 26, 2014 at 10:58 AM, Marko Rauhamaa ma...@pacujo.net wrote: Fractions of seconds are supported -- the other fields can't be fractional. Actually, it appears that whatever the last value you give can be fractionated. From the

Re: YADTR (Yet Another DateTime Rant)

2014-03-26 Thread Ben Finney
Grant Edwards invalid@invalid.invalid writes: We're still just papering-over the basic problem: the entire time/calendar system use by western civilization is a mess. I don't know a lot about other systems in use, but from what I have seen they were all pretty much just as bad. We should fix

Re: Dynamically reference variable in object

2014-03-26 Thread Ian Kelly
On Mar 26, 2014 5:48 AM, Ben Collier bmcoll...@gmail.com wrote: Sorry, subject was wrong. Please see below: On Wednesday, 26 March 2014 11:43:49 UTC, Ben Collier wrote: Hi all, I know that I can dynamically reference a variable with locals()[i], for instance, but I'd like to know how to

Re: YADTR (Yet Another DateTime Rant)

2014-03-26 Thread Jean-Michel Pichavant
- Original Message - One of my roles on this newsgroup is to periodically whine about stupidities in the Python datetime module. This is one of those times. I have some code which computes how long ago the sun set. Being a nice pythonista, I'm using a timedelta to represent this

datetime

2014-03-26 Thread Victor Engle
I want to keep a collection of data organized by collection date and I'll use datetime like this... datetime.date.today() datetime.date(2014, 3, 26) I'll format the date and create directories like /mydata/-mm-dd When I create a directory for today, I need to know the directory name for

Re: calling Python script from another Python script (Windows, multiple installation problem)

2014-03-26 Thread Cameron Simpson
On 26Mar2014 05:49, Martin Landa landa.mar...@gmail.com wrote: Dne středa, 26. března 2014 13:29:47 UTC+1 Martin Landa napsal(a): not really, I am just searching for a better solution based on virtualenv or something similar... particularly I am using something like if

Re: datetime

2014-03-26 Thread Peter Otten
Victor Engle wrote: I want to keep a collection of data organized by collection date and I'll use datetime like this... datetime.date.today() datetime.date(2014, 3, 26) I'll format the date and create directories like /mydata/-mm-dd When I create a directory for today, I

Re: datetime

2014-03-26 Thread Ben Finney
Victor Engle victor.en...@gmail.com writes: It would be convenient if datetime.date.today() accepted an argument as an offset from today, like datetime.date.today(-1). Is there an easy way to do this with datetime? The types defined in ‘datetime’ can perform calendar arithmetic:: import

Re: YADTR (Yet Another DateTime Rant)

2014-03-26 Thread Gregory Ewing
Chris Angelico wrote: By showing those last ones as 1̅.091... and 2̅.091..., you emphasize the floating-point nature of the data: everything after the decimal is the mantissa, and everything before the decimal is the exponent. The reason for writing them that way is so that you can look the

Re: Delayed evaluation of expressions [was Re: Time we switched to unicode?]

2014-03-26 Thread Chris Angelico
On Thu, Mar 27, 2014 at 4:32 AM, Rustom Mody rustompm...@gmail.com wrote: Now actual python def sumjensen(i_get, i_set,lower,upper,exp): tot = 0 i_set(lower) while i_get() = upper: tot += exp_get() i_set(i_get() + 1) return tot i=0 a=[3,4,5] i_get =

Re: Delayed evaluation of expressions

2014-03-26 Thread Marko Rauhamaa
Chris Angelico ros...@gmail.com: You prove here that Python has first-class expressions in the same way that 80x86 assembly language has garbage collection. Sure, you can implement it using the primitives you have, but that's not support. I was more reminded of STL and Boost. For example:

Re: Dynamically reference variable in object

2014-03-26 Thread Steven D'Aprano
On Wed, 26 Mar 2014 15:19:03 -0600, Ian Kelly wrote: You want to access object attributes, not variables. In fairness to the OP, the terminology instance variables meaning attributes or members of an instance is (sadly, in my opinion) common in some other languages, such as Java, and

Re: Delayed evaluation of expressions [was Re: Time we switched to unicode?]

2014-03-26 Thread Steven D'Aprano
On Thu, 27 Mar 2014 09:24:49 +1100, Chris Angelico wrote: On Thu, Mar 27, 2014 at 4:32 AM, Rustom Mody rustompm...@gmail.com wrote: Now actual python def sumjensen(i_get, i_set,lower,upper,exp): tot = 0 i_set(lower) while i_get() = upper: tot += exp_get()

Re: YADTR (Yet Another DateTime Rant)

2014-03-26 Thread Ethan Furman
On 03/26/2014 04:25 PM, Dennis Lee Bieber wrote: On Tue, 25 Mar 2014 20:58:27 -0400, Roy Smith r...@panix.com declaimed the following: One of my roles on this newsgroup is to periodically whine about stupidities in the Python datetime module. This is one of those times. I have some code

Re: YADTR (Yet Another DateTime Rant)

2014-03-26 Thread Steven D'Aprano
On Wed, 26 Mar 2014 19:25:45 -0400, Dennis Lee Bieber wrote: On Tue, 25 Mar 2014 20:58:27 -0400, Roy Smith r...@panix.com declaimed the following: One of my roles on this newsgroup is to periodically whine about stupidities in the Python datetime module. This is one of those times. I have

Re: Delayed evaluation of expressions [was Re: Time we switched to unicode?]

2014-03-26 Thread Terry Reedy
I agree that we have not been understanding each other. From you original post that I responded to: The thing is, we can't just create a ∑ function, because it doesn't work the way the summation operator works. The problem is that we would want syntactic support, so we could write something

Re: python installation on windows

2014-03-26 Thread Rhodri James
On Tue, 25 Mar 2014 18:17:30 -, rborol...@gmail.com wrote: Thanks for your comment but i also edited httpd.conf file then my wamp not running LoadModule php5_module c:/wamp/bin/php/php5.3.0/php5apache2_2.dll This line i added on line 128 but nothing. Wampserver showing yellow. I'm not

Re: gdb python how to output integer for examine memory

2014-03-26 Thread Wesley
在 2014年3月26日星期三UTC+8下午3时10分23秒,dieter写道: Wesley nisp...@gmail.com writes: ... Actually, I can now see the varialbe names at Python level and C level. I just want to verify x command to monitor the memory content. So, in my origin post, I can get variable i's address, and see the

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-26 Thread Rhodri James
On Tue, 25 Mar 2014 06:12:50 -, Chris Angelico ros...@gmail.com wrote: Because the shorter symbols lend themselves better to the super-tokenization where you don't read the individual parts but the whole. The difference between 40 and forty is minimal, but the difference between 86400 and

Re: Time we switched to unicode? (was Explanation of this Python language feature?)

2014-03-26 Thread Chris Angelico
On Thu, Mar 27, 2014 at 12:16 PM, Rhodri James rho...@wildebst.org.uk wrote: It's not quite that simple, sadly (for me). I have mild dyscalculia, which in my case is another way of saying that collections of digits *aren't* tokens to me unless I ascribe a specific meaning to them. I don't

Re: YADTR (Yet Another DateTime Rant)

2014-03-26 Thread Chris Angelico
On Thu, Mar 27, 2014 at 11:16 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: If an event happened 30 hours ago, it is correct to say that it occurred 18 hours after 2 days ago, but who talks that way? That response demonstrates real genius. Rue the datetime? Who talks like

Re: YADTR (Yet Another DateTime Rant)

2014-03-26 Thread Roy Smith
In article mailman.8597.1395883727.18130.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: On Thu, Mar 27, 2014 at 11:16 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: If an event happened 30 hours ago, it is correct to say that it occurred 18 hours after 2

Re: Delayed evaluation of expressions [was Re: Time we switched to unicode?]

2014-03-26 Thread Rustom Mody
On Thursday, March 27, 2014 5:13:21 AM UTC+5:30, Steven D'Aprano wrote: On Thu, 27 Mar 2014 09:24:49 +1100, Chris Angelico wrote: wrote: Now actual python def sumjensen(i_get, i_set,lower,upper,exp): tot = 0 i_set(lower) while i_get() = upper: tot += exp_get()

Re: Delayed evaluation of expressions [was Re: Time we switched to unicode?]

2014-03-26 Thread Steven D'Aprano
On Wed, 26 Mar 2014 20:44:17 -0400, Terry Reedy wrote: I agree that we have not been understanding each other. From you original post that I responded to: The thing is, we can't just create a ∑ function, because it doesn't work the way the summation operator works. The problem is that we

regex line by line over file

2014-03-26 Thread James Smith
I can't get this to work. It runs but there is no output when I try it on a file. #!/usr/bin/python import os import sys import re from datetime import datetime #logDir = '/nfs/projects/equinox/platformTools/RTLG/RTLG_logs'; #os.chdir( logDir ); programName = sys.argv[0] fileName =

Re: regex line by line over file

2014-03-26 Thread Chris Angelico
On Thu, Mar 27, 2014 at 2:23 PM, James Smith bjloc...@lockie.ca wrote: re.M p = re.compile('^\s*\SHELF-.*,SC,.*,:\\\Log Collection In Progress\\\') If you're expecting this to be parsed as a multiline regex, it won't be. Probing re.M doesn't do anything on its own; you have to pass it as an

Re: YADTR (Yet Another DateTime Rant)

2014-03-26 Thread Dan Sommers
On Thu, 27 Mar 2014 00:16:57 +, Steven D'Aprano wrote: py divmod(-30, 24) (-2, 18) If an event happened 30 hours ago, it is correct to say that it occurred 18 hours after 2 days ago, but who talks that way? Well, not *exactly*, but: If today happens to be Wednesday, and an event

Re: regex line by line over file

2014-03-26 Thread James Smith
On Wednesday, March 26, 2014 11:23:29 PM UTC-4, James Smith wrote: I can't get this to work. It runs but there is no output when I try it on a file. #!/usr/bin/python import os import sys import re from datetime import datetime #logDir =

Re: regex line by line over file

2014-03-26 Thread Rustom Mody
On Thursday, March 27, 2014 8:53:29 AM UTC+5:30, James Smith wrote: I can't get this to work. It runs but there is no output when I try it on a file. #!/usr/bin/python import os import sys import re from datetime import datetime #logDir =

Re: regex line by line over file

2014-03-26 Thread Chris Angelico
On Thu, Mar 27, 2014 at 3:14 PM, James Smith bjloc...@lockie.ca wrote: I tried the re.M in the compile and that didn't help. Okay. Try printing out the repr of the line at the point where you have the commented-out write to stdout. That might tell you if there's some other difference. At that

Re: Delayed evaluation of expressions

2014-03-26 Thread Rustom Mody
On Thursday, March 27, 2014 4:15:19 AM UTC+5:30, Marko Rauhamaa wrote: Chris Angelico : You prove here that Python has first-class expressions in the same way that 80x86 assembly language has garbage collection. Sure, you can implement it using the primitives you have, but that's not

Re: regex line by line over file

2014-03-26 Thread Steven D'Aprano
On Wed, 26 Mar 2014 20:23:29 -0700, James Smith wrote: I can't get this to work. It runs but there is no output when I try it on a file. Simplify, simplify, simplify. Either you will find the problem, or you will find the simplest example that demonstrates the problem. In this case, the

[issue21045] fix layout to generate documentation for Qt Assistant

2014-03-26 Thread Georg Brandl
Georg Brandl added the comment: Thanks for the report! -- nosy: +georg.brandl resolution: fixed - stage: committed/rejected - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21045

[issue21045] fix layout to generate documentation for Qt Assistant

2014-03-26 Thread Georg Brandl
Changes by Georg Brandl ge...@python.org: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21045 ___

[issue21067] Support Multiple finally clauses.

2014-03-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: If you think this should go forward please discuss it on the python-ideas list. For it to go forward a PEP will likely need to be written. I concur with this assessment. Marking this as closed. -- nosy: +rhettinger resolution: - rejected

[issue21069] urllib unit tests failing without ssl module

2014-03-26 Thread Daniel Farrell
New submission from Daniel Farrell: I'm seeing quite a few unit test failures in urllib (urlopen error unknown url type: https). From what I've gathered on IRC, this seems to be because I'm missing the ssl module. I'm seeing these errors in 3.4.0, after a simple `./configure; make; make

[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-03-26 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis added the comment: If it is planned to support BSD make, then partial rewrite of patches will be needed. Example of syntax of GNU make: ifeq (something,something) … endif Example of syntax of FreeBSD make: .if ${variable}==something … .endif --

[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-03-26 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis added the comment: According to koobs, building of CPython with FreeBSD make works at least with -j1 (and sporadically fails with higher value). -- ___ Python tracker rep...@bugs.python.org

[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-03-26 Thread koobs
koobs added the comment: More precisely: Python 3.3 fails at anything -j1 (switching to gmake makes this go away) Python 3.4 has not failed up to -j8 (with bsd make) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20210

[issue21057] TextIOWrapper does not support reading bytearrays or memoryviews

2014-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If someone is willing to do the work (and I am), is there a reason *not* to allow TextIOWrapper to accept bytes-like objects? Yes, there are. The code which works only with bytes is much simpler. Not only TextIOWrapper, but many other classes in the stdlib

[issue20526] python: Modules/gcmodule.c:379: visit_decref: Assertion `((gc)-gc.gc_refs (1)) != 0' failed.

2014-03-26 Thread STINNER Victor
STINNER Victor added the comment: I encounter a quite similar issue with python 3.4.0 and cx_Oracle. Your issue is different, compare the top frames: My trace: #0 0x003f3a835c59 in raise () from /lib64/libc.so.6 #1 0x003f3a837368 in abort () from /lib64/libc.so.6 #2

[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-03-26 Thread STINNER Victor
STINNER Victor added the comment: Antoine Pitrou wrote: I don't really like the idea of complicating our build tools even more. Can't you simply prune the install tree yourself? In the embedded world, the (cross) compilation process is very complex and slow. Being able to disable features

[issue20951] SSLSocket.send() returns 0 for non-blocking socket

2014-03-26 Thread Antoine Pitrou
Antoine Pitrou added the comment: I vote -1 to adding a new flag to control whether it returns zero or raises and +0 to just fixing it in Python 3.5 (I don't think returning zero is an unreasonable thing to do; it's not obvious to me from send(2) that it is guaranteed to never return zero

[issue20526] python: Modules/gcmodule.c:379: visit_decref: Assertion `((gc)-gc.gc_refs (1)) != 0' failed.

2014-03-26 Thread Antoine Pitrou
Antoine Pitrou added the comment: In cx_Oracle trace, visit_decref() is called on a NULL pointer which comes from an Exception. Unless C conventions changed, 0xb is not a NULL pointer :-) -- ___ Python tracker rep...@bugs.python.org

[issue21057] TextIOWrapper does not support reading bytearrays or memoryviews

2014-03-26 Thread STINNER Victor
STINNER Victor added the comment: 2014-03-26 0:35 GMT+01:00 Antoine Pitrou rep...@bugs.python.org: - they are immutable: you can keep an internal reference to a bytes object and be sure it won't change under your feet Is it possible to request this feature using PyObject_GetBuffer()? I don't

[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-03-26 Thread Antoine Pitrou
Antoine Pitrou added the comment: Antoine Pitrou wrote: I don't really like the idea of complicating our build tools even more. Can't you simply prune the install tree yourself? In the embedded world, the (cross) compilation process is very complex and slow. Being able to disable features

[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-03-26 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20210 ___ ___ Python-bugs-list mailing

[issue21057] TextIOWrapper does not support reading bytearrays or memoryviews

2014-03-26 Thread STINNER Victor
STINNER Victor added the comment: class MyByteStream(BytesIO): def read1(self, len_): return memoryview(super().read(len_)) bs = MyByteStream(b'some data in ascii\n') I guess that you are trying to implement a zero-copy I/O. The problem is that BytesIO does copy data. Example:

[issue20526] python: Modules/gcmodule.c:379: visit_decref: Assertion `((gc)-gc.gc_refs (1)) != 0' failed.

2014-03-26 Thread STINNER Victor
STINNER Victor added the comment: Unless C conventions changed, 0xb is not a NULL pointer :-) Ooops, I missed the B :-) By the way, my gdb example is wrong: you should pass self :-) #1 0x0048193a in BaseException_traverse (self=0x70f645f8, visit=0x43ab64 visit_decref,

[issue20904] HAVE_PY_SET_53BIT_PRECISION for m68k

2014-03-26 Thread Larry Hastings
Larry Hastings added the comment: (And hooray for that, given the meteoric rise of AtheOS. :| ) I'm going to go way out on a limb and say that Guido hasn't made a pronouncement here. Also, the discussions cited by Martin are about entire new platforms (AtheOS, Haiku), whereas what we're

[issue20210] Provide configure options to enable/disable Python modules and extensions

2014-03-26 Thread Martin v . Löwis
Martin v. Löwis added the comment: I'm +1 on the general idea, but -1 on the implementation strategy used. Instead of coming up with configure options for selected (apparently problematic) modules, I'd like to see a solution that covers *all* extension modules. One approach could be to

[issue21069] urllib unit tests failing without ssl module

2014-03-26 Thread R. David Murray
R. David Murray added the comment: What makes you think this is a different issue? It sounds like a duplicate to me. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21069

[issue21069] urllib unit tests failing without ssl module

2014-03-26 Thread R. David Murray
R. David Murray added the comment: Ah, in case I wasn't clear: what unittest failures that you are seeing are not covered by issue 20939? In order to diagnose this issue, we'll need to know that :) -- ___ Python tracker rep...@bugs.python.org

[issue21057] TextIOWrapper does not support reading bytearrays or memoryviews

2014-03-26 Thread Nikolaus Rath
Nikolaus Rath added the comment: On 03/26/2014 03:43 AM, STINNER Victor wrote: class MyByteStream(BytesIO): def read1(self, len_): return memoryview(super().read(len_)) bs = MyByteStream(b'some data in ascii\n') I guess that you are trying to implement a zero-copy I/O. The

[issue20062] Remove emacs page from devguide

2014-03-26 Thread Albert Looney
Changes by Albert Looney aloo...@capital.edu: Removed file: http://bugs.python.org/file34503/index.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20062 ___

[issue16043] xmlrpc: gzip_decode has unlimited read()

2014-03-26 Thread jan matejek
Changes by jan matejek jmate...@suse.cz: -- nosy: +matejcik ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16043 ___ ___ Python-bugs-list mailing

[issue21069] urllib unit tests failing without ssl module

2014-03-26 Thread Daniel Farrell
Daniel Farrell added the comment: Ah, in case I wasn't clear: what unittest failures that you are seeing are not covered by issue 20939? The unit test failures I'm seeing are different in at least two ways: 1) A larger set of tests failing than mentioned in Issue 20939; 2) Their failure was

[issue21069] urllib unit tests failing without ssl module

2014-03-26 Thread R. David Murray
R. David Murray added the comment: Well, I just looked at one of those tests at random, and it is using an http://www.python.org url, so it would be covered by 20939. Can you re-run your tests after applying the patches from that issue? -- ___

[issue21070] test_xmlrpc waits forever instead of reporting failure

2014-03-26 Thread jan matejek
New submission from jan matejek: Testcases derived from BaseServerTestCase will launch a server process in a separate thread. This server will shut itself down after handling a specified number of requests. If the test case fails before performing enough requests, the server thread will

[issue21070] test_xmlrpc waits forever instead of reporting failure

2014-03-26 Thread jan matejek
Changes by jan matejek jmate...@suse.cz: -- versions: -Python 2.7, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21070 ___ ___

[issue21071] struct.Struct.format is bytes, but should be str

2014-03-26 Thread Zbyszek Jędrzejewski-Szmek
New submission from Zbyszek Jędrzejewski-Szmek: In Python 2, Struct.format used to be a str. In Python 3 it is bytes, which is unexpected. Why do I expect .format to be a string: - This format is pretty much the same as a {}-format - plain text - according to documentation it is composed of

  1   2   >