Thomas 'PointedEars' Lahn wrote:
with open(os.path.join(dirpath, name), 'r') as f:
SHOULD be
with open(os.path.join(dirpath, name), 'rb') as f:
(as in the original), else the some code units might not be read properly.
--
PointedEars
Bitte keine Kopien per E-Mail. /
Steven D'Aprano wrote:
Nulpum wrote:
I want to make sure that folder exists.
'2011-07-03' is really exists. but 'os.path.isdir' say false
Does anyone know why?
Yes.
print logs/2011-07-03
logs/2011-07-03
print logs\2011-07-03
logs�1-07-03
Don't use backslashes as path
On 19/07/11 00:33, Thomas 'PointedEars' Lahn wrote:
Thomas 'PointedEars' Lahn wrote:
Dave Angel wrote:
On 01/-10/-28163 02:59 PM, Terry Reedy wrote:
def makeadder(y)
def _add(x): return x+y
add2 = makeadder(2)
A couple of typos in that code:
def makeaddr(y):
def _add(x):
On 19/07/11 06:42, Steven D'Aprano wrote:
Nulpum wrote:
I want to make sure that folder exists.
'2011-07-03' is really exists. but 'os.path.isdir' say false
Does anyone know why?
Yes.
print logs/2011-07-03
logs/2011-07-03
print logs\2011-07-03
logs�1-07-03
Don't use backslashes
On Jul 14, 6:21 pm, Inside fancheyuj...@gmail.com wrote:
As telling in the subject,because list and tuple aren't functions,they
are types.Is that right?
list() and tuple() are in the right place in the documentation because
they would be harder to find if listed elsewhere. Tools like str(),
On Jul 19, 1:42 pm, Steven D'Aprano steve
+comp.lang.pyt...@pearwood.info wrote:
Nulpum wrote:
I want to make sure that folder exists.
'2011-07-03' is really exists. but 'os.path.isdir' say false
Does anyone know why?
Yes.
print logs/2011-07-03
logs/2011-07-03
print
Thomas Jollans wrote:
On 19/07/11 06:42, Steven D'Aprano wrote:
(1) Escape every backslash with an extra backslash:
print logs\\2011-07-03
logs\2011-07-03
There is a more elegant solution: use raw strings: r'c:\foo\bar'
Well, perhaps, but not all paths can be written as a raw string:
On Tue, Jul 19, 2011 at 11:52 AM, Thomas Jollans t...@jollybox.de wrote:
On 19/07/11 00:33, Thomas 'PointedEars' Lahn wrote:
Thomas 'PointedEars' Lahn wrote:
Dave Angel wrote:
On 01/-10/-28163 02:59 PM, Terry Reedy wrote:
def makeadder(y)
def _add(x): return x+y
add2 =
On 7월19일, 오후3시15분, Thomas 'PointedEars' Lahn pointede...@web.de
wrote:
Steven D'Aprano wrote:
Nulpum wrote:
I want to make sure that folder exists.
'2011-07-03' is really exists. but 'os.path.isdir' say false
Does anyone know why?
Yes.
print logs/2011-07-03
logs/2011-07-03
Hi All,
I'm happy to announce a new release of TestFixtures with the following
changes:
- Removed the dependency on zope.dottedname.
- Implement the ability to mock out dict and list
items using testfixtures.Replacer and
testfixtures.replace.
- Implement the ability to remove attributes
FOR GOOD JOBS SITES TO YOU
http://goodjobssites.blogspot.com/
FOR HOT PHOTOVIDEOS
KATRINA KAIF RARE PHOTOS
http://southactresstou.blogspot.com/2011/07/katrina-kaif-wallpapers.html
On Jul 18, 7:07 pm, Billy Mays no...@nohow.com wrote:
On 7/18/2011 7:56 PM, Steven D'Aprano wrote:
Billy Mays wrote:
On 07/17/2011 03:47 AM, Xah Lee wrote:
2011-07-16
I gave it a shot. It doesn't do any of the Unicode delims, because
let's face it, Unicode is for goobers.
Hmm, might have been helpful to include docs for these new bits:
On 19/07/2011 09:36, Chris Withers wrote:
- Implement the ability to mock out dict and list
items using testfixtures.Replacer and
testfixtures.replace.
- Implement the ability to remove attributes and dict
items using
Thanks for the suggestions. Felt the thread could be of help on
consolidating the solution.
*Max Value from a csv column:*
import numpy
data1 = numpy.genfromtxt(data.csv,dtype='float',delimiter =
',',skiprows=1, skip_header=0, skip_footer=0,
usecols=11,usemask=True)
Hello,
I am looking to improve the performance of the following piece of Python code:-
for cc in StatusContainer:
for srv in StatusContainer[cc]:
for id in StatusContainer[cc][srv]['RECV']:
if id in StageContainer['13']:
Hello, please I have problem with The following modules appear to be
missing message during compiling my app exe file with py2exe. What should I
do with this? Many thanks in advance.
The following modules appear to be missing
['Carbon', 'Carbon.Files', '_scproxy', 'fixedpoint', 'gdk', 'mx',
Hello, please I have problem with The following modules appear to be
missing message during compiling my app exe file with py2exe. What
should I do with this? Many thanks in advance.
The following modules appear to be missing
['Carbon', 'Carbon.Files', '_scproxy', 'fixedpoint', 'gdk', 'mx',
On 01/-10/-28163 02:59 PM, Thomas 'PointedEars' Lahn wrote:
Dave Angel wrote:
On 01/-10/-28163 02:59 PM, Terry Reedy wrote:
def makeadder(y)
def _add(x): return x+y
add2 = makeadder(2)
A couple of typos in that code:
def makeaddr(y):
def _add(x): return x+y
return _add
I
Hello everyone!
I've started developing a little application for one of my friends,
which he will use at work to measure his hours working + the time he
has breaks. I wanna do this in python cause, I just started with this
language and wanna get more fimiliar with it. Sometimes though, it's a
bit
J wrote:
I am looking to improve the performance of the following piece of Python
code:-
for cc in StatusContainer:
for srv in StatusContainer[cc]:
for id in StatusContainer[cc][srv]['RECV']:
if id in StageContainer['13']:
On Tue, Jul 19, 2011 at 7:47 PM, Peter Irbizon peterirbi...@gmail.com wrote:
Hello, please I have problem with The following modules appear to be
missing message during compiling my app exe file with py2exe. What should I
do with this? Many thanks in advance.
The following modules appear to
On 07/19/2011 04:36 AM, J wrote:
Someone in a different forum suggested that I use 'binary
search' to iterate through the dictionaries
I'm not sure what they were smoking...a binary search is useful
for finding a thing in a sorted list. It looks like your data is
not sorted (strike #1) and
On 01/-10/-28163 02:59 PM, J wrote:
Hello,
I am looking to improve the performance of the following piece of Python code:-
for cc in StatusContainer:
for srv in StatusContainer[cc]:
for id in StatusContainer[cc][srv]['RECV']:
if id in
On Jul 19, 1:13 pm, Noon Silk noonsli...@gmail.com wrote:
On Tue, Jul 19, 2011 at 7:47 PM, Peter Irbizon peterirbi...@gmail.com wrote:
Hello, please I have problem with The following modules appear to be
missing message during compiling my app exe file with py2exe. What should I
do with
I have a method getToken() which checks to see if a value is set, and if
so, return it. However, it doesn't feel pythonic to me:
def getToken(self):
if self.tok:
t = self.tok
self.tok = None
return t
# ...
Is there a way to trim the 'if' block to reset
Hey everyone. I am currently reading through an RFC, and it mentions
that a client and server half of a transaction are embodied by finite
state machines. I am reading through the wikipedia article for finite
state machines, and sadly it's going a bit above my head. I don't
really have a
I don't know if this is better (or more pythonic), but it works for me on
python 2.7.
class MyKlass(object):
... def __init__(self, tok):
... self.tok = tok
... def gettoken(self):
... t, self.tok = self.tok or None, None
... return t
On Tue, Jul 19, 2011 at 9:23
On Tue, Jul 19, 2011 at 11:32 PM, Matty Sarro msa...@gmail.com wrote:
Hey everyone. I am currently reading through an RFC, and it mentions
that a client and server half of a transaction are embodied by finite
state machines. I am reading through the wikipedia article for finite
state machines,
Billy Mays
81282ed9a88799d21e77957df2d84bd6514d9...@myhashismyemail.com writes:
I have a method getToken() which checks to see if a value is set, and
if so, return it. However, it doesn't feel pythonic to me:
Clearly that's because the function name is not Pythonic :-)
I'll assume the name is
On 07/19/2011 09:43 AM, Ben Finney wrote:
Billy Mays
81282ed9a88799d21e77957df2d84bd6514d9...@myhashismyemail.com writes:
I have a method getToken() which checks to see if a value is set, and
if so, return it. However, it doesn't feel pythonic to me:
Clearly that's because the function name
markolopa wrote:
I would like to find a good system to keep track of my household
finance. Do Python programmers have suggestions on that? Do you use
Python to help on this task?
libreOffice doesn't do it?
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
Thomas Jollans wrote:
The correct solution in many cases is to not assume any particular
path separator at all, and use os.path.join when dealing with paths.
This will work even on systems that do not accept forward slashes as
path separators. (does Python still support
On 2011-07-19, Nulpum changjun@gmail.com wrote:
I want to make sure that folder exists.
'2011-07-03' is really exists. but 'os.path.isdir' say false
Does anyone know why?
os.path.isdir(C:\Users\??\Desktop\logs)
True
os.path.isdir(C:\Users\??\Desktop\logs\2011-07-03)
False
Hi guys,
Thank you for your suggestions. I have managed to get my whole script to
execute in under 10 seconds by changing the 'for loop' I posted above to the
following:-
for opco in Cn:
for service in Cn[opco]:
ack = set(Cn[opco][service]['RECV']) set(Pr['13'])
You might wanna have a look at theory of computation.
http://www.youtube.com/user/Coderisland#g/c/601FC994BDD963E4
in this lecture series you will have an explanation for FSM from the ground
up
-AB
On Tue, Jul 19, 2011 at 7:02 PM, Matty Sarro msa...@gmail.com wrote:
Hey everyone. I am
On 7/19/2011 2:52 AM, Raymond Hettinger wrote:
On Jul 14, 6:21 pm, Insidefancheyuj...@gmail.com wrote:
As telling in the subject,because list and tuple aren't
functions,they are types.Is that right?
They are not instances of a class whose definition name includes the
word 'Function'. They
On 7/19/2011 5:47 AM, Peter Irbizon wrote:
Hello, please I have problem with The following modules appear to be
missing message during compiling my app exe file with py2exe. What
should I do with this? Many thanks in advance.
From the stuff below, you appear to be compiling for Windows.
The
On Tue, Jul 19, 2011 at 12:22 AM, Thomas Jollans t...@jollybox.de wrote:
Supplemental: The above can be simplified to
def makeadder(y): return lambda x: x + y
In turn:
makeadder = lambda y: lambda x: x + y
That's not an improvement. lambda is for making anonymous functions.
If you're
On 7/19/2011 6:07 AM, Dave Angel wrote:
On 01/-10/-28163 02:59 PM, Thomas 'PointedEars' Lahn wrote:
Dave Angel wrote:
On 01/-10/-28163 02:59 PM, Terry Reedy wrote:
def makeadder(y)
def _add(x): return x+y
add2 = makeadder(2)
A couple of typos in that code:
def makeaddr(y):
def _add(x):
On 19/07/11 18:49, Ian Kelly wrote:
On Tue, Jul 19, 2011 at 12:22 AM, Thomas Jollans t...@jollybox.de wrote:
Supplemental: The above can be simplified to
def makeadder(y): return lambda x: x + y
In turn:
makeadder = lambda y: lambda x: x + y
That's not an improvement. lambda is for
On 7/19/2011 9:52 AM, Billy Mays wrote:
On 07/19/2011 09:43 AM, Ben Finney wrote:
Billy Mays
81282ed9a88799d21e77957df2d84bd6514d9...@myhashismyemail.com writes:
I have a method getToken() which checks to see if a value is set, and
if so, return it. However, it doesn't feel pythonic to me:
That sounds artificially backwards; why not let getToken() reuse peekToken()?
def peek(self):
if self.tok is None:
try:
self.tok = self.gen.next()
except StopIteration:
self.tok = NULL
return self.tok
def pop(self):
token = self.peek()
On Sunday, July 17, 2011 2:48:42 AM UTC-7, Raymond Hettinger wrote:
On Jul 17, 12:47 am, Xah Lee xah...@gmail.com wrote:
i hope you'll participate. Just post solution here. Thanks.
http://pastebin.com/7hU20NNL
just installed py3.
there seems to be a bug.
in this file
On 07/19/2011 01:00 PM, Micah wrote:
That sounds artificially backwards; why not let getToken() reuse peekToken()?
def peek(self):
if self.tok is None:
try:
self.tok = self.gen.next()
except StopIteration:
self.tok = NULL
return self.tok
On Jul 18, 10:12 am, Billy Mays
81282ed9a88799d21e77957df2d84bd6514d9...@myhashismyemail.com wrote:
On 07/17/2011 03:47 AM,XahLee wrote:
2011-07-16
I gave it a shot. It doesn't do any of the Unicode delims, because
let's face it, Unicode is for goobers.
import sys, os
pairs =
On Tue, Jul 19, 2011 at 10:58 AM, Thomas Jollans t...@jollybox.de wrote:
No, it's not an improvement. It's an illustration.
I get that. The difference I pointed out between your
simplification and the other Thomas's is the reason why yours would
be unpythonic whilst his is fine.
--
On 07/19/2011 01:02 PM, Terry Reedy wrote:
You did not answer Ben's question about the allowed values of self.tok
and whether you really want to clobber all 'false' values. The proper
code depends on that answer.
NULL is an enumerated value I have defined above. The idea is for
peekToken to
On Tue, Jul 19, 2011 at 7:20 AM, J jnr.gonza...@googlemail.com wrote:
Hi guys,
Thank you for your suggestions. I have managed to get my whole script to
execute in under 10 seconds by changing the 'for loop' I posted above to the
following:-
for opco in Cn:
for service in
On Jul 18, 2:59 pm, Thomas 'PointedEars' Lahn pointede...@web.de
wrote:
Ian Kelly wrote:
Billy Mays wrote:
I gave it a shot. It doesn't do any of the Unicode delims, because let's
face it, Unicode is for goobers.
Uh, okay...
Your script also misses the requirement of outputting the
On 07/19/2011 01:14 PM, Xah Lee wrote:
I added other unicode brackets to your list of brackets, but it seems
your code still fail to catch a file that has mismatched curly quotes.
(e.g.http://xahlee.org/p/time_machine/tm-ch04.html )
LOL Billy.
Xah
I suspect its due to the file mode being
On 7/19/2011 9:32 AM, Matty Sarro wrote:
Hey everyone. I am currently reading through an RFC, and it mentions
that a client and server half of a transaction are embodied by finite
state machines. I am reading through the wikipedia article for finite
That was going to be my first suggestion,
On Jul 17, 8:31 am, Thomas Jollans t...@jollybox.de wrote:
On Jul 17, 9:47 am,XahLee xah...@gmail.com wrote:
2011-07-16
folks, this one will be interesting one.
the problem is to write a script that can check a dir of text files
(and all subdirs) and reports if a file has any
On 7/19/2011 2:15 AM, Thomas 'PointedEars' Lahn wrote:
Steven D'Aprano wrote:
Nulpum wrote:
I want to make sure that folder exists.
'2011-07-03' is really exists. but 'os.path.isdir' say false
Does anyone know why?
Yes.
print logs/2011-07-03
logs/2011-07-03
print logs\2011-07-03
On 19/07/11 18:54, Xah Lee wrote:
On Sunday, July 17, 2011 2:48:42 AM UTC-7, Raymond Hettinger wrote:
On Jul 17, 12:47 am, Xah Lee xah...@gmail.com wrote:
i hope you'll participate. Just post solution here. Thanks.
http://pastebin.com/7hU20NNL
just installed py3.
there seems to be a bug.
On Tue, Jul 19, 2011 at 10:54 AM, Xah Lee xah...@gmail.com wrote:
On Sunday, July 17, 2011 2:48:42 AM UTC-7, Raymond Hettinger wrote:
On Jul 17, 12:47 am, Xah Lee xah...@gmail.com wrote:
i hope you'll participate. Just post solution here. Thanks.
http://pastebin.com/7hU20NNL
just installed
On 19/07/11 19:49, Xah Lee wrote:
On Jul 17, 8:31 am, Thomas Jollans t...@jollybox.de wrote:
I thought I'd have some fun with multi-processing:
https://gist.github.com/1087682
hi Thomas. I ran the program, all cpu went max (i have a quad), but
after i think 3 minutes nothing happens, so i
On Jul 19, 10:33 am, Billy Mays
81282ed9a88799d21e77957df2d84bd6514d9...@myhashismyemail.com wrote:
On 07/19/2011 01:14 PM,XahLee wrote:
I added other unicode brackets to your list of brackets, but it seems
your code still fail to catch a file that has mismatched curly quotes.
Oh, by the way:
On 19/07/11 19:49, Xah Lee wrote:
I ran the program, all cpu went max
Mission accomplished.
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I used sys.path.append() to add to the path directory, but the changes
made are not saved when I exit the compiler. Is there a way to save
it?
Thank you.
--
http://mail.python.org/mailman/listinfo/python-list
On 07/19/2011 02:24 PM, Chess Club wrote:
Hello,
I used sys.path.append() to add to the path directory, but the changes
made are not saved when I exit the compiler. Is there a way to save
it?
Thank you.
Since python is running in a child process, it only affects its own
environment
On 2011-07-19, Matty Sarro wrote:
Hey everyone. I am currently reading through an RFC, and it mentions
that a client and server half of a transaction are embodied by finite
state machines. I am reading through the wikipedia article for finite
state machines, and sadly it's going a bit above
On 7/19/2011 6:41 AM, Morten Klim wrote:
Hello everyone!
I've started developing a little application for one of my friends,
which he will use at work to measure his hours working + the time he
has breaks. I wanna do this in python cause, I just started with this
language and wanna get more
Chess Club wrote:
Hello,
I used sys.path.append() to add to the path directory, but the changes
made are not saved when I exit the compiler. Is there a way to save
it?
Do you mean saved as in your PATH environment variable is now changed?
This would be bad. Not sure about *nix, but on M$
I've got a unit test suite which instantiates an HTTP client to test
our server. We depend on session cookies. To handle this, I've got:
def setUp(self):
self.cj = cookielib.CookieJar()
self.opener =
urllib2.build_opener(urllib2.HTTPCookieProcessor(self.cj))
This works fine
On 7/19/2011 2:12 PM, Xah Lee wrote:
Also, you may have answered this earlier but I'll ask again anyways: You
ask for the first mismatched pair, Are you referring to the inner most
mismatched, or the outermost? For example, suppose you have this file:
foo[(])bar
Would the ( be the first
In article mailman.1057.1310717193.1164.python-l...@python.org
Chris Angelico ros...@gmail.com wrote:
I agree that [C's ++ operators are] often confusing (i+j) ...
For what it is worth, this has to be written as:
i++ + ++j /* or i+++ ++j */
or similar (e.g., newline after the middle +
On 7/19/2011 1:00 PM, Micah wrote:
That sounds artificially backwards; why not let getToken() reuse peekToken()?
def peek(self):
if self.tok is None:
try:
self.tok = self.gen.next()
If this is changed (as intended for the iteration protocol) to
Ah, never mind. I found cookielib.debug = True, which told me
exactly what I needed to know. I did indeed have a hostname problem.
--
http://mail.python.org/mailman/listinfo/python-list
Well that's exactly the problem. My attempt to make this work, made
the counter go crazy and didn't care if it was paused or not. So for
this for work properly, remove following:
def _updatepause(self):
self._elapsedpause = time.time() - self._pausestart
On Jul 19, 8:55 pm, Terry Reedy tjre...@udel.edu wrote:
On 7/19/2011 6:41 AM, Morten Klim wrote:
Hello everyone!
I've started developing a little application for one of my friends,
which he will use at work to measure his hours working + the time he
has breaks. I wanna do this in
Hi,
I am a newbie - I have been teaching myself Python 3 since a few
months ago. My “self assignments” include some purely for fun. Among
them was using the turtle module to have multiple turtles running
around on the screen.
Recently one such fun turtle “project” showed strange behavior that I
On Jun 27, 1:29 pm, J.O. Aho u...@example.net wrote:
miamia wrote:
hello,
I find out that my program needs
Microsoft.VC90.CRT.manifest,msvcm90.dll,msvcp90.dll,msvcr90.dll files
when I want to run it on win 64bit systems. I find these files in
some other software.
Can I simply take
J.O. Aho u...@example.net wrote:
Read the EULA that comes with Microsoft Visual C++ Redistributable Package.
Chaz chaz.littlej...@gmail.com wrote:
PLEASE RESPOND WITH AN ANSWER NEXT TIME
READ THE EULA THAT COMES WITH THE MICROSOFT VISUAL C++ REDISTRIBUTABLE PACKAGE.
I hope that helps.
Scenario. I have a fifo named 'fifo' on my computer (ubuntu linux)
operating in nonblocking mode for both read and write. Under normal
operation all is good:
Interpreter 1 (writer)
import os
fd = os.open('fifo', os.O_WRONLY | os.O_NONBLOCK)
f = os.fdopen(fd,'wb')
f.write('k')
f.flush()
What is wrong with them:
1. Designed for other languages, particularly C++, tcl and Java.
2. Bloatware. Qt and wxWidgets are C++ application frameworks. (Python
has a standard library!)
3. Unpythonic memory management: Python references to deleted C++
objects (PyQt). Manual dialog destruction
In article
40996f2a-4ed8-4388-ae1a-6f81f57a4...@f17g2000prf.googlegroups.com,
Aaron Staley usaa...@gmail.com wrote:
Scenario. I have a fifo named 'fifo' on my computer (ubuntu linux)
operating in nonblocking mode for both read and write. Under normal
operation all is good:
Interpreter 1
On 7/19/2011 6:02 PM, EricC wrote:
Hi,
I am a newbie - I have been teaching myself Python 3 since a few
months ago. My “self assignments” include some purely for fun. Among
them was using the turtle module to have multiple turtles running
around on the screen.
Recently one such fun turtle
On 7/19/2011 10:12 PM, sturlamolden wrote:
What is wrong with them:
1. Designed for other languages, particularly C++, tcl and Java.
2. Bloatware. Qt and wxWidgets are C++ application frameworks. (Python
has a standard library!)
3. Unpythonic memory management: Python references to deleted
-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160
There's PyGUI, which, at a glance, fits whit what you want. Looks like
it uses OpenGL and native GUI facilities.
http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
It has quite a few external dependencies, though (different dependencies
for
OK, I'll bite...
On 7/19/11 10:12 PM, sturlamolden wrote:
1. Designed for other languages, particularly C++, tcl and Java.
So? Doing a GUI toolkit is a hard project.
2. Bloatware. Qt and wxWidgets are C++ application frameworks. (Python
has a standard library!)
Again, so? This isn't
On Jul 19, 9:19 pm, Aaron Staley usaa...@gmail.com wrote:
However, if interpreter 1 overfills the FIFO, we get an error (EAGAIN)
f.write('a'*7)
IOError: [Errno 11] Resource temporarily unavailable
However interpreter 2 still receives data len(f.read())
65536
It looks like
I have three items in a dict, like this:
the_dict = {'a':1, 'b':2, 'c':3}
but the vals could be anything. I want to configure something else
based on the winner of such a dict, with these rules:
1. In this dict, if there is a UNIQUE max value, that's the winner.
2. If there are any TIES for
On Wed, 20 Jul 2011 01:17 pm CM wrote:
I have three items in a dict, like this:
the_dict = {'a':1, 'b':2, 'c':3}
but the vals could be anything. I want to configure something else
based on the winner of such a dict, with these rules:
1. In this dict, if there is a UNIQUE max value,
On Wed, 20 Jul 2011 12:12 pm sturlamolden wrote:
What is wrong with them:
[...]
4. They might look bad (Tkinter, Swing with Jython).
Have you tried Tkinter version 8.0 or better, which offers a native look and
feel?
5. All projects to write a Python GUI toolkit die before they are
On Tue, Jul 19, 2011 at 8:17 PM, CM cmpyt...@gmail.com wrote:
I have three items in a dict, like this:
the_dict = {'a':1, 'b':2, 'c':3}
but the vals could be anything. I want to configure something else
based on the winner of such a dict, with these rules:
1. In this dict, if there is a
On Jul 19, 11:17 pm, CM cmpyt...@gmail.com wrote:
I have three items in a dict, like this:
the_dict = {'a':1, 'b':2, 'c':3}
but the vals could be anything. I want to configure something else
based on the winner of such a dict, with these rules:
1. In this dict, if there is a UNIQUE max
1. In this dict, if there is a UNIQUE max value, then its *key* is the
winner.
2. If there are any TIES for max value, then the *key* 'b' is the
winner by default.
This will store the max value(s) in a list. In case of a tie, you can
take the first value in the list, but it may be different
Terry J. Reedy tjre...@udel.edu added the comment:
Yes, that would be great. It is better than my initial suggestion.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12434
___
Petter Haggholm pet...@petterhaggholm.net added the comment:
It’s my pleasure — it’s very trivial, but hopefully it’ll get my feet wet and
get me in a place where I am familiar enough with procedures and things to
contribute something relevant. :)
Attaching a modified patch with (1) reversion
Senthil Kumaran sent...@uthcode.com added the comment:
Hi Petter, writing tests are ofcourse a good way to start. As long as the tests
increase the coverage, those are most welcome. Thanks!
--
assignee: - orsenthil
___
Python tracker
Sébastien Sablé sa...@users.sourceforge.net added the comment:
Hi,
sorry for the late reply.
STINNER Victor added the comment:
At least, I would like to know if Sébastien Sablé (the author of the original
patch) changed his opinion about this issue since 2007 ;-)
I haven't changed my
Eric V. Smith e...@trueblade.com added the comment:
I finally got around to reviewing the patch. A couple of comments:
1. There should be some tests for str.__format__, not just str.format. This is
really a bug with str.__format__, after all. I can add those.
2. The bigger issue is that the
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:
I'd like to reopen this, as it doesn't seem to be a duplicate of #8084.
Specifically, test_getsitepackages in test_sitepackages appears to be wrong,
since it has a correct test for platform builds later in the method, but the
failure
Éric Araujo mer...@netwok.org added the comment:
The sequence ABCs do not require slicing support.
Understood, but is it said in the docs? David said that he couldn’t find that
bit of info, which is why I suggested a doc bug.
--
___
Python tracker
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment:
Here is something unsorted and loose:
- @neologix:
One could argue that something had happened before the fsync(2),
so that code which blindly did so is too dumb to do any right
decision anyway. Even PEP 3151 won't help.
-
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment:
If Nir's analysis is right, and Antoines comment pushes me into
this direction, (i personally have not looked at that code),
then multiprocessing is completely brain-damaged and has been
implemented by a moron.
And yes, I know this
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +r.david.murray
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3232
___
___
Python-bugs-list
Steffen Daode Nurpmeso sdao...@googlemail.com added the comment:
Um, and just to add: i'm not watching out for anything, and it won't
and it can't be me:
?0%0[steffen@sherwood sys]$ grep -F smp CHANGELOG.svn -B3 | grep -E
'^r[[:digit:]]+' | tail -n 1
r162 | steffen | 2006-01-18 18:29:58 +0100
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +eric.araujo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12575
___
___
Python-bugs-list
Changes by Éric Araujo mer...@netwok.org:
--
stage: - commit review
title: non-framework built python fails to define environ properly -
non-framework python fails to define os.environ properly
versions: +Python 3.3 -Python 3.1
___
Python tracker
1 - 100 of 180 matches
Mail list logo