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
and I was like wtf
2017-12-28T19:34:02.000048
Glinda
pythondev_help_Glinda_2017-12-28T19:34:02.000048
1,514,489,642.000048
106,103
pythondev
help
with int var it doesnt happen, for ex
2017-12-28T19:34:19.000135
Johnsie
pythondev_help_Johnsie_2017-12-28T19:34:19.000135
1,514,489,659.000135
106,104
pythondev
help
thanks, the problem was solved :slightly_smiling_face:
2017-12-28T19:34:38.000008
Johnsie
pythondev_help_Johnsie_2017-12-28T19:34:38.000008
1,514,489,678.000008
106,105
pythondev
help
python treats integers weirdly
2017-12-28T19:34:42.000099
Glinda
pythondev_help_Glinda_2017-12-28T19:34:42.000099
1,514,489,682.000099
106,106
pythondev
help
np
2017-12-28T19:34:43.000089
Glinda
pythondev_help_Glinda_2017-12-28T19:34:43.000089
1,514,489,683.000089
106,107
pythondev
help
i think python list/dict is like c/c++ array, is always a pointer
2017-12-28T19:35:24.000106
Johnsie
pythondev_help_Johnsie_2017-12-28T19:35:24.000106
1,514,489,724.000106
106,108
pythondev
help
Python caches small integers for efficiency
2017-12-28T20:42:53.000096
Marcie
pythondev_help_Marcie_2017-12-28T20:42:53.000096
1,514,493,773.000096
106,109
pythondev
help
``` >>> a = 256 >>> b = 256 >>> a is b True >>> a = 257 >>> b = 257 >>> a is b False```
2017-12-28T20:43:40.000135
Marcie
pythondev_help_Marcie_2017-12-28T20:43:40.000135
1,514,493,820.000135
106,110
pythondev
help
everything from 0-256 isnt created as new object, everything 256+ is
2017-12-28T20:44:06.000058
Marcie
pythondev_help_Marcie_2017-12-28T20:44:06.000058
1,514,493,846.000058
106,111
pythondev
help
But what the best practices? All list/dict i put in __init__, and string, int, decimal, i put out of __init__. This is ok?
2017-12-28T22:06:57.000137
Johnsie
pythondev_help_Johnsie_2017-12-28T22:06:57.000137
1,514,498,817.000137
106,112
pythondev
help
hello :slightly_smiling_face:
2017-12-29T00:46:00.000038
Clarine
pythondev_help_Clarine_2017-12-29T00:46:00.000038
1,514,508,360.000038
106,113
pythondev
help
Do experienced python devs create virtualenvs for every single project?? Is this best practice? if not, then what is best practice?
2017-12-29T00:51:07.000109
Clarine
pythondev_help_Clarine_2017-12-29T00:51:07.000109
1,514,508,667.000109
106,114
pythondev
help
> Do experienced python devs create virtualenvs for every single project?? Is this best practice? if not, then what is best practice? any time when you don't want to create docker container
2017-12-29T02:12:16.000092
Gennie
pythondev_help_Gennie_2017-12-29T02:12:16.000092
1,514,513,536.000092
106,115
pythondev
help
<@Johnsie> <https://docs.python.org/3/tutorial/classes.html#class-and-instance-variables>
2017-12-29T07:20:50.000076
Tilda
pythondev_help_Tilda_2017-12-29T07:20:50.000076
1,514,532,050.000076
106,116
pythondev
help
I wondered, why it was behaving like this.
2017-12-29T08:05:59.000094
Regina
pythondev_help_Regina_2017-12-29T08:05:59.000094
1,514,534,759.000094
106,117
pythondev
help
Hi all. I have a Dockerfile. I run the command docker build. Then docker run. My script creates a file, how to make so that it is stored on my PC, because if I the script will run using Docker, it is nowhere to be found.
2017-12-29T08:48:53.000014
Georgeann
pythondev_help_Georgeann_2017-12-29T08:48:53.000014
1,514,537,333.000014
106,118
pythondev
help
<@Georgeann> have you checked for the file inside of the container?
2017-12-29T09:32:31.000143
Deedee
pythondev_help_Deedee_2017-12-29T09:32:31.000143
1,514,539,951.000143
106,119
pythondev
help
after you've checked if the file exists inside of the container you should use docker-compose 'volumes' <https://docs.docker.com/compose/compose-file/#volumes>
2017-12-29T09:35:59.000136
Elma
pythondev_help_Elma_2017-12-29T09:35:59.000136
1,514,540,159.000136
106,120
pythondev
help
Agreed. But also depends on what no-name wants to do. I didn't get much other than script creates a file that can't be found. Apparently should be written in host OS.
2017-12-29T09:39:38.000087
Deedee
pythondev_help_Deedee_2017-12-29T09:39:38.000087
1,514,540,378.000087
106,121
pythondev
help
mmm you're right.
2017-12-29T09:51:09.000042
Elma
pythondev_help_Elma_2017-12-29T09:51:09.000042
1,514,541,069.000042
106,122
pythondev
help
<@Elma> <@Deedee> Look. I have a pythonscript for example look like ```f = open('some.txt', 'w') f.wrtite('Test') f.close() ``` and i build docker, like ```$ docker build -t test/test1 . ``` then ``` $ docker run --rm idonotknowwhat ``` And what should I add to start to the file to appear in the same folder where I run...
2017-12-29T10:10:59.000213
Georgeann
pythondev_help_Georgeann_2017-12-29T10:10:59.000213
1,514,542,259.000213
106,123
pythondev
help
To share files between client and container you can create volumes
2017-12-29T10:20:54.000270
Elma
pythondev_help_Elma_2017-12-29T10:20:54.000270
1,514,542,854.00027
106,124
pythondev
help
You should take a look on this <http://jdlm.info/articles/2016/03/06/lessons-building-node-app-docker.html#the-nodemodules-volume-trick>
2017-12-29T10:21:10.000351
Elma
pythondev_help_Elma_2017-12-29T10:21:10.000351
1,514,542,870.000351
106,125
pythondev
help
or check in the official documentation <https://docs.docker.com/engine/admin/volumes/volumes/#choose-the--v-or-mount-flag>
2017-12-29T10:21:44.000071
Elma
pythondev_help_Elma_2017-12-29T10:21:44.000071
1,514,542,904.000071
106,126
pythondev
help
I looked at the official documentation and i run script like ``` $ docker run --rm -v /home/cat/Documents/projects/mypr/my2pr:/home test/test1 ``` And I still received the error.
2017-12-29T10:24:20.000351
Georgeann
pythondev_help_Georgeann_2017-12-29T10:24:20.000351
1,514,543,060.000351
106,127
pythondev
help
Too hard :smiley:
2017-12-29T10:24:35.000136
Georgeann
pythondev_help_Georgeann_2017-12-29T10:24:35.000136
1,514,543,075.000136
106,128
pythondev
help
are you setted the WORKDIR in your dockerfile ?
2017-12-29T10:51:06.000309
Elma
pythondev_help_Elma_2017-12-29T10:51:06.000309
1,514,544,666.000309
106,129
pythondev
help
<@Johnsie> Best practice: anything that needs to be unique among instances needs to be in `__init__` or an instance variable anything that needs to be shared among instances needs to be a class variable. Code to the behavior here, don't code to the variable type.
2017-12-29T11:24:40.000068
Glinda
pythondev_help_Glinda_2017-12-29T11:24:40.000068
1,514,546,680.000068
106,130
pythondev
help
Nope
2017-12-29T11:31:29.000214
Georgeann
pythondev_help_Georgeann_2017-12-29T11:31:29.000214
1,514,547,089.000214
106,131
pythondev
help
<@Glinda>, ok thanks. You last phrase make senses a lot. "Code to the behavior".
2017-12-29T12:04:09.000174
Johnsie
pythondev_help_Johnsie_2017-12-29T12:04:09.000174
1,514,549,049.000174
106,132
pythondev
help
What is this behavior called: ```from src.modules import Module # Instance the class and save a variable in this package. Module(important_variable) # classmethod, that can reference 'important_variable' # only if called after the above call ModuleHelper.function('some string')```
2017-12-29T12:46:16.000169
Glinda
pythondev_help_Glinda_2017-12-29T12:46:16.000169
1,514,551,576.000169
106,133
pythondev
help
closure?
2017-12-29T12:49:56.000142
Suellen
pythondev_help_Suellen_2017-12-29T12:49:56.000142
1,514,551,796.000142
106,134
pythondev
help
binding?
2017-12-29T12:50:04.000214
Suellen
pythondev_help_Suellen_2017-12-29T12:50:04.000214
1,514,551,804.000214
106,135
pythondev
help
That sounds right.
2017-12-29T12:50:45.000224
Glinda
pythondev_help_Glinda_2017-12-29T12:50:45.000224
1,514,551,845.000224
106,136
pythondev
help
How bad of an idea is this: ```token = None class Module: def __init__(self, variable): global token token = variable if __name__ == '__main__': print(token) Module('test') print(token) ```
2017-12-29T12:56:16.000329
Glinda
pythondev_help_Glinda_2017-12-29T12:56:16.000329
1,514,552,176.000329
106,137
pythondev
help
what's the goal ?
2017-12-29T12:56:42.000293
Ciera
pythondev_help_Ciera_2017-12-29T12:56:42.000293
1,514,552,202.000293
106,138
pythondev
help
I have a few classes in this module, all of them need access to this token.
2017-12-29T12:57:27.000147
Glinda
pythondev_help_Glinda_2017-12-29T12:57:27.000147
1,514,552,247.000147
106,139
pythondev
help
I want to make the module as much like a package as I can
2017-12-29T12:57:38.000065
Glinda
pythondev_help_Glinda_2017-12-29T12:57:38.000065
1,514,552,258.000065
106,140
pythondev
help
where you have to pass in a token instead of looking for one in the local area or define it within the package.
2017-12-29T12:58:07.000152
Glinda
pythondev_help_Glinda_2017-12-29T12:58:07.000152
1,514,552,287.000152
106,141
pythondev
help
you can create a variable inside a package
2017-12-29T12:59:40.000145
Ciera
pythondev_help_Ciera_2017-12-29T12:59:40.000145
1,514,552,380.000145
106,142
pythondev
help
``` &gt;&gt;&gt; import requests &gt;&gt;&gt; print(requests) &lt;module 'requests' from '/usr/lib/python3/dist-packages/requests/__init__.py'&gt; &gt;&gt;&gt; requests.hello = 'world' &gt;&gt;&gt; print(requests.hello) world &gt;&gt;&gt; ```
2017-12-29T13:00:20.000352
Ciera
pythondev_help_Ciera_2017-12-29T13:00:20.000352
1,514,552,420.000352
106,143
pythondev
help
I believe something like this should work
2017-12-29T13:00:33.000247
Ciera
pythondev_help_Ciera_2017-12-29T13:00:33.000247
1,514,552,433.000247
106,144
pythondev
help
Okay that sounds good.
2017-12-29T13:01:02.000141
Glinda
pythondev_help_Glinda_2017-12-29T13:01:02.000141
1,514,552,462.000141
106,145
pythondev
help
I'm trying to scrape data from wunderground with requests and its working but eventually after about 8 or so requests it gives me an exception, is there an easy way to tell requests to keep trying? not seeing anything after a few quick searches
2017-12-29T13:03:19.000291
Devorah
pythondev_help_Devorah_2017-12-29T13:03:19.000291
1,514,552,599.000291
106,146
pythondev
help
<https://www.wunderground.com/weather/api/d/pricing.html>
2017-12-29T13:03:58.000017
Meg
pythondev_help_Meg_2017-12-29T13:03:58.000017
1,514,552,638.000017
106,147
pythondev
help
why not use the api?
2017-12-29T13:04:02.000191
Meg
pythondev_help_Meg_2017-12-29T13:04:02.000191
1,514,552,642.000191
106,148
pythondev
help
I am
2017-12-29T13:04:12.000210
Devorah
pythondev_help_Devorah_2017-12-29T13:04:12.000210
1,514,552,652.00021
106,149
pythondev
help
I'm using requests to get the data from the api
2017-12-29T13:04:27.000073
Devorah
pythondev_help_Devorah_2017-12-29T13:04:27.000073
1,514,552,667.000073
106,150
pythondev
help
what’s the exception you’re getting?
2017-12-29T13:04:31.000058
Meg
pythondev_help_Meg_2017-12-29T13:04:31.000058
1,514,552,671.000058
106,151
pythondev
help
sounds like you’re on the developer plan, which limits you to 10 calls/minute and 500 calls/day
2017-12-29T13:05:00.000203
Meg
pythondev_help_Meg_2017-12-29T13:05:00.000203
1,514,552,700.000203
106,152
pythondev
help
whats your code?
2017-12-29T13:09:22.000088
Meg
pythondev_help_Meg_2017-12-29T13:09:22.000088
1,514,552,962.000088
106,153
pythondev
help
but given the number of requests you’re making, sounds like you’re hitting the limit per minute
2017-12-29T13:10:10.000047
Meg
pythondev_help_Meg_2017-12-29T13:10:10.000047
1,514,553,010.000047
106,154
pythondev
help
Yeah, and they should be returning a status response.
2017-12-29T13:10:22.000101
Glinda
pythondev_help_Glinda_2017-12-29T13:10:22.000101
1,514,553,022.000101
106,155
pythondev
help
But it's easier to ignore I guess.
2017-12-29T13:10:30.000288
Glinda
pythondev_help_Glinda_2017-12-29T13:10:30.000288
1,514,553,030.000288
106,156
pythondev
help
<https://apicommunity.wunderground.com/weatherapi/topics/error-code-list>
2017-12-29T13:13:14.000242
Meg
pythondev_help_Meg_2017-12-29T13:13:14.000242
1,514,553,194.000242
106,157
pythondev
help
&gt;just not something we ever put together
2017-12-29T13:13:35.000063
Meg
pythondev_help_Meg_2017-12-29T13:13:35.000063
1,514,553,215.000063
106,158
pythondev
help
:eyeroll:
2017-12-29T13:13:56.000231
Meg
pythondev_help_Meg_2017-12-29T13:13:56.000231
1,514,553,236.000231
106,159
pythondev
help
LOL
2017-12-29T13:14:04.000165
Suellen
pythondev_help_Suellen_2017-12-29T13:14:04.000165
1,514,553,244.000165
106,160
pythondev
help
hahahaha
2017-12-29T13:16:56.000327
Ozie
pythondev_help_Ozie_2017-12-29T13:16:56.000327
1,514,553,416.000327
106,161
pythondev
help
I did have it every 30 seconds and it would do it as well too
2017-12-29T13:17:28.000160
Devorah
pythondev_help_Devorah_2017-12-29T13:17:28.000160
1,514,553,448.00016
106,162
pythondev
help
What you should do for the responses is check if there's an error section. Scroll down that link I posted above with a sample response with an error
2017-12-29T13:24:40.000357
Meg
pythondev_help_Meg_2017-12-29T13:24:40.000357
1,514,553,880.000357
106,163
pythondev
help
And implement some try catches, exception handling and response code checks
2017-12-29T13:25:10.000335
Meg
pythondev_help_Meg_2017-12-29T13:25:10.000335
1,514,553,910.000335
106,164
pythondev
help
I would suspect you're getting a number of error responses, and the api is just shutting you off as a result
2017-12-29T13:26:24.000334
Meg
pythondev_help_Meg_2017-12-29T13:26:24.000334
1,514,553,984.000334
106,165
pythondev
help
Within pycharm... Myabe something to do with docstrings, wraps and decorators?
2017-12-29T14:11:56.000283
Glinda
pythondev_help_Glinda_2017-12-29T14:11:56.000283
1,514,556,716.000283
106,166
pythondev
help
what’s the difference?
2017-12-29T14:14:19.000005
Meg
pythondev_help_Meg_2017-12-29T14:14:19.000005
1,514,556,859.000005
106,167
pythondev
help
can’t see anything
2017-12-29T14:14:22.000181
Meg
pythondev_help_Meg_2017-12-29T14:14:22.000181
1,514,556,862.000181
106,168
pythondev
help
oh, you have the docstring inside
2017-12-29T14:14:41.000009
Meg
pythondev_help_Meg_2017-12-29T14:14:41.000009
1,514,556,881.000009
106,169
pythondev
help
Yeah
2017-12-29T14:14:46.000027
Glinda
pythondev_help_Glinda_2017-12-29T14:14:46.000027
1,514,556,886.000027
106,170
pythondev
help
hmm
2017-12-29T14:14:50.000137
Meg
pythondev_help_Meg_2017-12-29T14:14:50.000137
1,514,556,890.000137
106,171
pythondev
help
not an error
2017-12-29T14:15:19.000049
Suellen
pythondev_help_Suellen_2017-12-29T14:15:19.000049
1,514,556,919.000049
106,172
pythondev
help
it's just pycharm being pycharm
2017-12-29T14:15:24.000166
Suellen
pythondev_help_Suellen_2017-12-29T14:15:24.000166
1,514,556,924.000166
106,173
pythondev
help
See also: `callable object is not callable`
2017-12-29T14:15:38.000316
Suellen
pythondev_help_Suellen_2017-12-29T14:15:38.000316
1,514,556,938.000316
106,174
pythondev
help
yes
2017-12-29T14:15:45.000132
Suellen
pythondev_help_Suellen_2017-12-29T14:15:45.000132
1,514,556,945.000132
106,175
pythondev
help
function is obviously callable, right?
2017-12-29T14:16:00.000145
Suellen
pythondev_help_Suellen_2017-12-29T14:16:00.000145
1,514,556,960.000145
106,176
pythondev
help
Yup
2017-12-29T14:16:10.000235
Glinda
pythondev_help_Glinda_2017-12-29T14:16:10.000235
1,514,556,970.000235
106,177
pythondev
help
<https://mail.python.org/pipermail/python-ideas/2013-May/020357.html>
2017-12-29T14:16:20.000157
Meg
pythondev_help_Meg_2017-12-29T14:16:20.000157
1,514,556,980.000157
106,178
pythondev
help
cool thanks!
2017-12-29T14:20:28.000031
Glinda
pythondev_help_Glinda_2017-12-29T14:20:28.000031
1,514,557,228.000031
106,179
pythondev
help
I could do this ```def external_router(calls: List[ResponseContainer]): # slack, or airtable for call in calls: class_method = getattr(call.route, call.method, None) if iscallable(class_method): class_method(call.payload) else: getattr(call.route, 'default...
2017-12-29T15:22:35.000309
Glinda
pythondev_help_Glinda_2017-12-29T15:22:35.000309
1,514,560,955.000309
106,180
pythondev
help
This is more of a learning excercise
2017-12-29T15:23:12.000180
Glinda
pythondev_help_Glinda_2017-12-29T15:23:12.000180
1,514,560,992.00018
106,181
pythondev
help
have you looked into functools.partial ( <https://docs.python.org/3/library/functools.html#functools.partial> )? I honestly have never implemented it, but it *may* be appropriate here?
2017-12-29T15:23:38.000068
Seema
pythondev_help_Seema_2017-12-29T15:23:38.000068
1,514,561,018.000068
106,182
pythondev
help
Thanks that looks cool.
2017-12-29T15:25:52.000021
Glinda
pythondev_help_Glinda_2017-12-29T15:25:52.000021
1,514,561,152.000021
106,183
pythondev
help
you might also want to look at the `collections` module and/or use propriety instead
2017-12-29T15:28:06.000194
Ciera
pythondev_help_Ciera_2017-12-29T15:28:06.000194
1,514,561,286.000194
106,184
pythondev
help
and `defaultdict`
2017-12-29T15:28:54.000034
Ciera
pythondev_help_Ciera_2017-12-29T15:28:54.000034
1,514,561,334.000034
106,185
pythondev
help
propriety?
2017-12-29T15:29:13.000139
Glinda
pythondev_help_Glinda_2017-12-29T15:29:13.000139
1,514,561,353.000139
106,186
pythondev
help
property ?
2017-12-29T15:30:29.000071
Ciera
pythondev_help_Ciera_2017-12-29T15:30:29.000071
1,514,561,429.000071
106,187
pythondev
help
when I start to speak in frenglish I should go to sleep :smile:
2017-12-29T15:33:33.000002
Ciera
pythondev_help_Ciera_2017-12-29T15:33:33.000002
1,514,561,613.000002
106,188
pythondev
help
ha
2017-12-29T15:34:00.000088
Glinda
pythondev_help_Glinda_2017-12-29T15:34:00.000088
1,514,561,640.000088
106,189
pythondev
help
Moved this in here b/c channel has taken another direction. `docker run --rm -v /home/cat/Documents/projects/mypr/my2pr:/home test/test1` `--rm` removes the container when it stops/exits. My guess is that any mapped volumes disappear as well. Do you have this issue if you DON'T use `--rm`?
2017-12-29T16:05:21.000293
Deedee
pythondev_help_Deedee_2017-12-29T16:05:21.000293
1,514,563,521.000293
106,190
pythondev
help
if it's working :thumbsup:
2017-12-29T16:45:26.000263
Ciera
pythondev_help_Ciera_2017-12-29T16:45:26.000263
1,514,565,926.000263
106,191
pythondev
help
but it looks a bit scary :smile:
2017-12-29T16:45:32.000025
Ciera
pythondev_help_Ciera_2017-12-29T16:45:32.000025
1,514,565,932.000025
106,192
pythondev
help
Yeah I figure when I properly make it into a module the `__name__` part will look better.
2017-12-29T16:52:44.000018
Glinda
pythondev_help_Glinda_2017-12-29T16:52:44.000018
1,514,566,364.000018
106,193
pythondev
help
I need help. I've read so many posts/responses/articles... even watched 2 hrs worth of vids on LinuxAcademy on Git that things like <https://git-scm.com/book/en/v2/Git-Branching-Rebasing> may as well be written as hieroglyphs. What I need to do is replace my local repo w/ the most recent upstream. So sync my local copy...
2017-12-29T17:43:13.000089
Deedee
pythondev_help_Deedee_2017-12-29T17:43:13.000089
1,514,569,393.000089
106,194
pythondev
help
do you have local changes you need to keep ?
2017-12-29T17:44:29.000052
Ciera
pythondev_help_Ciera_2017-12-29T17:44:29.000052
1,514,569,469.000052
106,195
pythondev
help
no.
2017-12-29T17:44:34.000076
Deedee
pythondev_help_Deedee_2017-12-29T17:44:34.000076
1,514,569,474.000076
106,196
pythondev
help
ok, do `git stash`
2017-12-29T17:44:41.000141
Meg
pythondev_help_Meg_2017-12-29T17:44:41.000141
1,514,569,481.000141
106,197
pythondev
help
and then `git pull`
2017-12-29T17:44:45.000111
Meg
pythondev_help_Meg_2017-12-29T17:44:45.000111
1,514,569,485.000111
106,198
pythondev
help
assuming you’re on the master branch, or whatever branch you need to be on
2017-12-29T17:44:56.000092
Meg
pythondev_help_Meg_2017-12-29T17:44:56.000092
1,514,569,496.000092
106,199
pythondev
help
and i've thought about deleting my local copy but.... stash?
2017-12-29T17:44:57.000010
Deedee
pythondev_help_Deedee_2017-12-29T17:44:57.000010
1,514,569,497.00001
106,200
pythondev
help
or nuke the directory and clone again (but you won't learn anything)
2017-12-29T17:45:10.000101
Ciera
pythondev_help_Ciera_2017-12-29T17:45:10.000101
1,514,569,510.000101
106,201
pythondev
help
<https://git-scm.com/docs/git-stash>
2017-12-29T17:45:15.000156
Meg
pythondev_help_Meg_2017-12-29T17:45:15.000156
1,514,569,515.000156
106,202