I need an input function with GNU readline support. So far I have:
import readline
readline.parse_and_bind("tab: complete")
file = raw_input('File to send: ')
Cursor keys are working, but TAB-completion works only in the current
directory. Example:
File to send: [TAB][TAB]
argv.py
Кисик Мурысик writes:
> Hello!
> I'm new to Python, so I decided to learn it
Congratulations! Python is a fine language to learn, and this is the
place to discuss general Python topics.
You may also want to join the ‘tutor’ forum
https://mail.python.org/mailman/listinfo/tutor>, which is
specifi
Ben Finney :
> Indeed, in the past I used the term “value” as synonymous (in Python
> context) with the term “object”. I have become convinced through this
> discussion that I should no longer use the terms that way.
>
> [...]
>
> The concepts are distinct, so I apologise for misleadingly conflati
On Wed, Nov 25, 2015 at 3:22 PM, ARONA KANAGARATHNA via Python-list
wrote:
> I tried to install this software python 3.4.3 to my pc which run windows Xp
> 32. i could installed but it doesnot run.it gives this message
> "python35-32/python.exe isnot a valid win32 app.Please help me to get solved
Hi,
I have an if statement which seems to run both commands and I cannot figure out
why. (just learning so I may be missing something obvious) Any ideas?
while True:
global latit,longt,jlatit,jlongt,mlongt,mlatit
response = urllib.urlopen(url)
data = json.loads(response.r
I tried to install this software python 3.4.3 to my pc which run windows Xp 32.
i could installed but it doesnot run.it gives this message
"python35-32/python.exe isnot a valid win32 app.Please help me to get solved
this problem
Thanks
Aruna
--
https://mail.python.org/mailman/listinfo/python-li
Hi,
Do you see any possible dangerous hidden bug in the below code(using
python2.7 and python3.4)?
My goal is to avoid go through the metrics list twice. But, I don't
know if there will be a problem with doing in place replace of list
elements using 2 generators.
# metrics = ['', '0', '10']
Hello!
I'm new to Python, so I decided to learn it and write simple apt alternative
(apt is somewhat broken for me).
But I can't decide - can I read just one file (/DEBIAN/control) from archive
without unpacking it, or do I need to unpack? And what module I can use to
handle .ar files? (I read i
Laura Creighton writes:
> If I had a time machine, I would go back to early days of Python and
> ban the use of the term 'assignment' and 'value' both. I would insist
> that the term 'binding' be used instead, though if you want to use the
> verb refer, to be synonymous with bind, well, I think t
Full story here:
http://grodola.blogspot.com/2015/11/openbsd-support-for-psutil.html
--
Giampaolo - http://grodola.blogspot.com
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, Nov 25, 2015 at 11:36 AM, Steven D'Aprano wrote:
> If, and only if, the tuple
> contains nothing but immutable constants e.g.
>
> (1, 2.0, None, "spam")
>
> then a sufficiently smart compiler may be able to treat that specific tuple
> as a constant/literal. But that's a special case, and c
In a message of Wed, 25 Nov 2015 11:39:54 +1100, "Steven D'Aprano" writes:
>I'm not sure what value [ha, see what I did there?!] there is in inventing
>two new words for things that we already have standard terms for.
Done correctly, you can get clarity.
>"Referent" is just a funny way of saying
On Wed, 25 Nov 2015 08:25 am, Antoon Pardon wrote:
> The point is that a
> tuple can just be loaded as a constant without needing something extra.
How would one load this tuple as a constant?
(myfile.read(), "%.5f" % sin(x or y))
The point is that *in general*, tuple so-called "literals" (wha
On Wed, 25 Nov 2015 01:18 am, Ned Batchelder wrote:
> In English, "value" means something like, what is this equal to?
> There isn't another good word to use in place of "value" here.
There are many different meanings for the English noun "value" (Websters
1913 dictionary includes ten), but I th
On Wed, 25 Nov 2015 06:00 am, Random832 wrote:
> On 2015-11-24, Chris Angelico wrote:
>> Probably the grammar. In other words, it's part of the language's very
>> definition.
>
> Then the definition is wrong. I think "literal" is a word whose meaning is
> generally agreed on, rather than somethi
On 24Nov2015 14:53, Ian Kelly wrote:
On Mon, Nov 23, 2015 at 10:25 PM, Cameron Simpson wrote:
Then #3. I would have a common function/method for submitting a request to
go to the subprocess, and have that method return an Event on which to wait.
Then caller then just waits for the Event and co
On Wed, Nov 25, 2015 at 6:00 AM, Random832 wrote:
> On 2015-11-24, Chris Angelico wrote:
>> Probably the grammar. In other words, it's part of the language's very
>> definition.
>
> Then the definition is wrong. I think "literal" is a word whose meaning is
> generally agreed on, rather than somet
On Wed, Nov 25, 2015 at 7:27 AM, wrote:
> The problem happens with Python3 because "logging" is in the default
> installation. In Python2 it is not installed. I installed it with
>sudo python2 -m pip install logging -U
>
> This works without problems. Importing in Python2 works, too.
You app
On Mon, Nov 23, 2015 at 10:25 PM, Cameron Simpson wrote:
> Then #3. I would have a common function/method for submitting a request to
> go to the subprocess, and have that method return an Event on which to wait.
> Then caller then just waits for the Event and collects the data. Obviously,
> the m
On Tue, Nov 24, 2015 at 1:54 PM, Antoon Pardon
wrote:
> Op 24-11-15 om 20:15 schreef Ian Kelly:
>
>>> But no matter what you want to call it. The dis module shows that
>>> -42 is treated in exactly the same way as 42, which is treated
>>> exactly the same way as () or as (5, 8, 13) which is treate
On 24Nov2015 06:33, israel wrote:
On 11/23/2015 20:29, Cameron Simpson wrote:
On 24Nov2015 16:25, Cameron Simpson wrote:
Completely untested example code:
class ReturnEvent:
def __init__(self):
self.event = Event()
With, of course:
def wait(self):
return self.event.wait()
Of c
Op 24-11-15 om 22:14 schreef BartC:
> On 24/11/2015 20:54, Antoon Pardon wrote:
>> Op 24-11-15 om 20:15 schreef Ian Kelly:
>>
But no matter what you want to call it. The dis module shows that
-42 is treated in exactly the same way as 42, which is treated
exactly the same way as () or
On 24/11/2015 20:54, Antoon Pardon wrote:
Op 24-11-15 om 20:15 schreef Ian Kelly:
But no matter what you want to call it. The dis module shows that
-42 is treated in exactly the same way as 42, which is treated
exactly the same way as () or as (5, 8, 13) which is treated
differently from [] or
I using 'logging' for some month.
But today I have strange problem. When importing it it fails.
Python 3.4.3 (default, Oct 14 2015, 20:33:09)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging
Traceback (most recent call last):
File "
Op 24-11-15 om 20:15 schreef Ian Kelly:
>> But no matter what you want to call it. The dis module shows that
>> -42 is treated in exactly the same way as 42, which is treated
>> exactly the same way as () or as (5, 8, 13) which is treated
>> differently from [] or [5, 8, 13].
>
> This is an imple
On Tue, Nov 24, 2015 at 9:17 PM, Marc Aymerich wrote:
> On Tue, Nov 24, 2015 at 8:41 PM, Zachary Ware
> wrote:
>> On Tue, Nov 24, 2015 at 12:37 PM, Marc Aymerich wrote:
>>> still it appears to work only if the main thread is in the foreground
>>> (as of calling Thread() with deamon=True), I don'
On Tue, Nov 24, 2015 at 8:41 PM, Zachary Ware
wrote:
> On Tue, Nov 24, 2015 at 12:37 PM, Marc Aymerich wrote:
>> still it appears to work only if the main thread is in the foreground
>> (as of calling Thread() with deamon=True), I don't get why it behaves
>> differently :( maybe it is waiting for
On Tue, Nov 24, 2015 at 12:37 PM, Marc Aymerich wrote:
> still it appears to work only if the main thread is in the foreground
> (as of calling Thread() with deamon=True), I don't get why it behaves
> differently :( maybe it is waiting for other stuff, but no idea how to
> confirm this with strace
Steven D'Aprano :
> On Wed, 25 Nov 2015 05:13 am, Marko Rauhamaa wrote:
>> I would prefer this wording:
>>
>> Objects whose inner state can change are said to be mutable
>
> I see your point, but "inner state" might not be related to the
> object's externally visible value.
The inner state is in
On Tue, Nov 24, 2015 at 12:00 PM, Random832 wrote:
> On 2015-11-24, Chris Angelico wrote:
>> Probably the grammar. In other words, it's part of the language's very
>> definition.
>
> Then the definition is wrong. I think "literal" is a word whose meaning is
> generally agreed on, rather than some
On Tue, Nov 24, 2015 at 11:45 AM, Antoon Pardon
wrote:
> I think limiting literals to lexical tokens is too limited. Sure we
> can define them like that in the context of the python grammar, but
> I don't see why we should limit ourselves to such a definition outside
> that context.
>
> I see noth
On 2015-11-24, Chris Angelico wrote:
> Probably the grammar. In other words, it's part of the language's very
> definition.
Then the definition is wrong. I think "literal" is a word whose meaning is
generally agreed on, rather than something each language's spec can invent from
whole cloth for it
On Tuesday, November 24, 2015 at 1:45:34 PM UTC-5, Antoon Pardon wrote:
> Whether you want to call it literals or something else, the fact
> remains that (3, 5, 8) is treated like -42 by the CPython interpreter
> and [3, 5, 8] is not.
Maybe I've lost the original point in all this minutia about wh
Op 24-11-15 om 18:53 schreef Ian Kelly:
> On Tue, Nov 24, 2015 at 10:32 AM, Antoon Pardon
> wrote:
>> Op 24-11-15 om 17:56 schreef Ian Kelly:
>>
>>>
So on what grounds would you argue that () is not a literal.
>>>
>>> This enumerates exactly what literals are in Python:
>>>
>>> https://docs.p
On Tue, Nov 24, 2015 at 7:11 PM, Zachary Ware
wrote:
> On Tue, Nov 24, 2015 at 9:46 AM, Marc Aymerich wrote:
>> if __name__ == '__main__':
>> loop_container = {}
>> handler = threading.Thread(target=run_loop, args=(loop_container, ))
>> handler.start()
>> try:
>> time.slee
On Wed, 25 Nov 2015 05:13 am, Marko Rauhamaa wrote:
> Personally, I don't like the "official" Python usage:
>
> Objects whose value can change are said to be mutable
>
> I would prefer this wording:
>
> Objects whose inner state can change are said to be mutable
I see your point, but "inner s
Op 24-11-15 om 18:46 schreef Terry Reedy:
> On 11/24/2015 9:34 AM, Antoon Pardon wrote:
>
> I agree that the tutorial should talk about default argument objects (which
> have values) instead of conflating 'object' with 'value'.
>
>> Op 20-11-15 om 13:12 schreef Ned Batchelder:
>
>>> I'm not sur
Ned Batchelder :
> Oscar, thanks for the thoughtful comments. I agree that using "object"
> for the result of an expression, and for the referent of a name, would
> go some ways to clarifying things.
>
> Perhaps the Python world uses "value" less to mean "object" than I am
> thinking. But we do ta
On Tue, Nov 24, 2015 at 9:46 AM, Marc Aymerich wrote:
> if __name__ == '__main__':
> loop_container = {}
> handler = threading.Thread(target=run_loop, args=(loop_container, ))
> handler.start()
> try:
> time.sleep(1)
> finally:
> loop_container['loop'].stop(
On Tue, Nov 24, 2015 at 10:53 AM, Ian Kelly wrote:
> On Tue, Nov 24, 2015 at 10:32 AM, Antoon Pardon
> wrote:
>> Op 24-11-15 om 17:56 schreef Ian Kelly:
>>
>>>
So on what grounds would you argue that () is not a literal.
>>>
>>> This enumerates exactly what literals are in Python:
>>>
>>> ht
On Wed, 25 Nov 2015 01:58 am, Antoon Pardon wrote:
> Op 23-11-15 om 14:58 schreef Steven D'Aprano:
> > ... closures can also be used for [static storage] ...
> If you really want mutable static storage, you can simulate it more
> cleanly with a closure than using a default argument.
You don't s
On Wed, 25 Nov 2015 02:17 am, Chris Angelico wrote:
> On Wed, Nov 25, 2015 at 2:03 AM, Antoon Pardon
> wrote:
>> So are you saying
>>
>> () isn't a literal
>>
>> because
>>
>> (x * x for x in range(int(input("How far? " isn't a literal?
>
> I'm pretty sure tuple/list/dict display predat
On Tue, Nov 24, 2015 at 10:32 AM, Antoon Pardon
wrote:
> Op 24-11-15 om 17:56 schreef Ian Kelly:
>
>>
>>> So on what grounds would you argue that () is not a literal.
>>
>> This enumerates exactly what literals are in Python:
>>
>> https://docs.python.org/3/reference/lexical_analysis.html#literals
In <277843f7-c898-4378-85ea-841b09a28...@googlegroups.com> Cai Gengyang
writes:
> results = [
> {"id": 1, "name": "ensheng", "score": 10},
> {"id": 2, "name": "gengyang", "score": 12},
> {"id": 3, "name": "jordan", "score": 5},
> ]
Okay, this is a list.
> I want to find gengyang's score. This
On 11/24/2015 9:34 AM, Antoon Pardon wrote:
I agree that the tutorial should talk about default argument objects
(which have values) instead of conflating 'object' with 'value'.
Op 20-11-15 om 13:12 schreef Ned Batchelder:
I'm not sure what your goal is at this point. Are you:
1) stil
On Tuesday, November 24, 2015 at 12:25:54 PM UTC-5, Oscar Benjamin wrote:
> On 24 November 2015 at 15:27, Ned Batchelder wrote:
> > On Tuesday, November 24, 2015 at 10:10:51 AM UTC-5, Antoon Pardon wrote:
> >> Op 24-11-15 om 15:18 schreef Ned Batchelder:
> >>
> >> > 2) In Python, "value" means, wh
Op 24-11-15 om 17:56 schreef Ian Kelly:
>
>> So on what grounds would you argue that () is not a literal.
>
> This enumerates exactly what literals are in Python:
>
> https://docs.python.org/3/reference/lexical_analysis.html#literals
>
> I think it's a rather pedantic point, though. How are nu
On Tue, 24 Nov 2015 11:38 pm, Antoon Pardon wrote:
> Op 19-11-15 om 13:45 schreef Steven D'Aprano:
[...]
>> I don't mean that it isn't sometimes useful. Of course it is sometimes
>> useful, there's no doubt about that. But why would you expect the
>> language to default to the *slow*, *expensive*,
On 24 November 2015 at 15:27, Ned Batchelder wrote:
> On Tuesday, November 24, 2015 at 10:10:51 AM UTC-5, Antoon Pardon wrote:
>> Op 24-11-15 om 15:18 schreef Ned Batchelder:
>>
>> > 2) In Python, "value" means, what object does a name refer to, or what
>> > object did an evaluation produce.
>>
>>
On Tuesday, November 24, 2015 at 9:29:30 AM UTC-5, Mark Lawrence wrote:
> On 24/11/2015 14:07, Denis McMahon wrote:
> > On Tue, 24 Nov 2015 02:04:56 -0800, Cai Gengyang wrote:
> >
> >> Here's a dictionary with 3 values :
> >>
> >> results = {
> >>"gengyang": 14,
> >>"ensheng": 13, "jordan":
On Tue, Nov 24, 2015 at 9:41 AM, Antoon Pardon
wrote:
> Op 24-11-15 om 16:48 schreef Chris Angelico:
>> () is not a literal either.
>
> The byte code sure suggests it is.
>
> Take the following code:
>
> import dis
>
> def f():
> i = 42
> t = ()
> l = []
>
> dis.dis(f)
>
> That produces the
Op 24-11-15 om 16:48 schreef Chris Angelico:
> On Wed, Nov 25, 2015 at 2:46 AM, Antoon Pardon
> wrote:
>> What is your point? I say that [] looks like a literal. Because it
>> sure resembles () which is a literal.
>>
>> That [] in fact isn't a literal doesn't contradict it looks like
>> one.
>>
>>
threading supports the 'daemon' option[1], when set to True and the
program is in *foreground* then the event-loop thread dies when
SIGTERM-ed, however, if the program is in the *background* it doesn't
work! still deadlocked :'''(
while I'm not finding a definitive solution I'll be doing a
os.kill
Ben Finney writes:
Ben Finney
Date:
11/24/2015 04:49 AM
To:
python-list@python.org
George Trojan writes:
The following code has bitten me recently:
t=(0,1)
x,y=t if t else 8, 9
print(x, y)
(0, 1) 9
You can simplify this by taking assignment out of the picture::
>>> t = (0, 1)
On Wed, Nov 25, 2015 at 3:28 AM, Random832 wrote:
> On 2015-11-24, Chris Angelico wrote:
>> On Wed, Nov 25, 2015 at 1:24 AM, Antoon Pardon
>> wrote:
Start thinking of it as a constructor call rather than a literal, and
you'll get past most of the confusion.
>>>
>>> That doesn't change t
On 2015-11-24, Chris Angelico wrote:
> On Wed, Nov 25, 2015 at 1:24 AM, Antoon Pardon
> wrote:
>>> Start thinking of it as a constructor call rather than a literal, and
>>> you'll get past most of the confusion.
>>
>> That doesn't change the fact it does look like a literal and not like
>> a const
On Tue, 24 Nov 2015 11:57 pm, Marko Rauhamaa wrote:
> Antoon Pardon :
>
>> You then switching to talking about objects, just gives the impression
>> that object is a synonym for value.
>
> It isn't?
No it isn't.
The definition of "object" -- well, I say "the" definition, but the nasty
truth is
On Tue, Nov 24, 2015 at 4:29 PM, Marc Aymerich wrote:
> Hi,
>
> I have to run the asyncio.loop on a separated thread because the main
> thread is running FUSE. Apparently fuse needs to run on the main
> thread because it uses signal():
>
>
> File "/usr/local/lib/python3.4/dist-packages/fuse.p
Op 24-11-15 om 16:17 schreef Chris Angelico:
> On Wed, Nov 25, 2015 at 2:03 AM, Antoon Pardon
> wrote:
>> Op 24-11-15 om 15:34 schreef Chris Angelico:
>>> On Wed, Nov 25, 2015 at 1:24 AM, Antoon Pardon
>>> wrote:
> Start thinking of it as a constructor call rather than a literal, and
> yo
On Wed, Nov 25, 2015 at 2:46 AM, Antoon Pardon
wrote:
> What is your point? I say that [] looks like a literal. Because it
> sure resembles () which is a literal.
>
> That [] in fact isn't a literal doesn't contradict it looks like
> one.
>
> That you can come up with more complicated list express
On 11/23/2015 20:29, Cameron Simpson wrote:
On 24Nov2015 16:25, Cameron Simpson wrote:
Completely untested example code:
class ReturnEvent:
def __init__(self):
self.event = Event()
With, of course:
def wait(self):
return self.event.wait()
Of course :-) Ah, the Event() object
On Tuesday, November 24, 2015 at 10:10:51 AM UTC-5, Antoon Pardon wrote:
> Op 24-11-15 om 15:18 schreef Ned Batchelder:
>
> > 2) In Python, "value" means, what object does a name refer to, or what
> > object did an evaluation produce.
>
> I don't think this is correct because that would imply tha
Hi,
I have to run the asyncio.loop on a separated thread because the main
thread is running FUSE. Apparently fuse needs to run on the main
thread because it uses signal():
File "/usr/local/lib/python3.4/dist-packages/fuse.py", line 390, in __init__
old_handler = signal(SIGINT, SIG_DFL)
V
On Wed, Nov 25, 2015 at 2:03 AM, Antoon Pardon
wrote:
> Op 24-11-15 om 15:34 schreef Chris Angelico:
>> On Wed, Nov 25, 2015 at 1:24 AM, Antoon Pardon
>> wrote:
Start thinking of it as a constructor call rather than a literal, and
you'll get past most of the confusion.
>>>
>>> That does
Op 24-11-15 om 15:34 schreef Chris Angelico:
> On Wed, Nov 25, 2015 at 1:24 AM, Antoon Pardon
> wrote:
>>> Start thinking of it as a constructor call rather than a literal, and
>>> you'll get past most of the confusion.
>>
>> That doesn't change the fact it does look like a literal and not like
>>
Op 24-11-15 om 15:18 schreef Ned Batchelder:
> 2) In Python, "value" means, what object does a name refer to, or what
> object did an evaluation produce.
I don't think this is correct because that would imply that objects don't
change values (since the value would be the object).
When a list is
Op 24-11-15 om 15:34 schreef Chris Angelico:
> On Wed, Nov 25, 2015 at 1:24 AM, Antoon Pardon
> wrote:
>>> Start thinking of it as a constructor call rather than a literal, and
>>> you'll get past most of the confusion.
>>
>> That doesn't change the fact it does look like a literal and not like
>>
Op 24-11-15 om 15:34 schreef Chris Angelico:
> On Wed, Nov 25, 2015 at 1:24 AM, Antoon Pardon
> wrote:
>>> Start thinking of it as a constructor call rather than a literal, and
>>> you'll get past most of the confusion.
>>
>> That doesn't change the fact it does look like a literal and not like
>>
Op 23-11-15 om 14:58 schreef Steven D'Aprano:
> On Mon, 23 Nov 2015 09:40 pm, BartC wrote:
>
>> On 23/11/2015 07:47, Steven D'Aprano wrote:
>>
>>> I think it would be cleaner and better if Python had dedicated syntax for
>>> declaring static local variables:
>>
>> Interesting. So why is it that wh
On Wed, Nov 25, 2015 at 1:43 AM, BartC wrote:
> It comes from the use of file handles (what you get in some languages when
> you open or create a file) which everyone can understand:
>
> * If you copy handle F to G like in an assignment, it obviously doesn't copy
> the contents of the file, just t
On Tuesday, November 24, 2015 at 9:34:36 AM UTC-5, Antoon Pardon wrote:
> Op 20-11-15 om 13:12 schreef Ned Batchelder:
> > On Friday, November 20, 2015 at 6:59:54 AM UTC-5, BartC wrote:
> >> On 20/11/2015 01:05, Steven D'Aprano wrote:
> >>> On Fri, 20 Nov 2015 04:30 am, BartC wrote:
> >>>
> On
On 24/11/2015 14:18, Ned Batchelder wrote:
On Tuesday, November 24, 2015 at 7:57:54 AM UTC-5, Marko Rauhamaa wrote:
Antoon Pardon :
You then switching to talking about objects, just gives the impression
that object is a synonym for value.
It isn't?
1) In English, "value" means something l
2015-11-24 14:41 GMT+01:00 Marko Rauhamaa :
> Mark Lawrence :
>
> > 1) I was being facetious.
> > 2) How many times do people have to be asked not to top post here
> > before they stop top posting?
> > 3) I only have two things to say so this is superfluous.
>
> Having posted only 2 times in this
Op 20-11-15 om 14:04 schreef Chris Angelico:
> On Fri, Nov 20, 2015 at 11:39 PM, BartC wrote:
>> * The refusal to acknowledge that the def fn(a=[]) syntax is misleading.
>> (What value will a have when you call fn()? The true answer is that you
>> can't tell.)
>
> It isn't misleading. The default
Op 20-11-15 om 13:12 schreef Ned Batchelder:
> On Friday, November 20, 2015 at 6:59:54 AM UTC-5, BartC wrote:
>> On 20/11/2015 01:05, Steven D'Aprano wrote:
>>> On Fri, 20 Nov 2015 04:30 am, BartC wrote:
>>>
On 19/11/2015 16:01, Steven D'Aprano wrote:
>>> [...]
>>>
The whole concept of 'm
On Wed, Nov 25, 2015 at 1:24 AM, Antoon Pardon
wrote:
>> Start thinking of it as a constructor call rather than a literal, and
>> you'll get past most of the confusion.
>
> That doesn't change the fact it does look like a literal and not like
> a constructor.
Then explain how this is a literal:
On 24/11/2015 14:07, Denis McMahon wrote:
On Tue, 24 Nov 2015 02:04:56 -0800, Cai Gengyang wrote:
Here's a dictionary with 3 values :
results = {
"gengyang": 14,
"ensheng": 13, "jordan": 12
}
How do I define a function that takes the last of the 3 items in that
list and returns Jordan's
Op 24-11-15 om 15:00 schreef Chris Angelico:
> On Wed, Nov 25, 2015 at 12:43 AM, Antoon Pardon
> wrote:
>> I think that part of the problem is, that [] is not a constant object. So
>> that when you see a line like
>>
>> ls = []
>>
>> It behaves more lke
>>
>> ls = [].copy()
>>
>> than what
On Tuesday, November 24, 2015 at 7:57:54 AM UTC-5, Marko Rauhamaa wrote:
> Antoon Pardon :
>
> > You then switching to talking about objects, just gives the impression
> > that object is a synonym for value.
>
> It isn't?
We are tangled up in another terminology conflict. The word "value" is
be
Op 20-11-15 om 02:05 schreef Steven D'Aprano:
> On Fri, 20 Nov 2015 04:30 am, BartC wrote:
>
>> On 19/11/2015 16:01, Steven D'Aprano wrote:
> [...]
>
>> The whole concept of 'mutable' default is alien to me. A default is just
>> a convenient device to avoid having to write:
>>
>>fn(0) or fn(
On Tue, 24 Nov 2015 03:04:09 -0800, Cai Gengyang wrote:
> results = {
> "gengyang": { "maths": 10, "english": 15},
> "ensheng": {"maths": 12, "english": 10}, "jordan": {"maths": 9,
> "english": 13}
> }
>
> How do you get gengyang's maths scores ?
I refer to my previous answer. Open a web
On 24/11/2015 13:25, Cai Gengyang wrote:
results = [
{"id": 1, "name": "ensheng", "score": 10},
{"id": 2, "name": "gengyang", "score": 12},
{"id": 3, "name": "jordan", "score": 5},
]
I want to find gengyang's score. This is what I tried :
print((results["gengyang"])["score"])
but I got an e
On Tue, 24 Nov 2015 02:04:56 -0800, Cai Gengyang wrote:
> Here's a dictionary with 3 values :
>
> results = {
> "gengyang": 14,
> "ensheng": 13, "jordan": 12
> }
>
> How do I define a function that takes the last of the 3 items in that
> list and returns Jordan's results i.e. (12) ?
You ope
Hi everyone.
Im trying to solve some problems in parallel using the multiprocessing module
in Python 2.7. A general model is built using CPython and then the subproblems
are solved in parallel returning results in a queue. This is currently working
fine. I would like to solve the subproblems us
On Wed, Nov 25, 2015 at 12:43 AM, Antoon Pardon
wrote:
> I think that part of the problem is, that [] is not a constant object. So
> that when you see a line like
>
> ls = []
>
> It behaves more lke
>
> ls = [].copy()
>
> than what you would expect with the normal python semantics.
You're
Cai Gengyang wrote:
>
> results = [
> {"id": 1, "name": "ensheng", "score": 10},
> {"id": 2, "name": "gengyang", "score": 12},
> {"id": 3, "name": "jordan", "score": 5},
> ]
>
> I want to find gengyang's score. This is what I tried :
>
print((results["gengyang"])["score"])
>
> but I got a
Op 19-11-15 om 19:20 schreef Mark Lawrence:
> On 19/11/2015 17:30, BartC wrote:
>> On 19/11/2015 16:01, Steven D'Aprano wrote:
>>> On Fri, 20 Nov 2015 12:19 am, BartC wrote:
>>
>>> You know, for somebody who claims to design and implement your own
>>> languages, you sometimes go to a remarkable eff
On 24/11/2015 13:25, Cai Gengyang wrote:
results = [
{"id": 1, "name": "ensheng", "score": 10},
{"id": 2, "name": "gengyang", "score": 12},
{"id": 3, "name": "jordan", "score": 5},
]
I want to find gengyang's score. This is what I tried :
print((results["gengyang"])["score"])
but I got an e
Mark Lawrence :
> 1) I was being facetious.
> 2) How many times do people have to be asked not to top post here
> before they stop top posting?
> 3) I only have two things to say so this is superfluous.
Mark, it may not be your objective, but you really are poisoning the
atmosphere here.
Marko
Op 20-11-15 om 01:27 schreef Ned Batchelder:
> On Thursday, November 19, 2015 at 7:11:52 PM UTC-5, BartC wrote:
>> On 19/11/2015 22:55, Michael Torrie wrote:
>>> On 11/19/2015 02:21 PM, BartC wrote:
(Python returns 42; so that means my languages are more dynamic than
Python? That's hard t
On 24/11/2015 12:23, Arie van Wingerden wrote:
Hi Mark, what use would that have? Please show your code ...
2015-11-24 13:15 GMT+01:00 Mark Lawrence :
On 24/11/2015 11:04, Cai Gengyang wrote:
results = {
"gengyang": { "maths": 10, "english": 15},
"ensheng": {"maths": 12, "english": 1
results = [
{"id": 1, "name": "ensheng", "score": 10},
{"id": 2, "name": "gengyang", "score": 12},
{"id": 3, "name": "jordan", "score": 5},
]
I want to find gengyang's score. This is what I tried :
>>> print((results["gengyang"])["score"])
but I got an error message instead :
Traceback (most r
Antoon Pardon :
> You then switching to talking about objects, just gives the impression
> that object is a synonym for value.
It isn't?
Marko
--
https://mail.python.org/mailman/listinfo/python-list
Op 24-11-15 om 13:07 schreef Chris Angelico:
> On Tue, Nov 24, 2015 at 10:36 PM, Antoon Pardon
> wrote:
So, looking at some source code, a default value for certain types is only
certain to be that value for the very first call of that function?
>>>
>>> On the contrary, it is certain alw
Op 19-11-15 om 13:45 schreef Steven D'Aprano:
> On Thu, 19 Nov 2015 10:41 pm, BartC wrote:
>
>
>> I expect the version with the default argument to be
>> exactly the same as the last lot of calls, namely for:
>>
>> fn()
>> fn()
>> fn()
>>
>> to be equivalent to:
>>
>> temp=[]
>> fn(temp)
>> temp=
Hi Mark, what use would that have? Please show your code ...
2015-11-24 13:15 GMT+01:00 Mark Lawrence :
> On 24/11/2015 11:04, Cai Gengyang wrote:
>
>> results = {
>>"gengyang": { "maths": 10, "english": 15},
>>"ensheng": {"maths": 12, "english": 10},
>>"jordan": {"maths": 9, "english
On 24/11/2015 11:04, Cai Gengyang wrote:
results = {
"gengyang": { "maths": 10, "english": 15},
"ensheng": {"maths": 12, "english": 10},
"jordan": {"maths": 9, "english": 13}
}
How do you get gengyang's maths scores ?
Thank you ...
One way is to delete the scores for ensheng and
On Tue, Nov 24, 2015 at 10:36 PM, Antoon Pardon
wrote:
>>> So, looking at some source code, a default value for certain types is only
>>> certain to be that value for the very first call of that function?
>>
>> On the contrary, it is certain always to be that exact object.
>
> No, he is talking ab
Great, it works! Thanks a lot ..
>>> results = {
"gengyang": { "maths": 10, "english": 15},
"ensheng": {"maths": 12, "english": 10},
"jordan": {"maths": 9, "english": 13}
}
>>> print((results["gengyang"])["maths"])
10
On Tue, Nov 24, 2015 at 7:10 PM, Arie van Wingerden
wrote:
> print((
print((results["gengyang"])["maths"])
2015-11-24 12:04 GMT+01:00 Cai Gengyang :
> results = {
> "gengyang": { "maths": 10, "english": 15},
> "ensheng": {"maths": 12, "english": 10},
> "jordan": {"maths": 9, "english": 13}
> }
>
> How do you get gengyang's maths scores ?
>
> Thank you ...
1 - 100 of 118 matches
Mail list logo