On Sun, 3 Sep 2017 08:34 am, Chris Roberts wrote:
> Perhaps someone here could help me to get this into perspective.
> Somehow when we start to feed an instance as the argument in a new instance.
> my head explodes.. in this case...
> a = Foo()
> b = Bar(a)
> So...
> a is a 'Foo instance' with pr
On Wed, Apr 26, 2017 at 10:38 PM, Cem Karan wrote:
>
> On Apr 24, 2017, at 8:54 PM, Jon Ribbens
> wrote:
>
> > On 2017-04-24, CFK wrote:
> >> Long version: I'm trying to write bindings for python via ctypes to
> control
> >> a library written in C that uses the bdwgc garbage collector (
> >> ht
On 9/2/2017 6:53 AM, Steve D'Aprano wrote:
I want to delay a computation and then print it, in the REPL (interactive
interpreter). I have something like this:
import time
from threading import Timer
def do_work():
x = 2 + 2
print("It is", time.asctime(), "and 2+2 is", x)
def schedul
> On Sep 2, 2017, at 3:34 PM, Chris Roberts wrote:
>
> Perhaps someone here could help me to get this into perspective.
> Somehow when we start to feed an instance as the argument in a new instance.
> my head explodes..
> in this case...
> a = Foo()
> b = Bar(a)
> So...
> a is a 'Foo instance
Perhaps someone here could help me to get this into perspective.
Somehow when we start to feed an instance as the argument in a new instance. my
head explodes..
in this case...
a = Foo()
b = Bar(a)
So...
a is a 'Foo instance' with properties and methods.
b is a 'Bar instance'
Since b is using
On 2017-09-02 18:53, Charles Hixson wrote:
python3 --version
Python 3.5.3
Running on Debian stretch
In this code s is a string parameter
while (j < k and \
(s[j].isalnum()) or \
(s[j] in seps and s[j+1].isalnum()) ):
j = j + 1
print ("i = {0}, j =
Charles Hixson wrote:
> python3 --version
> Python 3.5.3
>
> Running on Debian stretch
>
> In this code s is a string parameter
>
> while (j < k and \
> (s[j].isalnum()) or \
>(s[j] in seps and s[j+1].isalnum()) ):
> j = j + 1
> print ("i = {0}, j = {1
python3 --version
Python 3.5.3
Running on Debian stretch
In this code s is a string parameter
while (j < k and \
(s[j].isalnum()) or \
(s[j] in seps and s[j+1].isalnum()) ):
j = j + 1
print ("i = {0}, j = {1}, k = {2}, len[s] = {3}". \
format(i,
On Sat, Sep 2, 2017 at 5:53 AM, Steve D'Aprano
wrote:
>
> The problem is that after the message is printed, the REPL's prompt is
> disrupted. This is especially annoying when I'm in the middle of typing a
> line.
> This is just a cosmetic flaw, but it would be nice if I could tell Python to
> red
On 2017-09-02 11:59, Steve D'Aprano wrote:
On Sat, 2 Sep 2017 08:53 pm, Steve D'Aprano wrote:
I want to delay a computation and then print it, in the REPL (interactive
interpreter). I have something like this:
[...]
The other problem is that if I exit the REPL while a Timer is still active, i
On Sat, Sep 2, 2017 at 8:53 PM, Steve D'Aprano
wrote:
> The problem is that after the message is printed, the REPL's prompt is
> disrupted. This is especially annoying when I'm in the middle of typing a
> line.
> This is just a cosmetic flaw, but it would be nice if I could tell Python to
> redra
On Sat, 2 Sep 2017 08:53 pm, Steve D'Aprano wrote:
> I want to delay a computation and then print it, in the REPL (interactive
> interpreter). I have something like this:
[...]
> The other problem is that if I exit the REPL while a Timer is still active, it
> freezes until the time has run before
I want to delay a computation and then print it, in the REPL (interactive
interpreter). I have something like this:
import time
from threading import Timer
def do_work():
x = 2 + 2
print("It is", time.asctime(), "and 2+2 is", x)
def schedule_work():
Timer(60, do_work, ()).start() #
On 9/2/17 at 4:21, Steve D'Aprano wrote:
> If regular case-sensitive string comparisons don't support the locale, why
> should case-insensitive comparisons be required to?
I think that Chris answered very good before:
On 9/2/17 at 2:53 AM, Chris Angelico wrote:
> On Sat, Sep 2, 2017 at 10:31 AM
On 9/2/17, eryk sun wrote:
> On Fri, Sep 1, 2017 at 3:23 AM, Peter Otten <__pete...@web.de> wrote:
>>
>> I think you have to specify the types yourself:
>>
> import ctypes
> libm = ctypes.cdll.LoadLibrary("libm.so")
> libm.sqrt(42)
>> 0
> libm.sqrt.argtypes = [ctypes.c_double]
Steve D'Aprano wrote:
> On Sat, 2 Sep 2017 03:13 am, Ganesh Pal wrote:
>
>> Example :
>>
>> "a" and "1" => a0001
>>
>> "a" and "aa" => c00aa
>
> Why does the leading 'a' change to a 'c'? Is that a mistake? I'll assume
> its a typo.
>
> You want string slicing.
>
> base = 'a'
MRAB , Thanks for your solution it looks neat and best !
On Fri, Sep 1, 2017 at 11:14 PM, MRAB wrote:
> On 2017-09-01 18:13, Ganesh Pal wrote:
>
>> In the fixed length string i.e "a",last 4 bits i.e "" should be
>> replaced by the user provided value ( the value is between 0001 + f f f
17 matches
Mail list logo