>
> Well, your code was close. All you needed was a little tweak
> to make it work like you requested. So keep working at it,
> and if you have a specific question, feel free to ask on the
> list.
>
> Here's a tip. Try to simplify the problem. Instead of
> looping over a list of lists, and then a
> > Then using this cool answer on SO [...]
>
> Oh. I thought you wanted to learn how to solve problems. I had no idea you
> were auditioning for the James Dean part. My bad.
Awesome response burn lol.
I am trying to solve problems. Getting tired of dealing with JSON and having to
figure out
On Wed, Jul 25, 2018 at 9:18 AM, Rob Gaddi
wrote:
> On 07/24/2018 01:07 PM, Chris Angelico wrote:
>>
>> On Wed, Jul 25, 2018 at 5:33 AM, Tobiah wrote:
>>>
>>> Consider:
>>>
>>> >>> type({}) is dict
>>> True
>>> >>> type(3) is int
>>> True
>>> >>> type(
On 07/24/2018 01:07 PM, Chris Angelico wrote:
On Wed, Jul 25, 2018 at 5:33 AM, Tobiah wrote:
Consider:
>>> type({}) is dict
True
>>> type(3) is int
True
>>> type(None) is None
False
Obvious I guess, since the type object is not None.
So wh
On Tue, 24 Jul 2018 12:33:27 -0700, Tobiah wrote:
[...]
> So what would I compare type(None) to?
Why would you need to? The fastest, easiest, most reliable way to check
if something is None is:
if something is None
> >>> type(None)
>
> >>> type(None) is NoneType
>
https://docs.python.org/3.7/library/constants.html
"None
The sole value of the type NoneType..."
"x is None" and "type(x) is type(None)" are equivalent because of that.
I think though that the better way to do the first tests would be to use
isinstance
https://docs.python.org/3.7/library/functi
Hi there everyone, my name is Daniel Perry and I'm a totally blind new Python
user. I've only just recently started picking up python and playing with it and
I intend on building some unique audio computer games for the blind. Such
things mostly as simulation games like farming, building type ga
On Wed, Jul 25, 2018 at 5:33 AM, Tobiah wrote:
> Consider:
>
> >>> type({}) is dict
> True
> >>> type(3) is int
> True
> >>> type(None) is None
> False
>
> Obvious I guess, since the type object is not None.
> So what would I compare type(None) to?
>
In Python 2, you can import NoneType from types module.
In Python 3, the best you can do is:
NoneType = type(None)
Iwo Herka
https://github.com/IwoHerka
‐‐‐ Original Message ‐‐‐
On 24 July 2018 7:33 PM, Tobiah wrote:
>
>
> Consider:
>
> >>> type({}) is dict
>
> True
>
On 24.07.2018 20:07, John Ladasky wrote:
I've been using "sudo pip3 install" to add packages from the PyPI repository.
I have multiple user accounts on the computer in question. My goal is to install
packages that are accessible to all user accounts. I know that using the Synaptic
Package M
Consider:
>>> type({}) is dict
True
>>> type(3) is int
True
>>> type(None) is None
False
Obvious I guess, since the type object is not None.
So what would I compare type(None) to?
>>> type(None)
>>> type(None) is NoneType
I've been using "sudo pip3 install" to add packages from the PyPI repository.
I have multiple user accounts on the computer in question. My goal is to
install packages that are accessible to all user accounts. I know that using
the Synaptic Package Manager in Ubuntu will install for all users
On Mon, 23 Jul 2018 23:24:18 +0100, John Pote wrote:
> I recently wrote a command line app to take a stream of numbers, do some
> signal processing on them and display the results on the console. There
> may be several output columns of data so a title line is printed first.
> But the stream of
2018-07-24 13:30 GMT+02:00 Bartosz Golaszewski :
> 2018-07-24 12:09 GMT+02:00 Bartosz Golaszewski :
>> 2018-07-23 21:51 GMT+02:00 Thomas Jollans :
>>> On 23/07/18 20:02, Bartosz Golaszewski wrote:
Hi!
>>>
>>> Hey!
>>>
A user recently reported a memory leak in python bindings (C extension
2018-07-24 12:09 GMT+02:00 Bartosz Golaszewski :
> 2018-07-23 21:51 GMT+02:00 Thomas Jollans :
>> On 23/07/18 20:02, Bartosz Golaszewski wrote:
>>> Hi!
>>
>> Hey!
>>
>>> A user recently reported a memory leak in python bindings (C extension
>>> module) to a C library[1] I wrote. I've been trying to
2018-07-23 21:51 GMT+02:00 Thomas Jollans :
> On 23/07/18 20:02, Bartosz Golaszewski wrote:
>> Hi!
>
> Hey!
>
>> A user recently reported a memory leak in python bindings (C extension
>> module) to a C library[1] I wrote. I've been trying to fix it since
>> but so far without success. Since I'm pro
Sayth Renshaw wrote:
>
>> myjson = ...
>> path = "['foo']['bar'][42]"
>> print(eval("myjson" + path))
>>
>> ?
>>
>> Wouldn't it be better to keep 'data' as is and use a helper function like
>>
>> def get_value(myjson, path):
>> for key_or_index in path:
>> myjson = myjson[key_or_in
> myjson = ...
> path = "['foo']['bar'][42]"
> print(eval("myjson" + path))
>
> ?
>
> Wouldn't it be better to keep 'data' as is and use a helper function like
>
> def get_value(myjson, path):
> for key_or_index in path:
> myjson = myjson[key_or_index]
> return myjson
>
> path
Dennis Lee Bieber wrote:
> On Mon, 23 Jul 2018 22:14:22 +0100, Chris Green declaimed the
> following:
>
> >Anders Wegge Keller wrote:
> >>
> >> If your update frequency is low enough that it wont kill the filesystem
> >> and
> >> the amount of data is reasonably small, atomic writes to a fil
Sayth Renshaw wrote:
> I have data which is a list of lists of all the full paths in a json
> document.
>
> How can I change the format to be usable when selecting elements?
How do you want to select these elements?
myjson = ...
path = "['foo']['bar'][42]"
print(eval("myjson" + path))
?
Would
On 24/07/18 08:25, Mark Lawrence wrote:
> On 24/07/18 06:41, Sayth Renshaw wrote:
>> On Tuesday, 24 July 2018 14:25:48 UTC+10, Rick Johnson wrote:
>>> Sayth Renshaw wrote:
>>>
elements = [['[{0}]'.format(element) for element in elements]for
elements in data]
>>>
>>> I would suggest you a
2018-07-24 3:52 GMT+02:00, Sayth Renshaw :
> I have data which is a list of lists of all the full paths in a json
> document.
>
> How can I change the format to be usable when selecting elements?
>
> data = [['glossary'],
> ['glossary', 'title'],
> ['glossary', 'GlossDiv'],
> ['glossary', 'Gloss
On 24/07/18 06:41, Sayth Renshaw wrote:
On Tuesday, 24 July 2018 14:25:48 UTC+10, Rick Johnson wrote:
Sayth Renshaw wrote:
elements = [['[{0}]'.format(element) for element in elements]for elements in
data]
I would suggest you avoid list comprehensions until you master long-form loops.
I
23 matches
Mail list logo