workspace
stringclasses
1 value
channel
stringclasses
1 value
sentences
stringlengths
1
3.93k
ts
stringlengths
26
26
user
stringlengths
2
11
sentence_id
stringlengths
44
53
timestamp
float64
1.5B
1.56B
__index_level_0__
int64
0
106k
pythondev
help
some framework provide a `request.json` for ease of use :slightly_smiling_face: but it does exactly that :point_up:
2018-02-22T03:21:44.000205
Micki
pythondev_help_Micki_2018-02-22T03:21:44.000205
1,519,269,704.000205
35,424
pythondev
help
<@Micki> Yes I'm using Flask.
2018-02-22T03:23:11.000419
Hans
pythondev_help_Hans_2018-02-22T03:23:11.000419
1,519,269,791.000419
35,425
pythondev
help
That's a micro-framework but I guess it counts.
2018-02-22T03:23:45.000041
Hans
pythondev_help_Hans_2018-02-22T03:23:45.000041
1,519,269,825.000041
35,426
pythondev
help
Just a demo. Will make it json and hide when not None, etc etc
2018-02-22T03:26:49.000435
Carly
pythondev_help_Carly_2018-02-22T03:26:49.000435
1,519,270,009.000435
35,427
pythondev
help
could you try this `if 'name' in request.json and isinstance(request.json['description'], str):`
2018-02-22T03:33:10.000170
Micki
pythondev_help_Micki_2018-02-22T03:33:10.000170
1,519,270,390.00017
35,428
pythondev
help
and you check for `name` then access `ðescription` not sure if that's expected
2018-02-22T03:33:36.000105
Micki
pythondev_help_Micki_2018-02-22T03:33:36.000105
1,519,270,416.000105
35,429
pythondev
help
<@Micki> let me try and see.
2018-02-22T03:39:03.000028
Hans
pythondev_help_Hans_2018-02-22T03:39:03.000028
1,519,270,743.000028
35,430
pythondev
help
Unfortunately I've got my code a little messed up and I can't paste to Slack for some reason so here's a paste of the code: <https://ghostbin.com/paste/yd9eq>
2018-02-22T03:44:49.000413
Hans
pythondev_help_Hans_2018-02-22T03:44:49.000413
1,519,271,089.000413
35,431
pythondev
help
Removing the brackets from `request.json['description']` doesn't remove the error.
2018-02-22T03:46:48.000050
Hans
pythondev_help_Hans_2018-02-22T03:46:48.000050
1,519,271,208.00005
35,432
pythondev
help
could you share the full stacktrace
2018-02-22T03:47:18.000309
Micki
pythondev_help_Micki_2018-02-22T03:47:18.000309
1,519,271,238.000309
35,433
pythondev
help
<@Micki> typing everything out carefully seems to solve the error. So I guess it was a mistyping. Thanks. :smile:
2018-02-22T03:52:46.000422
Hans
pythondev_help_Hans_2018-02-22T03:52:46.000422
1,519,271,566.000422
35,434
pythondev
help
you might want to look at things like jsonschema (<https://github.com/Julian/jsonschema>) for validating input
2018-02-22T03:53:36.000274
Micki
pythondev_help_Micki_2018-02-22T03:53:36.000274
1,519,271,616.000274
35,435
pythondev
help
it looks like what you are doing
2018-02-22T03:53:54.000017
Micki
pythondev_help_Micki_2018-02-22T03:53:54.000017
1,519,271,634.000017
35,436
pythondev
help
<@Micki> not really. Designing a Flask API for an application. The JSON Schema would go right over my head. It seems like lots of overhead and the approach with this is to do stuff by hand.
2018-02-22T03:57:22.000180
Hans
pythondev_help_Hans_2018-02-22T03:57:22.000180
1,519,271,842.00018
35,437
pythondev
help
So that I can keep track of what I'm doing.
2018-02-22T03:57:35.000325
Hans
pythondev_help_Hans_2018-02-22T03:57:35.000325
1,519,271,855.000325
35,438
pythondev
help
Is there any way to display a real time output / `tail -f` or pipe of a process output into a tkinter window ?
2018-02-22T04:21:52.000131
Gwyn
pythondev_help_Gwyn_2018-02-22T04:21:52.000131
1,519,273,312.000131
35,439
pythondev
help
GraphQL is your buddy
2018-02-22T06:29:31.000089
Felisa
pythondev_help_Felisa_2018-02-22T06:29:31.000089
1,519,280,971.000089
35,440
pythondev
help
hey, everyone where is the data from the ckeditor in django stored?
2018-02-22T06:43:59.000258
Janelle
pythondev_help_Janelle_2018-02-22T06:43:59.000258
1,519,281,839.000258
35,441
pythondev
help
sommerville
2018-02-22T06:45:18.000106
Janelle
pythondev_help_Janelle_2018-02-22T06:45:18.000106
1,519,281,918.000106
35,442
pythondev
help
hello everyone. this thing is driving me crazy already! :smile: so I have this dictionary that consists of tuples as keys and integers as values ``` {('17', '44'): 3, ('05', '24'): 3, ('15', '38'): 3, ('04', '30'): 3, ('06', '29'): 2, ('19', '25'): 2, ('12', '32'): 2, ('23', '32'): 2, ('23', '50'): 2, ('32', '50'): 2, ...
2018-02-22T07:13:11.000234
Suzette
pythondev_help_Suzette_2018-02-22T07:13:11.000234
1,519,283,591.000234
35,443
pythondev
help
don't use sets? :slightly_smiling_face:
2018-02-22T07:18:40.000120
Barney
pythondev_help_Barney_2018-02-22T07:18:40.000120
1,519,283,920.00012
35,444
pythondev
help
hmm and check then manually if they exist in the list?
2018-02-22T07:20:05.000227
Suzette
pythondev_help_Suzette_2018-02-22T07:20:05.000227
1,519,284,005.000227
35,445
pythondev
help
that’s a good point actually :smile: thanks!
2018-02-22T07:20:11.000405
Suzette
pythondev_help_Suzette_2018-02-22T07:20:11.000405
1,519,284,011.000405
35,446
pythondev
help
or, you can use a set to keep track of uniques
2018-02-22T07:20:37.000082
Barney
pythondev_help_Barney_2018-02-22T07:20:37.000082
1,519,284,037.000082
35,447
pythondev
help
but actually store them in a list
2018-02-22T07:20:46.000299
Barney
pythondev_help_Barney_2018-02-22T07:20:46.000299
1,519,284,046.000299
35,448
pythondev
help
yeah makes sense. just wondering if it is ok to have these extra objects in place?
2018-02-22T07:21:30.000013
Suzette
pythondev_help_Suzette_2018-02-22T07:21:30.000013
1,519,284,090.000013
35,449
pythondev
help
so that extra set for example
2018-02-22T07:21:39.000287
Suzette
pythondev_help_Suzette_2018-02-22T07:21:39.000287
1,519,284,099.000287
35,450
pythondev
help
``` &gt;&gt;&gt; d = {('17', '44'): 3, ('05', '24'): 3, ('15', '38'): 3, ('04', '30'): 3, ('06', '29'): 2, ('19', '25'): 2, ('12', '32'): 2, ('23', '32'): 2, ('23', '50'): 2, ('32', '50'): 2, ('10', '17'): 2, ('10', '21'): 2, ('13', '17'): 2, ('13', '21'): 2, ('13', '44'): 2, ('22', '36'): 2, ('36', '44'): 2, ('08', '1...
2018-02-22T07:23:19.000294
Barney
pythondev_help_Barney_2018-02-22T07:23:19.000294
1,519,284,199.000294
35,451
pythondev
help
why not? it's OK I think
2018-02-22T07:23:43.000022
Barney
pythondev_help_Barney_2018-02-22T07:23:43.000022
1,519,284,223.000022
35,452
pythondev
help
it gets the job done at least :)
2018-02-22T07:23:50.000370
Barney
pythondev_help_Barney_2018-02-22T07:23:50.000370
1,519,284,230.00037
35,453
pythondev
help
thank you! :slightly_smiling_face:
2018-02-22T07:23:59.000431
Suzette
pythondev_help_Suzette_2018-02-22T07:23:59.000431
1,519,284,239.000431
35,454
pythondev
help
Hi you there, I have a problem here and some help would be great.
2018-02-22T11:12:29.000715
Gabrielle
pythondev_help_Gabrielle_2018-02-22T11:12:29.000715
1,519,297,949.000715
35,455
pythondev
help
``` re_path(r'some_path/(?P&lt;uuid&gt;[0-9a-f-]+)/$', views.do_something, name='my_name') ```
2018-02-22T11:15:45.000810
Gabrielle
pythondev_help_Gabrielle_2018-02-22T11:15:45.000810
1,519,298,145.00081
35,456
pythondev
help
This is my url
2018-02-22T11:15:52.000317
Gabrielle
pythondev_help_Gabrielle_2018-02-22T11:15:52.000317
1,519,298,152.000317
35,457
pythondev
help
and in a template I'm trying to link to this url
2018-02-22T11:16:43.000055
Gabrielle
pythondev_help_Gabrielle_2018-02-22T11:16:43.000055
1,519,298,203.000055
35,458
pythondev
help
```&lt;a href="{% url 'my_name' uuid=some_val %}"&gt;link&lt;/a&gt;```
2018-02-22T11:17:57.000601
Gabrielle
pythondev_help_Gabrielle_2018-02-22T11:17:57.000601
1,519,298,277.000601
35,459
pythondev
help
But it doesn't work.
2018-02-22T11:18:09.000523
Gabrielle
pythondev_help_Gabrielle_2018-02-22T11:18:09.000523
1,519,298,289.000523
35,460
pythondev
help
I'm sure ``some_val `` exists
2018-02-22T11:18:45.000354
Gabrielle
pythondev_help_Gabrielle_2018-02-22T11:18:45.000354
1,519,298,325.000354
35,461
pythondev
help
Hey Everyone, what are some good ecommerce platforms that are know to scale that you know of? I currently know of a few with the most known ones being woocommerce and magento, but I was wondering if there are any alternatives that anyone recommends or any reason to prefer one over the other?
2018-02-22T11:26:21.000246
Henrietta
pythondev_help_Henrietta_2018-02-22T11:26:21.000246
1,519,298,781.000246
35,462
pythondev
help
<@Gabrielle> how is the link being output in html? Do you get an error?
2018-02-22T11:26:59.000346
Henrietta
pythondev_help_Henrietta_2018-02-22T11:26:59.000346
1,519,298,819.000346
35,463
pythondev
help
and what’s your view?
2018-02-22T11:31:21.000378
Floy
pythondev_help_Floy_2018-02-22T11:31:21.000378
1,519,299,081.000378
35,464
pythondev
help
<@Gabrielle> you are missing `^` in beginning of your re_path
2018-02-22T11:31:46.000211
Henrietta
pythondev_help_Henrietta_2018-02-22T11:31:46.000211
1,519,299,106.000211
35,465
pythondev
help
‘doesn’t work’ is not a very descriptive message :slightly_smiling_face:
2018-02-22T11:31:47.000850
Floy
pythondev_help_Floy_2018-02-22T11:31:47.000850
1,519,299,107.00085
35,466
pythondev
help
sorry for my poor description
2018-02-22T11:33:53.000250
Gabrielle
pythondev_help_Gabrielle_2018-02-22T11:33:53.000250
1,519,299,233.00025
35,467
pythondev
help
<@Henrietta> the error is : ```do_something got an unexpected keyword argument 'uuid'```
2018-02-22T11:35:43.000742
Gabrielle
pythondev_help_Gabrielle_2018-02-22T11:35:43.000742
1,519,299,343.000742
35,468
pythondev
help
do you have `uuid` as a method parameter for the view
2018-02-22T11:36:25.000632
Floy
pythondev_help_Floy_2018-02-22T11:36:25.000632
1,519,299,385.000632
35,469
pythondev
help
would help to see the view
2018-02-22T11:36:34.000054
Floy
pythondev_help_Floy_2018-02-22T11:36:34.000054
1,519,299,394.000054
35,470
pythondev
help
<@Floy> sh** this is the error, geez it happens when you have not had good sleeping hours. :disappointed: sorry guys
2018-02-22T11:38:17.000776
Gabrielle
pythondev_help_Gabrielle_2018-02-22T11:38:17.000776
1,519,299,497.000776
35,471
pythondev
help
stupid error.
2018-02-22T11:38:26.000290
Gabrielle
pythondev_help_Gabrielle_2018-02-22T11:38:26.000290
1,519,299,506.00029
35,472
pythondev
help
thanks.
2018-02-22T11:38:32.000751
Gabrielle
pythondev_help_Gabrielle_2018-02-22T11:38:32.000751
1,519,299,512.000751
35,473
pythondev
help
*virtual hugs It happens to us all :joy:
2018-02-22T11:38:48.000799
Henrietta
pythondev_help_Henrietta_2018-02-22T11:38:48.000799
1,519,299,528.000799
35,474
pythondev
help
certainly does! no worries :_)
2018-02-22T11:39:02.000055
Floy
pythondev_help_Floy_2018-02-22T11:39:02.000055
1,519,299,542.000055
35,475
pythondev
help
hey all
2018-02-22T12:47:52.000226
Cuc
pythondev_help_Cuc_2018-02-22T12:47:52.000226
1,519,303,672.000226
35,476
pythondev
help
I have a doozy of a question
2018-02-22T12:47:56.000044
Cuc
pythondev_help_Cuc_2018-02-22T12:47:56.000044
1,519,303,676.000044
35,477
pythondev
help
Can someone explain what’s happening when I’m running the first set of code - specifically vis-a-vis w.upper and the implication on the hardware? The program is calling w.upper instead of w.upper() and w.upper outputs ” built-in method upper of str object at 0x105d4c0d” while w.upper() outputs [‘THE’, ‘the’, 3]. words...
2018-02-22T12:48:19.000109
Cuc
pythondev_help_Cuc_2018-02-22T12:48:19.000109
1,519,303,699.000109
35,478
pythondev
help
posted it on a forum as well on pythonista
2018-02-22T12:48:50.000462
Cuc
pythondev_help_Cuc_2018-02-22T12:48:50.000462
1,519,303,730.000462
35,479
pythondev
help
I'm...not quite sure what you're asking?
2018-02-22T12:50:05.000287
Garrett
pythondev_help_Garrett_2018-02-22T12:50:05.000287
1,519,303,805.000287
35,480
pythondev
help
Ah, OK, after a couple of readthroughs, I think I follow.
2018-02-22T12:56:32.000235
Garrett
pythondev_help_Garrett_2018-02-22T12:56:32.000235
1,519,304,192.000235
35,481
pythondev
help
<@Cuc> so, let's start with `0x105d4c0d8`. That's an address in memory. Your computer assigns an address to every byte of RAM available to it. When Python wants to store something, it asks for an amount of RAM large enough to hold the thing and your computer gives it an address. Python sticks the value into that addres...
2018-02-22T12:58:44.000611
Garrett
pythondev_help_Garrett_2018-02-22T12:58:44.000611
1,519,304,324.000611
35,482
pythondev
help
Strings are unique and so each one gets its own space in memory. You can see that in your example because each word has a different address in your first part.
2018-02-22T12:59:25.000088
Garrett
pythondev_help_Garrett_2018-02-22T12:59:25.000088
1,519,304,365.000088
35,483
pythondev
help
Now, why are you getting `&lt;built-in method upper of str object&gt;` instead of `DOG`? Strings are a type of data in Python and types have functionality associated with them. For instance, strings can be made uppercase by using the `str.upper()` method. Any functionality that belongs to a type is called a method (you...
2018-02-22T13:02:07.000595
Garrett
pythondev_help_Garrett_2018-02-22T13:02:07.000595
1,519,304,527.000595
35,484
pythondev
help
and python has weak typing, correct?
2018-02-22T13:02:46.000489
Cuc
pythondev_help_Cuc_2018-02-22T13:02:46.000489
1,519,304,566.000489
35,485
pythondev
help
compared to C and other strongly typed languages?
2018-02-22T13:02:55.000054
Cuc
pythondev_help_Cuc_2018-02-22T13:02:55.000054
1,519,304,575.000054
35,486
pythondev
help
To get the output of a method, you have to call it, using paretheses, just like you do a function. In your first example, you're asking Python for the method, not the output of the method.
2018-02-22T13:03:22.000744
Garrett
pythondev_help_Garrett_2018-02-22T13:03:22.000744
1,519,304,602.000744
35,487
pythondev
help
Python has strong but _dynamic_ types instead of _static_ types
2018-02-22T13:03:41.000267
Garrett
pythondev_help_Garrett_2018-02-22T13:03:41.000267
1,519,304,621.000267
35,488
pythondev
help
so I called the method
2018-02-22T13:03:56.000046
Cuc
pythondev_help_Cuc_2018-02-22T13:03:56.000046
1,519,304,636.000046
35,489
pythondev
help
not the actual output
2018-02-22T13:03:58.000650
Cuc
pythondev_help_Cuc_2018-02-22T13:03:58.000650
1,519,304,638.00065
35,490
pythondev
help
`"dog".upper` isn't calling the `upper` method, it's just...referencing it. Pointing at it
2018-02-22T13:04:26.000180
Garrett
pythondev_help_Garrett_2018-02-22T13:04:26.000180
1,519,304,666.00018
35,491
pythondev
help
"Hey, there's a thing there"
2018-02-22T13:04:32.000430
Garrett
pythondev_help_Garrett_2018-02-22T13:04:32.000430
1,519,304,672.00043
35,492
pythondev
help
`"dog".upper()` would be calling the method
2018-02-22T13:04:41.000478
Garrett
pythondev_help_Garrett_2018-02-22T13:04:41.000478
1,519,304,681.000478
35,493
pythondev
help
python recognized that “dog”.upper is available though
2018-02-22T13:06:30.000441
Cuc
pythondev_help_Cuc_2018-02-22T13:06:30.000441
1,519,304,790.000441
35,494
pythondev
help
and then referenced me to the location of “dog” in memory?
2018-02-22T13:06:39.000650
Cuc
pythondev_help_Cuc_2018-02-22T13:06:39.000650
1,519,304,799.00065
35,495
pythondev
help
Right, because `upper` is a method that exists on a string and `"dog"` is a string
2018-02-22T13:06:46.000765
Garrett
pythondev_help_Garrett_2018-02-22T13:06:46.000765
1,519,304,806.000765
35,496
pythondev
help
Yep
2018-02-22T13:06:50.000096
Garrett
pythondev_help_Garrett_2018-02-22T13:06:50.000096
1,519,304,810.000096
35,497
pythondev
help
so it recognized the method, but didn’t call it
2018-02-22T13:07:08.000080
Cuc
pythondev_help_Cuc_2018-02-22T13:07:08.000080
1,519,304,828.00008
35,498
pythondev
help
got it
2018-02-22T13:07:14.000310
Cuc
pythondev_help_Cuc_2018-02-22T13:07:14.000310
1,519,304,834.00031
35,499
pythondev
help
:thumbsup:
2018-02-22T13:07:18.000034
Cuc
pythondev_help_Cuc_2018-02-22T13:07:18.000034
1,519,304,838.000034
35,500
pythondev
help
Right. For a bit more insight into this, try it with a method that doesn't exist
2018-02-22T13:07:36.000580
Garrett
pythondev_help_Garrett_2018-02-22T13:07:36.000580
1,519,304,856.00058
35,501
pythondev
help
`"dog".divide` (notice I'm not calling it)
2018-02-22T13:07:45.000288
Garrett
pythondev_help_Garrett_2018-02-22T13:07:45.000288
1,519,304,865.000288
35,502
pythondev
help
attribute error
2018-02-22T13:08:49.000779
Cuc
pythondev_help_Cuc_2018-02-22T13:08:49.000779
1,519,304,929.000779
35,503
pythondev
help
Because that method doesn't exist
2018-02-22T13:09:04.000713
Garrett
pythondev_help_Garrett_2018-02-22T13:09:04.000713
1,519,304,944.000713
35,504
pythondev
help
you can’t call an int method on a string
2018-02-22T13:09:26.000601
Cuc
pythondev_help_Cuc_2018-02-22T13:09:26.000601
1,519,304,966.000601
35,505
pythondev
help
Python looks at the data, sees that it's a string, goes to the string definition, and looks for an attribute named "divide". It doesn't find one, because it doesn't exist, and so throws that error
2018-02-22T13:09:46.000381
Garrett
pythondev_help_Garrett_2018-02-22T13:09:46.000381
1,519,304,986.000381
35,506
pythondev
help
I don't believe `divide` is a method on any built-in type
2018-02-22T13:10:04.000691
Garrett
pythondev_help_Garrett_2018-02-22T13:10:04.000691
1,519,305,004.000691
35,507
pythondev
help
oh
2018-02-22T13:10:25.000291
Cuc
pythondev_help_Cuc_2018-02-22T13:10:25.000291
1,519,305,025.000291
35,508
pythondev
help
But that's beside the point :smile:
2018-02-22T13:10:36.000581
Garrett
pythondev_help_Garrett_2018-02-22T13:10:36.000581
1,519,305,036.000581
35,509
pythondev
help
just / for division
2018-02-22T13:10:37.000353
Cuc
pythondev_help_Cuc_2018-02-22T13:10:37.000353
1,519,305,037.000353
35,510
pythondev
help
Let's keep it at that level for now, sure :smile: There's some "magic" involved.
2018-02-22T13:11:10.000103
Garrett
pythondev_help_Garrett_2018-02-22T13:11:10.000103
1,519,305,070.000103
35,511
pythondev
help
so how would I learn more about reference `0x105d4c0d8`?
2018-02-22T13:11:49.000015
Cuc
pythondev_help_Cuc_2018-02-22T13:11:49.000015
1,519,305,109.000015
35,512
pythondev
help
and how python generates that?
2018-02-22T13:12:09.000002
Cuc
pythondev_help_Cuc_2018-02-22T13:12:09.000002
1,519,305,129.000002
35,513
pythondev
help
happy to read lots on it
2018-02-22T13:12:16.000517
Cuc
pythondev_help_Cuc_2018-02-22T13:12:16.000517
1,519,305,136.000517
35,514
pythondev
help
That's really more a product of your CPU and memory management than it is Python
2018-02-22T13:12:32.000369
Garrett
pythondev_help_Garrett_2018-02-22T13:12:32.000369
1,519,305,152.000369
35,515
pythondev
help
is understanding that important to writing pythonic code?
2018-02-22T13:12:51.000487
Cuc
pythondev_help_Cuc_2018-02-22T13:12:51.000487
1,519,305,171.000487
35,516
pythondev
help
What do you feel like you'll gain by knowing more about it?
2018-02-22T13:12:55.000464
Garrett
pythondev_help_Garrett_2018-02-22T13:12:55.000464
1,519,305,175.000464
35,517
pythondev
help
No, not really
2018-02-22T13:12:57.000516
Garrett
pythondev_help_Garrett_2018-02-22T13:12:57.000516
1,519,305,177.000516
35,518
pythondev
help
that’s my main concern that I can write more efficient and quicker programs
2018-02-22T13:13:15.000305
Cuc
pythondev_help_Cuc_2018-02-22T13:13:15.000305
1,519,305,195.000305
35,519
pythondev
help
and though that if I understand compiling, virtual machine etc that would help my “toolbox” perse
2018-02-22T13:13:35.000408
Cuc
pythondev_help_Cuc_2018-02-22T13:13:35.000408
1,519,305,215.000408
35,520
pythondev
help
Python's quickness and efficiency are more on the developer's side than the compiler's
2018-02-22T13:13:50.000346
Garrett
pythondev_help_Garrett_2018-02-22T13:13:50.000346
1,519,305,230.000346
35,521
pythondev
help
cool
2018-02-22T13:14:24.000090
Cuc
pythondev_help_Cuc_2018-02-22T13:14:24.000090
1,519,305,264.00009
35,522
pythondev
help
I have enough to learn, so happy to cross that off my list
2018-02-22T13:14:34.000607
Cuc
pythondev_help_Cuc_2018-02-22T13:14:34.000607
1,519,305,274.000607
35,523