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
exactly...
2017-06-28T15:42:05.292442
Georgeann
pythondev_help_Georgeann_2017-06-28T15:42:05.292442
1,498,664,525.292442
83,403
pythondev
help
<@Meghan> if you self host, there is no limit
2017-06-28T15:42:31.301636
Signe
pythondev_help_Signe_2017-06-28T15:42:31.301636
1,498,664,551.301636
83,404
pythondev
help
I would recommend that. With docker its really not all that hard to host it
2017-06-28T15:42:44.306346
Signe
pythondev_help_Signe_2017-06-28T15:42:44.306346
1,498,664,564.306346
83,405
pythondev
help
thats what I do. All similar systems will have some type of limit. There is also bugsnag, and rollbar, but they all have limits
2017-06-28T15:44:39.346631
Signe
pythondev_help_Signe_2017-06-28T15:44:39.346631
1,498,664,679.346631
83,406
pythondev
help
self hosting is the only way to have no limits. Oh, I guess google cloud has one called stack-driver that is just a flat monthly fee + minimal data charges
2017-06-28T15:45:18.360825
Signe
pythondev_help_Signe_2017-06-28T15:45:18.360825
1,498,664,718.360825
83,407
pythondev
help
use `dateutil`
2017-06-28T15:52:11.508101
Suellen
pythondev_help_Suellen_2017-06-28T15:52:11.508101
1,498,665,131.508101
83,408
pythondev
help
or `maya` or `arrow`, etc
2017-06-28T15:53:43.542023
Beula
pythondev_help_Beula_2017-06-28T15:53:43.542023
1,498,665,223.542023
83,409
pythondev
help
That's cheating :wink:
2017-06-28T15:53:43.542106
Gabriele
pythondev_help_Gabriele_2017-06-28T15:53:43.542106
1,498,665,223.542106
83,410
pythondev
help
``` &gt;&gt;&gt; from datetime import datetime &gt;&gt;&gt; from dateutil.relativedelta import relativedelta &gt;&gt;&gt; from pprint import pprint &gt;&gt;&gt; start = datetime(2017, 1, 1) &gt;&gt;&gt; end = datetime.today() &gt;&gt;&gt; delta = relativedelta(end, start) &gt;&gt;&gt; pprint(vars(delta)) {'_has_time': 1, 'day': None, 'days': 27, 'hour': None, 'hours': 22, 'leapdays': 0, 'microsecond': None, 'microseconds': 510107, 'minute': None, 'minutes': 53, 'month': None, 'months': 5, 'second': None, 'seconds': 28, 'weekday': None, 'year': None, 'years': 0} ```
2017-06-28T15:53:49.544337
Suellen
pythondev_help_Suellen_2017-06-28T15:53:49.544337
1,498,665,229.544337
83,411
pythondev
help
He may have misread that then, I'll look at it. Thanks.
2017-06-28T15:53:50.544499
Meghan
pythondev_help_Meghan_2017-06-28T15:53:50.544499
1,498,665,230.544499
83,412
pythondev
help
I don't think arrow helps here
2017-06-28T15:53:50.544626
Gabriele
pythondev_help_Gabriele_2017-06-28T15:53:50.544626
1,498,665,230.544626
83,413
pythondev
help
if you don't need to do anything complex, dateutil is nice and small
2017-06-28T15:54:20.555853
Suellen
pythondev_help_Suellen_2017-06-28T15:54:20.555853
1,498,665,260.555853
83,414
pythondev
help
Just use a unix timestamp and do maths in second offsets :wink: Of course, then there is the problem of leap seconds...
2017-06-28T15:54:26.558103
Beula
pythondev_help_Beula_2017-06-28T15:54:26.558103
1,498,665,266.558103
83,415
pythondev
help
and often is already installed as a dependency of another package
2017-06-28T15:54:34.561334
Suellen
pythondev_help_Suellen_2017-06-28T15:54:34.561334
1,498,665,274.561334
83,416
pythondev
help
arrow is cool, but it's for really complex stuff
2017-06-28T15:54:43.564288
Suellen
pythondev_help_Suellen_2017-06-28T15:54:43.564288
1,498,665,283.564288
83,417
pythondev
help
just don't use dateutil for parsing, because it often guesses wrong
2017-06-28T15:54:51.567010
Gabriele
pythondev_help_Gabriele_2017-06-28T15:54:51.567010
1,498,665,291.56701
83,418
pythondev
help
this way i was able to style it differently in css.
2017-06-28T15:55:22.578447
Johana
pythondev_help_Johana_2017-06-28T15:55:22.578447
1,498,665,322.578447
83,419
pythondev
help
<@Johana> Looks like a good approach. Something I'll consider if I find myself doing this again
2017-06-28T15:55:43.585988
Gabriele
pythondev_help_Gabriele_2017-06-28T15:55:43.585988
1,498,665,343.585988
83,420
pythondev
help
whats the cleanest/shortest way to check if any value in a tuple is in another tuple?
2017-06-28T15:56:16.598129
Signe
pythondev_help_Signe_2017-06-28T15:56:16.598129
1,498,665,376.598129
83,421
pythondev
help
for example: ``` for i in tup1: for j in tup2: if i == j: return True return False ```
2017-06-28T15:56:21.599680
Signe
pythondev_help_Signe_2017-06-28T15:56:21.599680
1,498,665,381.59968
83,422
pythondev
help
I have a feeling there are some built in's I can use...
2017-06-28T15:57:09.616940
Signe
pythondev_help_Signe_2017-06-28T15:57:09.616940
1,498,665,429.61694
83,423
pythondev
help
<@Beula> they needed an offset in months (see thread)
2017-06-28T15:57:32.625766
Suellen
pythondev_help_Suellen_2017-06-28T15:57:32.625766
1,498,665,452.625766
83,424
pythondev
help
``` &gt;&gt;&gt; start = datetime(2016, 12, 29) &gt;&gt;&gt; end = datetime.today() &gt;&gt;&gt; (end - start).total_seconds() / (3600 * 24 * 30) 6.065205603584491 &gt;&gt;&gt; delta = relativedelta(end, start) &gt;&gt;&gt; pprint(vars(delta)) {'_has_time': 1, 'day': None, 'days': 30, 'hour': None, 'hours': 22, 'leapdays': 0, 'microsecond': None, 'microseconds': 924491, 'minute': None, 'minutes': 56, 'month': None, 'months': 5, 'second': None, 'seconds': 52, 'weekday': None, 'year': None, 'years': 0} &gt;&gt;&gt; ``` Using seconds is just wrong :confused:
2017-06-28T15:57:43.630245
Suellen
pythondev_help_Suellen_2017-06-28T15:57:43.630245
1,498,665,463.630245
83,425
pythondev
help
<@Suellen> then convert back
2017-06-28T15:57:44.630451
Beula
pythondev_help_Beula_2017-06-28T15:57:44.630451
1,498,665,464.630451
83,426
pythondev
help
you can't count how many months passed if you only have unix timestamp 1 and unix timestamp 2
2017-06-28T15:58:16.641995
Suellen
pythondev_help_Suellen_2017-06-28T15:58:16.641995
1,498,665,496.641995
83,427
pythondev
help
``` [ x for x in tup1 if x in tup2] ```
2017-06-28T15:58:23.644780
Ciera
pythondev_help_Ciera_2017-06-28T15:58:23.644780
1,498,665,503.64478
83,428
pythondev
help
`any(x in y for x in (1, 2, 3, 4))`
2017-06-28T15:58:25.645526
Beula
pythondev_help_Beula_2017-06-28T15:58:25.645526
1,498,665,505.645526
83,429
pythondev
help
I guess you said any value, so `any`
2017-06-28T15:58:49.653829
Beula
pythondev_help_Beula_2017-06-28T15:58:49.653829
1,498,665,529.653829
83,430
pythondev
help
the perk of `any` over the list is it will short circuit itself on the first found one
2017-06-28T15:59:22.666382
Beula
pythondev_help_Beula_2017-06-28T15:59:22.666382
1,498,665,562.666382
83,431
pythondev
help
ya.. that works. Is it possible without an explicit loop? (im getting picky, but im challenging myself)
2017-06-28T15:59:31.669746
Signe
pythondev_help_Signe_2017-06-28T15:59:31.669746
1,498,665,571.669746
83,432
pythondev
help
since at least 1 is true
2017-06-28T15:59:33.670255
Beula
pythondev_help_Beula_2017-06-28T15:59:33.670255
1,498,665,573.670255
83,433
pythondev
help
probably operator
2017-06-28T15:59:45.674654
Beula
pythondev_help_Beula_2017-06-28T15:59:45.674654
1,498,665,585.674654
83,434
pythondev
help
basically I want `if anything_in(some_list) in other_list)`
2017-06-28T16:00:16.687353
Signe
pythondev_help_Signe_2017-06-28T16:00:16.687353
1,498,665,616.687353
83,435
pythondev
help
but I dont think thats possible
2017-06-28T16:00:24.690667
Signe
pythondev_help_Signe_2017-06-28T16:00:24.690667
1,498,665,624.690667
83,436
pythondev
help
I think you could do a fancy with intersections or unions
2017-06-28T16:00:35.694884
Beula
pythondev_help_Beula_2017-06-28T16:00:35.694884
1,498,665,635.694884
83,437
pythondev
help
there is intersections for set not sure for tuple
2017-06-28T16:00:48.699728
Ciera
pythondev_help_Ciera_2017-06-28T16:00:48.699728
1,498,665,648.699728
83,438
pythondev
help
oo now we are getting somewhere
2017-06-28T16:00:51.700765
Signe
pythondev_help_Signe_2017-06-28T16:00:51.700765
1,498,665,651.700765
83,439
pythondev
help
:thinking_face:
2017-06-28T16:01:10.707942
Beula
pythondev_help_Beula_2017-06-28T16:01:10.707942
1,498,665,670.707942
83,440
pythondev
help
`len(set(tup_1) &amp; set(tup_2)) &gt; 0`
2017-06-28T16:03:21.756656
Signe
pythondev_help_Signe_2017-06-28T16:03:21.756656
1,498,665,801.756656
83,441
pythondev
help
Yep, that looks like where i was trying to get
2017-06-28T16:04:14.775892
Beula
pythondev_help_Beula_2017-06-28T16:04:14.775892
1,498,665,854.775892
83,442
pythondev
help
downside: no short circuiting
2017-06-28T16:04:32.783014
Suellen
pythondev_help_Suellen_2017-06-28T16:04:32.783014
1,498,665,872.783014
83,443
pythondev
help
true.
2017-06-28T16:05:14.798184
Signe
pythondev_help_Signe_2017-06-28T16:05:14.798184
1,498,665,914.798184
83,444
pythondev
help
probably fine if your dataset is always little
2017-06-28T16:05:32.805181
Beula
pythondev_help_Beula_2017-06-28T16:05:32.805181
1,498,665,932.805181
83,445
pythondev
help
<@Suellen> Sorry, sarcasm doesn't always translate to text
2017-06-28T16:05:54.813560
Beula
pythondev_help_Beula_2017-06-28T16:05:54.813560
1,498,665,954.81356
83,446
pythondev
help
`takewhile(lambda x: x not in b, a)` :stuck_out_tongue:
2017-06-28T16:05:59.815127
Suellen
pythondev_help_Suellen_2017-06-28T16:05:59.815127
1,498,665,959.815127
83,447
pythondev
help
no loop
2017-06-28T16:06:04.817095
Suellen
pythondev_help_Suellen_2017-06-28T16:06:04.817095
1,498,665,964.817095
83,448
pythondev
help
Hello
2017-06-28T16:07:50.855657
Vennie
pythondev_help_Vennie_2017-06-28T16:07:50.855657
1,498,666,070.855657
83,449
pythondev
help
```
2017-06-28T16:08:46.875383
Vennie
pythondev_help_Vennie_2017-06-28T16:08:46.875383
1,498,666,126.875383
83,450
pythondev
help
```import json import urllib from pprint import pprint from urllib import request, parse import pytest class TestApp(object): TEST_URL = '<http://0.0.0.0:5001/>' def test_create_user(self): values = { "data": { "email": "<mailto:[email protected]|[email protected]>", "password": "test", "first_name": "ciccio", "last_name": "pizzo", "role": "1", "address": { "country": "Italy", "address_line": "Test Address, 1998, WXDJI Neverland", "coordinates": { "lat": "41.0914808", "long": "16.8672337" } } } } headers = { "Content-Type": "application/json" } data = urllib.parse.urlencode(values) data = data.encode("ascii") url = self.TEST_URL + 'api/user' req = urllib.request.Request(url, data, headers) with urllib.request.urlopen(req) as response: the_page = response.read() assert the_page.status == "success" ```
2017-06-28T16:08:52.877508
Vennie
pythondev_help_Vennie_2017-06-28T16:08:52.877508
1,498,666,132.877508
83,451
pythondev
help
Sorry to disturb you… I am doing TDD for the first time and I have an error that I cannot solve
2017-06-28T16:09:09.883322
Vennie
pythondev_help_Vennie_2017-06-28T16:09:09.883322
1,498,666,149.883322
83,452
pythondev
help
I did not find many textbooks covering the topic even though it’s a must have nowadays…
2017-06-28T16:09:43.895374
Vennie
pythondev_help_Vennie_2017-06-28T16:09:43.895374
1,498,666,183.895374
83,453
pythondev
help
This was made using some common sense rather than textbooks…
2017-06-28T16:10:06.903447
Vennie
pythondev_help_Vennie_2017-06-28T16:10:06.903447
1,498,666,206.903447
83,454
pythondev
help
It’s the base case scenario… db set up correctly with the needed data for booting the app, etc.
2017-06-28T16:10:45.916937
Vennie
pythondev_help_Vennie_2017-06-28T16:10:45.916937
1,498,666,245.916937
83,455
pythondev
help
&gt; I did not find many textbooks covering the topic
2017-06-28T16:11:29.932469
Suellen
pythondev_help_Suellen_2017-06-28T16:11:29.932469
1,498,666,289.932469
83,456
pythondev
help
that's the issue anyway?
2017-06-28T16:11:58.942583
Suellen
pythondev_help_Suellen_2017-06-28T16:11:58.942583
1,498,666,318.942583
83,457
pythondev
help
The issue is that I get request.py:1320: URLError
2017-06-28T16:13:13.969084
Vennie
pythondev_help_Vennie_2017-06-28T16:13:13.969084
1,498,666,393.969084
83,458
pythondev
help
<@Suellen> , I am using flask anyways
2017-06-28T16:13:25.973527
Vennie
pythondev_help_Vennie_2017-06-28T16:13:25.973527
1,498,666,405.973527
83,459
pythondev
help
Is there a way to specify a categorical type or a type that's a set of constant values with `typing`?
2017-06-28T16:14:06.988069
Carlie
pythondev_help_Carlie_2017-06-28T16:14:06.988069
1,498,666,446.988069
83,460
pythondev
help
if I have a June 2017, then I can take a single month. It can't understand.
2017-06-28T16:16:20.035238
Georgeann
pythondev_help_Georgeann_2017-06-28T16:16:20.035238
1,498,666,580.035238
83,461
pythondev
help
say, a string that is expected to be either `'production'` or `'dev'`, or a int that's only valid for `range(0, 100)`
2017-06-28T16:17:22.057372
Carlie
pythondev_help_Carlie_2017-06-28T16:17:22.057372
1,498,666,642.057372
83,462
pythondev
help
use an enum?
2017-06-28T16:43:12.617954
Dwain
pythondev_help_Dwain_2017-06-28T16:43:12.617954
1,498,668,192.617954
83,463
pythondev
help
It looks like it-s working
2017-06-28T16:46:24.686238
Vennie
pythondev_help_Vennie_2017-06-28T16:46:24.686238
1,498,668,384.686238
83,464
pythondev
help
I’m running a virtual environment and keep getting this `error: ModuleNotFoundError: No module named 'requests'` when trying to run my script
2017-06-28T17:10:12.184447
Sherry
pythondev_help_Sherry_2017-06-28T17:10:12.184447
1,498,669,812.184447
83,465
pythondev
help
have you tried google searching for "requests module" <@Sherry> ?
2017-06-28T17:12:45.234944
Levi
pythondev_help_Levi_2017-06-28T17:12:45.234944
1,498,669,965.234944
83,466
pythondev
help
Yes, I know what the requests module is, lol.
2017-06-28T17:14:13.262383
Sherry
pythondev_help_Sherry_2017-06-28T17:14:13.262383
1,498,670,053.262383
83,467
pythondev
help
Anyway, when I type pip3 list it shows up `requests (2.18.1)`
2017-06-28T17:14:43.272243
Sherry
pythondev_help_Sherry_2017-06-28T17:14:43.272243
1,498,670,083.272243
83,468
pythondev
help
are you doing that while activated in the virtualenv?
2017-06-28T17:15:01.277599
Levi
pythondev_help_Levi_2017-06-28T17:15:01.277599
1,498,670,101.277599
83,469
pythondev
help
yup!
2017-06-28T17:15:08.280038
Sherry
pythondev_help_Sherry_2017-06-28T17:15:08.280038
1,498,670,108.280038
83,470
pythondev
help
it’s really weird haha
2017-06-28T17:15:22.284506
Sherry
pythondev_help_Sherry_2017-06-28T17:15:22.284506
1,498,670,122.284506
83,471
pythondev
help
<@Sherry> can you try `which python3` and make sure that's the one from that virtualenv? I have had a sourced virtualenv before where somehow the path was screwed up and was using the system python still
2017-06-28T17:17:20.321625
Beula
pythondev_help_Beula_2017-06-28T17:17:20.321625
1,498,670,240.321625
83,472
pythondev
help
seems to be the one from that environment
2017-06-28T17:18:22.340354
Sherry
pythondev_help_Sherry_2017-06-28T17:18:22.340354
1,498,670,302.340354
83,473
pythondev
help
I created a new file with a single `import requests` line and am still getting the same error, so i’m pretty sure my environment is messed up. I will delete it and try again though
2017-06-28T17:19:27.360409
Sherry
pythondev_help_Sherry_2017-06-28T17:19:27.360409
1,498,670,367.360409
83,474
pythondev
help
do you have other python3's in your PATH somewhere
2017-06-28T17:22:31.416278
Winnifred
pythondev_help_Winnifred_2017-06-28T17:22:31.416278
1,498,670,551.416278
83,475
pythondev
help
How can I check? I do notice there’s a 3.51 and 3.6 now
2017-06-28T17:25:48.475705
Sherry
pythondev_help_Sherry_2017-06-28T17:25:48.475705
1,498,670,748.475705
83,476
pythondev
help
There’s probably a clever command to do it all in one go, but `echo $PATH`will show you your path and you can poke around a few folders to see.
2017-06-28T17:27:01.497436
Winnifred
pythondev_help_Winnifred_2017-06-28T17:27:01.497436
1,498,670,821.497436
83,477
pythondev
help
`which python3` will show which one is resolved in your PATH
2017-06-28T17:27:14.501214
Beula
pythondev_help_Beula_2017-06-28T17:27:14.501214
1,498,670,834.501214
83,478
pythondev
help
it’s showing python 3.5.1
2017-06-28T17:27:25.504697
Sherry
pythondev_help_Sherry_2017-06-28T17:27:25.504697
1,498,670,845.504697
83,479
pythondev
help
which is weird because when i go into the folders it’s showing python27 files
2017-06-28T17:28:22.521814
Sherry
pythondev_help_Sherry_2017-06-28T17:28:22.521814
1,498,670,902.521814
83,480
pythondev
help
hmm
2017-06-28T17:30:23.558789
Sherry
pythondev_help_Sherry_2017-06-28T17:30:23.558789
1,498,671,023.558789
83,481
pythondev
help
i think im fixing it
2017-06-28T17:30:26.559723
Sherry
pythondev_help_Sherry_2017-06-28T17:30:26.559723
1,498,671,026.559723
83,482
pythondev
help
`virtualenv --python=/usr/local/bin/python3 ultra_monitor`
2017-06-28T17:30:34.562056
Sherry
pythondev_help_Sherry_2017-06-28T17:30:34.562056
1,498,671,034.562056
83,483
pythondev
help
i guess it assumed I wanted python2
2017-06-28T17:30:44.564974
Sherry
pythondev_help_Sherry_2017-06-28T17:30:44.564974
1,498,671,044.564974
83,484
pythondev
help
maybe check which directories are in a search path, maybe it will help to solve a mystery: ``` print( sys.path ) ```
2017-06-28T17:30:52.567484
Suzanna
pythondev_help_Suzanna_2017-06-28T17:30:52.567484
1,498,671,052.567484
83,485
pythondev
help
Do that outside of my environment?
2017-06-28T17:31:50.584470
Sherry
pythondev_help_Sherry_2017-06-28T17:31:50.584470
1,498,671,110.58447
83,486
pythondev
help
Yeah, if you installed `virtualenv` with `python2` (or `pip` from py2) - it will use that interpreter as the default if you don't give the `--python/-p` flag
2017-06-28T17:32:05.589021
Beula
pythondev_help_Beula_2017-06-28T17:32:05.589021
1,498,671,125.589021
83,487
pythondev
help
hmm, i gave it the python3 flag and it’s still giving the same error
2017-06-28T17:32:28.595579
Sherry
pythondev_help_Sherry_2017-06-28T17:32:28.595579
1,498,671,148.595579
83,488
pythondev
help
Silly question, I am sure, but did you `pip install -r requirements.txt` since re-creating the env?
2017-06-28T17:34:02.623948
Beula
pythondev_help_Beula_2017-06-28T17:34:02.623948
1,498,671,242.623948
83,489
pythondev
help
yup!
2017-06-28T17:34:09.625862
Sherry
pythondev_help_Sherry_2017-06-28T17:34:09.625862
1,498,671,249.625862
83,490
pythondev
help
pip3
2017-06-28T17:34:14.627235
Sherry
pythondev_help_Sherry_2017-06-28T17:34:14.627235
1,498,671,254.627235
83,491
pythondev
help
Figured so :slightly_smiling_face:
2017-06-28T17:34:17.628198
Beula
pythondev_help_Beula_2017-06-28T17:34:17.628198
1,498,671,257.628198
83,492
pythondev
help
But it seems to be using my system libraries. Is that weird?
2017-06-28T17:35:06.642553
Sherry
pythondev_help_Sherry_2017-06-28T17:35:06.642553
1,498,671,306.642553
83,493
pythondev
help
It looks like we have similar environments <@Sherry>. I make my venvs like so `mkvirtualenv --python="/Library/Frameworks/Python.framework/Versions/3.5/bin/python3" new virtualenv`
2017-06-28T17:35:43.653535
Winnifred
pythondev_help_Winnifred_2017-06-28T17:35:43.653535
1,498,671,343.653535
83,494
pythondev
help
not exactly the same and I use `mkvirtualenv`
2017-06-28T17:36:51.673113
Winnifred
pythondev_help_Winnifred_2017-06-28T17:36:51.673113
1,498,671,411.673113
83,495
pythondev
help
Ahh okay
2017-06-28T17:36:59.675262
Sherry
pythondev_help_Sherry_2017-06-28T17:36:59.675262
1,498,671,419.675262
83,496
pythondev
help
why is it not `/usr/local/bin/python3`?
2017-06-28T17:37:12.678818
Sherry
pythondev_help_Sherry_2017-06-28T17:37:12.678818
1,498,671,432.678818
83,497
pythondev
help
he installed via the python installer
2017-06-28T17:37:53.691026
Beula
pythondev_help_Beula_2017-06-28T17:37:53.691026
1,498,671,473.691026
83,498
pythondev
help
`/usr/local/bin/python3` is from brew
2017-06-28T17:37:59.692714
Beula
pythondev_help_Beula_2017-06-28T17:37:59.692714
1,498,671,479.692714
83,499
pythondev
help
Thanks, <@Beula>. I actually didn’t have a solid answer there :neutral_face:. These are notes I took a long time ago that became a habit.
2017-06-28T17:38:52.707905
Winnifred
pythondev_help_Winnifred_2017-06-28T17:38:52.707905
1,498,671,532.707905
83,500
pythondev
help
Hmm, i still can’t get it to work
2017-06-28T17:41:35.754917
Sherry
pythondev_help_Sherry_2017-06-28T17:41:35.754917
1,498,671,695.754917
83,501
pythondev
help
I’ve used the `--python="/Library/Frameworks/Python.framework/Versions/3.5/bin/python3"` flag when creating the environment
2017-06-28T17:41:49.758950
Sherry
pythondev_help_Sherry_2017-06-28T17:41:49.758950
1,498,671,709.75895
83,502