On 2/7/2013 12:47 AM, Tim Roberts wrote:
Steven D'Aprano wrote:
Does anyone have an explanation why Decimal 0**0 behaves so differently from
float 0**0?
...
I am familiar with the arguments for treating 0**0 as 0, or undefined, but
thought that except for specialist use-cases, it was standard
Heureka!
Am 06.02.2013 15:37, schrieb Dave Angel:
> def myfunc2(i):
def myfunc2b():
print ("myfunc2 is using", i)
return myfunc2b
Earlier you wrote:
There is only one instance of i, so it's not clear what you expect.
Since it's not an argument to test(), it has to be found
- Original Message -
> Hi Python experts,
> I am working with an array of data and am trying to plot several
> columns of data which are not continuous; i.e. I would like to plot
> columns 1:4 and 6:8, without plotting column 5. The syntax I am
> currently using is:
> oplot (t,d[:,0:4])
Thank you for the answers! It was much simpler than I thought.
On Wednesday, 6 February 2013 17:49:06 UTC+1, Alain Ketterlin wrote:
> Julien Le Goff writes:
>
>
>
> > Today I came accross a behaviour I did not expect in python (I am
>
> > using 2.7). In my program, random.random() always see
rh wrote:
> I am curious to know if others would have done this differently. And if so
> how so?
>
> This converts a url to a more easily managed filename, stripping the
> http protocol off.
>
> This:
>
> http://alongnameofasite1234567.com/q?sports=run&a=1&b=1
>
> becomes this:
>
> alongname
On 7 February 2013 09:37, Jean-Michel Pichavant wrote:
> - Original Message -
>
>> Hi Python experts,
>> I am working with an array of data and am trying to plot several
>> columns of data which are not continuous; i.e. I would like to plot
>> columns 1:4 and 6:8, without plotting column 5
ciscorucin...@gmail.com writes:
> Basically I am creating a program that will stream musical notes into
> a program called Lilypond one-by-one and it will create the sheet
> music for that stream of music via OS command. Your understanding of
> Lilypond is not needed, but you need to know that for
On 7 fév, 04:04, Steven D'Aprano wrote:
> On Wed, 06 Feb 2013 13:55:58 -0800, Demian Brecht wrote:
> > Well, an alternative /could/ be:
>
> ...
> py> s = 'http://alongnameofasite1234567.com/q?sports=run&a=1&b=1'
> py> assert u2f(s) == mangle(s)
> py>
> py> from timeit import Timer
> py> setup = 'f
Hi Dennis,
I really appreciate your input :-)
Dennis Lee Bieber wrote:
> I'll confess that I've not looked at any such sites -- mainly
> because I wouldn't understand enough about the sport to understand why
> one would do something one way or another.
You better do not. The first one I h
On Thu, Feb 7, 2013 at 10:08 PM, jmfauth wrote:
> The future is bright for ... ascii users.
>
> jmf
So you're admitting to being not very bright?
*ducks*
Seriously jmf, please don't hijack threads just to whine about
contrived issues of Unicode performance yet again. That horse is dead.
Go fork
On Thu, Feb 7, 2013 at 6:08 PM, Paul Rubin wrote:
> Any idea of a good way to map the file descriptors back to socket
> objects? Is there some kind of hidden interface that I don't know
> about, that gives back sockets directly?
I don't know of any, but you can get the file descriptor from a soc
Hi RH,
translate methods might be faster (and a little easier to read) for your use
case. Just precompute and re-use the translation table punct_flatten.
Note that the translate method has changed somewhat for Python 3 due to the
separation of text from bytes. The is a Python 3 version.
from u
* Julien Le Goff [2013-02-06 08:28:24 -0800]:
> Hi everyone,
>
> Today I came accross a behaviour I did not expect in python (I am using 2.7).
> In my program, random.random() always seemed to return the same number; it
> turned out to be related to the fact that I was using os.fork.
>
> See
Thank you for your reply.
Actually I wanted to post it on the list but didn't notice that it went only to
your email.
For the shape file part: yes I have a sample patients' data in a shape file
with the patients' address locations (where the lat/long for the addresses are
available) and these
On 2013-02-06 7:04 PM, "Steven D'Aprano"
wrote:
>I dispute those results. I think you are mostly measuring the time to
>print the result, and I/O is quite slow.
Good call, hadn't even considered that.
>My tests show that using urlparse
>is 33% faster than using regexes, and far more understanda
I'm just making the transition from 2 to 3 for one module.
With Python 2.7, I had the benefit of mx datetime, but this is not yet
available for Python 3.2.
I find that the 3.2 datetime is not subclassable, for reasons that were
known some years back.
It would help if there was a note in the
Chris Angelico writes:
> fd_to_sock={sock.fileno():sock for sock in list_of_sockets}
> You'd need to manually maintain that as sockets get created/destroyed,
> though
Thanks, I was hoping to avoid that. I'll have to check how
select.select manages to return sockets. Maybe it builds such a dict
On Fri, Feb 8, 2013 at 3:15 AM, Paul Rubin wrote:
> Chris Angelico writes:
>> fd_to_sock={sock.fileno():sock for sock in list_of_sockets}
>> You'd need to manually maintain that as sockets get created/destroyed,
>> though
>
> Thanks, I was hoping to avoid that. I'll have to check how
> select.se
On 07.02.13 11:49, Peter Otten wrote:
ILLEGAL = "-:./?&="
try:
TRANS = string.maketrans(ILLEGAL, "_" * len(ILLEGAL))
except AttributeError:
# python 3
TRANS = dict.fromkeys(map(ord, ILLEGAL), "_")
str.maketrans()
--
http://mail.python.org/mailman/listinfo/python-list
ciscorucin...@gmail.com writes:
> Hello,
>
> I have been using Python for a few months now, so I am still learning a few
> things here and there.
>
> Basically I am creating a program that will stream musical notes into a
> program called Lilypond one-by-one and it will create the sheet music fo
On Thu, Feb 7, 2013, at 10:13 AM, Colin J. Williams wrote:
> I'm just making the transition from 2 to 3 for one module.
>
> With Python 2.7, I had the benefit of mx datetime, but this is not yet
> available for Python 3.2.
>
> I find that the 3.2 datetime is not subclassable, for reasons that
Dear Group,
If any one can kindly help me with a simple Forward Backward algorithm
implementation. I tried to search in web but did not help much.
Thanking You in Advance,
Regards,
Subhabrata.
--
http://mail.python.org/mailman/listinfo/python-list
=
Contact : REQUEST(at)TESTBANKLIST(dot)COM
Website: TESTBANKLIST(dot)COM
http://testbanklist.com
==
Western Civilization: Beyond Boundari
Chris Angelico writes:
> Yeah, I figured fileno() probably wouldn't be news to you. I don't
> suppose there's anything convenient in the rest of your application
> that makes such a list/dict plausible?
In fact it's rather annoying, sockets are created and destroyed in
multiple places in the pro
On 02/07/2013 03:13 PM, subhabangal...@gmail.com wrote:
Dear Group,
If any one can kindly help me with a simple Forward Backward algorithm
implementation. I tried to search in web but did not help much.
Thanking You in Advance,
Regards,
Subhabrata.
No idea what forward-backward-algorithm is.
I'm attempting to parse an RSS feed for the first instance of an element "".
def pageReader(url):
try:
readPage = urllib2.urlopen(url)
except urllib2.URLError, e:
# print 'We failed to reach a server.'
# print 'Reason: ', e.reason
return 404
except urllib2.HTTPError, e:
# print('
In <16828a11-6c7c-4ab6-b406-6b8819883...@googlegroups.com>
darrel.rend...@gmail.com writes:
> def pageReader(url):
> try:
> readPage =3D urllib2.urlopen(url)
> except urllib2.URLError, e:
> # print 'We failed to reach a server.'
> # print 'Reason: ', e.reason
> return 404 =20
> except
On 07Feb2013 02:43, Steven D'Aprano
wrote:
| On Thu, 07 Feb 2013 10:06:32 +1100, Cameron Simpson wrote:
| > Timing. (Let me say I consider this scenario unlikely, very unlikely.
| > But...)
| > If the latter is consistently slightly slower
|
| On my laptop, the difference is of the order of 10
rh wrote:
> I am using 2.7.3 and I put the re.compile outside the function and it
> performed faster than urlparse. I don't print out the data.
I find that hard to believe. re.compile caches its results, so except for
the very first time it is called, it is very fast -- basically a function
call
Chris Angelico wrote:
> On Thu, Feb 7, 2013 at 5:50 PM, Steven D'Aprano
> wrote:
>> On Thu, 07 Feb 2013 16:28:17 +1100, Chris Angelico wrote:
>>
>>> You misunderstand. It's actually a very simple rule. Python follows C's
>>> principle of accepting that any return value from an expression should
>
Dennis Lee Bieber wrote:
> On Thu, 7 Feb 2013 11:33:00 + (UTC), Steffen Mutter
> declaimed the following in
> gmane.comp.python.general:
>> CREATE TABLE "Runde20122013" (
>
> Is that table name specifying a playing season?
Yes.
> What happens next
> season -- you create a new table an
Dennis Lee Bieber wrote:
> Line 3 has unquoted "echo" which is not a REXX command; it is
> considered an external command and is passed the /result/ of calling
> REXX time() -- where Windows executes it
Good lord, that's even worse than I feared. So it's not just unparsable
non-REXX code that is
import objc
def clickMouse(x, y, button):
bndl = objc.loadBundle('CoreGraphics', globals(),
'/System/Library/Frameworks/ApplicationServices.framework')
objc.loadBundleFunctions(bndl, globals(), [('CGPostMouseEvent',
'v{CGPoint=ff}III')])
CGPostMouseEvent((x, y), 1, button, 1)
CG
Tim Roberts wrote:
> Steven D'Aprano wrote:
>>
>>Does anyone have an explanation why Decimal 0**0 behaves so differently
>>from float 0**0?
>>...
>>I am familiar with the arguments for treating 0**0 as 0, or undefined, but
>>thought that except for specialist use-cases, it was standard practice f
rh wrote:
> On Fri, 08 Feb 2013 09:45:41 +1100
> Steven D'Aprano wrote:
>
>> rh wrote:
>>
>> > I am using 2.7.3 and I put the re.compile outside the function and
>> > it performed faster than urlparse. I don't print out the data.
>>
>> I find that hard to believe. re.compile caches its results
Real-time...as close to real-time as possible. That is why I did not really
want to use a queue. That is because if a bunch of the thread that create the
images finish really close to one another (when they should be spread out based
on how the music is played), then there would be a larger "lag
On 2/7/2013 6:22 PM, joaofguio...@gmail.com wrote:
import objc
def clickMouse(x, y, button): bndl = objc.loadBundle('CoreGraphics',
globals(),
'/System/Library/Frameworks/ApplicationServices.framework')
objc.loadBundleFunctions(bndl, globals(), [('CGPostMouseEvent',
'v{CGPoint=ff}III')]) CGPo
On Thu, Feb 7, 2013 at 5:55 PM, Ian Kelly wrote:
> Whatever caching is being done by re.compile, that's still a 24%
> savings by moving the compile calls into the setup.
On the other hand, if you add an re.purge() call to the start of t1 to
clear the cache:
>>> t3 = Timer("""
... re.purge()
...
So, it's taken me a little while longer than I figured to actually get the
time to dig around for the question that I had (added to the bottom of
this message for context).. Pretty mundane stuff, but I did the digging
(3.4.0a). Hopefully the results will help anyone else with the same
questions.
h
On 8 February 2013 00:48, wrote:
> Real-time...as close to real-time as possible. That is why I did not really
> want to use a queue. That is because if a bunch of the thread that create the
> images finish really close to one another (when they should be spread out
> based on how the music is
Paul Rubin writes:
> Chris Angelico writes:
>> Yeah, I figured fileno() probably wouldn't be news to you. I don't
>> suppose there's anything convenient in the rest of your application
>> that makes such a list/dict plausible?
>
> In fact it's rather annoying, sockets are created and destroyed
On 02/07/2013 06:22 PM, joaofguio...@gmail.com wrote:
import objc
def clickMouse(x, y, button):
bndl = objc.loadBundle('CoreGraphics', globals(),
'/System/Library/Frameworks/ApplicationServices.framework')
objc.loadBundleFunctions(bndl, globals(), [('CGPostMouseEvent',
'v{CGPoint=ff
On Wednesday, February 6, 2013 7:36:28 PM UTC-6, Ethan Furman wrote:
> As Michael Torrie pointed out, the 'global' keyword is needed:
Wrong. The global keyword is in fact NOT needed and something i consider to be
another wart of the language (PyWart on this subject coming soon!).
Now, whilst Mi
Ian Kelly wrote:
> On Thu, Feb 7, 2013 at 4:59 PM, Steven D'Aprano
> wrote:
>> Oh, one last thing... pulling out "re.compile" outside of the function
>> does absolutely nothing. You don't even compile anything. It basically
>> looks up that a compile function exists in the re module, and that's a
On 2/7/2013 8:09 PM, Demian Brecht wrote:
http://demianbrecht.github.com/posts/2013/02/07/understanding-len/
When len() is called passing an immutable built-in type (such as a
string), I'd assume that the overhead in doing so is simply a function
call and there are no on-call calculations do
which situations should we use thread. join() ?
http://bpaste.net/show/yBDGfrlU7BDDpvEZEHmo/
why do we not put thread. join() in this code ?
--
http://mail.python.org/mailman/listinfo/python-list
Python's use of namespaces is, as we all quite know, "one honking great idea!";
and i must wholeheartedly agree, however, accessing and declaring variables
living in python namespaces is a kludge at best, and a malevolent obfuscation
at worst!
On Friday, February 8, 2013 2:08:35 AM UTC+5:30, Dave Angel wrote:
> On 02/07/2013 03:13 PM, subhabangal...@gmail.com wrote:
>
> > Dear Group,
>
> > If any one can kindly help me with a simple Forward Backward algorithm
> > implementation. I tried to search in web but did not help much.
>
> >
>
On Thursday 2013 February 07 12:38, Dave Angel wrote:
> On 02/07/2013 03:13 PM, subhabangal...@gmail.com wrote:
> > Dear Group,
> > If any one can kindly help me with a simple Forward Backward algorithm
> > implementation. I tried to search in web but did not help much.
> >
> > Thanking You in Adva
On Thursday 2013 February 07 12:36, darrel.rend...@gmail.com wrote:
> As I've said, BeautifulSoup fails to find both pubDate and Link, which are
> crucial to my app
> Any advice would be greatly appreciated.
http://packages.python.org/feedparser
--
Yonder nor sorghum stenches shut ladle gulls st
On Monday, July 16, 2012 7:43:47 PM UTC-5, Steven D'Aprano wrote:
>
> [...]
>
> If I insist on making a single object do duty for both the jar and the
> jellybean count, then I need a "null jar object", and I probably end up
> with something like this:
>
> Jar(number_of_beans=None) => null ja
On Monday, July 16, 2012 8:45:51 PM UTC-5, rusi wrote:
> On Jul 15, 9:50 pm, Rick Johnson wrote:
> > I think this issue is not so much a "bool test" vs "type
> > test", but more an ambiguous syntax issue.
> >
>
> If you know some English, its clear that if and while
> create bool contexts.
Wr
Hi, I'm being forced to use "import MySQLdb" to access a serverand
am not getting all my data back.
I'm trying to send multiple queries all at once (for time reasons) and
then extract the rows in bulk.
The queries have different number of columns; For a contrived example;
script.db.query
On 02/07/2013 07:14 PM, Rick Johnson wrote:
> On Wednesday, February 6, 2013 7:36:28 PM UTC-6, Ethan Furman wrote:
>> As Michael Torrie pointed out, the 'global' keyword is needed:
>
> Wrong. The global keyword is in fact NOT needed and something i
> consider to be another wart of the language (Py
On Fri, Feb 8, 2013 at 4:53 PM, Rick Johnson
wrote:
> And which Univeristy would you recommend for studying the intricacies of
> "gobbledygook"? ;-)
Dunno, where'd you get your degree in logic?
*dives for cover*
ChrisA
--
http://mail.python.org/mailman/listinfo/python-list
On Monday, July 16, 2012 11:18:28 PM UTC-5, Devin Jeanpierre wrote:
> On Mon, Jul 16, 2012 at 12:03 AM, Steven D'Aprano wrote:
> > On Sun, 15 Jul 2012 22:15:13 -0400, Devin Jeanpierre wrote:
> >
> >> For example, instead of "if stack:" or "if bool(stack):", we could use
> >> "if stack.isempty():".
On 02/07/2013 09:30 PM, Rick Johnson wrote:
> count = 0
> class Blah:
> def meth():
> for x in range(100):
> count = x
>
> Where is count living?
>
> Of course in this simplistic example we can see that count is @
> module level
Except that it's not after the "count=
On Tuesday, July 17, 2012 8:35:09 PM UTC-5, alex23 wrote:
> On Jul 17, 6:23 pm, Andrew Berg wrote:
>
> > On 7/17/2012 2:08 AM, Steven D'Aprano wrote:
>
> > > The default behaviour is that every object is something, hence true-like,
>
> > > unless explicitly coded to be treated as false-like. Si
On Fri, Feb 8, 2013 at 3:30 PM, Rick Johnson
wrote:
> It is my strong opinion that all "unqualified" variables must be local to the
> containing block, func/meth, class, or module. To access any variable outside
> of the local scope a programmer MUST qualify that variable with the func,
> class
On 2013-02-07 8:30 PM, "Terry Reedy" wrote:
>So you may assume
I've been bitten far too many times by incorrect assumptions about
implementations that ended up actually doing something quite silly. Having
said that, I felt fairly safe in making that assumption with Python, but
figured I'd write s
On 02/07/2013 11:16 PM, Rick Johnson wrote:
> He is so accustomed to "guessing" that it has become second nature
> for him.
I think most of us are guessing as to what you're talking about since
you're responding to a 7 month old thread that I think most people have
long since deleted from their e-
On Fri, Feb 8, 2013 at 3:32 PM, iMath wrote:
> which situations should we use thread. join() ?
> http://bpaste.net/show/yBDGfrlU7BDDpvEZEHmo/
> why do we not put thread. join() in this code ?
I've no idea why you don't put thread.join() in that code. Maybe
because it isn't needed, maybe because
On 02/07/2013 06:13 PM, rh wrote:
On Fri, 08 Feb 2013 09:45:41 +1100
Steven D'Aprano wrote:
But since you don't demonstrate any actual working code, you could be
correct, or you could be timing it wrong. Without seeing your timing
code, my guess is that you are doing it wrong. Timing code is
On Tuesday, July 17, 2012 8:35:09 PM UTC-5, alex23 wrote:
> On Jul 17, 6:23 pm, Andrew Berg wrote:
> > On 7/17/2012 2:08 AM, Steven D'Aprano wrote:
> > > The default behaviour is that every object is something, hence true-like,
> > > unless explicitly coded to be treated as false-like. Since both
On Friday, February 8, 2013 12:27:09 AM UTC-6, Michael Torrie wrote:
> On 02/07/2013 11:16 PM, Rick Johnson wrote:
> > He is so accustomed to "guessing" that it has become second nature
> > for him.
>
> I think most of us are guessing as to what you're talking about since
> you're responding to a
On Friday, February 8, 2013 12:25:34 AM UTC-6, Chris Angelico wrote:
> On Fri, Feb 8, 2013 at 3:30 PM, Rick Johnson wrote:
> > It is my strong opinion that all "unqualified" variables must be local to
> > the containing block, func/meth, class, or module. To access any variable
> > outside of the
Rick Johnson wrote:
> Why even have a damn bool function if you're never going to use it?
bool is for converting arbitrary objects into a canonical True or False
flag. E.g. one use-case is if you wish to record in permanent storage a
flag, and don't want arbitrary (possibly expensive) objects to
On Fri, Feb 8, 2013 at 6:23 PM, Rick Johnson
wrote:
> from builtins import print, len, repr
> from builtins import * # This is not recommended!
>
> This would serve two purposes (1) the reader would know which builtins where
> being used in this module (2) the names would be bound prop
68 matches
Mail list logo