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
sounds like your virtualenv wasn't activated in that shell?
2018-01-10T18:12:38.000020
Noel
pythondev_help_Noel_2018-01-10T18:12:38.000020
1,515,607,958.00002
28,624
pythondev
help
It's definitely activated. Got the parens with (env) at the prompt
2018-01-10T18:14:15.000145
Porsha
pythondev_help_Porsha_2018-01-10T18:14:15.000145
1,515,608,055.000145
28,625
pythondev
help
sorry, i mean it sounds like something busted your virtualenv's paths after the activation
2018-01-10T18:19:08.000487
Noel
pythondev_help_Noel_2018-01-10T18:19:08.000487
1,515,608,348.000487
28,626
pythondev
help
i've had that issue where i spawn another shell from the parent shell and my prompt's PS1 carries through and still has the (env) inside
2018-01-10T18:19:26.000430
Noel
pythondev_help_Noel_2018-01-10T18:19:26.000430
1,515,608,366.00043
28,627
pythondev
help
Yeah must be something weird happening. Normally works just fine. Thanks for the help though :smiley:
2018-01-10T18:25:36.000219
Porsha
pythondev_help_Porsha_2018-01-10T18:25:36.000219
1,515,608,736.000219
28,628
pythondev
help
Hey guys I'm trying to design a database schema for leader boards of a x-week long competition. The way it works is there are say 5 teams, each with players that are part of the team. Now I want to be able to track the stats of a team within a week time period, but at the same time track the overall stats which is just...
2018-01-10T20:16:08.000130
Cherlyn
pythondev_help_Cherlyn_2018-01-10T20:16:08.000130
1,515,615,368.00013
28,629
pythondev
help
Can you add a datetime schema to all the entries in the db? Use the datetime library or arrow
2018-01-10T20:18:39.000311
Porsha
pythondev_help_Porsha_2018-01-10T20:18:39.000311
1,515,615,519.000311
28,630
pythondev
help
Or maybe a `matchUp` model which denotes the week and the teams
2018-01-10T20:18:41.000262
Cherlyn
pythondev_help_Cherlyn_2018-01-10T20:18:41.000262
1,515,615,521.000262
28,631
pythondev
help
I can do whatever honestly.
2018-01-10T20:19:00.000133
Cherlyn
pythondev_help_Cherlyn_2018-01-10T20:19:00.000133
1,515,615,540.000133
28,632
pythondev
help
Then query a date range in the db
2018-01-10T20:19:01.000065
Porsha
pythondev_help_Porsha_2018-01-10T20:19:01.000065
1,515,615,541.000065
28,633
pythondev
help
Okay so here's an idea. `team` model: `id` (PK) -> uuid `member_list` (FK) -> points to player model (one-to-many) `player` model: `id` (PK) -> uuid `stats` (FK) -> points to weekStats model (one-to-many) `the rest of this model contains details of each player, but no stats` `matchUp`...
2018-01-10T20:28:39.000118
Cherlyn
pythondev_help_Cherlyn_2018-01-10T20:28:39.000118
1,515,616,119.000118
28,634
pythondev
help
Any thoughts on this?
2018-01-10T20:45:34.000092
Cherlyn
pythondev_help_Cherlyn_2018-01-10T20:45:34.000092
1,515,617,134.000092
28,635
pythondev
help
I'm using python 3.5 and I have a few tests that use self.assertLogs(). The tests work fine when I just run their file (e.g. `pytest path/to/test/test.py`) , but when I run them using test discovery (e.g. `pytest`), I always get: `AssertionError: no logs of level ERROR or higher triggered on path.to.test.module`
2018-01-10T21:35:39.000175
Len
pythondev_help_Len_2018-01-10T21:35:39.000175
1,515,620,139.000175
28,636
pythondev
help
Does anyone have any idea why this is happening?
2018-01-10T21:35:52.000084
Len
pythondev_help_Len_2018-01-10T21:35:52.000084
1,515,620,152.000084
28,637
pythondev
help
I feel like it has something to do with how I'm setting up the logger in the module: `log = logging.getLogger(__name__)`
2018-01-10T21:36:19.000199
Len
pythondev_help_Len_2018-01-10T21:36:19.000199
1,515,620,179.000199
28,638
pythondev
help
but I'm not sure why...
2018-01-10T21:36:23.000297
Len
pythondev_help_Len_2018-01-10T21:36:23.000297
1,515,620,183.000297
28,639
pythondev
help
<@Len> Try this: import logging logging.basicConfig(level=logging.ERROR) log = logging.getLogger(__name__)
2018-01-10T21:43:39.000192
Malik
pythondev_help_Malik_2018-01-10T21:43:39.000192
1,515,620,619.000192
28,640
pythondev
help
Thanks <@Malik>, I'll give that a shot.
2018-01-10T21:49:14.000091
Len
pythondev_help_Len_2018-01-10T21:49:14.000091
1,515,620,954.000091
28,641
pythondev
help
hmm, no luck. I think it's related to the fact that I'm running alembic in one module to test my migrations.
2018-01-10T22:13:48.000071
Len
pythondev_help_Len_2018-01-10T22:13:48.000071
1,515,622,428.000071
28,642
pythondev
help
yep, that's it
2018-01-10T22:16:52.000206
Len
pythondev_help_Len_2018-01-10T22:16:52.000206
1,515,622,612.000206
28,643
pythondev
help
Calling `alembic.command.upgrade(...)` looks like it sets up the logger with alembic's config.
2018-01-10T22:18:02.000046
Len
pythondev_help_Len_2018-01-10T22:18:02.000046
1,515,622,682.000046
28,644
pythondev
help
If anyone is interested, I think that adding `disable_existing_loggers=False` to alembic's default env.py's `fileConfig(config.config_file_name)` will do the trick.
2018-01-10T22:54:02.000091
Len
pythondev_help_Len_2018-01-10T22:54:02.000091
1,515,624,842.000091
28,645
pythondev
help
Hey all, looking to make a system config change on MacOS with a python script. basically moving a file to .bak.&lt;programatic&gt; and moving the new config file to /Library/Preferences/&lt;etc&gt;… Thinking about using” from os.path import expanduser from subprocess import call def vmnetconfig(filename): user,ho...
2018-01-10T23:18:47.000228
Veronica
pythondev_help_Veronica_2018-01-10T23:18:47.000228
1,515,626,327.000228
28,646
pythondev
help
Any suggestions if there is a better way?
2018-01-10T23:18:58.000089
Veronica
pythondev_help_Veronica_2018-01-10T23:18:58.000089
1,515,626,338.000089
28,647
pythondev
help
Was also thinking about buildling a config dictionary of the settings? Then pulling the file into python, modding file, then writing it out?
2018-01-10T23:19:39.000132
Veronica
pythondev_help_Veronica_2018-01-10T23:19:39.000132
1,515,626,379.000132
28,648
pythondev
help
Just looking to see if anyone has done this before and can suggest a better approach
2018-01-10T23:19:50.000088
Veronica
pythondev_help_Veronica_2018-01-10T23:19:50.000088
1,515,626,390.000088
28,649
pythondev
help
looking to use only default libraries in MacOS for wide distribution
2018-01-10T23:20:04.000153
Veronica
pythondev_help_Veronica_2018-01-10T23:20:04.000153
1,515,626,404.000153
28,650
pythondev
help
Forgot to post the getuser() function
2018-01-10T23:20:35.000071
Veronica
pythondev_help_Veronica_2018-01-10T23:20:35.000071
1,515,626,435.000071
28,651
pythondev
help
def getuser(): localuser = getpass.getuser() home = expanduser(“~”) return localuser, home
2018-01-10T23:20:36.000074
Veronica
pythondev_help_Veronica_2018-01-10T23:20:36.000074
1,515,626,436.000074
28,652
pythondev
help
hey guys, i wanna ask for python 2 vs 3, is the only way to jump between them to use things like python vs python3, or pip vs pip3?
2018-01-11T00:08:28.000077
Jestine
pythondev_help_Jestine_2018-01-11T00:08:28.000077
1,515,629,308.000077
28,653
pythondev
help
you can do it a variety of ways, one of the old school ways is the shebang `#! usr/env/bin python3`, there's pipenv which will both pip install and create a virtualenv with a --three flag. All(?) the virutalenv allow you to create by version too
2018-01-11T00:22:34.000176
Monroe
pythondev_help_Monroe_2018-01-11T00:22:34.000176
1,515,630,154.000176
28,654
pythondev
help
using virtual environments is the easiest way to swap between versions <@Jestine>
2018-01-11T00:26:14.000001
Cherlyn
pythondev_help_Cherlyn_2018-01-11T00:26:14.000001
1,515,630,374.000001
28,655
pythondev
help
<@Jestine> the package management is often the trickier issue, espeically if you have multiple versions of 3 installed
2018-01-11T00:26:14.000015
Monroe
pythondev_help_Monroe_2018-01-11T00:26:14.000015
1,515,630,374.000015
28,656
pythondev
help
for virtualenv its `virtualenv &lt;env_name&gt; -p &lt;path_to_python.exe&gt;`
2018-01-11T00:26:52.000089
Cherlyn
pythondev_help_Cherlyn_2018-01-11T00:26:52.000089
1,515,630,412.000089
28,657
pythondev
help
so every time i start a project, i should be doing them in virtual environments first?
2018-01-11T00:29:24.000040
Jestine
pythondev_help_Jestine_2018-01-11T00:29:24.000040
1,515,630,564.00004
28,658
pythondev
help
is this considered a best practice?
2018-01-11T00:29:27.000212
Jestine
pythondev_help_Jestine_2018-01-11T00:29:27.000212
1,515,630,567.000212
28,659
pythondev
help
yes and yes
2018-01-11T00:30:55.000020
Monroe
pythondev_help_Monroe_2018-01-11T00:30:55.000020
1,515,630,655.00002
28,660
pythondev
help
if you use PyCharm or other IDE they have a way to set it up for you, but I actually found it easier to do at cli
2018-01-11T00:31:39.000211
Monroe
pythondev_help_Monroe_2018-01-11T00:31:39.000211
1,515,630,699.000211
28,661
pythondev
help
<https://stackoverflow.com/questions/41573587/what-is-the-difference-between-venv-pyvenv-pyenv-virtualenv-virtualenvwrappe>
2018-01-11T00:32:26.000027
Monroe
pythondev_help_Monroe_2018-01-11T00:32:26.000027
1,515,630,746.000027
28,662
pythondev
help
someone did a great breakdown of all of them with links
2018-01-11T00:32:58.000148
Monroe
pythondev_help_Monroe_2018-01-11T00:32:58.000148
1,515,630,778.000148
28,663
pythondev
help
It would also be useful to checkout out pipenv (<http://pipenv.org>)
2018-01-11T00:56:40.000115
Cecila
pythondev_help_Cecila_2018-01-11T00:56:40.000115
1,515,632,200.000115
28,664
pythondev
help
thank you!
2018-01-11T01:24:09.000177
Jestine
pythondev_help_Jestine_2018-01-11T01:24:09.000177
1,515,633,849.000177
28,665
pythondev
help
is it possible to show dates bc with datetime `idle_of_march = datetime(-42, 3, 10)` is not working
2018-01-11T04:05:36.000284
Margot
pythondev_help_Margot_2018-01-11T04:05:36.000284
1,515,643,536.000284
28,666
pythondev
help
using `from datetime import datetime`
2018-01-11T04:06:06.000129
Margot
pythondev_help_Margot_2018-01-11T04:06:06.000129
1,515,643,566.000129
28,667
pythondev
help
keke, i googled it :wink: have fun coding out there
2018-01-11T04:10:45.000169
Margot
pythondev_help_Margot_2018-01-11T04:10:45.000169
1,515,643,845.000169
28,668
pythondev
help
<@Barney> tried both :disappointed:
2018-01-11T05:05:22.000253
Krista
pythondev_help_Krista_2018-01-11T05:05:22.000253
1,515,647,122.000253
28,669
pythondev
help
hello, please am completely new to python how do I become good within one month? and use it for my school project
2018-01-11T05:24:06.000414
Silva
pythondev_help_Silva_2018-01-11T05:24:06.000414
1,515,648,246.000414
28,670
pythondev
help
<http://abstrusegoose.com/249>
2018-01-11T05:24:50.000422
Micki
pythondev_help_Micki_2018-01-11T05:24:50.000422
1,515,648,290.000422
28,671
pythondev
help
More seriously I recommend reading "Automate the boring stuff with python"
2018-01-11T05:25:09.000328
Micki
pythondev_help_Micki_2018-01-11T05:25:09.000328
1,515,648,309.000328
28,672
pythondev
help
Can anyone tell me why docker is doing this: ``` Staff@DESKTOP-C0T7TG5 MINGW64 ~/documents/projects/dockertest $ docker-compose up Starting dockertest_db_1 ... Starting dockertest_db_1 ... done Starting dockertest_web_1 ... Starting dockertest_web_1 ... done Attaching to dockertest_db_1, dockertest_web_1 db_1 | 201...
2018-01-11T06:36:02.000104
Tanesha
pythondev_help_Tanesha_2018-01-11T06:36:02.000104
1,515,652,562.000104
28,673
pythondev
help
issues with your dockerfile, I suspect
2018-01-11T06:36:45.000147
Floy
pythondev_help_Floy_2018-01-11T06:36:45.000147
1,515,652,605.000147
28,674
pythondev
help
might want to move to <#C22DMH61M|devops>
2018-01-11T06:37:00.000257
Floy
pythondev_help_Floy_2018-01-11T06:37:00.000257
1,515,652,620.000257
28,675
pythondev
help
``` FROM python:3 ENV PYTHONUNBUFFERED 1 RUN mkdir /code WORKDIR /code ADD requirements.txt /code/ RUN pip install -r requirements.txt ADD . /code/ ```
2018-01-11T06:37:03.000200
Tanesha
pythondev_help_Tanesha_2018-01-11T06:37:03.000200
1,515,652,623.0002
28,676
pythondev
help
ah okay, thanks :0
2018-01-11T06:37:15.000464
Tanesha
pythondev_help_Tanesha_2018-01-11T06:37:15.000464
1,515,652,635.000464
28,677
pythondev
help
is there some tools to generate auto documentation
2018-01-11T07:41:05.000313
Dominic
pythondev_help_Dominic_2018-01-11T07:41:05.000313
1,515,656,465.000313
28,678
pythondev
help
in python
2018-01-11T07:41:08.000030
Dominic
pythondev_help_Dominic_2018-01-11T07:41:08.000030
1,515,656,468.00003
28,679
pythondev
help
<http://www.sphinx-doc.org/en/stable/> ?
2018-01-11T07:41:35.000041
Evia
pythondev_help_Evia_2018-01-11T07:41:35.000041
1,515,656,495.000041
28,680
pythondev
help
Thanks, I will.
2018-01-11T09:09:37.000193
Elias
pythondev_help_Elias_2018-01-11T09:09:37.000193
1,515,661,777.000193
28,681
pythondev
help
guys, a more general question about HTTP status. Let’s say that there is a POST method that stores the given payload, but it doesn’t allow duplicate. So, after the first successful call, it returns a 200, but if I send again the same payload no action will be performed and what HTTP status should be returned? i was th...
2018-01-11T09:59:15.000530
Maya
pythondev_help_Maya_2018-01-11T09:59:15.000530
1,515,664,755.00053
28,682
pythondev
help
I’d say 403 forbidden
2018-01-11T09:59:50.000313
Floy
pythondev_help_Floy_2018-01-11T09:59:50.000313
1,515,664,790.000313
28,683
pythondev
help
but 403 is more on the ACL, something like I have no right to perform that action.
2018-01-11T10:00:11.000390
Maya
pythondev_help_Maya_2018-01-11T10:00:11.000390
1,515,664,811.00039
28,684
pythondev
help
&gt;The request was valid, but the server is refusing action. The user might not have the necessary permissions for a resource, or may need an account of some sort.
2018-01-11T10:00:54.000381
Floy
pythondev_help_Floy_2018-01-11T10:00:54.000381
1,515,664,854.000381
28,685
pythondev
help
uhmm, it seems related to some sort of permissions. The server refused the action because of the lack of some permissions.
2018-01-11T10:03:10.000323
Maya
pythondev_help_Maya_2018-01-11T10:03:10.000323
1,515,664,990.000323
28,686
pythondev
help
I'd go with a 409 (conflict)
2018-01-11T10:03:18.000610
Nancy
pythondev_help_Nancy_2018-01-11T10:03:18.000610
1,515,664,998.00061
28,687
pythondev
help
`The request could not be completed due to a conflict with the current state of the resource. This code is only allowed in situations where it is expected that the user might be able to resolve the conflict and resubmit the request. The response body SHOULD include enough`
2018-01-11T10:03:44.000385
Maya
pythondev_help_Maya_2018-01-11T10:03:44.000385
1,515,665,024.000385
28,688
pythondev
help
Or a 400 (maybe too broad), but I'd keep 401 and 403 just for ACL (authentication and authorization)
2018-01-11T10:04:52.000856
Nancy
pythondev_help_Nancy_2018-01-11T10:04:52.000856
1,515,665,092.000856
28,689
pythondev
help
I usually use 400 for bad payload, and I agree with you for 401 and 403
2018-01-11T10:05:25.000361
Maya
pythondev_help_Maya_2018-01-11T10:05:25.000361
1,515,665,125.000361
28,690
pythondev
help
403 could work since it's technically forbidden, but in this use case it's because of business logic and not because you don't have access
2018-01-11T10:06:38.000016
Nancy
pythondev_help_Nancy_2018-01-11T10:06:38.000016
1,515,665,198.000016
28,691
pythondev
help
exactly.
2018-01-11T10:07:35.000043
Maya
pythondev_help_Maya_2018-01-11T10:07:35.000043
1,515,665,255.000043
28,692
pythondev
help
thanks a lot guys
2018-01-11T10:08:09.000382
Maya
pythondev_help_Maya_2018-01-11T10:08:09.000382
1,515,665,289.000382
28,693
pythondev
help
Anyone have experience with `configparser`? <https://docs.python.org/3/library/configparser.html>
2018-01-11T11:05:28.000388
Huong
pythondev_help_Huong_2018-01-11T11:05:28.000388
1,515,668,728.000388
28,694
pythondev
help
Based on what I am seeing in the implementation, it looks like it will parse a whole file but raise a `ParsingError` at the end if there is, for example, a bad line (non-comment, non-definition, non-blank). It won't just die and not load the valid values that are present.
2018-01-11T11:06:20.000078
Huong
pythondev_help_Huong_2018-01-11T11:06:20.000078
1,515,668,780.000078
28,695
pythondev
help
But I don't see that in the doc I don't think?
2018-01-11T11:06:26.000921
Huong
pythondev_help_Huong_2018-01-11T11:06:26.000921
1,515,668,786.000921
28,696
pythondev
help
Not sure if I can assume that behavior will persist in the future?
2018-01-11T11:06:31.000471
Huong
pythondev_help_Huong_2018-01-11T11:06:31.000471
1,515,668,791.000471
28,697
pythondev
help
It actually is pretty plain in the implementation so wondering why I can't find it in the spec doc? Unless I am just totally missing it
2018-01-11T11:09:19.000839
Huong
pythondev_help_Huong_2018-01-11T11:09:19.000839
1,515,668,959.000839
28,698
pythondev
help
heya does anyone know if it possible to run python script on windows, via portable version of python if it not installed on the machine
2018-01-11T11:24:11.000432
Danyel
pythondev_help_Danyel_2018-01-11T11:24:11.000432
1,515,669,851.000432
28,699
pythondev
help
I want my taskrunner, to run it on a windows machines.
2018-01-11T11:24:43.000571
Danyel
pythondev_help_Danyel_2018-01-11T11:24:43.000571
1,515,669,883.000571
28,700
pythondev
help
<@Danyel> you could use something like PyInstaller to turn your script into an executable. Make sure to use the --onefile flag. <https://pythonhosted.org/PyInstaller/>
2018-01-11T11:56:01.000725
Malik
pythondev_help_Malik_2018-01-11T11:56:01.000725
1,515,671,761.000725
28,701
pythondev
help
ahh cool
2018-01-11T11:56:15.000011
Danyel
pythondev_help_Danyel_2018-01-11T11:56:15.000011
1,515,671,775.000011
28,702
pythondev
help
I just broke python-mode in vim
2018-01-11T11:56:28.000137
Danyel
pythondev_help_Danyel_2018-01-11T11:56:28.000137
1,515,671,788.000137
28,703
pythondev
help
bah
2018-01-11T11:56:33.000700
Danyel
pythondev_help_Danyel_2018-01-11T11:56:33.000700
1,515,671,793.0007
28,704
pythondev
help
```found = False for i in details['key']: if i['id'] == 999: found = True assert found is True, 'Expected id 999 to be found, but it was not'```
2018-01-11T12:09:38.000372
Kelsey
pythondev_help_Kelsey_2018-01-11T12:09:38.000372
1,515,672,578.000372
28,705
pythondev
help
Is there a better way to write this assertion
2018-01-11T12:09:50.000208
Kelsey
pythondev_help_Kelsey_2018-01-11T12:09:50.000208
1,515,672,590.000208
28,706
pythondev
help
or loop
2018-01-11T12:09:52.000790
Kelsey
pythondev_help_Kelsey_2018-01-11T12:09:52.000790
1,515,672,592.00079
28,707
pythondev
help
you should really just do `assert found`
2018-01-11T12:14:27.000168
Garrett
pythondev_help_Garrett_2018-01-11T12:14:27.000168
1,515,672,867.000168
28,708
pythondev
help
you could also do it all in a list comprehension
2018-01-11T12:14:51.000518
Garrett
pythondev_help_Garrett_2018-01-11T12:14:51.000518
1,515,672,891.000518
28,709
pythondev
help
might or might not be any more readable, though
2018-01-11T12:14:58.000338
Garrett
pythondev_help_Garrett_2018-01-11T12:14:58.000338
1,515,672,898.000338
28,710
pythondev
help
I added a list comprehension
2018-01-11T12:15:41.000872
Kelsey
pythondev_help_Kelsey_2018-01-11T12:15:41.000872
1,515,672,941.000872
28,711
pythondev
help
`found = [i['id'] for i in details['key'] if i['id'] == 999]`
2018-01-11T12:16:31.000342
Kelsey
pythondev_help_Kelsey_2018-01-11T12:16:31.000342
1,515,672,991.000342
28,712
pythondev
help
`assert 999 in found`
2018-01-11T12:16:44.000187
Kelsey
pythondev_help_Kelsey_2018-01-11T12:16:44.000187
1,515,673,004.000187
28,713
pythondev
help
broke it down to that
2018-01-11T12:16:55.000282
Kelsey
pythondev_help_Kelsey_2018-01-11T12:16:55.000282
1,515,673,015.000282
28,714
pythondev
help
wonder if theres is a better way?
2018-01-11T12:17:03.000124
Kelsey
pythondev_help_Kelsey_2018-01-11T12:17:03.000124
1,515,673,023.000124
28,715
pythondev
help
`assert any([i['id'] == 999 for i in details['key']])`
2018-01-11T12:19:09.000219
Garrett
pythondev_help_Garrett_2018-01-11T12:19:09.000219
1,515,673,149.000219
28,716
pythondev
help
none of these are necessarily 'better' though
2018-01-11T12:19:27.000260
Garrett
pythondev_help_Garrett_2018-01-11T12:19:27.000260
1,515,673,167.00026
28,717
pythondev
help
so all 3 approaches are pretty much the same?
2018-01-11T12:20:03.000220
Kelsey
pythondev_help_Kelsey_2018-01-11T12:20:03.000220
1,515,673,203.00022
28,718
pythondev
help
pretty much
2018-01-11T12:20:16.000256
Garrett
pythondev_help_Garrett_2018-01-11T12:20:16.000256
1,515,673,216.000256
28,719
pythondev
help
i didnt like the start of found = False on first one
2018-01-11T12:20:23.000482
Kelsey
pythondev_help_Kelsey_2018-01-11T12:20:23.000482
1,515,673,223.000482
28,720
pythondev
help
than settign found to true
2018-01-11T12:20:41.000110
Kelsey
pythondev_help_Kelsey_2018-01-11T12:20:41.000110
1,515,673,241.00011
28,721
pythondev
help
eh, it's less elegant but more obvious, so it's fine
2018-01-11T12:21:13.000313
Garrett
pythondev_help_Garrett_2018-01-11T12:21:13.000313
1,515,673,273.000313
28,722
pythondev
help
alright cool.
2018-01-11T12:23:50.000095
Kelsey
pythondev_help_Kelsey_2018-01-11T12:23:50.000095
1,515,673,430.000095
28,723