On Sat, 14 Apr 2012 11:25:57 -0700, vmars316 wrote:
> win7HomePremium:
> Greetings,
> 1)
> I installed portablePython(pP) here:
> C:\Users\vmars\Python3
> ?Does that look ok?
Sure, why not?
> 2)
> I would like to try pyWin, but it won't let me install because there is
> no pP3.2 in registry.
>
On Sat, 14 Apr 2012 15:47:54 -0700, Bryan wrote:
> Miki Tebeka wrote:
>> If you have an interesting/common "Gotcha" (warts/dark corners ...)
>> please share.
>
> Python 3(K) likes to use the same '.py' file extension as its
> incompatible predecessors,
And so it should.
Python 2 and Python 3 a
On 14/04/2012 23:47, Bryan wrote:
Miki Tebeka wrote:
If you have an interesting/common "Gotcha" (warts/dark corners ...) please
share.
Python 3(K) likes to use the same '.py' file extension as its
incompatible predecessors, and in some/many/most *nix implementations,
it likes to install in t
On Sun, Apr 15, 2012 at 9:00 AM, MRAB wrote:
> re.match(...) returns either a match object or None. In a condition, a
> match object always evaluates as True and None always evaluates as
> False.
Yes, should have clarified that. It's a deliberate feature of the re
module that you can do this. Ver
On Sun, Apr 15, 2012 at 8:47 AM, Bryan
wrote:
> Python 3(K) likes to use the same '.py' file extension as its
> incompatible predecessors, and in some/many/most *nix implementations,
> it likes to install in the same place. Python 3 is an improvement upon
> Python 2, but Python went from, "sure...
On 14/04/2012 23:45, Chris Angelico wrote:
On Sun, Apr 15, 2012 at 8:41 AM, Mahmoud Abdel-Fattah
wrote:
item['author_brand'] = author_brand.group(2) if type(author_brand) != None
else ''
Almost there! :)
None is a singleton, not a type; you don't need to check
type(author_brand) but rathe
Miki Tebeka wrote:
> If you have an interesting/common "Gotcha" (warts/dark corners ...) please
> share.
Python 3(K) likes to use the same '.py' file extension as its
incompatible predecessors, and in some/many/most *nix implementations,
it likes to install in the same place. Python 3 is an impro
On Sun, Apr 15, 2012 at 8:41 AM, Mahmoud Abdel-Fattah
wrote:
> item['author_brand'] = author_brand.group(2) if type(author_brand) != None
> else ''
Almost there! :)
None is a singleton, not a type; you don't need to check
type(author_brand) but rather its identity. Use "author_brand is not
None"
Thanks ChrisA a lot.
I just tried what you said, but I got an error, here's what I tried :
item['name'] = hxs.select('//div[@id="center-main"]/h1/text()').extract()[0]
author_brand = re.match(r'^[.*] - (.*)$', item['name'], re.I|re.S|re.M)
item['author_brand'] = author_brand.group(2) if type(autho
:
> 1. How can I write the following code in easier way in Python ?
> if len(item['description']) > 0:
> item['description'] = item['description'][0]
> else:
> item['description'] = ''
Assuming item['description'] is a string, all you need is
>>> item['description
On Sun, Apr 15, 2012 at 8:22 AM, Stefan Schwarzer
wrote:
> The future object returned by `put_bytes` has a `was_sent`
> method which will return `True` once the sender thread has
> actually sent the data via a socket call.
Dunno if this throws a spanner in your works, but does the future
object e
On Sun, Apr 15, 2012 at 8:16 AM, Mahmoud Abdel-Fattah
wrote:
> Hello,
>
> I'm coming from PHP background ant totally new to Python, I just started
> using scrapy, but has some generic question in python.
>
> 1. How can I write the following code in easier way in Python ?
> if len(item['description
Hello,
I wrote a `Connection` class that can be found at [1]. A
`Connection` object has a method `put_bytes(data)` which
returns a "future" [2]. The data will be sent asynchronously
by a thread attached to the connection object.
The future object returned by `put_bytes` has a `was_sent`
method wh
Hello,
I'm coming from PHP background ant totally new to Python, I just started
using scrapy, but has some generic question in python.
1. How can I write the following code in easier way in Python ?
if len(item['description']) > 0:
item['description'] = item['description'][0]
On 4/14/2012 11:25 AM vmars316 said...
win7HomePremium:
Greetings,
1)
I installed portablePython(pP) here:
C:\Users\vmars\Python3
?Does that look ok?
2)
I would like to try pyWin, but it won't let me install
because there is no pP3.2 in registry.
? How can I update the Registry for Python3.2
On 13 April 2012 17:35, Kiuhnm wrote:
> On 4/13/2012 17:58, Alexander Blinne wrote:
>>
>> zip(*[x[1] for x in sorted(d.items(), key=lambda y: y[0])])
>
> Or
> zip(*[d[k] for k in sorted(d.keys())])
.keys() is superfluous here:
zip(*(d[k] for k in sorted(d)))
--
Arnaud
--
http://mail.pyth
>3) When ever I cllick on *.py file,
>it runs by so fast that I can't see what's going on.
> ?Is there a way to keep the pyconsole open 'til i decide to close
>it?
>Thanks...Vernon
This one's answered easily enough - just open a command prompt window
at that directory (shift-right click the folder
On 4/14/2012 1:25 PM, vmars316 wrote:
> I installed portablePython(pP) here:
> C:\Users\vmars\Python3
> ?Does that look ok?
I would suggest including the minor version number (i.e. Python32
instead of Python3) because not all 3.x code is compatible with all
versions of Python 3.x - all code that w
win7HomePremium:
Greetings,
1)
I installed portablePython(pP) here:
C:\Users\vmars\Python3
?Does that look ok?
2)
I would like to try pyWin, but it won't let me install
because there is no pP3.2 in registry.
? How can I update the Registry for Python3.2 ?
3) When ever I cllick on *.py file,
it ru
On Apr 11, 9:52 pm, cerr wrote:
> Hi,
>
> I want to install some python driver on my system that requires trac.util
> (from Image.py) but I can't find that anywhere, any suggestions, anyone?
>
> Thank you very much, any help is appreciated!
>
> Error:
> File "/root/weewx/bin/Image.py", line 32, i
On 04/13/12 22:54, Chris Angelico wrote:
Yes, that would be the right method to use. I'd not bother with the
function and map() though, and simply iterate:
d = {}
for val in l:
d.setdefault(f(val), []).append(val)
Or make d a defaultdict:
from collections import defaultdict
d = defaultd
21 matches
Mail list logo