On Fri, Oct 26, 2012 at 5:06 PM, Paul Rubin wrote:
> Dan Loewenherz writes:
>> In this case, profile_id is "None" when the loop breaks. It would be
>> much more straightforward (and more Pythonic, IMO), to write:
>>
>> client = StrictRedis()
>> while client.spop("profile_ids") as profile_
Dan Loewenherz writes:
> In this case, profile_id is "None" when the loop breaks. It would be
> much more straightforward (and more Pythonic, IMO), to write:
>
> client = StrictRedis()
> while client.spop("profile_ids") as profile_id:
> print profile_id
That is pretty loose, in my
On 25Oct2012 22:04, Terry Reedy wrote:
| Containment of nan in collection is tested by is, not ==.
| >>> nan = float('nan')
| >>> nan2 = float('nan')
| >>> nan2 is nan
| False
This argues otherwise, and for use of math.isnan() instead.
I expect you were making the point that another NaN is di
It seems the topic of this thread has changed drastically from the original
message.
1) "while EXPR as VAR" in no way says that EXPR must be a boolean value. In
fact, a use case I've run into commonly in web development is popping from a
redis set. E.g.
client = StrictRedis()
while Tru
On Thu, Oct 25, 2012 at 10:00 PM, Ed Morton wrote:
> Because there is no solution - there IS no _RE_ that will match a string not
> at the beginning of a line.
Depending on what the OP meant, the following would both work:
- r"^(?!mystring)" (the string does not occur at the beginning)
- r"(?!^)
Thanks everyone, esp this gentleman.
The solution that worked best for me is just to use a DOT before the
string as the one at the beginning of the line did not have any char
before it. I guess, this requires the ability to ignore the CARAT as
the beginning of the line.
I am a satisfied custormer
On Oct 25, 2012, at 6:34 AM, Schneider wrote:
> Hi Folkz,
> how can i create a SSH-Connection with python? I have to send some commands
> to the remote host and parse their answers.
> greatz Johannes
Fabric is the way to go!
> --
> http://mail.python.org/mailman/listinfo/python-list
--
http:/
On Thu, 25 Oct 2012 18:08:53 -0700 (PDT), Rivka Miller
wrote in
<73f60cf3-d932-4366-a405-676748856...@q16g2000yqc.googlegroups.com>:
>no one has really helped yet.
We regret that you are not a satisfied customer.
Please take your receipt to the cashier and you will receive double your
money bac
> how can i create a SSH-Connection with python? I have to send some commands
> to the remote host and parse their answers.
Consider also the sh module:
http://amoffat.github.com/sh/tutorials/2-interacting_with_processes.html.
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, Oct 25, 2012 at 9:08 PM, Rivka Miller wrote:
> On Oct 25, 2:27 pm, Danny wrote:
>> Why you just don't give us the string/input, say a line or two, and what you
>> want off of it, so we can tell better what to suggest
>
> no one has really helped yet.
>
> I want to search and modify.
>
>
On Thu, 25 Oct 2012 22:04:52 -0400, Terry Reedy wrote:
> It is a consequence of the following, which some people (but not all)
> believe is mandated by the IEEE standard.
>
> >>> nan = float('nan')
> >>> nan is nan
> True
The IEEE 754 standard says nothing about object identity. It only
discu
On Thu, 25 Oct 2012 18:46:20 -0700, mamboknave wrote:
> That means, the function .index() cannot detect nan values. It happens
> on both Python 2.6 and Python 3.1
>
> Is this a bug? Or I am not using .index() correctly?
You shouldn't be using index() or == to detect NANs. The right way to
detec
On 25/10/2012 21:53, Rivka Miller wrote:
Hello Programmers,
I am looking for a regexp for a string not at the beginning of the
line.
Why bother with a silly regex thingy when simple string methods will
suffice e.g.
'yourstring'.find('xyz', 1)
or
'yourstring'.index('xyz', 1)
or
'xyz' in
On Thursday, October 25, 2012 7:16:02 PM UTC-7, Cameron Simpson wrote:
Of course!! How could I get into that trap??
Thanks to you & to Terry
--
http://mail.python.org/mailman/listinfo/python-list
On 2012-10-26 03:04, Terry Reedy wrote:
On 10/25/2012 9:46 PM, mambokn...@gmail.com wrote:
a = [float('nan'), 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
a
[nan, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
a.index(float('nan'))
Traceback (most recent call last):
File "", line 1, in
ValueError: list.index(x):
On 25Oct2012 18:46, mambokn...@gmail.com wrote:
| >>> a = [float('nan'), 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
| >>> a
| [nan, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
| >>> a.index(float('nan'))
| Traceback (most recent call last):
| File "", line 1, in
| ValueError: list.index(x): x not in list
|
| Tha
Rivka Miller writes:
> On Oct 25, 2:27 pm, Danny wrote:
>> Why you just don't give us the string/input, say a line or two, and
>> what you want off of it, so we can tell better what to suggest
>
> no one has really helped yet.
Really? I was going to reply but then I saw Janis had given you the
On 2012-10-26 02:08, Rivka Miller wrote:
On Oct 25, 2:27 pm, Danny wrote:
Why you just don't give us the string/input, say a line or two, and what you
want off of it, so we can tell better what to suggest
no one has really helped yet.
I want to search and modify.
I dont wanna be tied to a
On 10/25/2012 9:46 PM, mambokn...@gmail.com wrote:
a = [float('nan'), 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
a
[nan, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
a.index(float('nan'))
Traceback (most recent call last):
File "", line 1, in
ValueError: list.index(x): x not in list
That means, the function
On 10/25/2012 8:08 PM, Rivka Miller wrote:
On Oct 25, 2:27 pm, Danny wrote:
Why you just don't give us the string/input, say a line or two, and what you
want off of it, so we can tell better what to suggest
no one has really helped yet.
Because there is no solution - there IS no _RE_ that
>>> a = [float('nan'), 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>>> a
[nan, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>>> a.index(float('nan'))
Traceback (most recent call last):
File "", line 1, in
ValueError: list.index(x): x not in list
That means, the function .index() cannot detect nan values.
It happens
On 10/25/2012 09:08 PM, Rivka Miller wrote:
> On Oct 25, 2:27 pm, Danny wrote:
>> Why you just don't give us the string/input, say a line or two, and what you
>> want off of it, so we can tell better what to suggest
> no one has really helped yet.
>
>
>
> first non beginning of the line and I wi
On Oct 25, 2:27 pm, Danny wrote:
> Why you just don't give us the string/input, say a line or two, and what you
> want off of it, so we can tell better what to suggest
no one has really helped yet.
I want to search and modify.
I dont wanna be tied to a specific language etc so I just want a
re
On Thu, 25 Oct 2012 14:20:00 -0600, Ian Kelly wrote:
> On Thu, Oct 25, 2012 at 2:00 PM, Neil Cerutti wrote:
>> Yes indeed! Python string operations are fast enough and its arithmetic
>> slow enough that I no longer assume I can beat a neat lexicographical
>> solution. Try defeating the following
On 25 Oct 2012 16:55:46 GMT, Peter Pearson wrote:
> On Thu, 25 Oct 2012 12:16:58 +0200, Schneider wrote:
>> how can i create a SSH-Connection with python? I have to send some
>> commands to the remote host and parse their answers.
>> greatz Johannes
>
> I've been using Twisted (twistedmatrix.com
On 25/10/2012 17:08, Charles Hixson wrote:
On 10/25/2012 08:57 AM, Steven D'Aprano wrote:
On Fri, 26 Oct 2012 02:31:53 +1100, Chris Angelico wrote:
On Fri, Oct 26, 2012 at 2:25 AM, Christian Heimes
wrote:
Simple, easy, faster than a Python loop but not very elegant:
bin(number).count("1"
David Hutto wrote:
> On Wed, Oct 24, 2012 at 1:23 AM, seektime wrote:
> > Here's some example code. The input is a list which is a "matrix" of
> > letters:
> >a b a
> >b b a
> >
> > and I'd like to turn this into a Python array:
> >
> > 1 2 1
> > 2 2 1
> >
> > so 1 replaces a, and
In Python3 is there any good way to count the number of on bits in an
integer (after an & operation)?
Alternatively, is there any VERY light-weight implementation of a bit
set? I'd prefer to use integers, as I'm probably going to need
thousands of these, if the tests work out. But before I can
:
On 25 October 2012 16:53, Rivka Miller wrote:
> I am looking for a regexp for a string not at the beginning of the
> line.
There are probably quite a few ways to do this, but '(?>> pattern = re.compile(r"(?>> re.findall(pattern, "this is some text")
['is', 'some', 'text']
-[]z.
--
http://ma
On 2012-10-25, Dennis Lee Bieber wrote:
> On Thu, 25 Oct 2012 04:09:56 -0700 (PDT), kura...@gmail.com wrote:
>
>> I use Arduino 1280 and Arduino 2560 under Fedora 15. 1280 creates
>> ttyUSB0 port and can be set at 250 successfully. 2560 creates
>> ttyACM0 port and can be only set at speeds fr
On 10/25/2012 08:57 AM, Steven D'Aprano wrote:
On Fri, 26 Oct 2012 02:31:53 +1100, Chris Angelico wrote:
On Fri, Oct 26, 2012 at 2:25 AM, Christian Heimes
wrote:
Simple, easy, faster than a Python loop but not very elegant:
bin(number).count("1")
Unlikely to be fast.
Oh I don't know abo
On 25.10.2012 22:53, Rivka Miller wrote:
> Hello Programmers,
>
> I am looking for a regexp for a string not at the beginning of the
> line.
>
> For example, I want to find $hello$ that does not occur at the
> beginning of the string, ie all $hello$ that exclude ^$hello$.
.hello
The dot repr
Hello Programmers,
I am looking for a regexp for a string not at the beginning of the
line.
For example, I want to find $hello$ that does not occur at the
beginning of the string, ie all $hello$ that exclude ^$hello$.
In addition, if you have a more difficult problem along the same
lines, I woul
andrea crotti wrote:
> 2012/10/25 Steven D'Aprano :
> > On Wed, 24 Oct 2012 13:51:30 +0100, andrea crotti wrote:
> >
[snip]
> > Without a try...except block, execution will cease after an exception is
> > caught, even when using sys.excepthook. I don't believe that there is any
> > way to jump back
Am 25.10.2012 18:36 schrieb Ian Kelly:
On Thu, Oct 25, 2012 at 1:21 AM, Thomas Rachel
wrote:
j = next(j for j in iter(partial(randrange, n), None) if j not in
selected)
This generator never ends. If it meets a non-matching value, it just skips
it and goes on.
next() only returns one value.
In Python3 is there any good way to count the number of on bits in an
integer (after an & operation)?
Alternatively, is there any VERY light-weight implementation of a bit
set? I'd prefer to use integers, as I'm probably going to need
thousands of these, if the tests work out. But before I can
On Thu, Oct 25, 2012 at 2:00 PM, Neil Cerutti wrote:
> Yes indeed! Python string operations are fast enough and its
> arithmetic slow enough that I no longer assume I can beat a neat
> lexicographical solution. Try defeating the following with
> arithmetic:
>
> def is_palindrom(n):
>s = str(n)
On 10/25/2012 12:13 PM, rusi wrote:
On Oct 25, 7:56 pm, Charles Hixson wrote:
In Python3 is there any good way to count the number of on bits in an
integer (after an & operation)?
Alternatively, is there any VERY light-weight implementation of a bit
set? I'd prefer to use integers, as I'm prob
On 10/25/2012 6:50 AM, Steven D'Aprano wrote:
On Thu, 25 Oct 2012 11:52:31 +0200, Thomas Rachel wrote:
Am 25.10.2012 06:50 schrieb Terry Reedy:
Keep in mind that any new syntax has to be a substantial improvement in
some sense or make something new possible. There was no new syntax in
3.2 and
On 2012-10-25, Neil Cerutti wrote:
> Try defeating the following with arithmetic:
>
> def is_palindrom(n):
>s = str(n)
>return s = s[::-1]
Sorry for the typos. It should've been:
def is_palindrome(n):
s = str(n)
return s == s[::-1]
--
Neil Cerutti
--
http://mail.python.org/mailm
On 2012-10-25, Steven D'Aprano wrote:
> On Fri, 26 Oct 2012 02:31:53 +1100, Chris Angelico wrote:
>> On Fri, Oct 26, 2012 at 2:25 AM, Christian Heimes
>>
>> wrote:
>>> Simple, easy, faster than a Python loop but not very elegant:
>>>
>>>bin(number).count("1")
>>
>> Unlikely to be fast.
>
> O
Chris Angelico's suggestion:
>>> bitcount = bytes(bin(i).count("1") for i in range(256))
>>> t = Timer('sum(number.to_bytes((number.bit_length() + 7) // 8,'
... '"little").translate(bitcount))',
... setup='from __main__ import bitcount; number=2**10001-1')
>>> min(t.repeat(number=1, repeat=7)
Demian Brecht wrote:
> On 2012-10-24, at 8:00 AM, inshu chauhan wrote:
>
> > Yes, a Class method returns a list. I am trying to append this in main() to
> > make another list.
> > But the list i am getting after appending i showing addresses like this
> > '<__main__.Point object at
> 0x0254FAB0
On Thu, Oct 25, 2012 at 11:25 AM, Christian Gollwitzer wrote:
> There is a very geeky algorithm with only a few integer operations.
>
> Checkout
> http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSet64
>
> for a C version. Maybe the same thing is equally fast when ported to Python.
It
Am 25.10.12 16:47, schrieb Charles Hixson:
In Python3 is there any good way to count the number of on bits in an
integer (after an & operation)?
Alternatively, is there any VERY light-weight implementation of a bit
set? I'd prefer to use integers, as I'm probably going to need
thousands of these
On Thu, 25 Oct 2012 09:17:40 -0700, rusi wrote:
> On Oct 25, 8:57 pm, Steven D'Aprano +comp.lang.pyt...@pearwood.info> wrote:
>> On Fri, 26 Oct 2012 02:31:53 +1100, Chris Angelico wrote:
>> > On Fri, Oct 26, 2012 at 2:25 AM, Christian Heimes
>> > wrote:
>> >> Simple, easy, faster than a Python l
On Thu, 25 Oct 2012 12:16:58 +0200, Schneider wrote:
> how can i create a SSH-Connection with python? I have to send some
> commands to the remote host and parse their answers.
> greatz Johannes
I've been using Twisted (twistedmatrix.com). It is especially
convenient for the server end. Its or
On Thu, Oct 25, 2012 at 10:36 AM, Ian Kelly wrote:
> On Thu, Oct 25, 2012 at 1:21 AM, Thomas Rachel
>
> wrote:
>>> j = next(j for j in iter(partial(randrange, n), None) if j not in
>>> selected)
>>
>>
>> This generator never ends. If it meets a non-matching value, it just skips
>> it and goes on.
On Thu, Oct 25, 2012 at 3:52 AM, Thomas Rachel
wrote:
> Am 25.10.2012 06:50 schrieb Terry Reedy:
>
>
>> Keep in mind that any new syntax has to be a substantial improvement in
>> some sense or make something new possible. There was no new syntax in
>> 3.2 and very little in 3.3.
>
>
> I would cons
On Oct 25, 9:30 pm, Chris Angelico wrote:
> On Fri, Oct 26, 2012 at 3:17 AM, rusi wrote:
> > On Oct 25, 8:57 pm, Steven D'Aprano > +comp.lang.pyt...@pearwood.info> wrote:
> >> py> min(t.repeat(number=1, repeat=7))
> >> 0.6819710731506348
> >> py> min(t.repeat(number=100, repeat=7))
> >> 4.14
On 25/10/2012 17:29, Chris Angelico wrote:
On Fri, Oct 26, 2012 at 3:17 AM, rusi wrote:
On Oct 25, 8:57 pm, Steven D'Aprano wrote:
py> min(t.repeat(number=1, repeat=7))
0.6819710731506348
py> min(t.repeat(number=100, repeat=7))
4.141788959503174
That makes the "inelegant" solution using
On Thu, Oct 25, 2012 at 1:21 AM, Thomas Rachel
wrote:
>> j = next(j for j in iter(partial(randrange, n), None) if j not in
>> selected)
>
>
> This generator never ends. If it meets a non-matching value, it just skips
> it and goes on.
next() only returns one value. After it is returned, the gene
On Thu, Oct 25, 2012 at 9:24 AM, Mark Lawrence wrote:
> On 25/10/2012 15:47, Charles Hixson wrote:
>
>> In Python3 is there any good way to count the number of on bits in an
>> integer (after an & operation)?
>> Alternatively, is there any VERY light-weight implementation of a bit
>> set? I'd pre
On Fri, Oct 26, 2012 at 3:17 AM, rusi wrote:
> On Oct 25, 8:57 pm, Steven D'Aprano +comp.lang.pyt...@pearwood.info> wrote:
>> py> min(t.repeat(number=1, repeat=7))
>> 0.6819710731506348
>> py> min(t.repeat(number=100, repeat=7))
>> 4.141788959503174
>>
>> That makes the "inelegant" solution u
Am 25.10.2012 16:15 schrieb Grant Edwards:
I guess that depends on what sort of programs you write. In my
experience, EXPR is usually a read from a file/socket/pipe that
returns '' on EOF. If VAR is not '', then you process, then you
process it inside the loop.
Right. The same as in
if regex
On 25/10/2012 15:47, Charles Hixson wrote:
In Python3 is there any good way to count the number of on bits in an
integer (after an & operation)?
Alternatively, is there any VERY light-weight implementation of a bit
set? I'd prefer to use integers, as I'm probably going to need
thousands of these
On Oct 25, 8:57 pm, Steven D'Aprano wrote:
> On Fri, 26 Oct 2012 02:31:53 +1100, Chris Angelico wrote:
> > On Fri, Oct 26, 2012 at 2:25 AM, Christian Heimes
> > wrote:
> >> Simple, easy, faster than a Python loop but not very elegant:
>
> >> bin(number).count("1")
>
> > Unlikely to be fast.
>
On Oct 25, 7:56 pm, Charles Hixson wrote:
> In Python3 is there any good way to count the number of on bits in an
> integer (after an & operation)?
> Alternatively, is there any VERY light-weight implementation of a bit
> set? I'd prefer to use integers, as I'm probably going to need
> thousands
On Fri, Oct 26, 2012 at 2:31 AM, Hans Mulder wrote:
> This seems to work; I'm not sure how robust it is:
>
> import signal
>
> def handler(signum, frame):
> while True:
> q = raw_input("This will quit the program, are you sure? [y/N]")
> if q[:1] in "yY":
> raise Ke
On Fri, 26 Oct 2012 02:31:53 +1100, Chris Angelico wrote:
> On Fri, Oct 26, 2012 at 2:25 AM, Christian Heimes
> wrote:
>> Simple, easy, faster than a Python loop but not very elegant:
>>
>>bin(number).count("1")
>
> Unlikely to be fast.
Oh I don't know about that. Here's some timing results
On Fri, 26 Oct 2012 01:51:43 +1100, Chris Angelico wrote:
> On Thu, Oct 25, 2012 at 12:15 PM, Steven D'Aprano
> wrote:
>> I don't believe that there is any
>> way to jump back to the line of code that just failed (and why would
>> you, it will just fail again)
>
> There are several reasons to re
On 24/10/12 14:51:30, andrea crotti wrote:
> So I would like to be able to ask for confirmation when I receive a C-c,
> and continue if the answer is "N/n".
>
> I'm already using an exception handler set with sys.excepthook, but I
> can't make it work with the confirm_exit, because it's going to q
On Fri, Oct 26, 2012 at 2:25 AM, Christian Heimes wrote:
> Simple, easy, faster than a Python loop but not very elegant:
>
>bin(number).count("1")
Unlikely to be fast.
What you may want is some sort of hybrid loop/lookup approach. Do you
know what your highest bit number is going to be? For
Am 25.10.2012 16:47, schrieb Charles Hixson:
> In Python3 is there any good way to count the number of on bits in an
> integer (after an & operation)?
Simple, easy, faster than a Python loop but not very elegant:
bin(number).count("1")
Christian
--
http://mail.python.org/mailman/listinfo/
On 2012-10-25 15:47, Charles Hixson wrote:
In Python3 is there any good way to count the number of on bits in an
integer (after an & operation)?
Alternatively, is there any VERY light-weight implementation of a bit
set? I'd prefer to use integers, as I'm probably going to need
thousands of these
In Python3 is there any good way to count the number of on bits in an
integer (after an & operation)?
Alternatively, is there any VERY light-weight implementation of a bit
set? I'd prefer to use integers, as I'm probably going to need
thousands of these, if the tests work out. But before I can
On Thu, Oct 25, 2012 at 12:15 PM, Steven D'Aprano
wrote:
> I don't believe that there is any
> way to jump back to the line of code that just failed (and why would you,
> it will just fail again)
There are several reasons to retry something after an exception,
mainly if some external state gets c
2012/10/25 Steven D'Aprano :
> On Wed, 24 Oct 2012 13:51:30 +0100, andrea crotti wrote:
>
>> So I would like to be able to ask for confirmation when I receive a C-c,
>> and continue if the answer is "N/n".
>
> I don't think there is any way to do this directly.
>
> Without a try...except block, exe
On 2012-10-25, Terry Reedy wrote:
> The op wondered if these proposals have been made before. They have
> been, and have been rejected. Some of the discussion has been on
> python-ideas list. But go ahead and brainstorm and discuss.
>
> Keep in mind that any new syntax has to be a substantial i
On 2012-10-24, Cameron Simpson wrote:
>| I must say I really like the parity of Dan's
>| while EXPR as VAR:
>| BLOCK
>| proposal with the "with" statement.
>
> Well, it's nice. But usually EXPR will be a boolean.
I guess that depends on what sort of programs you write. In my
experience,
On 2012-10-25, at 3:16 AM, Schneider wrote:
> how can i create a SSH-Connection with python? I have to send some commands
> to the remote host and parse their answers.
I have yet to use it, but Fabric (http://docs.fabfile.org/en/1.4.3/) should
have everything you're looking for. I've heard n
Web content caching is the most effective type of cache. This way your python
handler is not executed to determine a valid response to user, instead one
returned from cache. Since the operation is that simple, it should be the
maximum possible speed your `real world` application capable to prov
On 25/10/2012 13:40, Gilles wrote:
> On Thu, 25 Oct 2012 13:03:14 +0100, Tim Golden
> wrote:
>> (Your question is a little confused at the end. I'm choosing to
>> understand: why can't we just run Python one-shot, like CGI? The likely
>> alternative meaning is: why can't the incoming request be ro
On Thu, Oct 25, 2012 at 8:03 AM, Tim Golden wrote:
> On 25/10/2012 12:45, Gilles wrote:
>> I'd like to check something about running Python web applications.
>>
>> Generally speaking, the reason scripts run faster when called
>> through FastCGI or the mod_* modules, is because the interpreter is
>
On 2012-10-25, Piet van Oostrum wrote:
> Adrien writes:
>
>> print "{:.3g}".format(2.356) # this rounds up
>
> But:
>
print "{:.3g}".format(12.356)
> 12.4
print "{:.3g}".format(123.356)
> 123
The precision is a decimal number indicating how many digits
should be displayed after
On Thu, 25 Oct 2012 13:03:14 +0100, Tim Golden
wrote:
>(Your question is a little confused at the end. I'm choosing to
>understand: why can't we just run Python one-shot, like CGI? The likely
>alternative meaning is: why can't the incoming request be routed to an
>already-running Python program --
In article ,
Schneider wrote:
> Hi Folkz,
> how can i create a SSH-Connection with python? I have to send some
> commands to the remote host and parse their answers.
> greatz Johannes
At a low level, you want to look at the paramiko library. Built on top
of that, and adding hoards of neat fu
On 25/10/2012 12:45, Gilles wrote:
> I'd like to check something about running Python web applications.
>
> Generally speaking, the reason scripts run faster when called
> through FastCGI or the mod_* modules, is because the interpreter is
> already up and running. But when running PHP scripts, th
Hello
I'd like to check something about running Python web applications.
Generally speaking, the reason scripts run faster when called through
FastCGI or the mod_* modules, is because the interpreter is already up
and running.
But when running PHP scripts, this does nothing about fetching the
fil
Am 25.10.2012 12:50 schrieb Steven D'Aprano:
Then I think you have misunderstood the purpose of "yield from".
Seems so. As I have not yet switched to 3.x, I haven't used it till now.
[quote]
However, if the subgenerator is to interact properly with the caller in
the case of calls to send(),
On 25-10-12 06:50, Terry Reedy wrote:
> On 10/24/2012 7:19 PM, Evan Driscoll wrote:
>> On 10/24/2012 05:26 PM, Cameron Simpson wrote:
>>> But I'm still -0 on it, because it supplants the glaringly obvious:
>>>
>>>m = ...
>>>
>>> assignment with the far less in your face:
>>>
>>>possibly-lon
I use Arduino 1280 and Arduino 2560 under Fedora 15.
1280 creates ttyUSB0 port and can be set at 250 successfully.
2560 creates ttyACM0 port and can be only set at speeds from list (no 25)
in pyserial. How to set 25 to ttyACM0 port?? Need I patch kernel or python?
--
http://mail.pyt
On Thu, 25 Oct 2012 11:52:31 +0200, Thomas Rachel wrote:
> Am 25.10.2012 06:50 schrieb Terry Reedy:
>
>> Keep in mind that any new syntax has to be a substantial improvement in
>> some sense or make something new possible. There was no new syntax in
>> 3.2 and very little in 3.3.
>
> I would con
You can use paramiko module. Very easy to use.
On Thu, Oct 25, 2012 at 4:04 PM, Laszlo Nagy wrote:
> On 2012-10-25 12:16, Schneider wrote:
>
>> Hi Folkz,
>> how can i create a SSH-Connection with python? I have to send some
>> commands to the remote host and parse their answers.
>> greatz Joha
Am 25.10.2012 09:21 schrieb Thomas Rachel:
I think
# iterate ad inf., because partial never returns None:
i1 = iter(partial(randrange, n), None)
# take the next value, make it None for breaking:
i2 = (j if j in selected else None for j in i1)
# and now, break on None:
i3 = iter(lambda: next(i2)
On 2012-10-25 12:16, Schneider wrote:
Hi Folkz,
how can i create a SSH-Connection with python? I have to send some
commands to the remote host and parse their answers.
greatz Johannes
http://www.lag.net/paramiko/
Another solution would be to use subprocess and/or pexpect
--
http://mail.pyth
On Thu, Oct 25, 2012 at 12:17 PM, David Hutto wrote:
> On Thu, Oct 25, 2012 at 6:12 AM, inshu chauhan
> wrote:
> >
> >
> > On Thu, Oct 25, 2012 at 12:04 PM, David Hutto
> > wrote:
> >>
> >> On Thu, Oct 25, 2012 at 5:58 AM, inshu chauhan
> >> wrote:
> >> > Yes Dave ..You are right and my problem
On Thu, Oct 25, 2012 at 6:12 AM, inshu chauhan wrote:
>
>
> On Thu, Oct 25, 2012 at 12:04 PM, David Hutto
> wrote:
>>
>> On Thu, Oct 25, 2012 at 5:58 AM, inshu chauhan
>> wrote:
>> > Yes Dave ..You are right and my problem is solved now.. Thanx to all...
>> >
>> >
>> > On Thu, Oct 25, 2012 at 1
Hi Folkz,
how can i create a SSH-Connection with python? I have to send some
commands to the remote host and parse their answers.
greatz Johannes
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, Oct 25, 2012 at 12:04 PM, David Hutto wrote:
> On Thu, Oct 25, 2012 at 5:58 AM, inshu chauhan
> wrote:
> > Yes Dave ..You are right and my problem is solved now.. Thanx to all...
> >
> >
> > On Thu, Oct 25, 2012 at 11:55 AM, David Hutto
> > wrote:
> >>
> >> On Thu, Oct 25, 2012 at 5:51
On Thu, Oct 25, 2012 at 5:58 AM, inshu chauhan wrote:
> Yes Dave ..You are right and my problem is solved now.. Thanx to all...
>
>
> On Thu, Oct 25, 2012 at 11:55 AM, David Hutto
> wrote:
>>
>> On Thu, Oct 25, 2012 at 5:51 AM, inshu chauhan
>> wrote:
>> >
>> >
>> >>
>> >> Is this what you mean
Also,
>>> list_1 = [i for i in range(0,5)]
>>> list_2 = [i for i in range(5,11)]
>>> list_0 = [list_1,list_2]
>>> list_0
[[0, 1, 2, 3, 4], [5, 6, 7, 8, 9, 10]]
--
Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com
--
http://mail.python.org/mailman/listinfo/python-list
Yes Dave ..You are right and my problem is solved now.. Thanx to all...
On Thu, Oct 25, 2012 at 11:55 AM, David Hutto wrote:
> On Thu, Oct 25, 2012 at 5:51 AM, inshu chauhan
> wrote:
> >
> >
> >>
> >> Is this what you mean:
> >>
> list_0 = []
> list_1 = [i for i in range(0,5)]
> list_2 = [i for
On Thu, Oct 25, 2012 at 5:51 AM, inshu chauhan wrote:
>
>
>>
>> Is this what you mean:
>>
list_0 = []
list_1 = [i for i in range(0,5)]
list_2 = [i for i in range(5,11)]
list_0.append(list_1)
list_0.append(list_2)
>> >>> for i in list_2:
>> ... list_1.append(i)
>> ...
>> >>> list_1
>> [0, 1, 2,
Am 25.10.2012 06:50 schrieb Terry Reedy:
Keep in mind that any new syntax has to be a substantial improvement in
some sense or make something new possible. There was no new syntax in
3.2 and very little in 3.3.
I would consinder this at least as new substantial than
yield_from it
as oppo
Am 25.10.2012 00:26 schrieb Cameron Simpson:
If I could write this as:
if re_FUNKYPATTERN.match(test_string) as m:
do stuff with the results of the match, using "m"
then some cascading parse decisions would feel a bit cleaner. Where I
current have this:
m = re_CONSTRUCT1.match(line
On 10/25/2012 05:44 AM, inshu chauhan wrote:
>>>
or if the clist initial contents were relevant, perhaps you mean
> clist += alist, blist
>>>
>>> But not this because it will simply concatenate the list like
>>> [1,2,3,4,5,6] .. I dont want this actaully...
>>>
>>
>> No, it
> Is this what you mean:
>
> >>> list_1 = [i for i in range(0,5)]
> >>> list_2 = [i for i in range(5,11)]
> >>> for i in list_2:
> ... list_1.append(i)
> ...
> >>> list_1
> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>
>
> or would another example help you out more?
>
No but really sorry this is what I
On Thu, Oct 25, 2012 at 5:44 AM, inshu chauhan wrote:
>
>
>> >>
>> >> or if the clist initial contents were relevant, perhaps you mean
>> >>
>> >>> clist += alist, blist
>> >>
>> >
>> > But not this because it will simply concatenate the list like
>> > [1,2,3,4,5,6] .. I dont want this actaully..
On Thu, Oct 25, 2012 at 5:31 AM, Dave Angel wrote:
> On 10/25/2012 05:21 AM, inshu chauhan wrote:
>>>
>>> or if the clist initial contents were relevant, perhaps you mean
>>>
clist += alist, blist
>>>
>>
>> But not this because it will simply concatenate the list like
>> [1,2,3,4,5,6] .. I d
1 - 100 of 112 matches
Mail list logo