Ulrich Goebel wrote at 2024-6-28 18:08 +0200:
>Hi,
>
>a class can have methods, and it can have attributes, which can hold a
>function. Both is well known, of course.
>
>My question: Is there any difference?
I think you should make the distinction "class versus instance attribute"
rather than "me
On 6/28/2024 12:08 PM, Ulrich Goebel via Python-list wrote:
Hi,
a class can have methods, and it can have attributes, which can hold a
function. Both is well known, of course.
My question: Is there any difference?
The code snipped shows that both do what they should do. But __dict__ includes
On 6/28/24 10:08, Ulrich Goebel via Python-list wrote:
By the way: in my usecase I want to pass different functions to different
instances of MyClass. It is in the context of a database app where I build
Getters for database data and pass one Getter per instance.
If I understood what you're
On 2024-06-28 18:08:54 +0200, Ulrich Goebel via Python-list wrote:
> a class can have methods, and it can have attributes, which can hold a
> function. Both is well known, of course.
>
> My question: Is there any difference?
>
> The code snipped shows that both do what they should do. But __dict_
On 5/1/22, Brent Hunter wrote:
>
> I was recently running a Windows 10 machine Python 3.9. I simply created a
> batch file titled "Start-AIG.bat" which simply contained the following:
> "pythonw AIG.py". It started a python program titled "AIG.py" and the
> Python dialog box was displayed on my
On 2022-05-02 02:56, Brent Hunter wrote:
Hello,
I was recently running a Windows 10 machine Python 3.9. I simply created a batch file titled "Start-AIG.bat" which
simply contained the following: "pythonw AIG.py". It started a python program titled "AIG.py" and the Python
dialog box was displ
Yeah it is True, for the last two weeks or so I can access bugs.python.org
in normal way. But I totally agree with the site that the best description
of this situation is "Yet".
with kind regards,
-gdg
сб, 14 дек. 2019 г. в 19:46, Terry Reedy :
> On 7/26/2019 3:12 AM, Kirill Balunov wrote:
> > ч
On 7/26/2019 3:12 AM, Kirill Balunov wrote:
чт, 25 июл. 2019 г. в 20:28, eryk sun :
On 7/25/19, Kirill Balunov wrote:
import os
from pathlib import Path
dummy = " " # or "" or " "
os.path.isdir(dummy)
False
Path(dummy).is_dir()
True
I can't reproduce the above result in either Li
чт, 25 июл. 2019 г. в 20:28, eryk sun :
> On 7/25/19, Kirill Balunov wrote:
> >
> import os
> from pathlib import Path
> dummy = " " # or "" or " "
> os.path.isdir(dummy)
> > False
> Path(dummy).is_dir()
> > True
>
> I can't reproduce the above result in either Linu
On 26Jul2019 03:43, Chris Angelico wrote:
On Fri, Jul 26, 2019 at 3:28 AM eryk sun wrote:
On 7/25/19, Kirill Balunov wrote:
import os
from pathlib import Path
dummy = " " # or "" or " "
os.path.isdir(dummy)
> False
Path(dummy).is_dir()
> True
I can't reproduce
On 25Jul2019 13:40, eryk sun wrote:
Windows trims trailing spaces and dots from the final component of a
path, unless we use a non-normalized \\?\ path.
Hoo!
Well, that explains some extremely weird NAS behaviour I encountered the
other month with some paths ending in spaces. (My machine and
On Fri, Jul 26, 2019 at 6:13 AM Kirill Balunov wrote:
>
>
>
> чт, 25 июл. 2019 г. в 22:58, Chris Angelico :
>>
>> On Fri, Jul 26, 2019 at 5:52 AM Kirill Balunov
>> wrote:
>> [...]
>> > No, it's not just because of curiosity. I will try to tell the background,
>> > and maybe I went the wrong way
чт, 25 июл. 2019 г. в 22:58, Chris Angelico :
> On Fri, Jul 26, 2019 at 5:52 AM Kirill Balunov
> wrote:
> [...]
> > No, it's not just because of curiosity. I will try to tell the
> background, and maybe I went the wrong way initially. There is a very cool
> project https://github.com/3b1b/manim,
On Fri, Jul 26, 2019 at 5:52 AM Kirill Balunov wrote:
>
>
>
> чт, 25 июл. 2019 г. в 19:16, Chris Angelico :
>>
>> On Fri, Jul 26, 2019 at 1:30 AM Kirill Balunov
>> wrote:
>> >
>> > Hi all! It is expected that:
>> > ```
>> > >>> import os
>> > >>> from pathlib import Path
>> > >>> dummy = " "
чт, 25 июл. 2019 г. в 19:16, Chris Angelico :
> On Fri, Jul 26, 2019 at 1:30 AM Kirill Balunov
> wrote:
> >
> > Hi all! It is expected that:
> > ```
> > >>> import os
> > >>> from pathlib import Path
> > >>> dummy = " " # or "" or " "
> > >>> os.path.isdir(dummy)
> > False
> > >>> Path(dum
чт, 25 июл. 2019 г. в 20:28, eryk sun :
> On 7/25/19, Kirill Balunov wrote:
> >
> import os
> from pathlib import Path
> dummy = " " # or "" or " "
> os.path.isdir(dummy)
> > False
> Path(dummy).is_dir()
> > True
>
> I can't reproduce the above result in either Linu
On 7/25/19, Chris Angelico wrote:
> On Fri, Jul 26, 2019 at 3:54 AM eryk sun wrote:
>
>> That's what I said. But the OP shows os.path.isdir(" ") == False and
>> Path(" ").is_dir() == True, which is what I cannot reproduce and
>> really should not be able to reproduce, unless there's a bug
>> some
On Fri, Jul 26, 2019 at 3:54 AM eryk sun wrote:
>
> On 7/25/19, Chris Angelico wrote:
> > On Fri, Jul 26, 2019 at 3:28 AM eryk sun wrote:
> >>
> >> On 7/25/19, Kirill Balunov wrote:
> >> >
> >> import os
> >> from pathlib import Path
> >> dummy = " " # or "" or " "
> >> >>>
On 7/25/19, Chris Angelico wrote:
> On Fri, Jul 26, 2019 at 3:28 AM eryk sun wrote:
>>
>> On 7/25/19, Kirill Balunov wrote:
>> >
>> import os
>> from pathlib import Path
>> dummy = " " # or "" or " "
>> os.path.isdir(dummy)
>> > False
>> Path(dummy).is_dir()
>> > T
On Fri, Jul 26, 2019 at 3:28 AM eryk sun wrote:
>
> On 7/25/19, Kirill Balunov wrote:
> >
> import os
> from pathlib import Path
> dummy = " " # or "" or " "
> os.path.isdir(dummy)
> > False
> Path(dummy).is_dir()
> > True
>
> I can't reproduce the above result in e
On 7/25/19, Kirill Balunov wrote:
>
import os
from pathlib import Path
dummy = " " # or "" or " "
os.path.isdir(dummy)
> False
Path(dummy).is_dir()
> True
I can't reproduce the above result in either Linux or Windows. The
results should only be different for an empt
On Fri, Jul 26, 2019 at 1:30 AM Kirill Balunov wrote:
>
> Hi all! It is expected that:
> ```
> >>> import os
> >>> from pathlib import Path
> >>> dummy = " " # or "" or " "
> >>> os.path.isdir(dummy)
> False
> >>> Path(dummy).is_dir()
> True
> ```
>
> or was it overlooked?
>
Was not aware
Thanks Edmondo, Stephen, Mats and Steven you for the tips,
I studied linear algebra many years ago and I remember only a few rudiments.
But I was trying to visualize (in a geometric way) how the numpy
represents arrays, and what the geometrical meaning of the transpose
operation made by numpy.
On 2019-06-21 02:39, Markos wrote:
Hi,
I'm studying Numpy and I don't understand the difference between
vector_1 = np.array( [ 1,0,1 ] )
with 1 bracket and
vector_2 = np.array( [ [ 1,0,1 ] ] )
with 2 brackets
The shape of vector_1 is:
vector_1.shape
(3,)
But the shape of vector_2 i
Keep also in mind that numpy is quite different from Matlab.
In Matlab every vaiable is a matrix of at least 2 dimensions.
This is not the case of numpy (and is not the case in Fortran too).
every array can have a different number of dimensions. The transposition of an
array with just 1 dimension
Every array in numpy has a number of dimensions,
"np.array" is a function that can create an array numpy given a list.
when you write
vector_1 = np.array([1,2,1])
you are passing a list of number to thet function array that will create a 1D
array.
As you are showing:
vector_1.shape
will retur
Markos,
I can explain the difference from a non-numpy point of view - I hope you
will be able to see how this difference affects what you are trying to do
in numpy.
vector_1 is an np.array consisting of a three-element list, with the three
elements being 1, 0 and 1.
vector_2 is an np.array consi
Yes, it sort-of makes sense... I'll basically re-post my question there.
Thanks for the link!
Oren.
On Sun, Jul 16, 2017 at 4:29 PM, Peter Otten <__pete...@web.de> wrote:
> Oren Ben-Kiki wrote:
>
> > TL;DR: We need improved documentation of the way meta-classes behave for
> > generic classes,
Oren Ben-Kiki wrote:
> TL;DR: We need improved documentation of the way meta-classes behave for
> generic classes, and possibly reconsider the way "__setattr__" and
> "__getattribute__" behave for such classes.
The typing module is marked as "provisional", so you probably have to live
with the i
Hi Wolfgang,
thanks for your kind reply. I got.
regards
skyworld
--
https://mail.python.org/mailman/listinfo/python-list
On 17.10.2016 16:45, chenyong20...@gmail.com wrote:
Hi Wolfgang,
thanks for your kind reply. I try to explain what I got from your reply:
for code1, when running "foo = outer()", since outer() is callable, function outer() is running and it
returns an object, which referring to function inner(
Hi Wolfgang,
thanks for your kind reply. I try to explain what I got from your reply:
for code1, when running "foo = outer()", since outer() is callable, function
outer() is running and it returns an object, which referring to function
inner(). When "foo" is running, it indicates it is referrin
On 17.10.2016 10:52, chenyong20...@gmail.com wrote:
Hi,
i'm confused by a piece of code with parenthese as this:
code 1--
def outer():
... def inner():
... print 'inside inner'
... return inner
...
foo = outer()
foo
foo()
inside inner
On 2013-02-26, 16:25 GMT, Terry Reedy wrote:
> On 2/21/2013 4:22 PM, Matej Cepl wrote:
>> as my method to commemorate Aaron Swartz, I have decided to port his
>> html2text to work fully with the latest python 3.3. After some time
>> dealing with various bugs, I have now in my repo
>> https://github
On 2/21/2013 4:22 PM, Matej Cepl wrote:
as my method to commemorate Aaron Swartz, I have decided to port his
html2text to work fully with the latest python 3.3. After some time
dealing with various bugs, I have now in my repo
https://github.com/mcepl/html2text (branch python3) working solution
wh
On Tue, Jan 8, 2013 at 1:21 PM, wrote:
> Repr and Eval I think I get. Eval certainly. That's a familiar concept, and
> one I hope to use tomorrow to feed a line to psycopg2.
I hope not. Why do you need eval? It's extremely dangerous.
Chances are there's a better way to do it; if your users are
Thanks, I think I'm clear now.
I guess (map(str, stn_list)) was all about how to make a string starting with
integers. I picked that up and began using it without realising it was over
catering for a list already containing strings, and join(stn_list) was really
all I required.
Repr and Eval
On 01/07/2013 08:00 PM, andydtay...@gmail.com wrote:
> Hi,
>
> Python newbie here again - this is probably a quick one. What's the
> difference between the lines I've numbered 1. and 2. below, which produce the
> following results:
>
> Results:
> 1. [ANG, BAR, BPK, CTN, QGH, QHD, KXX]
> 2. ['ANG
In article <700d2bd9-e1df-4d38-81c7-77029a36c...@googlegroups.com>,
andydtay...@gmail.com wrote:
> Hi,
>
> Python newbie here again - this is probably a quick one. What's the
> difference between the lines I've numbered 1. and 2. below, which produce the
> following results:
>
> Results:
> 1
On Tue, Jan 8, 2013 at 12:06 PM, wrote:
> I think I can answer my own question on reflection the first one is
> actually a string I think? I was confused by the square brackets around the
> placeholder %s.
That's correct. Your first line is putting square brackets around a
comma-joined li
On Tue, Jan 8, 2013 at 12:00 PM, wrote:
> Hi,
>
> Python newbie here again - this is probably a quick one. What's the
> difference between the lines I've numbered 1. and 2. below, which produce the
> following results:
>1. print stn_fields = '[%s]' % ', '.join(map(str, stn_list_short))
>
I think I can answer my own question on reflection the first one is
actually a string I think? I was confused by the square brackets around the
placeholder %s.
--
http://mail.python.org/mailman/listinfo/python-list
On 11/5/2012 9:23 AM, inshu chauhan wrote:
what is the difference between range and xrange.. both seem to work the
same. ?
>>> range(3)
[0, 1, 2]
>>> xrange(3)
xrange(3)
You should read the appropriate manual entries before asking trivial
questions. They say pretty clearly that range returns
in python 2.x xrange is a generator and range returns a list. In python
3.x xrange is renamed to range replacing the list function with the
generator
On Mon, Nov 5, 2012 at 9:23 AM, inshu chauhan wrote:
> what is the difference between range and xrange.. both seem to work the
> same. ? And whi
On 11/05/2012 09:23 AM, inshu chauhan wrote:
> what is the difference between range and xrange.. both seem to work the
> same. ? And which should be used where and in what situations.. ??
>
>
One difference is that from versions of Python 3.0 and later, xrange
doesn't exist, and range takes over
On 5/17/2012 4:23 AM, Devin Jeanpierre wrote:
str.isdecimal = isdecimal(...)
S.isdecimal() -> bool
Return True if there are only decimal characters in S,
False otherwise.
Help on method_descriptor in str:
str.isdigit = isdigit(...)
S.isdigit() -> bool
Return True i
On Wed, May 16, 2012 at 5:07 PM, Thomas 'PointedEars' Lahn
wrote:
> RTFM.
>
> $ python3 -c 'print("42".isdecimal.__doc__ + "\n");
> print("42".isdigit.__doc__)'
Heh, don't print docstrings. Use pydoc.
$ ( export PAGER=cat && pydoc3 str.isdecimal && pydoc3 str.isdigit )
Help on method_descriptor
On 05/17/2012 02:15 AM, Steven D'Aprano wrote:
the Fine Manual has more detail, although I admit it isn't *entirely*
clear what it is talking about if you're not a Unicode expert:
http://docs.python.org/py3k/library/stdtypes.html#str.isdecimal
You are right, that is clear, thanks :)
Exampl
On Wed, 16 May 2012 17:48:19 +0200, Marco wrote:
> Hi all, because
>
> "There should be one-- and preferably only one --obvious way to do it",
>
> there should be a difference between the two methods in the subject, but
> I can't find it:
The Fine Manual has more detail, although I admit it isn
On Wed, May 16, 2012 at 3:07 PM, Thomas 'PointedEars' Lahn
wrote:
> RTFM.
>
> $ python3 -c 'print("42".isdecimal.__doc__ + "\n");
> print("42".isdigit.__doc__)'
> S.isdecimal() -> bool
>
> Return True if there are only decimal characters in S,
> False otherwise.
>
> S.isdigit() -> bool
>
> Return
Marco wrote:
> Hi all, because
>
> "There should be one-- and preferably only one --obvious way to do it",
>
> there should be a difference between the two methods in the subject, but
> I can't find it:
>
> >>> '123'.isdecimal(), '123'.isdigit()
> (True, True)
> >>> print('\u0660123')
> ٠123
On 16 mai, 17:48, Marco wrote:
> Hi all, because
>
> "There should be one-- and preferably only one --obvious way to do it",
>
> there should be a difference between the two methods in the subject, but
> I can't find it:
>
> >>> '123'.isdecimal(), '123'.isdigit()
> (True, True)
> >>> print('\u06
On 05/16/2012 06:24 PM, Ulrich Eckhardt wrote:
Marco wrote:
>>>> '123'.isdecimal(), '123'.isdigit()
> (True, True)
>>>> print('\u0660123')
> ٠123
>>>> '\u0660123'.isdigit(), '\u0660123'.isdecimal()
> (True, True)
>>>> print('\u216B')
> Ⅻ
>>>> '\u216B'.isdecimal(), '
On Wed, May 16, 2012 at 10:24 AM, Ulrich Eckhardt wrote:
> Marco wrote:
>> >>> '123'.isdecimal(), '123'.isdigit()
>> (True, True)
>> >>> print('\u0660123')
>> ٠123
>> >>> '\u0660123'.isdigit(), '\u0660123'.isdecimal()
>> (True, True)
>> >>> print('\u216B')
>> Ⅻ
>> >>> '\u216B'.isdecimal(), '\
Marco wrote:
> >>> '123'.isdecimal(), '123'.isdigit()
> (True, True)
> >>> print('\u0660123')
> ٠123
> >>> '\u0660123'.isdigit(), '\u0660123'.isdecimal()
> (True, True)
> >>> print('\u216B')
> Ⅻ
> >>> '\u216B'.isdecimal(), '\u216B'.isdigit()
> (False, False)
[chr(a) for a in range(0x2) if
On 16/05/2012 16:48, Marco wrote:
Hi all, because
"There should be one-- and preferably only one --obvious way to do it",
there should be a difference between the two methods in the subject, but
I can't find it:
>>> '123'.isdecimal(), '123'.isdigit()
(True, True)
>>> print('\u0660123')
٠
On Wed, May 16, 2012 at 9:48 AM, Marco wrote:
> Hi all, because
>
> "There should be one-- and preferably only one --obvious way to do it",
>
> there should be a difference between the two methods in the subject, but I
> can't find it:
>
'123'.isdecimal(), '123'.isdigit()
> (True, True)
On Fri, Apr 20, 2012 at 1:30 AM, Frank Millman wrote:
> Hi all
>
> I need the ability to execute a function by parsing a string containing the
> full path to the function. The string is multi-dotted. The last element is
> the function name, the second-last is the name of the module containing the
On Apr 5, 8:10 am, Steve Howell wrote:
> On Apr 5, 7:50 am, "Alex van der Spek" wrote:
>
>
>
>
>
>
>
>
>
> > I do not understand why the spooled write gives an error. See below.
> > The normal tempfile works just fine. They are supposed to behave equal?
>
> > All insight you can provide is welcom
On Apr 5, 7:50 am, "Alex van der Spek" wrote:
> I do not understand why the spooled write gives an error. See below.
> The normal tempfile works just fine. They are supposed to behave equal?
>
> All insight you can provide is welcome.
> Alex van der Spek
>
> +++
2012/3/28 ian douglas
>
> The functions with an s take string parameters. The others take file
> streams.
>
> foo = '{"age": 38}'
> my_json = json.loads(foo)
>
I see, it makes perfectly sense now. Thanks for clearing it up.
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 28, 2012 6:54 AM, "Nadir Sampaoli" wrote:
>
> Hello everyone (my first message in the mailing list),
>
>>
>> > Is the following function correct?
>> Yes, though I'd use json.load(f) instead of json.loads().
>
>
> The docs aren't very clear (at least for me) about the difference between
json
Am 06.02.2012 09:45, schrieb Matej Cepl:
Also, how could I write a re-implementation of random.choice which would
work same on python 2.6 and python 3.2? It is not only matter of unit
tests, but I would really welcome if the results on both versions
produce the same results.
Two approaches come
07.02.12 00:06, Matej Cepl написав(ла):
> return seq[int(random.random() * len(seq))]
>
> doesn't seem like something so terrible (and maintenance intense). :)
_choice('abc') returns 'a' with probability P('a') =
1501199875790165/4503599627370496 = 1/3 - 1/13510798882111488 and 'b' with
probabi
On 6.2.2012 20:26, Tim Chase wrote:
In an ideal world, the code wouldn't have broken backwards compat.
However, given the conditions, if Matej is willing to forgo bug-fixes,
it's a reasonable solution. The alternate might be to try moving the
recent/fixed version into the old project and updating
On 02/06/12 12:48, Aaron France wrote:
On 02/06/2012 09:57 AM, Matej Cepl wrote:
Silly, of course, the solution is obvious ... I have just
embedded random.choice from 2.6 to my code.
Matěj
Is the above actually a good idea though?
What I understand you're doing is embedding the source from
th
On 02/06/2012 09:57 AM, Matej Cepl wrote:
On 6.2.2012 09:45, Matej Cepl wrote:
Also, how could I write a re-implementation of random.choice which would
work same on python 2.6 and python 3.2? It is not only matter of unit
tests, but I would really welcome if the results on both versions
produce
Steven D'Aprano wrote:
> A more explicit note will help, but the basic problem applies: how do you
> write deterministic tests given that the random.methods (apart from
> random.random itself) can be changed without warning?
Biting the bullet would mean supplying your own PRNG, under your control
On 6.2.2012 09:45, Matej Cepl wrote:
Also, how could I write a re-implementation of random.choice which would
work same on python 2.6 and python 3.2? It is not only matter of unit
tests, but I would really welcome if the results on both versions
produce the same results.
Silly, of course, the s
On 6.2.2012 09:05, Steven D'Aprano wrote:
You have persuaded me that the doc should be more explicit that while
the basic random.random sequence will be kept repeatable with seed set
(except perhaps after a changeover of several releases), the convenience
transformations can be changed if improve
On Mon, 06 Feb 2012 02:27:14 -0500, Terry Reedy wrote:
[...]
>> and should be treated as a bug. Raymond made a strong case arguing for
>> repeatability, and then approved a bug fix that broke repeatability. I
>> doubt that was deliberate.
>
> It was deliberate that randrange was changed to an eve
On 2/6/2012 12:56 AM, Steven D'Aprano wrote:
On Mon, 06 Feb 2012 00:07:04 -0500, Terry Reedy wrote:
On 2/5/2012 11:01 PM, Steven D'Aprano wrote:
Reading the docs, I would expect that when using an int as seed, you
should get identical results.
That is similar to expecting hash to be consist
On Mon, 06 Feb 2012 00:07:04 -0500, Terry Reedy wrote:
> On 2/5/2012 11:01 PM, Steven D'Aprano wrote:
>
>> Reading the docs, I would expect that when using an int as seed, you
>> should get identical results.
>
> That is similar to expecting hash to be consistent from version to
> version.
No.
On 2/5/2012 11:01 PM, Steven D'Aprano wrote:
Reading the docs, I would expect that when using an int as seed, you
should get identical results.
That is similar to expecting hash to be consistent from version to version.
There is no mention that the PRNG has changed between 2.6 and 3.2;
The
On Mon, 06 Feb 2012 02:27:38 +0100, Matej Cepl wrote:
> Strange thing is that this unit tests correctly with python3, but fails
> with python2. The problem is that apparently python3 random.choice picks
> different element of self[k] than the one python2 (at least, both of
> them are constant in t
On 20 January 2011 15:16, lakshmi wrote:
> Is the programming related to image processing in python is advantageous or
> else in MATLAB
>
Matlab comes with a lot of builtins for image processing, pattern
recognition and many other engineering-related things. If it's just a
quick hack and you're
On Thursday 20 January 2011, it occurred to lakshmi to exclaim:
> Is the programming related to image processing in python is advantageous or
> else in MATLAB
Tell us what you want to do, and what you know about doing this in Python and
in MATLAB, if possible, ask a specific question. Then, someb
Ethan Furman writes:
> If I'm printing the number 735, or any other positive or negative
> integer, is there any difference between %7s and %7d?
>
> ~Ethan~
To link with another thread:
>>> "%s" % True
'True'
>>> "%d" % True
'1'
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-lis
Ethan Furman wrote:
If I'm printing the number 735, or any other positive or negative
integer, is there any difference between %7s and %7d?
Grant Edwards wrote:
> Let's ask Python:
>
> --> [n for n in range(-,,123) if ("%7d" % n)
> != ("%7s" % n)]
> []
>
> --> [n
On 01/10/2010 20:15, Ethan Furman wrote:
If I'm printing the number 735, or any other positive or negative
integer, is there any difference between %7s and %7d?
"%s" uses str(). In Python 2.7:
>>> class MyInt(int):
... def __init__(self, value):
... int.__init__(self, value)
...
On 2010-10-01, Ethan Furman wrote:
> If I'm printing the number 735, or any other positive or negative
> integer, is there any difference between %7s and %7d?
Let's ask Python:
>>> [n for n in range(-,,123) if ("%7d" % n) != ("%7s" % n)]
[]
>>> [n for n in range(-9,99
Nobody wrote:
On Thu, 09 Sep 2010 12:23:17 -0700, Ethan Furman wrote:
basically a Queue is a syncronization primitive used to
share and pass data to and from parent/child processes.
A pipe is as the name suggests, a socket pair connected
end-to-end allowing for full-duplex communications.
Isn
On Thu, 09 Sep 2010 12:23:17 -0700, Ethan Furman wrote:
>> basically a Queue is a syncronization primitive used to
>> share and pass data to and from parent/child processes.
>>
>> A pipe is as the name suggests, a socket pair connected
>> end-to-end allowing for full-duplex communications.
>>
>
James Mills wrote:
On Wed, Aug 4, 2010 at 7:20 PM, Navkirat Singh wrote:
I was wondering what are the differences between queues and pipes implemented
using multiprocessing python module. Am I correct if I say, in pipes, if
another process writes to one receiving end concurrently, then an err
On Wed, Aug 4, 2010 at 7:20 PM, Navkirat Singh wrote:
> I was wondering what are the differences between queues and pipes implemented
> using multiprocessing python module. Am I correct if I say, in pipes, if
> another process writes to one receiving end concurrently, then an error will
> be ra
Steven D'Aprano wrote:
On Mon, 19 Jul 2010 00:53:56 -0400, Edward Diener wrote:
In a python script a:
from xxx.yyy.zzz import aaa
fails with the message:
"ImportError: No module named xxx.yyy.zzz"
but from within the python interpreter the same line succeeds. What
would be the causes of
Edward Diener wrote:
> In a python script a:
>
> from xxx.yyy.zzz import aaa
>
> fails with the message:
>
> "ImportError: No module named xxx.yyy.zzz"
>
> but from within the python interpreter the same line succeeds. What
> would be the causes of that ?
>
> From within the python interpreter
On Mon, 19 Jul 2010 00:53:56 -0400, Edward Diener wrote:
> In a python script a:
>
> from xxx.yyy.zzz import aaa
>
> fails with the message:
>
> "ImportError: No module named xxx.yyy.zzz"
>
> but from within the python interpreter the same line succeeds. What
> would be the causes of that ?
>
AON LAZIO wrote:
As subject says, what is the differences of 'is not' and '!='. Confusing..
"is not" checks if two objects are not identical. "!=" checks if two
objects are not equal.
Example:
Two apples may be equal in size, form and color but they can never be
identical because they are m
On Mon, May 10, 2010 at 4:25 PM, AON LAZIO wrote:
> As subject says, what is the differences of 'is not' and '!='. Confusing..
!= checks value inequality, `is not` checks object identity /
"pointer" inequality
Unless you're doing `foo is not None`, you almost always want !=.
By way of demonstrat
In article ,
J wrote:
>
>Say I had a file, foo.txt that I wanted to read from, only one time
>and only read.
>
>So what's the difference between this:
>
>mylist = Popen(["cat","foo.txt"], stdout=PIPE).communicate()[0].splitlines()
>
>Is there a reason why you would not use subprocess.Popen for th
On Thu, Apr 22, 2010 at 15:18, Dave Angel wrote:
> The same difference as between handing the paper boy three bucks, versus
> flying to London to open an account, making a deposit, going to a branch in
> Sydney and asking for a bank check, then flying back home and taking the
> paper boy with you
J wrote:
I was reading something from a code review a little while ago and saw
something that's got my curiosity up...
Say I had a file, foo.txt that I wanted to read from, only one time
and only read.
So what's the difference between this:
mylist = Popen(["cat","foo.txt"], stdout=PIPE).comm
J wrote:
I was reading something from a code review a little while ago and saw
something that's got my curiosity up...
Say I had a file, foo.txt that I wanted to read from, only one time
and only read.
So what's the difference between this:
mylist = Popen(["cat","foo.txt"], stdout=PIPE).commun
On Thu, Apr 22, 2010 at 11:28 AM, J wrote:
> I was reading something from a code review a little while ago and saw
> something that's got my curiosity up...
>
> Say I had a file, foo.txt that I wanted to read from, only one time
> and only read.
>
> So what's the difference between this:
>
> mylis
> I'd like to start with two dates as strings, as
> "1961/06/16 04:35:25" and "1973/01/18 03:45:50"
> How do I get the strings into a shape that will accommodate a difference?
Pyfdate http://www.ferg.org/pyfdate/index.html
has a numsplit function that should do the trick:
http://www.ferg.org/pyf
On Tue, Dec 29, 2009 at 7:21 AM, M.-A. Lemburg wrote:
> If you want a more human readable, relative format use Age():
>
> >>> Age(bree, nat)
> 0x2b99c6e37ef0>
>
> i.e. 8 years, 4 months, 29 days, 49 minutes, 35 seconds.
>
That is... awesome. I use mx.DateTime all the time, and never knew about
W. eWatson wrote:
> According to one web source, this program:
>
> import datetime
> bree = datetime.datetime(1981, 6, 16, 4, 35, 25)
> nat = datetime.datetime(1973, 1, 18, 3, 45, 50)
>
> difference = bree - nat
> print "There were", difference, "minutes between Nat and Bree"
>
> yields:
> Ther
W. eWatson wrote:
> Peter Otten wrote:
>> W. eWatson wrote:
>>
>>> This is quirky.
>>>
>>> >>> t1=datetime.datetime.strptime("20091205_221100","%Y%m%d_%H%M%S")
>>> >>> t1
>>> datetime.datetime(2009, 12, 5, 22, 11)
>>> >>> type(t1)
>>>
>>> >>>
>>> t1: 2009-12-05 22:11:00
>>>
>>> but in the pr
Peter Otten wrote:
W. eWatson wrote:
This is quirky.
>>> t1=datetime.datetime.strptime("20091205_221100","%Y%m%d_%H%M%S")
>>> t1
datetime.datetime(2009, 12, 5, 22, 11)
>>> type(t1)
>>>
t1: 2009-12-05 22:11:00
but in the program:
import datetime
t1=datetime.datetime.strptime("2
1 - 100 of 384 matches
Mail list logo