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
Can anyone help me install Mongodb? Mongodb failed to start and i can't figure out which version of kb2999226 to download.
2019-01-28T22:36:17.893300
Javier
pythondev_help_Javier_2019-01-28T22:36:17.893300
1,548,714,977.8933
4,821
pythondev
help
Is there a prettier way to do this? Doing basic add ups in sqlalchemy
2019-01-28T22:41:29.893500
Philip
pythondev_help_Philip_2019-01-28T22:41:29.893500
1,548,715,289.8935
4,822
pythondev
help
`sum(i.product.price * i.quantity for i in order_info.products)` perhaps?
2019-01-28T22:46:43.894400
Sasha
pythondev_help_Sasha_2019-01-28T22:46:43.894400
1,548,715,603.8944
4,823
pythondev
help
In sqlalchemy- do you want to share more about the problem? Should probably be doing sums in the SQL basically-
2019-01-28T22:51:51.895200
Selene
pythondev_help_Selene_2019-01-28T22:51:51.895200
1,548,715,911.8952
4,824
pythondev
help
thank you <@Sasha> :taco: , btw is it good practice to do line breaks for oneliners?
2019-01-28T23:01:37.896300
Philip
pythondev_help_Philip_2019-01-28T23:01:37.896300
1,548,716,497.8963
4,825
pythondev
help
i.e. ``` sum(i.product.price * i.quantity for i in order_info.products) ```
2019-01-28T23:01:51.896700
Philip
pythondev_help_Philip_2019-01-28T23:01:51.896700
1,548,716,511.8967
4,826
pythondev
help
I only do a line break if I run up against 80-column limits personally, but styles vary.
2019-01-28T23:03:16.897500
Sasha
pythondev_help_Sasha_2019-01-28T23:03:16.897500
1,548,716,596.8975
4,827
pythondev
help
Yeah, I'm about to hit 80-column here as well due to it being in a function and `if` condition
2019-01-28T23:04:28.898500
Philip
pythondev_help_Philip_2019-01-28T23:04:28.898500
1,548,716,668.8985
4,828
pythondev
help
Well, I'm basically doing much more operations with the query within the function, thus the application of sum outside of sqlalchemy.
2019-01-28T23:06:28.898600
Philip
pythondev_help_Philip_2019-01-28T23:06:28.898600
1,548,716,788.8986
4,829
pythondev
help
``` order_info = (db.session.query(Order) .filter(Order.id==order_id) .first()) subtotal = get_subtotal(order_info) tax = get_tax(order_info) ```
2019-01-28T23:07:28.898800
Philip
pythondev_help_Philip_2019-01-28T23:07:28.898800
1,548,716,848.8988
4,830
pythondev
help
From the HTTP response codes here <https://developer.twitter.com/en/docs/basics/response-codes.html>, I would like to add one more `except` for some of the response codes here, ie HTTP code 500. How would I do something like that? Should I use requests package?
2019-01-29T02:34:02.899500
Conchita
pythondev_help_Conchita_2019-01-29T02:34:02.899500
1,548,729,242.8995
4,831
pythondev
help
FYI This is for a tool that connects to Twitter's API that continuously streams tweets to analyse their sentiment
2019-01-29T02:35:21.900900
Conchita
pythondev_help_Conchita_2019-01-29T02:35:21.900900
1,548,729,321.9009
4,832
pythondev
help
I'm not sure, but I think HTTP error codes are given to the listener's `on_error()` callback. So you might need to raise an exception there if you want to handle them that way.
2019-01-29T02:41:50.902500
Sasha
pythondev_help_Sasha_2019-01-29T02:41:50.902500
1,548,729,710.9025
4,833
pythondev
help
I'm using Tweepy, which is a Python library to access the API. I have pasted some of the code from Tweepy below - how would I use that in my try/except snippet above?
2019-01-29T02:45:54.902600
Conchita
pythondev_help_Conchita_2019-01-29T02:45:54.902600
1,548,729,954.9026
4,834
pythondev
help
<@Sasha>
2019-01-29T02:46:01.903000
Conchita
pythondev_help_Conchita_2019-01-29T02:46:01.903000
1,548,729,961.903
4,835
pythondev
help
Maybe I need to read Tweepy's docs more closely, have focused on Twitter docs so far
2019-01-29T02:47:14.903600
Conchita
pythondev_help_Conchita_2019-01-29T02:47:14.903600
1,548,730,034.9036
4,836
pythondev
help
Something like this, I think. You'll want to define the exceptions you want to handle, raise them in `on_error`, and catch them in your loop.
2019-01-29T02:50:23.903700
Sasha
pythondev_help_Sasha_2019-01-29T02:50:23.903700
1,548,730,223.9037
4,837
pythondev
help
Ok thanks, will try that. Here's a hot :taco: <@Sasha>
2019-01-29T02:51:32.904600
Conchita
pythondev_help_Conchita_2019-01-29T02:51:32.904600
1,548,730,292.9046
4,838
pythondev
help
BTW, you don't need the `start_stream()` recursive calls, since you've got a `while` loop to continually retry the stream within the function.
2019-01-29T02:53:06.905600
Sasha
pythondev_help_Sasha_2019-01-29T02:53:06.905600
1,548,730,386.9056
4,839
pythondev
help
I should remove line 5 from my snippet <@Sasha>?
2019-01-29T02:54:14.905800
Conchita
pythondev_help_Conchita_2019-01-29T02:54:14.905800
1,548,730,454.9058
4,840
pythondev
help
Yes, and the same in the other exception handlers.
2019-01-29T02:55:01.906400
Sasha
pythondev_help_Sasha_2019-01-29T02:55:01.906400
1,548,730,501.9064
4,841
pythondev
help
Ok great, thank you
2019-01-29T02:55:47.906700
Conchita
pythondev_help_Conchita_2019-01-29T02:55:47.906700
1,548,730,547.9067
4,842
pythondev
help
I want to configure some of my applications to send a notification on slack if X happens. Any recommendations on guides or which libraries to use to accomplish this?
2019-01-29T03:16:37.908000
Conchita
pythondev_help_Conchita_2019-01-29T03:16:37.908000
1,548,731,797.908
4,843
pythondev
help
I was thinking maybe using something like <https://ifttt.com>
2019-01-29T03:16:54.908500
Conchita
pythondev_help_Conchita_2019-01-29T03:16:54.908500
1,548,731,814.9085
4,844
pythondev
help
Can you elaborate more on the X you're talking about
2019-01-29T03:40:46.909400
Valeri
pythondev_help_Valeri_2019-01-29T03:40:46.909400
1,548,733,246.9094
4,845
pythondev
help
?
2019-01-29T03:40:47.909600
Valeri
pythondev_help_Valeri_2019-01-29T03:40:47.909600
1,548,733,247.9096
4,846
pythondev
help
I'm aware of tools that push out notifs to Slack <@Conchita>
2019-01-29T03:41:08.910000
Valeri
pythondev_help_Valeri_2019-01-29T03:41:08.910000
1,548,733,268.91
4,847
pythondev
help
But they're specific to the use cases, obviously
2019-01-29T03:41:34.910600
Valeri
pythondev_help_Valeri_2019-01-29T03:41:34.910600
1,548,733,294.9106
4,848
pythondev
help
you can easily push message to slack by calling a unique webhook url
2019-01-29T03:41:42.910900
Jimmy
pythondev_help_Jimmy_2019-01-29T03:41:42.910900
1,548,733,302.9109
4,849
pythondev
help
that's the easiest way to do it
2019-01-29T03:41:52.911400
Jimmy
pythondev_help_Jimmy_2019-01-29T03:41:52.911400
1,548,733,312.9114
4,850
pythondev
help
This is related to the exception handling I posted above; so for this case I want to send a notification to slack if a critical error happens <@Valeri>
2019-01-29T03:42:48.912400
Conchita
pythondev_help_Conchita_2019-01-29T03:42:48.912400
1,548,733,368.9124
4,851
pythondev
help
I'm not familiar with how to do that <@Jimmy> Is there a library I should use?
2019-01-29T03:44:49.913100
Conchita
pythondev_help_Conchita_2019-01-29T03:44:49.913100
1,548,733,489.9131
4,852
pythondev
help
<@Conchita> You'll have to create a Slack app probably
2019-01-29T03:45:20.913700
Valeri
pythondev_help_Valeri_2019-01-29T03:45:20.913700
1,548,733,520.9137
4,853
pythondev
help
you can but that's not really necessary, let me look it up
2019-01-29T03:45:24.913900
Jimmy
pythondev_help_Jimmy_2019-01-29T03:45:24.913900
1,548,733,524.9139
4,854
pythondev
help
yeah
2019-01-29T03:45:40.914200
Valeri
pythondev_help_Valeri_2019-01-29T03:45:40.914200
1,548,733,540.9142
4,855
pythondev
help
<https://api.slack.com/incoming-webhooks>
2019-01-29T03:45:44.914400
Jimmy
pythondev_help_Jimmy_2019-01-29T03:45:44.914400
1,548,733,544.9144
4,856
pythondev
help
no you don't need an app
2019-01-29T03:45:48.914700
Jimmy
pythondev_help_Jimmy_2019-01-29T03:45:48.914700
1,548,733,548.9147
4,857
pythondev
help
haha yes you do sorry. That's the first point :smile:
2019-01-29T03:46:05.915100
Jimmy
pythondev_help_Jimmy_2019-01-29T03:46:05.915100
1,548,733,565.9151
4,858
pythondev
help
my bad
2019-01-29T03:46:06.915300
Jimmy
pythondev_help_Jimmy_2019-01-29T03:46:06.915300
1,548,733,566.9153
4,859
pythondev
help
Great, reading now
2019-01-29T03:46:43.915600
Conchita
pythondev_help_Conchita_2019-01-29T03:46:43.915600
1,548,733,603.9156
4,860
pythondev
help
<https://github.com/slackapi/python-slackclient>
2019-01-29T03:46:58.915800
Jimmy
pythondev_help_Jimmy_2019-01-29T03:46:58.915800
1,548,733,618.9158
4,861
pythondev
help
you can probably use that as library :point_up:
2019-01-29T03:47:12.916300
Jimmy
pythondev_help_Jimmy_2019-01-29T03:47:12.916300
1,548,733,632.9163
4,862
pythondev
help
but it's just an http request so you don't really have to
2019-01-29T03:47:27.916700
Jimmy
pythondev_help_Jimmy_2019-01-29T03:47:27.916700
1,548,733,647.9167
4,863
pythondev
help
Clients are always better tho
2019-01-29T03:52:46.917000
Valeri
pythondev_help_Valeri_2019-01-29T03:52:46.917000
1,548,733,966.917
4,864
pythondev
help
You won't need to handle network errors yourself
2019-01-29T03:53:00.917500
Valeri
pythondev_help_Valeri_2019-01-29T03:53:00.917500
1,548,733,980.9175
4,865
pythondev
help
at least
2019-01-29T03:53:27.917700
Valeri
pythondev_help_Valeri_2019-01-29T03:53:27.917700
1,548,734,007.9177
4,866
pythondev
help
true, but something like requests would be enough
2019-01-29T03:53:58.918200
Jimmy
pythondev_help_Jimmy_2019-01-29T03:53:58.918200
1,548,734,038.9182
4,867
pythondev
help
I doubt the slack client does much more,
2019-01-29T03:54:10.918600
Jimmy
pythondev_help_Jimmy_2019-01-29T03:54:10.918600
1,548,734,050.9186
4,868
pythondev
help
probably a bit of formatting since the API is not consistent in that regards
2019-01-29T03:54:28.919100
Jimmy
pythondev_help_Jimmy_2019-01-29T03:54:28.919100
1,548,734,068.9191
4,869
pythondev
help
Would something like this work? This is after I have created a slack app, enabled webhooks and generated my webhook address (which I masked in my example)
2019-01-29T03:55:08.919200
Conchita
pythondev_help_Conchita_2019-01-29T03:55:08.919200
1,548,734,108.9192
4,870
pythondev
help
I don't think the payload should be like that
2019-01-29T03:55:37.920300
Jimmy
pythondev_help_Jimmy_2019-01-29T03:55:37.920300
1,548,734,137.9203
4,871
pythondev
help
Or I mean, I know this isn't working - I received `invalid output`. I mean is it something close to this I neeed to do?
2019-01-29T03:55:40.920400
Conchita
pythondev_help_Conchita_2019-01-29T03:55:40.920400
1,548,734,140.9204
4,872
pythondev
help
``` payload = { "text": "Hello, world." } ```
2019-01-29T03:56:00.920700
Jimmy
pythondev_help_Jimmy_2019-01-29T03:56:00.920700
1,548,734,160.9207
4,873
pythondev
help
try that
2019-01-29T03:56:02.920900
Jimmy
pythondev_help_Jimmy_2019-01-29T03:56:02.920900
1,548,734,162.9209
4,874
pythondev
help
That outputs a lenghty html file that starts like this ```&lt;!DOCTYPE html&gt; &lt;html lang="en-US"&gt; &lt;head&gt; &lt;script&gt; window.ts_endpoint_url = "https:\/\/slack.com\/beacon\/timing"; (function(e) { ..............```
2019-01-29T03:57:22.921600
Conchita
pythondev_help_Conchita_2019-01-29T03:57:22.921600
1,548,734,242.9216
4,875
pythondev
help
And no msg is posted in slack
2019-01-29T03:57:35.921900
Conchita
pythondev_help_Conchita_2019-01-29T03:57:35.921900
1,548,734,255.9219
4,876
pythondev
help
hmm I can't enable incoming webhook on <@Leana> to test it :confused:
2019-01-29T04:00:33.922400
Jimmy
pythondev_help_Jimmy_2019-01-29T04:00:33.922400
1,548,734,433.9224
4,877
pythondev
help
try with `<http://requests.post|requests.post>("urll", json=payload)`
2019-01-29T04:01:07.922900
Jimmy
pythondev_help_Jimmy_2019-01-29T04:01:07.922900
1,548,734,467.9229
4,878
pythondev
help
Boom! That worked <@Jimmy>
2019-01-29T04:01:58.923300
Conchita
pythondev_help_Conchita_2019-01-29T04:01:58.923300
1,548,734,518.9233
4,879
pythondev
help
Have a hot :taco: <@Jimmy> Thank you
2019-01-29T04:02:12.923700
Conchita
pythondev_help_Conchita_2019-01-29T04:02:12.923700
1,548,734,532.9237
4,880
pythondev
help
None
2019-01-29T04:02:19.923800
Leana
pythondev_help_Leana_2019-01-29T04:02:19.923800
1,548,734,539.9238
4,881
pythondev
help
so by putting `json` you tell request that your payload is json and it encodes it for you and set the content-type header to json
2019-01-29T04:03:01.924600
Jimmy
pythondev_help_Jimmy_2019-01-29T04:03:01.924600
1,548,734,581.9246
4,882
pythondev
help
without that data is sent in another format and slack wants it in json
2019-01-29T04:03:20.925100
Jimmy
pythondev_help_Jimmy_2019-01-29T04:03:20.925100
1,548,734,600.9251
4,883
pythondev
help
Got it!
2019-01-29T04:10:47.925400
Conchita
pythondev_help_Conchita_2019-01-29T04:10:47.925400
1,548,735,047.9254
4,884
pythondev
help
Hi guys, I have a question but I couldn’t find any answer elsewhere… There’s a way to force conda to download packages only from pypi?
2019-01-29T05:33:53.926800
Alicia
pythondev_help_Alicia_2019-01-29T05:33:53.926800
1,548,740,033.9268
4,885
pythondev
help
I'm not familliar with conda but is there any advantages using it if you only download stuff from pypi ?
2019-01-29T05:37:59.927300
Jimmy
pythondev_help_Jimmy_2019-01-29T05:37:59.927300
1,548,740,279.9273
4,886
pythondev
help
<@Jimmy> the advantages of using conda are (IMO): • that is easy to use • it has already been spread across the company I work in • A good dependency mgmt (but not as good as pipenv or poetry ones) • It automatically downloads the python version you ask for your env Why I want it to download only from pypi? • Because ...
2019-01-29T05:45:48.932800
Alicia
pythondev_help_Alicia_2019-01-29T05:45:48.932800
1,548,740,748.9328
4,887
pythondev
help
The cons in that list clearly outweigh the pros
2019-01-29T05:48:26.933500
Jonas
pythondev_help_Jonas_2019-01-29T05:48:26.933500
1,548,740,906.9335
4,888
pythondev
help
<@Alicia> <https://stackoverflow.com/a/52132667/6403406>
2019-01-29T05:57:48.935400
Valeri
pythondev_help_Valeri_2019-01-29T05:57:48.935400
1,548,741,468.9354
4,889
pythondev
help
might help
2019-01-29T05:58:03.935700
Valeri
pythondev_help_Valeri_2019-01-29T05:58:03.935700
1,548,741,483.9357
4,890
pythondev
help
this problem is driving me insane - given a arbitrary string - return a list of valid json strings/ objects. Is there any way to do this easily without regex and recursion? <https://stackoverflow.com/questions/21994677/find-json-strings-in-a-string>
2019-01-29T06:02:05.936600
Renna
pythondev_help_Renna_2019-01-29T06:02:05.936600
1,548,741,725.9366
4,891
pythondev
help
I dont want to implement some kind of lexical parser...
2019-01-29T06:02:22.937100
Renna
pythondev_help_Renna_2019-01-29T06:02:22.937100
1,548,741,742.9371
4,892
pythondev
help
Can you show us your i/p?
2019-01-29T06:03:54.937500
Valeri
pythondev_help_Valeri_2019-01-29T06:03:54.937500
1,548,741,834.9375
4,893
pythondev
help
me?
2019-01-29T06:04:08.937700
Renna
pythondev_help_Renna_2019-01-29T06:04:08.937700
1,548,741,848.9377
4,894
pythondev
help
yes, what does your actual input string look like
2019-01-29T06:05:14.937900
Chuck
pythondev_help_Chuck_2019-01-29T06:05:14.937900
1,548,741,914.9379
4,895
pythondev
help
yes
2019-01-29T06:05:41.938100
Valeri
pythondev_help_Valeri_2019-01-29T06:05:41.938100
1,548,741,941.9381
4,896
pythondev
help
<https://pastebin.com/ukJxhAAW>
2019-01-29T06:07:00.938700
Renna
pythondev_help_Renna_2019-01-29T06:07:00.938700
1,548,742,020.9387
4,897
pythondev
help
i can parse it but i was hoping for a more generic solution
2019-01-29T06:07:20.939000
Renna
pythondev_help_Renna_2019-01-29T06:07:20.939000
1,548,742,040.939
4,898
pythondev
help
it has two json strings embedded in a string
2019-01-29T06:07:33.939200
Renna
pythondev_help_Renna_2019-01-29T06:07:33.939200
1,548,742,053.9392
4,899
pythondev
help
maybe parser like this might be able to scan and select all valid json trees <https://pythonhosted.org/pyrser/tutorial1.html>
2019-01-29T06:08:14.939400
Renna
pythondev_help_Renna_2019-01-29T06:08:14.939400
1,548,742,094.9394
4,900
pythondev
help
which might be the more general solution
2019-01-29T06:08:37.939600
Renna
pythondev_help_Renna_2019-01-29T06:08:37.939600
1,548,742,117.9396
4,901
pythondev
help
And you need a solution using python or php?
2019-01-29T06:10:05.940200
Valeri
pythondev_help_Valeri_2019-01-29T06:10:05.940200
1,548,742,205.9402
4,902
pythondev
help
well atm i am using python
2019-01-29T06:11:34.940400
Renna
pythondev_help_Renna_2019-01-29T06:11:34.940400
1,548,742,294.9404
4,903
pythondev
help
didn’t worked :confused:
2019-01-29T06:11:56.940600
Alicia
pythondev_help_Alicia_2019-01-29T06:11:56.940600
1,548,742,316.9406
4,904
pythondev
help
i need to do a bit more reading i guess if i want a generalized solution <https://tomassetti.me/parsing-in-python/>
2019-01-29T06:14:14.940800
Renna
pythondev_help_Renna_2019-01-29T06:14:14.940800
1,548,742,454.9408
4,905
pythondev
help
Your use case is pretty straightforward imo
2019-01-29T06:16:44.941100
Valeri
pythondev_help_Valeri_2019-01-29T06:16:44.941100
1,548,742,604.9411
4,906
pythondev
help
You just have to pickup stuff between `{}` and form a dict right?
2019-01-29T06:17:17.941300
Valeri
pythondev_help_Valeri_2019-01-29T06:17:17.941300
1,548,742,637.9413
4,907
pythondev
help
To convert a string back to json you have `json.loads()`
2019-01-29T06:18:01.941500
Valeri
pythondev_help_Valeri_2019-01-29T06:18:01.941500
1,548,742,681.9415
4,908
pythondev
help
<@Renna>
2019-01-29T06:18:21.941800
Valeri
pythondev_help_Valeri_2019-01-29T06:18:21.941800
1,548,742,701.9418
4,909
pythondev
help
So, what exactly are you trying to achieve?
2019-01-29T06:18:53.942000
Valeri
pythondev_help_Valeri_2019-01-29T06:18:53.942000
1,548,742,733.942
4,910
pythondev
help
And tell us more about your use case?
2019-01-29T06:19:10.942200
Valeri
pythondev_help_Valeri_2019-01-29T06:19:10.942200
1,548,742,750.9422
4,911
pythondev
help
yea correct - well there are actually two json strings
2019-01-29T06:20:08.942400
Renna
pythondev_help_Renna_2019-01-29T06:20:08.942400
1,548,742,808.9424
4,912
pythondev
help
one at the very end saying total rows returned
2019-01-29T06:20:22.942600
Renna
pythondev_help_Renna_2019-01-29T06:20:22.942600
1,548,742,822.9426
4,913
pythondev
help
I think i might make a handcrafted solution for now but i might make a more general solution as a side project - it should be possible
2019-01-29T06:20:59.942800
Renna
pythondev_help_Renna_2019-01-29T06:20:59.942800
1,548,742,859.9428
4,914
pythondev
help
Sure
2019-01-29T06:27:54.943000
Valeri
pythondev_help_Valeri_2019-01-29T06:27:54.943000
1,548,743,274.943
4,915
pythondev
help
I can already think of a two-pointers based solution
2019-01-29T06:28:12.943200
Valeri
pythondev_help_Valeri_2019-01-29T06:28:12.943200
1,548,743,292.9432
4,916
pythondev
help
Lemme know if you'd like to do it as a side project. I'd contribute <@Renna>
2019-01-29T06:28:41.943400
Valeri
pythondev_help_Valeri_2019-01-29T06:28:41.943400
1,548,743,321.9434
4,917
pythondev
help
is this proper pep 8 standards? Bare in mind this has come out of a function; ``` not_present_script = inter_freq_internal_freq['Script'].loc[~( inter_freq_internal_freq['eNodeBName'].isin( sites_file['*eNodeB Name']))] ```
2019-01-29T06:41:23.944100
Arturo
pythondev_help_Arturo_2019-01-29T06:41:23.944100
1,548,744,083.9441
4,918
pythondev
help
yea might be easier to look for opening and closing { and keep a stack or something - then checking the string is valid json using the json libary. I will try this first at least
2019-01-29T06:50:30.944400
Renna
pythondev_help_Renna_2019-01-29T06:50:30.944400
1,548,744,630.9444
4,919
pythondev
help
maybe parser is over kill
2019-01-29T06:50:42.944800
Renna
pythondev_help_Renna_2019-01-29T06:50:42.944800
1,548,744,642.9448
4,920