Ian Kelly wrote:
On Wed, Dec 24, 2014 at 1:34 PM, Rustom Mody rustompm...@gmail.com
wrote:
+1 for the slice in succinct form
Not only more succinct but also more correct. The purpose of islice is to
slice arbitrary iterables as opposed to just sequences. But this function
requires a
Hello,
Is it possible in python:
if ((x = a(b,c)) == 'TRUE'):
print x
Thanks.
--
https://mail.python.org/mailman/listinfo/python-list
Is it possible in python:
if ((x = a(b,c)) == 'TRUE'):
print x
Nope. Assignment is not allowed in a conditional.
Cheers,
Daniel
Thanks.
--
https://mail.python.org/mailman/listinfo/python-list
--
Psss, psss, put it down! - http://www.cafepress.com/putitdown
--
On Thu, Dec 25, 2014 at 8:18 AM, JC chalao.a...@gmail.com wrote:
Hello,
Is it possible in python:
if ((x = a(b,c)) == 'TRUE'):
print x
No, assignments in Python are statements, not expressions.
--
https://mail.python.org/mailman/listinfo/python-list
Hi all,
I was using sl4a for quite some time on android and it basically
worked very well although some features are missing. It looks like
sl4a is dead, although I could be wrong. Does anyone knowledgeable
have any further info on the future of sl4a? For instance it doesn't
work with android 5
One line assignment is ok, but, seems like you can't perform actions.
#the following will work:
I = 1 if True else 2
#but the following will generate an error:
if I == 1: print(one)
And, not sure if/how to work around that second one myself.
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
One line assignment is ok, but, seems like you can't perform actions.
#the following will work:
I = 1 if True else 2
#but the following will generate an error:
if I == 1: print(one)
And, not sure if/how to work around that second one myself.
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
I don't get an error.
I = 1 if True else 2
if I == 1: print(one)
...
one
What error did you get?
Skip
--
https://mail.python.org/mailman/listinfo/python-list
On Thursday, December 25, 2014 10:16:54 AM UTC-6, Jacob Kruger wrote:
One line assignment is ok, but, seems like you can't perform actions.
#the following will work:
I = 1 if True else 2
#but the following will generate an error:
if I == 1: print(one)
Only if I is undefined.
--
On Tue, 23 Dec 2014 20:28:30 -0500, Dave Tian wrote:
Hi,
There are 2 statements:
A: a = ‘h’
B: b = ‘hh’
According to me understanding, A should be faster as characters would
shortcut this 1-byte string ‘h’ without malloc; B should be slower than
A as characters does not work for 2-byte
try kivy, instead of sl4a http://kivy.org/
I believe in the past year or two, the python foundation gave a grant to
kivy to add further functionality..
According to wikipedia http://en.wikipedia.org/wiki/Guido_van_Rossum Guido
works for dropbox.
Billy
On Thu, Dec 25, 2014 at 9:31 AM,
On Thursday, December 25, 2014 9:19:25 AM UTC-6, JC wrote:
Hello,
Is it possible in python:
if ((x = a(b,c)) == 'TRUE'):
print x
Thanks.
Could you not simply rephrase:
result = foo()
if result == 'TRUE':
do_something()
Of course, another oddity is fact that
Actually more that in the interpreter, it's prompting me with ... as if I had
left out a closing ) or something, but, suppose it could work fine in an actual
imported bit of code?
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
Roger Wilco wants to welcome you...to the space janitor's
Actually more that in the interpreter, it's prompting me with ... as if I
had left out a closing ) or something, but, suppose it could work fine in
an actual imported bit of code?
That's how it's supposed to work. Given that Python block structure is
determined by indentation, you need some way
Ok, makes sense - just slipped same one line if: action bit of code inside a
function, and worked fine.
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
Roger Wilco wants to welcome you...to the space janitor's closet...
- Original Message -
From: Skip Montanaro
To: Jacob
Ok, makes sense - just slipped same one line if: action bit of code inside a
function, and worked fine.
Stay well
Jacob Kruger
Blind Biker
Skype: BlindZA
Roger Wilco wants to welcome you...to the space janitor's closet...
- Original Message -
From: Skip Montanaro
To: Jacob
On 12/25/14, Billy Earney billy.ear...@gmail.com wrote:
try kivy, instead of sl4a http://kivy.org/
I believe in the past year or two, the python foundation gave a grant to
kivy to add further functionality..
Thanks, I didn't know about kivy but it looks quite nice, will give it a try!
From: joshuaemsteves joshuaemste...@yahoo.com
There is a familiar chance Pdf to Doc wasn't going to take off as long as
don't be an idiot and use this pdf to docx converter. I expect this was a
bad hypothesis, but you really have to open your mind. While Pdf to Doc is
used in those situations,
On 24/12/2014 2:20 AM, Grant Edwards wrote:
And even _with_ all the technical jibber-jabber, none of it explained
or justified the whole writing a virus to infect the brain through
the optic nerve thing which might just have well been magick and
witches.
While I love SNOW CRASH, I do think
On 24/12/2014 9:50 PM, alister wrote:
what feels like 3 or 4 chapters in it is still trying to set the scene,
an exercise in stylish writing with very little content so far.
even early scifi written for magazines on a per word basis were not this
excessive (because if they were they would
On 26/12/2014 1:18 AM, JC wrote:
Is it possible in python:
if ((x = a(b,c)) == 'TRUE'):
print x
One approach is to use a function in the condition to do the assignment:
x = None
def assign_to_x(val):
global x
x = val
return val
def a(x, y):
I would like to parse the VIN, frame and engine numbers found on this page
(below). I don't really know any regex, I have looked a little at
pyparsing. I have some other similar numbers to. I am looking for
suggestions, which tool should I learn, how should I approach this.
On Thu, Dec 25, 2014 at 4:02 PM, Vincent Davis vinc...@vincentdavis.net wrote:
I would like to parse the VIN, frame and engine numbers found on this page
(below). I don't really know any regex, I have looked a little at pyparsing.
I have some other similar numbers to. I am looking for
These are vintage motorcycles so the VIN's are not like modern VIN's
these are frame numbers and engine number.
I don't want to parse the page, I what a function that given a VIN (frame
or engine number) returns the year the bike was made.
Vincent Davis
720-301-3003
On Thu, Dec 25, 2014 at 5:56
On 2014-12-25 17:59, Vincent Davis wrote:
These are vintage motorcycles so the VIN's are not like modern
VIN's these are frame numbers and engine number.
I don't want to parse the page, I what a function that given a VIN
(frame or engine number) returns the year the bike was made.
While I've
Vincent Davis vinc...@vincentdavis.net writes:
I don't want to parse the page, I what a function that given a VIN
(frame or engine number) returns the year the bike was made.
So the page has a collection of tables which the reader can use to
manually look up the VIN, or elements of the VIN, to
Tim and Ben,
Thanks for your input, I am working on it now and will come back when I
have questions.
Any comment on using pyparsing VS regex
Vincent Davis
720-301-3003
On Thu, Dec 25, 2014 at 7:18 PM, Ben Finney ben+pyt...@benfinney.id.au
wrote:
Vincent Davis vinc...@vincentdavis.net writes:
On 2014-12-25 19:58, Vincent Davis wrote:
Any comment on using pyparsing VS regex
If the VIN had any sort of regular grammar (especially if it involved
nesting) then pyparsing would have value.
I defaulted to regexp (1) because it's available out of the box, and
(2) while it might be overkill,
You're extracting structured data from an html file. You might want to look
at the lxml.etree module. (I think that's where ElementTree landed when it
was adopted into the stdlib).
Skip
--
https://mail.python.org/mailman/listinfo/python-list
JC wrote:
Hello,
Is it possible in python:
if ((x = a(b,c)) == 'TRUE'):
print x
Fortunately, no. Assignment as an expression is an anti-pattern and a bug
magnet.
The above is best written as:
if a(b,c) == 'TRUE':
print 'TRUE'
If you need the result of calling the a()
alex23 wrote:
On 26/12/2014 1:18 AM, JC wrote:
Is it possible in python:
if ((x = a(b,c)) == 'TRUE'):
print x
One approach is to use a function in the condition to do the assignment:
Let me fix that for you:
/s/approach/bad idea/
All you have done is replace one anti-pattern
alex23 wrote:
On 24/12/2014 2:20 AM, Grant Edwards wrote:
And even _with_ all the technical jibber-jabber, none of it explained
or justified the whole writing a virus to infect the brain through
the optic nerve thing which might just have well been magick and
witches.
While I love SNOW
On Wed, Dec 24, 2014 at 5:21 AM, Rustom Mody rustompm...@gmail.com wrote:
On Tuesday, December 23, 2014 6:30:30 PM UTC+5:30, shawool wrote:
Thank you for answering my query.
Fonts and colors are reset to defaults now. Sorry for the inconvenience
caused.
Regards,
Shawool
Sorry for the
Fetchinson . wrote:
Guido is still working at google, right?
No. Google is still using Python for lots of things, but Guido is now
working for Dropbox.
https://www.python.org/~guido/
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes:
However, be warned that there are two subtly different models for
delegation. Here's the one that people seem to forget:
http://code.activestate.com/recipes/519639-true-lieberman-style-delegation-in-python/
Very interesting!
The
On 26/12/2014 1:37 PM, Steven D'Aprano wrote:
One approach is to use a function in the condition to do the assignment:
Let me fix that for you:
/s/approach/bad idea/
I never said it was a _good_ approach ;)
And you don't even save any lines! Instead of a one-liner, you have six
lines!
Vincent Davis vinc...@vincentdavis.net writes:
Any comment on using pyparsing VS regex
A full-blown parser (with ‘pyparsing’) is overkill for this.
Even regular expressions isn't needed.
The built-in text type (‘str’) in Python 3 should have everything you
need; you only need to match
Vajrasky Kok added the comment:
Here is the latest patch which executes unittest.main inside __main__ based on
R. David Murray's review. Thanks!
--
Added file: http://bugs.python.org/file37540/add_unit_test_os_chown_v7.patch
___
Python tracker
New submission from Josep Portella Florit:
To reproduce:
1) Create directory foo in the current directory.
2) Run python -m SimpleHTTPServer or python3 -m http.server.
3A) Point web browser to http://127.0.0.1:8000/foo/?;.
The request is redirected to http://127.0.0.1:8000/foo/?/;.
The
New submission from John Firestone:
Python 2.7.8 (v2.7.8:ee879c0ffa11, Jun 29 2014, 21:07:35)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type help, copyright, credits or license for more information.
def outer():
... def inner(arg):
... len(arg)
... exec('', {})
...
John Firestone added the comment:
Sorry. Duplicates 21591
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23113
___
___
Changes by R. David Murray rdmur...@bitdance.com:
--
resolution: - duplicate
stage: - resolved
superseder: - exec(a, b, c) not the same as exec a in b, c in nested
functions
___
Python tracker rep...@bugs.python.org
Changes by STINNER Victor victor.stin...@gmail.com:
--
nosy: +pitrou, serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23107
___
___
STINNER Victor added the comment:
I'm going to commit check_thread-3.patch if nobody complains: in debug mode,
call_soon(), call_at() and call_later() now check threading.get_ident() to
ensure that they are called from the thread running the event loop.
--
Added file:
STINNER Victor added the comment:
testfun(objid(), c_wchar_p('test'))
I'm not sure that the objid object lives until testfun() is called. It would be
safer to write:
o = objid()
testfun(o, c_wchar_p('test')))
o = None
--
nosy: +haypo
___
Python
Changes by STINNER Victor victor.stin...@gmail.com:
--
title: [Windows x86-64] Incorrect function call - [Windows x86-64] ctypes:
Incorrect function call
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23104
Roundup Robot added the comment:
New changeset 32c5b9aeee82 by R David Murray in branch 'default':
#20069: Add tests for os.chown.
https://hg.python.org/cpython/rev/32c5b9aeee82
--
nosy: +python-dev
___
Python tracker rep...@bugs.python.org
R. David Murray added the comment:
Thanks, Vajrasky.
--
resolution: - fixed
stage: commit review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20069
___
Changes by Jan Kaliszewski z...@chopin.edu.pl:
--
resolution: - duplicate
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19539
___
Jan Kaliszewski added the comment:
My concerns are now being addressed in the issue19548.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19539
___
Guido van Rossum added the comment:
SGTM. Merry Xmas!
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22926
___
___
Python-bugs-list mailing list
51 matches
Mail list logo