Hi,
I installed python 2.6 and python 2.7 on a windows 7 machine.
At the moment Python 2.7 is the interpreter being used if I 'start' a
python script without explicit interpreter.
I always thought, that 'repairing' Python 2.6 (reinstalling it) would
set the default settings back to Python 2.
Am 21.11.2012 02:43, schrieb Steven D'Aprano:
On Tue, 20 Nov 2012 20:07:54 +, Robert Kern wrote:
The source of bugs is not excessive complexity in a method, just
excessive lines of code.
Taken literally, that cannot possibly the case.
def method(self, a, b, c):
do_this(a)
do_tha
Am Dienstag, 20. November 2012 13:18:38 UTC+1 schrieb Michael Herrmann:
> Hi,
>
>
>
> I'm developing a GUI Automation library (http://www.getautoma.com) and am
> having difficulty picking a name for the function that simulates key strokes.
> I currently have it as 'type' but that clashes with
On 21/11/2012 08:23, Gelonida N wrote:
> Hi,
>
> I installed python 2.6 and python 2.7 on a windows 7 machine.
>
> At the moment Python 2.7 is the interpreter being used if I 'start' a
> python script without explicit interpreter.
>
> I always thought, that 'repairing' Python 2.6 (reinstalling i
On 20/11/2012 23:41, Tom Borkin wrote:
> Using shlex, I now have this:
> #!\Python27\python
> import os, subprocess
> path = os.path.join("C:\\", "Program Files", "Apache Group", "Apache2",
> "htdocs", "ccc", "run_alert.py")
> #subprocess.call(['SchTasks', '/Create', '/SC', 'ONCE', '/TN', '"test"',
>
> >
> >> Yes i tried "or" also but no use .
>
> Explain "no use". If you mean you still fail, then what else did you
> try? For example, did you try interchanging the two subscripts? I've
> suspected all along that the meanings of row and column, x and y, [0]
> and [1], height and width ar
> >
> > def GenerateRing(x,y, N): Generates square rings around a point in data
> which has 300 columns(x) and 3000
> > rows(y)
> > indices = []
> > for i in xrange(-N, N):
> > indices.append((x+i, y-N))
> > indices.append((x+N, y+i))
> > indices.append((x-i, y+N))
>
Robert,
You would never get a better product by accident.
The meaning of better product might differ from team to team but you can not
ignore excessive complexity. Earlier or later you get back to that code and
refactor it, thus existence of such fact was driven by your intention to make
it a
We choose Python for its readability. This is essential principal of language
and thousands around reading the open source code. Things like PEP8, CC, LoC
are all to serve you one purpose: bring your attention, teach you make your
code better.
Thanks.
Andriy
On Tuesday, November 20, 2012 6:03:47 PM UTC-5, Ian wrote:
> On Tue, Nov 20, 2012 at 2:49 PM, Daniel Klein wrote:
>
> > With the assistance of this group I am understanding unicode encoding issues
>
> > much better; especially when handling special characters that are outside of
>
> > the ASCII
On Wed, 21 Nov 2012 22:21:23 +1100, Chris Angelico wrote:
> Counting complexity by giving a score to every statement encourages code
> like this:
>
> def bletch(x,y):
> return x + {"foo":y*2,"bar":x*3+y,"quux":math.sin(y)}.get(mode,0)
>
> instead of:
>
> def bletch(x,y):
> if mode=="foo": r
Chris,
The focus of development team is controlled by setting a metric threshold or
just excluding some. So you do not have an overhead for the development team
from the point it set forward, assuming them team committed to adherence it.
Your strategy for perfection may vary. You can start wit
On 21/11/2012 01:43, Steven D'Aprano wrote:
On Tue, 20 Nov 2012 20:07:54 +, Robert Kern wrote:
The source of bugs is not excessive complexity in a method, just
excessive lines of code.
Taken literally, that cannot possibly the case.
def method(self, a, b, c):
do_this(a)
do_that
I believe for the quality of code you produce.
Thanks.
Andriy
> From: steve+comp.lang.pyt...@pearwood.info
> Subject: Re: Web Frameworks Excessive Complexity
> Date: Wed, 21 Nov 2012 11:43:10 +
> To: python-list@python.org
>
> On Wed, 21 Nov 2012 22
On 21/11/2012 11:02, Andriy Kornatskyy wrote:
Robert,
You would never get a better product by accident.
The meaning of better product might differ from team to team but you can not
ignore excessive complexity. Earlier or later you get back to that code and
refactor it, thus existence of such
Agreed. I think we have pretty much the same point of view on this.
All these metrics advise you... this is again depends how you look at this. If
you are a new comer to a project, you usually spend some time on code review,
talk to people, read docs if any. The qa tools for static code analysi
On Wed, 21 Nov 2012 03:24:01 -0800, danielk wrote:
>> >>> import sys
>> >>> sys.stdout.encoding
>> 'cp437'
>
> Hmmm. So THAT'S why I am only able to use 'cp437'. I had (mistakenly)
> thought that I could just indicate whatever encoding I wanted, as long as
> the codec supported it.
sys.stdout.enc
On 21/11/2012 12:17, Andriy Kornatskyy wrote:
Agreed. I think we have pretty much the same point of view on this.
All these metrics advise you... this is again depends how you look at this. If
you are a new comer to a project, you usually spend some time on code review,
talk to people, read d
On 21/11/12 02:17:26, Steven D'Aprano wrote:
> On Tue, 20 Nov 2012 18:00:59 -0600, Tim Chase wrote:
>
>> On 11/20/12 06:18, Michael Herrmann wrote:
>>> am having difficulty picking a name for the function that simulates key
>>> strokes. I currently have it as 'type' but that clashes with the
>>> b
I just came across this:
>>> 'spam'.find('', 5)
-1
Now, reading find's documentation:
>>> print(str.find.__doc__)
S.find(sub [,start [,end]]) -> int
Return the lowest index in S where substring sub is found,
such that sub is contained within S[start:end]. Optional
arguments start and end are
Hm... what serves an evidence purpose for you?
See functions at line 2619 and 2974 as an example for CC 20+:
https://github.com/defnull/bottle/blob/master/bottle.py
Andriy
> To: python-list@python.org
> From: robert.k...@gmail.com
> Subject: Re: Web Fra
On 11/21/2012 06:24 AM, danielk wrote:
> On Tuesday, November 20, 2012 6:03:47 PM UTC-5, Ian wrote:
>>>
>>
>> In Linux, your terminal encoding is probably either UTF-8 or Latin-1,
>>
>> and either way it has no problems encoding that data for output. In a
>>
>> Windows cmd terminal, the default t
On 21/11/2012 12:47, Andriy Kornatskyy wrote:
Hm... what serves an evidence purpose for you?
Well-done empirical studies, like the one I gave you.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to inte
On 11/21/2012 05:11 AM, inshu chauhan wrote:
>>
>>>
>> I must confess I have no idea what data represents. When you're doing
>> rings, you use deltas on the cx and cy values. But when you're
>> computing radius, you use the 3d coordinates returned by data[cx, cy].
>> So is data some kind
>
>
>
>>
>> Back to an earlier comment. I asked if N was ever bigger than x or
>> bigger than y, and you said never. But your ComputeClasses will have
>> such a case the very first time around, when cx==0, cy==0, and
>> ring_number == 1.
>>
>
> I doubt this , M confused..
>
I'll paste an e
On 2012-11-21 12:43, Giacomo Alzetta wrote:
I just came across this:
'spam'.find('', 5)
-1
Now, reading find's documentation:
print(str.find.__doc__)
S.find(sub [,start [,end]]) -> int
Return the lowest index in S where substring sub is found,
such that sub is contained within S[start:en
I am trying to write a small bit of code that interactively deletes selected
slices in an image series using matplotlib. I have created a button 'delete'
which stores a number of indices to be deleted when the button 'update' is
selected. However, I am currently unable to reset the range of my s
I guess I have to use try and except as Chris suggested, this isn't working.
--
http://mail.python.org/mailman/listinfo/python-list
Le mardi 20 novembre 2012 22:00:49 UTC+1, Chris Angelico a écrit :
> On Wed, Nov 21, 2012 at 1:57 AM, wrote:
>
-
> To the OP: jmf has an unnatural hatred of Python 3.3 and PEP 393
>
> strings.
No. Not at all. I'm mainly and deeply disappointed.
jmf
--
http://mail.python.org/mailman/lis
Hi,
I'm using the json module to create a JSON string, then inserting that string
into a html template containing a javascript function (from the highcharts
library: http://www.highcharts.com/)
The json string I'm trying to create is to initialize a data variable in the
javascript function, th
On 2012-11-21 14:59, saikari78 wrote:
Hi,
I'm using the json module to create a JSON string, then inserting that string
into a html template containing a javascript function (from the highcharts
library: http://www.highcharts.com/)
The json string I'm trying to create is to initialize a data
Thanks for your reply, but the javascript function expects option names to be
unquoted, otherwise it won't work.
On Wednesday, November 21, 2012 3:48:07 PM UTC, MRAB wrote:
> On 2012-11-21 14:59, saikari78 wrote:
>
> > Hi,
>
> >
>
> > I'm using the json module to create a JSON string, then
On 2012-11-21, MRAB wrote:
>> However, I don't know how to do that because dictionary keys in
>> python need to be strings. If I try to do the following, Python,of
>> course, complains that y,color,drilldown, etc are not defined.
>
> Just quote them:
>
> data = [ { 'y':55.11, 'color':colors[0], '
On Wednesday, November 21, 2012 2:32:40 AM UTC-5, Kev Dwyer wrote:
> Hello List,
>
>
>
> I have to build a simple web service which will:
>
>
>
> - receive queries from our other servers
>
> - forward the requests to a third party SOAP service
>
> - process the response from the third pa
On 2012-11-21 16:04, hfo...@gmail.com wrote:
On Wednesday, November 21, 2012 3:48:07 PM UTC, MRAB wrote:
On 2012-11-21 14:59, saikari78 wrote:
Hi,
I'm using the json module to create a JSON string, then
inserting that string into a html template containing a javascript
>>> function (from th
On 2012-11-21 16:27, MRAB wrote:> On 2012-11-21 16:04, hfo...@gmail.com
wrote:
>> On Wednesday, November 21, 2012 3:48:07 PM UTC, MRAB wrote:
>>> On 2012-11-21 14:59, saikari78 wrote:
Hi,
I'm using the json module to create a JSON string, then
inserting that string into a ht
On Nov 20, 1:37 pm, Ian Kelly wrote:
> On Tue, Nov 20, 2012 at 12:09 PM, Kevin T wrote:
> > #if re.search( "rsrvd", sigName ) : #version a
> > #if re.search( "rsrvd", sigName ) == None : #version b
> > if re.search( "rsrvd", sigName ) is None : #version bb
> > print sigName
> > newVal
On Wed, 21 Nov 2012 04:43:57 -0800, Giacomo Alzetta wrote:
> I just came across this:
>
'spam'.find('', 5)
> -1
>
>
> Now, reading find's documentation:
>
print(str.find.__doc__)
> S.find(sub [,start [,end]]) -> int
>
> Return the lowest index in S where substring sub is found,
> su
On 20/11/2012 4:00 PM, Chris Angelico wrote:
On Wed, Nov 21, 2012 at 1:57 AM, wrote:
Le mardi 20 novembre 2012 09:09:50 UTC+1, Chris Angelico a écrit :
On Tue, Nov 20, 2012 at 7:02 PM, Pavel Solin wrote:
Perhaps you are right. Is there any statistics of how many Python
programmers are u
Dear all,
thanks so much for your replies. Based on your inputs, we have started to
experiment with changes to our API. I hope to be able to present the results to
you tomorrow.
Thanks again,
Michael
On Tuesday, November 20, 2012 1:18:38 PM UTC+1, Michael Herrmann wrote:
> Hi,
>
>
>
> I'm
Hi ,
my purpose is a generic insert via tuple , because the number of fields and
can differ. But I'm stucking .
ilist=['hello',None,7,None,None]
#This version works, but all varchar fields are in extra '' enclosed.
con.execute(""" INSERT INTO {} VALUES %r; """.format(table) , (tuple(ilist),))
On Wed, Nov 21, 2012 at 9:49 AM, rh wrote:
> On Tue, 20 Nov 2012 20:41:42 +0300
> Andriy Kornatskyy wrote:
>> Cyclomatic (or conditional) complexity is a metric used to indicate
>> the complexity of a source code. Excessive complexity is something
>> that is beyond recommended level of 10 (thresh
Richard,
Thank you for the comment.
I have examined web frameworks for PEP8 and CC metrics already. Results are
here:
http://mindref.blogspot.com/2012/10/python-web-pep8-consistency.html
http://mindref.blogspot.com/2012/11/python-web-excessive-complexity.html
Same applies to performance benchm
On Wed, Nov 21, 2012 at 7:48 AM, MRAB wrote:
> On 2012-11-21 14:59, saikari78 wrote:
>>
>> Hi,
>>
>> I'm using the json module to create a JSON string, then inserting that
>> string into a html template containing a javascript function (from the
>> highcharts library: http://www.highcharts.com/)
On Wed, Nov 21, 2012 at 10:57 AM, rh wrote:
> On Wed, 21 Nov 2012 10:12:26 -0800
> Chris Rebert wrote:
>> On Wed, Nov 21, 2012 at 9:49 AM, rh
>> wrote:
>> > On Tue, 20 Nov 2012 20:41:42 +0300
>> > Andriy Kornatskyy wrote:
>> > I'm looking at different technology right now on which to base a
>>
On 21/11/12 17:59:05, Alister wrote:
> On Wed, 21 Nov 2012 04:43:57 -0800, Giacomo Alzetta wrote:
>
>> I just came across this:
>>
> 'spam'.find('', 5)
>> -1
>>
>>
>> Now, reading find's documentation:
>>
> print(str.find.__doc__)
>> S.find(sub [,start [,end]]) -> int
>>
>> Return the lowe
Hi Tim,
Thanks a lot for your answer.
On 11/21/2012 10:34 AM, Tim Golden wrote:
On 21/11/2012 08:23, Gelonida N wrote:
Hi,
I installed python 2.6 and python 2.7 on a windows 7 machine.
At the moment Python 2.7 is the interpreter being used if I 'start' a
python script without explicit inter
Hi,
I'm using Python's logger for logging but it doesn't seem to roll over, my file
is now 2.2MB and should've rolled over after ever 1MB.
My code:
logger = logging.getLogger("")
logger.setLevel(logging.DEBUG)
handler = logging.handlers.RotatingFileHandler(
LOGFILE
On Wed, Nov 21, 2012 at 9:19 AM, Christian wrote:
> Hi ,
>
> my purpose is a generic insert via tuple , because the number of fields and
> can differ. But I'm stucking .
>
> ilist=['hello',None,7,None,None]
>
> #This version works, but all varchar fields are in extra '' enclosed.
> con.execute(
On 21/11/12 18:19:15, Christian wrote:
> Hi ,
>
> my purpose is a generic insert via tuple , because the number of fields and
> can differ. But I'm stucking .
>
> ilist=['hello',None,7,None,None]
>
> #This version works, but all varchar fields are in extra '' enclosed.
> con.execute(""" INSER
Ron,
LOGFILE, maxBytes=(1048576*10), backupCount=5
What am I doing wrong here, I don't get it.
10 * 1048576 = 10MB
--
GC
--
http://mail.python.org/mailman/listinfo/python-list
Hooops sh*t! I outsmarted myself I guess... :o
However, Thanks for the kick GC!
Ron Eggler
1804 - 1122 Gilford St.
Vancouver, BC
V6G 2P5
(778) 230-9442
On 12-11-21 11:41 AM, Gary Chambers wrote:
Ron,
LOGFILE, maxBytes=(1048576*10), backupCount=5
What am I doing wrong here, I don't get it.
I'm attempting to build cpython 2.{5,6,7} and cpython 3.[0,1,2,3}. I find
that having them all around facilitates interversion testing and
discovering what works in which versions.
Anyway, in 3.3, I'm getting a bz2 module, but in 3.2, I'm not - but only
when compiling on Linux Mint 14. On Linux
Il giorno mercoledì 21 novembre 2012 20:25:10 UTC+1, Hans Mulder ha scritto:
> On 21/11/12 17:59:05, Alister wrote:
>
> > On Wed, 21 Nov 2012 04:43:57 -0800, Giacomo Alzetta wrote:
>
> >
>
> >> I just came across this:
>
> >>
>
> > 'spam'.find('', 5)
>
> >> -1
>
> >>
>
> >>
>
> >> Now
On 2012-11-21 19:25, Hans Mulder wrote:
On 21/11/12 17:59:05, Alister wrote:
On Wed, 21 Nov 2012 04:43:57 -0800, Giacomo Alzetta wrote:
I just came across this:
'spam'.find('', 5)
-1
Now, reading find's documentation:
print(str.find.__doc__)
S.find(sub [,start [,end]]) -> int
Return t
cerr writes:
> 2.2MB and should've rolled over after ever 1MB.
> LOGFILE, maxBytes=(1048576*10), backupCount=5
1048576*10 is 10MB, not 1MB.
--
http://mail.python.org/mailman/listinfo/python-list
On 21/11/2012 20:53, Tony the Tiger wrote:
On Wed, 21 Nov 2012 09:23:00 +0100, Gelonida N wrote:
What am I missing?
The PATH environment variable?
Nope. PATH doesn't affect either double-clicking or running a .py file
on the command line (unless, obviously, you run it by typing "python
my
On 21 November 2012 20:58, MRAB wrote:
> On 2012-11-21 19:25, Hans Mulder wrote:
>
>> On 21/11/12 17:59:05, Alister wrote:
>>
>>> On Wed, 21 Nov 2012 04:43:57 -0800, Giacomo Alzetta wrote:
'spam'.find('', 5)
>>>
>> -1
Now, reading find's documentation:
pr
On Wed, Nov 21, 2012 at 6:01 AM, Tim Golden wrote:
> subprocess.call([
> 'SchTasks', '/Create',
> '/SC', 'ONCE',
> '/TN', 'test',
> '/TR', path,
> '/ST', '23:50'
> ])
>
Thank you. Yes, it was the quoting of "test". Oops :-}
Thanks again,
Tom
--
http://mail.python.org/mailman/listinfo/p
On Wed, Nov 21, 2012 at 10:43 PM, Steven D'Aprano
wrote:
> On Wed, 21 Nov 2012 22:21:23 +1100, Chris Angelico wrote:
>
>> Counting complexity by giving a score to every statement encourages code
>> like this:
>>
>> def bletch(x,y):
>> return x + {"foo":y*2,"bar":x*3+y,"quux":math.sin(y)}.get(mod
On Thu, Nov 22, 2012 at 4:03 AM, Colin J. Williams wrote:
> On 20/11/2012 4:00 PM, Chris Angelico wrote:
>> To the OP: jmf has an unnatural hatred of Python 3.3 and PEP 393
>> strings. Take no notice; the rest of the world sees this as a huge
>> advantage. Python is now in a VERY small group of la
On 21/11/2012 07:01, Steven D'Aprano wrote:
> On Wed, 21 Nov 2012 17:35:27 +1100, Chris Angelico wrote:
>
>> And yet, trivial though it may seem, function naming in a permanent API
>> is pretty important. Threads like this can be the difference between
>> coherent and useful APIs and veritable pil
On 11/21/2012 05:17 PM, Chris Angelico wrote:
>
>
>
> That said, though, I'm just glad that %-formatting is staying. It's an
> extremely expressive string formatting method, and exists in many
> languages (thanks to C's heritage). Pike's version is insanely
> powerful, Python's is more like C's, b
On Wed, Nov 21, 2012 at 3:58 PM, Dave Angel wrote:
> Some don't realize that one very powerful use for the .format style of
> working is that it makes localization much more straightforward. With
> the curly brace approach, one can translate the format string into
> another language, and if the p
On 21 November 2012 22:17, Chris Angelico wrote:
> On Thu, Nov 22, 2012 at 4:03 AM, Colin J. Williams wrote:
> > On 20/11/2012 4:00 PM, Chris Angelico wrote:
> >> To the OP: jmf has an unnatural hatred of Python 3.3 and PEP 393
> >> strings. Take no notice; the rest of the world sees this as a h
On Wed, 21 Nov 2012 12:03:30 -0500, Colin J. Williams wrote:
> On 20/11/2012 4:00 PM, Chris Angelico wrote:
>> To the OP: jmf has an unnatural hatred of Python 3.3 and PEP 393
>> strings. Take no notice; the rest of the world sees this as a huge
>> advantage. Python is now in a VERY small group o
On 21/11/2012 23:21, Joshua Landau wrote:
On 21 November 2012 22:17, Chris Angelico wrote:
On Thu, Nov 22, 2012 at 4:03 AM, Colin J. Williams wrote:
On 20/11/2012 4:00 PM, Chris Angelico wrote:
To the OP: jmf has an unnatural hatred of Python 3.3 and PEP 393
strings. Take no notice; the res
On Wed, Nov 21, 2012 at 4:21 PM, Joshua Landau
wrote:
> "{}".format() is a blessing an "" % () should go. "%" has no relevance to
> strings, is hard to "get" and has an appalling* syntax. Having two syntaxes
> just makes things less obvious, and the right choice rarer.
>
> str.format is also reall
On Wed, Nov 21, 2012 at 12:18 PM, Dan Stromberg wrote:
>
> I'm attempting to build cpython 2.{5,6,7} and cpython 3.[0,1,2,3}. I find
> that having them all around facilitates interversion testing and
> discovering what works in which versions.
>
> Anyway, in 3.3, I'm getting a bz2 module, but in
Hi Alec,
> Can you put your website—http://femhub.com/textbook-python/—on your
> github—https://github.com/femhub/nclab-textbook-python?
Done, thank you so much.
I edited the textbook based on responses that I received. Based
on several inquiries we also decided to add Python 3.2 to NCLab.
New r
On 11/21/2012 8:32 AM, MRAB wrote:
On 2012-11-21 12:43, Giacomo Alzetta wrote:
I just came across this:
>>> 'spam'.find('')
0
>>> 'spam'.find('', 1)
1
>>> 'spam'.find('', 4)
4
'spam'.find('', 5)
-1
Now, reading find's documentation:
print(str.find.__doc__)
S.find(sub [,start [,end]]) -
On 2012-11-22 03:41, Terry Reedy wrote:
On 11/21/2012 8:32 AM, MRAB wrote:
On 2012-11-21 12:43, Giacomo Alzetta wrote:
I just came across this:
>>> 'spam'.find('')
0
>>> 'spam'.find('', 1)
1
>>> 'spam'.find('', 4)
4
'spam'.find('', 5)
-1
Now, reading find's documentation:
print(s
On 11/21/2012 6:21 PM, Joshua Landau wrote:
Since we've decided to derail the conversation...
"{}".format() is a blessing an "" % () should go. "%" has no relevance
to strings, is hard to "get" and has an appalling* syntax. Having two
syntaxes just makes things less obvious, and the right choic
On Thu, Nov 22, 2012 at 3:41 AM, Kevin T wrote:
> I went back and tried version a again, blam it is/does work now ?!?!?
> I am not sure what changed but version a was the original code that
> wouldn't work. All the examples i had read, showed version a as a
> working version. I spent significant
> On Wed, Nov 21, 2012 at 10:43 PM, Steven D'Aprano
> wrote:
>> On Wed, 21 Nov 2012 22:21:23 +1100, Chris Angelico wrote:
>>
>>> Counting complexity by giving a score to every statement encourages code
>>> like this:
>>>
>>> def bletch(x,y):
>>> return x + {"foo":y*2,"bar":x*3+y,"quux":math.sin(
Kev Dwyer writes:
> I have to build a simple web service which will:
>
> - receive queries from our other servers
> - forward the requests to a third party SOAP service
> - process the response from the third party
> - send the result back to the original requester
>
> From the point of view
Steve Petrie wrote:
> On Wednesday, November 21, 2012 2:32:40 AM UTC-5, Kev Dwyer wrote:
>> Hello List,
>>
>>
>>
>> I have to build a simple web service which will:
>>
>>
>>
>> - receive queries from our other servers
>>
>> - forward the requests to a third party SOAP service
>>
>> - pr
Il giorno giovedì 22 novembre 2012 05:00:39 UTC+1, MRAB ha scritto:
> On 2012-11-22 03:41, Terry Reedy wrote:
> It can't return 5 because 5 isn't an index in 'spam'.
>
>
>
> It can't return 4 because 4 is below the start index.
Uhm. Maybe you are right, because returning a greater value would c
78 matches
Mail list logo