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
True
2017-11-06T17:56:10.000077
Frieda
pythondev_help_Frieda_2017-11-06T17:56:10.000077
1,509,990,970.000077
99,603
pythondev
help
Does anyone know why a program would run in debug but not normally? I'm using a Raspberry Pi and attempting to use signal.pause() to await an interrupt to occur, but it won't work normally running it, however in debug it works fine
2017-11-06T18:06:10.000115
Myong
pythondev_help_Myong_2017-11-06T18:06:10.000115
1,509,991,570.000115
99,604
pythondev
help
<@Vena> don't do naked `except`s like that. they'll swallow _all_ errors that the encapsulated code throws and you won't know if something breaks in a new/unexpected way
2017-11-06T18:07:38.000353
Frieda
pythondev_help_Frieda_2017-11-06T18:07:38.000353
1,509,991,658.000353
99,605
pythondev
help
also, try to _only_ do code that might throw an exception in the `try` block
2017-11-06T18:07:53.000072
Frieda
pythondev_help_Frieda_2017-11-06T18:07:53.000072
1,509,991,673.000072
99,606
pythondev
help
``` try: f = open(filename, 'r') except (FileNotFoundError, OSError): failed_files.append(file) else: # do stuff with f ```
2017-11-06T18:08:44.000052
Frieda
pythondev_help_Frieda_2017-11-06T18:08:44.000052
1,509,991,724.000052
99,607
pythondev
help
<@Myong> "in debug"?
2017-11-06T18:11:25.000092
Frieda
pythondev_help_Frieda_2017-11-06T18:11:25.000092
1,509,991,885.000092
99,608
pythondev
help
While debugging.
2017-11-06T18:11:38.000256
Myong
pythondev_help_Myong_2017-11-06T18:11:38.000256
1,509,991,898.000256
99,609
pythondev
help
But it doesn't seem to be the issue. Signal.pause() just won't detect the press
2017-11-06T18:11:59.000303
Myong
pythondev_help_Myong_2017-11-06T18:11:59.000303
1,509,991,919.000303
99,610
pythondev
help
But if I step to just before pause the presses are detected
2017-11-06T18:12:13.000078
Myong
pythondev_help_Myong_2017-11-06T18:12:13.000078
1,509,991,933.000078
99,611
pythondev
help
<@Frieda> Interesting. Got it. Thanks.
2017-11-06T18:13:11.000100
Vena
pythondev_help_Vena_2017-11-06T18:13:11.000100
1,509,991,991.0001
99,612
pythondev
help
<@Myong> sorry, no idea.
2017-11-06T18:14:05.000097
Frieda
pythondev_help_Frieda_2017-11-06T18:14:05.000097
1,509,992,045.000097
99,613
pythondev
help
<@Myong> does it do the same thing on another linux system?
2017-11-06T18:15:20.000076
Marcie
pythondev_help_Marcie_2017-11-06T18:15:20.000076
1,509,992,120.000076
99,614
pythondev
help
I can't check at the moment it's the only Linux system I have
2017-11-06T18:15:39.000326
Myong
pythondev_help_Myong_2017-11-06T18:15:39.000326
1,509,992,139.000326
99,615
pythondev
help
I tried `sudo apt-get dist-upgrade`
2017-11-06T18:16:00.000162
Myong
pythondev_help_Myong_2017-11-06T18:16:00.000162
1,509,992,160.000162
99,616
pythondev
help
Doesn't work with using `while True: time.sleep(1)`
2017-11-06T18:17:08.000037
Myong
pythondev_help_Myong_2017-11-06T18:17:08.000037
1,509,992,228.000037
99,617
pythondev
help
check to see if anything for `signal.getsignal(2)` return anythings beforehand
2017-11-06T18:18:44.000001
Marcie
pythondev_help_Marcie_2017-11-06T18:18:44.000001
1,509,992,324.000001
99,618
pythondev
help
Like so?
2017-11-06T18:29:05.000052
Myong
pythondev_help_Myong_2017-11-06T18:29:05.000052
1,509,992,945.000052
99,619
pythondev
help
i believe so yeah, you generally just want to check that you're setup to handle a signal
2017-11-06T18:30:30.000230
Marcie
pythondev_help_Marcie_2017-11-06T18:30:30.000230
1,509,993,030.00023
99,620
pythondev
help
pause internally uses `signal(2)` which itself is normally fine on x86 linux systems but gets weird once you start working on other hardware :disappointed:
2017-11-06T18:31:03.000021
Marcie
pythondev_help_Marcie_2017-11-06T18:31:03.000021
1,509,993,063.000021
99,621
pythondev
help
It brings up an object for signal handler
2017-11-06T18:31:50.000016
Myong
pythondev_help_Myong_2017-11-06T18:31:50.000016
1,509,993,110.000016
99,622
pythondev
help
I mispoke
2017-11-06T18:33:03.000358
Myong
pythondev_help_Myong_2017-11-06T18:33:03.000358
1,509,993,183.000358
99,623
pythondev
help
Maybe I could try GPIO native add callback
2017-11-06T18:36:59.000259
Myong
pythondev_help_Myong_2017-11-06T18:36:59.000259
1,509,993,419.000259
99,624
pythondev
help
Hello guys! any recommendations in dealing with time series data that has one insertion each day? I am currently using postgres and django
2017-11-06T18:47:55.000282
Iluminada
pythondev_help_Iluminada_2017-11-06T18:47:55.000282
1,509,994,075.000282
99,625
pythondev
help
Hi all. I'm trying to write a loop along the lines of `for number in numbers`. Sometimes numbers will contain multiple values and be a tuple `('1', '2')` but other times it may just be a single number. When it's just a single number, python is splitting the number. Ie: 12 becomes `[1, 2]`. Does anyone know how to work ...
2017-11-06T18:48:03.000003
Leon
pythondev_help_Leon_2017-11-06T18:48:03.000003
1,509,994,083.000003
99,626
pythondev
help
you'd need to detect whether it's a number or tuple first
2017-11-06T18:50:20.000005
Frieda
pythondev_help_Frieda_2017-11-06T18:50:20.000005
1,509,994,220.000005
99,627
pythondev
help
Paste a small snippet of your code and the outupt :slightly_smiling_face:
2017-11-06T18:52:14.000052
Corrinne
pythondev_help_Corrinne_2017-11-06T18:52:14.000052
1,509,994,334.000052
99,628
pythondev
help
``` # Parse parameters for param in sys.argv: if param.startswith('event='): event_ids = param.split('=')[1] # See if we have multiple event ids if ',' in event_ids: event_ids = event_ids.split(',')
2017-11-06T18:53:27.000088
Leon
pythondev_help_Leon_2017-11-06T18:53:27.000088
1,509,994,407.000088
99,629
pythondev
help
The code takes a parameter of event= where the value could be a single diget (ie: 21) or multiple comma separate digits (21, 22, 23 etc): ``` # Parse parameters for param in sys.argv: if param.startswith('event='): event_ids = param.split('=')[1] # See if we have multiple event ...
2017-11-06T18:55:45.000092
Leon
pythondev_help_Leon_2017-11-06T18:55:45.000092
1,509,994,545.000092
99,630
pythondev
help
you can use split on a string to get a list even if theres nothing to split on
2017-11-06T18:56:52.000187
Marcie
pythondev_help_Marcie_2017-11-06T18:56:52.000187
1,509,994,612.000187
99,631
pythondev
help
```In [1]: '21'.split(',') Out[1]: ['21'] In [2]: '21,22'.split(',') Out[2]: ['21', '22']```
2017-11-06T18:57:26.000081
Marcie
pythondev_help_Marcie_2017-11-06T18:57:26.000081
1,509,994,646.000081
99,632
pythondev
help
so just always split the `event_ids` string and you'll be able to iterate over single or multiple values
2017-11-06T18:58:04.000117
Marcie
pythondev_help_Marcie_2017-11-06T18:58:04.000117
1,509,994,684.000117
99,633
pythondev
help
<@Marcie> spot on! That's now working as expected. Thanks very much.
2017-11-06T18:58:45.000176
Leon
pythondev_help_Leon_2017-11-06T18:58:45.000176
1,509,994,725.000176
99,634
pythondev
help
:toot:
2017-11-06T18:58:53.000077
Marcie
pythondev_help_Marcie_2017-11-06T18:58:53.000077
1,509,994,733.000077
99,635
pythondev
help
... and removes the need for that if statement to boot :slightly_smiling_face:
2017-11-06T18:59:04.000015
Leon
pythondev_help_Leon_2017-11-06T18:59:04.000015
1,509,994,744.000015
99,636
pythondev
help
yup!
2017-11-06T18:59:12.000365
Marcie
pythondev_help_Marcie_2017-11-06T18:59:12.000365
1,509,994,752.000365
99,637
pythondev
help
Hi! Trying to do some web scrapping using scrapy and css selectors but I am running into trouble. <https://stackoverflow.com/questions/47147679/using-css-selectors-to-grab-nested-tag-scrapy>
2017-11-06T19:14:37.000168
Sharika
pythondev_help_Sharika_2017-11-06T19:14:37.000168
1,509,995,677.000168
99,638
pythondev
help
I am getting what seems like inconsistent results but I might be missing something
2017-11-06T19:14:53.000270
Sharika
pythondev_help_Sharika_2017-11-06T19:14:53.000270
1,509,995,693.00027
99,639
pythondev
help
<@Sharika> are you able to select that element in the chrome devtool if you turn javascript off?
2017-11-06T19:43:28.000031
Marcie
pythondev_help_Marcie_2017-11-06T19:43:28.000031
1,509,997,408.000031
99,640
pythondev
help
<@Marcie> I think it has to do with JS yes
2017-11-06T19:43:49.000009
Sharika
pythondev_help_Sharika_2017-11-06T19:43:49.000009
1,509,997,429.000009
99,641
pythondev
help
looking into Splash right now
2017-11-06T19:43:55.000143
Sharika
pythondev_help_Sharika_2017-11-06T19:43:55.000143
1,509,997,435.000143
99,642
pythondev
help
that's what i'd reckon yeah
2017-11-06T19:44:05.000029
Marcie
pythondev_help_Marcie_2017-11-06T19:44:05.000029
1,509,997,445.000029
99,643
pythondev
help
if its not being rendered serverside then that react-root points to it being a react component and thus won't exist in the DOM without splash
2017-11-06T19:44:31.000051
Marcie
pythondev_help_Marcie_2017-11-06T19:44:31.000051
1,509,997,471.000051
99,644
pythondev
help
Hy buddys
2017-11-06T19:52:03.000182
Twila
pythondev_help_Twila_2017-11-06T19:52:03.000182
1,509,997,923.000182
99,645
pythondev
help
Someone know how can i get linkedin profile picture
2017-11-06T19:52:46.000153
Twila
pythondev_help_Twila_2017-11-06T19:52:46.000153
1,509,997,966.000153
99,646
pythondev
help
for use it in django?
2017-11-06T19:52:56.000164
Twila
pythondev_help_Twila_2017-11-06T19:52:56.000164
1,509,997,976.000164
99,647
pythondev
help
There is a specific url for that?
2017-11-06T19:53:19.000077
Twila
pythondev_help_Twila_2017-11-06T19:53:19.000077
1,509,997,999.000077
99,648
pythondev
help
there's an entire API for it yeah <https://developer.linkedin.com/docs/rest-api#>
2017-11-06T19:54:44.000101
Marcie
pythondev_help_Marcie_2017-11-06T19:54:44.000101
1,509,998,084.000101
99,649
pythondev
help
you're likely after some of the data in the profile endpoint: <https://developer.linkedin.com/docs/fields/basic-profile>
2017-11-06T19:55:22.000035
Marcie
pythondev_help_Marcie_2017-11-06T19:55:22.000035
1,509,998,122.000035
99,650
pythondev
help
Hello guys, anyone know a good way to handle time series data in django database. I want to optimize in terms of query speed. Currently using postgres, and I dont want to deal with another database. what are the best options out there right now? store the times series data in (1) json, (2) a file or (3) just store the ...
2017-11-06T21:45:46.000200
Iluminada
pythondev_help_Iluminada_2017-11-06T21:45:46.000200
1,510,004,746.0002
99,651
pythondev
help
hi guys
2017-11-06T21:52:53.000064
So
pythondev_help_So_2017-11-06T21:52:53.000064
1,510,005,173.000064
99,652
pythondev
help
i am using vuejs with axios 3rd party for request ```let id = response.data.user.id let imageData = this.myCroppa.generateDataUrl() let data = { id: id, image: this.myCroppa.getChosenFile().name, img_uri: imageData } let headers...
2017-11-06T21:53:43.000149
So
pythondev_help_So_2017-11-06T21:53:43.000149
1,510,005,223.000149
99,653
pythondev
help
but
2017-11-06T21:53:57.000071
So
pythondev_help_So_2017-11-06T21:53:57.000071
1,510,005,237.000071
99,654
pythondev
help
error given is
2017-11-06T21:53:59.000211
So
pythondev_help_So_2017-11-06T21:53:59.000211
1,510,005,239.000211
99,655
pythondev
help
`detail: "Method "GET" not allowed."`
2017-11-06T21:54:05.000203
So
pythondev_help_So_2017-11-06T21:54:05.000203
1,510,005,245.000203
99,656
pythondev
help
any clarifications ?
2017-11-06T21:55:44.000041
So
pythondev_help_So_2017-11-06T21:55:44.000041
1,510,005,344.000041
99,657
pythondev
help
<@So> you're making a GET request instead of POST somehow
2017-11-06T22:00:48.000166
Collette
pythondev_help_Collette_2017-11-06T22:00:48.000166
1,510,005,648.000166
99,658
pythondev
help
but how ? i am using ``` <http://axios.post|axios.post>(process.env.API_URL + '/info/upload-profile-image/',```
2017-11-06T22:01:17.000061
So
pythondev_help_So_2017-11-06T22:01:17.000061
1,510,005,677.000061
99,659
pythondev
help
and ```@api_view(['POST'])```
2017-11-06T22:01:37.000122
So
pythondev_help_So_2017-11-06T22:01:37.000122
1,510,005,697.000122
99,660
pythondev
help
i am confused
2017-11-06T22:01:40.000255
So
pythondev_help_So_2017-11-06T22:01:40.000255
1,510,005,700.000255
99,661
pythondev
help
You need to figure that out.
2017-11-06T22:06:17.000066
Collette
pythondev_help_Collette_2017-11-06T22:06:17.000066
1,510,005,977.000066
99,662
pythondev
help
The problem is clearly on the frontend.
2017-11-06T22:06:27.000217
Collette
pythondev_help_Collette_2017-11-06T22:06:27.000217
1,510,005,987.000217
99,663
pythondev
help
look at the form itself that's sending the data, what `method` attribute are you using?
2017-11-06T22:07:16.000172
Lory
pythondev_help_Lory_2017-11-06T22:07:16.000172
1,510,006,036.000172
99,664
pythondev
help
```let id = response.data.user.id let imageData = this.myCroppa.generateDataUrl() let data = { id: id, image: this.myCroppa.getChosenFile().name, img_uri: imageData } let headers = { 'Content-Type': 'application/json...
2017-11-06T22:07:56.000109
So
pythondev_help_So_2017-11-06T22:07:56.000109
1,510,006,076.000109
99,665
pythondev
help
if not defined, it will default to a `GET` request, you have to define `method='POST'` in order to send a post request
2017-11-06T22:08:06.000055
Lory
pythondev_help_Lory_2017-11-06T22:08:06.000055
1,510,006,086.000055
99,666
pythondev
help
``` let headers = { 'Content-Type': 'application/json', 'Authorization': 'JWT ' + response.data.token } ```
2017-11-06T22:08:12.000180
So
pythondev_help_So_2017-11-06T22:08:12.000180
1,510,006,092.00018
99,667
pythondev
help
Hey guys i have a newbie question is there a particular way we can Execute multiple python files using a single main.py
2017-11-06T22:11:40.000102
Burma
pythondev_help_Burma_2017-11-06T22:11:40.000102
1,510,006,300.000102
99,668
pythondev
help
you can import them as modules and execute them that way
2017-11-06T22:12:25.000087
Lory
pythondev_help_Lory_2017-11-06T22:12:25.000087
1,510,006,345.000087
99,669
pythondev
help
from path import x from path import y
2017-11-06T22:12:58.000024
So
pythondev_help_So_2017-11-06T22:12:58.000024
1,510,006,378.000024
99,670
pythondev
help
the python scripts would be in the same directory as the main.py would this cause a conflict ?
2017-11-06T22:13:59.000235
Burma
pythondev_help_Burma_2017-11-06T22:13:59.000235
1,510,006,439.000235
99,671
pythondev
help
as long as they aren't named something that takes precedence over another module
2017-11-06T22:14:45.000187
Lory
pythondev_help_Lory_2017-11-06T22:14:45.000187
1,510,006,485.000187
99,672
pythondev
help
from yourmodule import x from yourmodule import y
2017-11-06T22:15:01.000005
So
pythondev_help_So_2017-11-06T22:15:01.000005
1,510,006,501.000005
99,673
pythondev
help
if same path
2017-11-06T22:15:07.000053
So
pythondev_help_So_2017-11-06T22:15:07.000053
1,510,006,507.000053
99,674
pythondev
help
sounds good I'll give it a try
2017-11-06T22:15:38.000208
Burma
pythondev_help_Burma_2017-11-06T22:15:38.000208
1,510,006,538.000208
99,675
pythondev
help
so like the time module, if you name a py file `time.py` within that directory then trying to import pythons time module wouldn't work
2017-11-06T22:15:45.000153
Lory
pythondev_help_Lory_2017-11-06T22:15:45.000153
1,510,006,545.000153
99,676
pythondev
help
<@Lory> makes sense
2017-11-06T22:16:24.000059
Burma
pythondev_help_Burma_2017-11-06T22:16:24.000059
1,510,006,584.000059
99,677
pythondev
help
i just give some idea base on django importing sorry
2017-11-06T22:16:48.000184
So
pythondev_help_So_2017-11-06T22:16:48.000184
1,510,006,608.000184
99,678
pythondev
help
i didng know python too much. rather i jump directly in django xd
2017-11-06T22:17:14.000006
So
pythondev_help_So_2017-11-06T22:17:14.000006
1,510,006,634.000006
99,679
pythondev
help
didnt*
2017-11-06T22:17:18.000076
So
pythondev_help_So_2017-11-06T22:17:18.000076
1,510,006,638.000076
99,680
pythondev
help
we all started somewhere, gotta learn one way or another!
2017-11-06T22:17:37.000123
Lory
pythondev_help_Lory_2017-11-06T22:17:37.000123
1,510,006,657.000123
99,681
pythondev
help
its basically a few python scripts being called by a main.py
2017-11-06T22:17:55.000017
Burma
pythondev_help_Burma_2017-11-06T22:17:55.000017
1,510,006,675.000017
99,682
pythondev
help
i'm i better off trying to do this with a type of framework
2017-11-06T22:18:40.000155
Burma
pythondev_help_Burma_2017-11-06T22:18:40.000155
1,510,006,720.000155
99,683
pythondev
help
thanks <@Lory>
2017-11-06T22:19:14.000097
So
pythondev_help_So_2017-11-06T22:19:14.000097
1,510,006,754.000097
99,684
pythondev
help
yea pythons import system is fairly simple once yo understand how it works. It just seems daunting because it seems to work like magic to a beginner. At least that's how I felt haha
2017-11-06T22:22:40.000103
Lory
pythondev_help_Lory_2017-11-06T22:22:40.000103
1,510,006,960.000103
99,685
pythondev
help
haha yea Foresure I'll stick with it :sweat_smile:
2017-11-06T22:25:24.000228
Burma
pythondev_help_Burma_2017-11-06T22:25:24.000228
1,510,007,124.000228
99,686
pythondev
help
You can just wrap your codes in functions. eg. `x.py`, `y.py`, `main..py` . import like this `from x import function_name ` in your `main.py`
2017-11-06T22:28:42.000078
Cammy
pythondev_help_Cammy_2017-11-06T22:28:42.000078
1,510,007,322.000078
99,687
pythondev
help
fairly simple...
2017-11-06T22:28:49.000060
Cammy
pythondev_help_Cammy_2017-11-06T22:28:49.000060
1,510,007,329.00006
99,688
pythondev
help
Greetings to awesome helpers here...
2017-11-06T22:29:15.000222
Cammy
pythondev_help_Cammy_2017-11-06T22:29:15.000222
1,510,007,355.000222
99,689
pythondev
help
I need a library to work with ussd codes. Any recommendations.. I have tried `python-gsmmodem` and I have not been successfull with it.
2017-11-06T22:31:05.000135
Cammy
pythondev_help_Cammy_2017-11-06T22:31:05.000135
1,510,007,465.000135
99,690
pythondev
help
``` wits.ussdmonitor.py git:(master) ✗ ./ussdmonitor/app_2.py Getting modem ready... Sending USSD code *124# Traceback (most recent call last): File "./ussdmonitor/app_2.py", line 31, in &lt;module&gt; app() File "./ussdmonitor/app_2.py", line 18, in app response = modem.sendUssd(USSD_STRING) File "/home...
2017-11-06T22:31:18.000082
Cammy
pythondev_help_Cammy_2017-11-06T22:31:18.000082
1,510,007,478.000082
99,691
pythondev
help
I would appreciate any help in direction to fix this error or any good recommendation
2017-11-06T22:33:13.000070
Cammy
pythondev_help_Cammy_2017-11-06T22:33:13.000070
1,510,007,593.00007
99,692
pythondev
help
i am not familiar with ussd code but take a look with this :slightly_smiling_face:
2017-11-06T22:35:37.000125
So
pythondev_help_So_2017-11-06T22:35:37.000125
1,510,007,737.000125
99,693
pythondev
help
<https://devspace.hsenidmobile.com/code/python/ussd/>
2017-11-06T22:35:38.000084
So
pythondev_help_So_2017-11-06T22:35:38.000084
1,510,007,738.000084
99,694
pythondev
help
Hellp
2017-11-07T09:12:49.000099
Lahoma
pythondev_help_Lahoma_2017-11-07T09:12:49.000099
1,510,045,969.000099
99,695
pythondev
help
hello
2017-11-07T09:12:50.000523
Lahoma
pythondev_help_Lahoma_2017-11-07T09:12:50.000523
1,510,045,970.000523
99,696
pythondev
help
<@Lahoma> you have provided two import statements and no other context, so we have no idea what two methods you are talking about. Can you provide more detaiil?
2017-11-07T09:28:18.000637
Vada
pythondev_help_Vada_2017-11-07T09:28:18.000637
1,510,046,898.000637
99,697
pythondev
help
<@Vada> yes generally im not sure what the difference is and which one should be used. It appears one can accomplish the same thing using ether of the options. Not really asking any spepfic other than what is the difference and how would one make choice on which one to use. I do know they handle arguments differentl...
2017-11-07T09:30:09.000497
Lahoma
pythondev_help_Lahoma_2017-11-07T09:30:09.000497
1,510,047,009.000497
99,698
pythondev
help
<@Vada> ^^
2017-11-07T09:31:49.000388
Lahoma
pythondev_help_Lahoma_2017-11-07T09:31:49.000388
1,510,047,109.000388
99,699
pythondev
help
<@Lahoma> what are you trying to achieve? They can be used to do the same things in many case but that does not mean they should be - they are very different in their general use, but I can't tell you more without knowing what you actually want to do.
2017-11-07T09:32:58.000011
Vada
pythondev_help_Vada_2017-11-07T09:32:58.000011
1,510,047,178.000011
99,700
pythondev
help
My plan is to use python to control ffmpeg.
2017-11-07T09:33:25.000009
Lahoma
pythondev_help_Lahoma_2017-11-07T09:33:25.000009
1,510,047,205.000009
99,701
pythondev
help
<@Vada> ^^
2017-11-07T09:33:43.000685
Lahoma
pythondev_help_Lahoma_2017-11-07T09:33:43.000685
1,510,047,223.000685
99,702