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
yes, they have changed it .
2018-03-14T17:23:54.000600
Maya
pythondev_help_Maya_2018-03-14T17:23:54.000600
1,521,048,234.0006
39,024
pythondev
help
are you using the bytes encoded stuff anywhere ?
2018-03-14T17:25:20.000198
Kristin
pythondev_help_Kristin_2018-03-14T17:25:20.000198
1,521,048,320.000198
39,025
pythondev
help
me?
2018-03-14T17:25:34.000348
Maya
pythondev_help_Maya_2018-03-14T17:25:34.000348
1,521,048,334.000348
39,026
pythondev
help
yeah
2018-03-14T17:25:37.000473
Kristin
pythondev_help_Kristin_2018-03-14T17:25:37.000473
1,521,048,337.000473
39,027
pythondev
help
lol
2018-03-14T17:25:43.000473
Terica
pythondev_help_Terica_2018-03-14T17:25:43.000473
1,521,048,343.000473
39,028
pythondev
help
not really, just in that portion of code
2018-03-14T17:26:02.000512
Maya
pythondev_help_Maya_2018-03-14T17:26:02.000512
1,521,048,362.000512
39,029
pythondev
help
best not to bother with encoding atal then
2018-03-14T17:26:19.000193
Kristin
pythondev_help_Kristin_2018-03-14T17:26:19.000193
1,521,048,379.000193
39,030
pythondev
help
```user = 'test' passw = 'test' cred = user + passw print(f"basic {cred}")```
2018-03-14T17:26:22.000648
Kristin
pythondev_help_Kristin_2018-03-14T17:26:22.000648
1,521,048,382.000648
39,031
pythondev
help
ok
2018-03-14T17:26:47.000082
Maya
pythondev_help_Maya_2018-03-14T17:26:47.000082
1,521,048,407.000082
39,032
pythondev
help
i think we all learned a little more unicode today though :+1:
2018-03-14T17:27:30.000235
Kristin
pythondev_help_Kristin_2018-03-14T17:27:30.000235
1,521,048,450.000235
39,033
pythondev
help
sure!
2018-03-14T17:27:48.000583
Maya
pythondev_help_Maya_2018-03-14T17:27:48.000583
1,521,048,468.000583
39,034
pythondev
help
unicode, the challenge of all computer interactions :wink:
2018-03-14T17:28:14.000359
Terica
pythondev_help_Terica_2018-03-14T17:28:14.000359
1,521,048,494.000359
39,035
pythondev
help
I remember when I used irssi for the first time in unicode
2018-03-14T17:28:45.000505
Terica
pythondev_help_Terica_2018-03-14T17:28:45.000505
1,521,048,525.000505
39,036
pythondev
help
with my fellow french colleagues
2018-03-14T17:29:02.000076
Terica
pythondev_help_Terica_2018-03-14T17:29:02.000076
1,521,048,542.000076
39,037
pythondev
help
Hello all! Does anyone know of a way to loop through a list containing the values of a column and assign data types. So if Column1 has values of '1', '2', '3' it would return 'int', int', 'int'. I did some digging and found: ```for column in columns: try: datatype.append(int(column)) excep...
2018-03-14T19:53:42.000379
Chi
pythondev_help_Chi_2018-03-14T19:53:42.000379
1,521,057,222.000379
39,038
pythondev
help
What strikes you as confusing and complex in that?
2018-03-14T19:54:14.000004
Garrett
pythondev_help_Garrett_2018-03-14T19:54:14.000004
1,521,057,254.000004
39,039
pythondev
help
Well I want to do this for strings, floats, decimals, ints, bigints. I feel like trying to include those in a Try would cause it to become very large and complicated.
2018-03-14T19:54:59.000195
Chi
pythondev_help_Chi_2018-03-14T19:54:59.000195
1,521,057,299.000195
39,040
pythondev
help
I would understand if it's the only way though. I seems like it would work overall. I just wondered if there was a much simpler way
2018-03-14T19:55:34.000115
Chi
pythondev_help_Chi_2018-03-14T19:55:34.000115
1,521,057,334.000115
39,041
pythondev
help
is the goal to try all varaibles to check their types?
2018-03-14T19:55:43.000364
Terica
pythondev_help_Terica_2018-03-14T19:55:43.000364
1,521,057,343.000364
39,042
pythondev
help
You could try the `literal_eval` function from the `ast` module.
2018-03-14T19:55:48.000200
Garrett
pythondev_help_Garrett_2018-03-14T19:55:48.000200
1,521,057,348.0002
39,043
pythondev
help
Yes, I will be using the columns to create a SQL table, and for that I need the datatypes. It would be nice if Python can grab these for me.
2018-03-14T19:56:24.000032
Chi
pythondev_help_Chi_2018-03-14T19:56:24.000032
1,521,057,384.000032
39,044
pythondev
help
Well it's not really to check the type of the member, it's to check the type _inside_ the member (assuming every member is a string to begin with, like in the example)
2018-03-14T19:56:24.000256
Garrett
pythondev_help_Garrett_2018-03-14T19:56:24.000256
1,521,057,384.000256
39,045
pythondev
help
Let me look into that, it looks good!
2018-03-14T19:56:47.000071
Chi
pythondev_help_Chi_2018-03-14T19:56:47.000071
1,521,057,407.000071
39,046
pythondev
help
It's also safer than actual `eval`
2018-03-14T19:57:39.000349
Garrett
pythondev_help_Garrett_2018-03-14T19:57:39.000349
1,521,057,459.000349
39,047
pythondev
help
Haha I just searched `literal_eval` and one of the first articles is: <https://nedbatchelder.com/blog/201206/eval_really_is_dangerous.html> I guess I should avoid that.
2018-03-14T19:58:35.000306
Chi
pythondev_help_Chi_2018-03-14T19:58:35.000306
1,521,057,515.000306
39,048
pythondev
help
Hi guys, I have a few questions about using flask with marshmallow. Is there a way to construct a schema based on the http method? Say for instance I’ll do a `GET` request, then I’d want a `created_by` field to be required, but upon using `POST`, `DELETE` or `PATCH` command, I’d want a `login_user` to be required. Or s...
2018-03-15T00:18:36.000068
Margert
pythondev_help_Margert_2018-03-15T00:18:36.000068
1,521,073,116.000068
39,049
pythondev
help
Hi guys, I\d like to get your opinion about what is the best way to repeatedly run a function every X seconds or minutes
2018-03-15T04:35:33.000170
Maya
pythondev_help_Maya_2018-03-15T04:35:33.000170
1,521,088,533.00017
39,050
pythondev
help
The easier way I think could be do ``` import time def myfunc(): time.sleep(10) while True: myfunc() ``` but I am looking for a no-blocking solution.
2018-03-15T04:36:03.000074
Maya
pythondev_help_Maya_2018-03-15T04:36:03.000074
1,521,088,563.000074
39,051
pythondev
help
I could use the `Timer` from `threading` but in my code I use a lot of asyncio function.
2018-03-15T04:37:43.000095
Maya
pythondev_help_Maya_2018-03-15T04:37:43.000095
1,521,088,663.000095
39,052
pythondev
help
the easiest is to set up a cron
2018-03-15T04:37:53.000179
Micki
pythondev_help_Micki_2018-03-15T04:37:53.000179
1,521,088,673.000179
39,053
pythondev
help
like `<https://docs.python.org/3/library/sched.html>` ?
2018-03-15T04:38:19.000328
Maya
pythondev_help_Maya_2018-03-15T04:38:19.000328
1,521,088,699.000328
39,054
pythondev
help
no a real system cron that start your script / call an url / something when you want it
2018-03-15T04:38:52.000161
Micki
pythondev_help_Micki_2018-03-15T04:38:52.000161
1,521,088,732.000161
39,055
pythondev
help
or if you need something that can be managed in python from the application itself you can use
2018-03-15T04:39:18.000104
Micki
pythondev_help_Micki_2018-03-15T04:39:18.000104
1,521,088,758.000104
39,056
pythondev
help
None
2018-03-15T04:39:22.000092
Hyo
pythondev_help_Hyo_2018-03-15T04:39:22.000092
1,521,088,762.000092
39,057
pythondev
help
I’d need to do in my code, ’cause I need to store or update a value in RAM
2018-03-15T04:39:34.000124
Maya
pythondev_help_Maya_2018-03-15T04:39:34.000124
1,521,088,774.000124
39,058
pythondev
help
and moreover the service has a public method in order to provide client with data
2018-03-15T04:40:14.000159
Maya
pythondev_help_Maya_2018-03-15T04:40:14.000159
1,521,088,814.000159
39,059
pythondev
help
depending what/how your code run you may already be listening for event from outside
2018-03-15T04:40:21.000259
Micki
pythondev_help_Micki_2018-03-15T04:40:21.000259
1,521,088,821.000259
39,060
pythondev
help
basically it runs a log in and store an access token
2018-03-15T04:40:50.000029
Maya
pythondev_help_Maya_2018-03-15T04:40:50.000029
1,521,088,850.000029
39,061
pythondev
help
for an http application for example you can do a cron that do `curl 127.0.0.1/do_my_scheduled_thingy`
2018-03-15T04:41:01.000318
Micki
pythondev_help_Micki_2018-03-15T04:41:01.000318
1,521,088,861.000318
39,062
pythondev
help
but every 5 seconds I need to refresh the token by calling a given endpint
2018-03-15T04:41:08.000281
Maya
pythondev_help_Maya_2018-03-15T04:41:08.000281
1,521,088,868.000281
39,063
pythondev
help
call you python script in cron
2018-03-15T04:42:33.000130
Terica
pythondev_help_Terica_2018-03-15T04:42:33.000130
1,521,088,953.00013
39,064
pythondev
help
then include the refresh of your token in it
2018-03-15T04:42:41.000310
Terica
pythondev_help_Terica_2018-03-15T04:42:41.000310
1,521,088,961.00031
39,065
pythondev
help
ah yeah so it's pretty often. If you use asyncio you can create a background task that does it
2018-03-15T04:43:02.000504
Micki
pythondev_help_Micki_2018-03-15T04:43:02.000504
1,521,088,982.000504
39,066
pythondev
help
this solution I like the most
2018-03-15T04:43:23.000232
Maya
pythondev_help_Maya_2018-03-15T04:43:23.000232
1,521,089,003.000232
39,067
pythondev
help
does it need to be portable to other OS?
2018-03-15T04:43:33.000136
Terica
pythondev_help_Terica_2018-03-15T04:43:33.000136
1,521,089,013.000136
39,068
pythondev
help
dunno, it will be a docker container
2018-03-15T04:43:45.000348
Maya
pythondev_help_Maya_2018-03-15T04:43:45.000348
1,521,089,025.000348
39,069
pythondev
help
inside Kube
2018-03-15T04:43:50.000084
Maya
pythondev_help_Maya_2018-03-15T04:43:50.000084
1,521,089,030.000084
39,070
pythondev
help
there is this <https://github.com/aio-libs/aiojobs> but haven't tried it
2018-03-15T04:44:05.000145
Micki
pythondev_help_Micki_2018-03-15T04:44:05.000145
1,521,089,045.000145
39,071
pythondev
help
hum, so cron or <@Micki> solution are ok then
2018-03-15T04:44:07.000401
Terica
pythondev_help_Terica_2018-03-15T04:44:07.000401
1,521,089,047.000401
39,072
pythondev
help
I am gonna try with the aiojobs
2018-03-15T04:44:36.000336
Maya
pythondev_help_Maya_2018-03-15T04:44:36.000336
1,521,089,076.000336
39,073
pythondev
help
thanks guys.
2018-03-15T04:44:55.000053
Maya
pythondev_help_Maya_2018-03-15T04:44:55.000053
1,521,089,095.000053
39,074
pythondev
help
```import asyncio async def f(): for i in range(10): await asyncio.sleep(1) print('hi') loop = asyncio.get_event_loop() loop.run_until_complete(f()) loop.close() ```
2018-03-15T04:45:58.000360
Breanne
pythondev_help_Breanne_2018-03-15T04:45:58.000360
1,521,089,158.00036
39,075
pythondev
help
sample of simple async function
2018-03-15T04:46:26.000342
Breanne
pythondev_help_Breanne_2018-03-15T04:46:26.000342
1,521,089,186.000342
39,076
pythondev
help
Hey I’m having issues trying to get flask and celery to communicate with AWS SQS, does anyone know/have any tutorials/tips? I currently use the celery function provided on github to run the celery jobs, it works when running with Redis, but when trying to connect to AWS SQS it fails I use a `.env` to store environment...
2018-03-15T04:50:27.000295
Terrence
pythondev_help_Terrence_2018-03-15T04:50:27.000295
1,521,089,427.000295
39,077
pythondev
help
Hi guys whats the difference between containers and sequences types in python 3.6. ?Different sources discusses list, tuples, dict etc in both concepts.
2018-03-15T04:57:49.000477
Luz
pythondev_help_Luz_2018-03-15T04:57:49.000477
1,521,089,869.000477
39,078
pythondev
help
Might find this helpful for containers: <https://stackoverflow.com/questions/11575925/what-exactly-are-containers-in-python-and-what-are-all-the-python-container>
2018-03-15T04:59:28.000102
Terrence
pythondev_help_Terrence_2018-03-15T04:59:28.000102
1,521,089,968.000102
39,079
pythondev
help
<@Deadra> Hi. I don't do much scraping but are you stuck on a particular thing ? what is not happening as you would expect ?
2018-03-15T06:26:09.000024
Micki
pythondev_help_Micki_2018-03-15T06:26:09.000024
1,521,095,169.000024
39,080
pythondev
help
<@Micki> When I run the programme I get TypeError: 'NoneType' object is not subscriptable
2018-03-15T06:27:06.000039
Deadra
pythondev_help_Deadra_2018-03-15T06:27:06.000039
1,521,095,226.000039
39,081
pythondev
help
on which line ?
2018-03-15T06:27:57.000284
Micki
pythondev_help_Micki_2018-03-15T06:27:57.000284
1,521,095,277.000284
39,082
pythondev
help
can you show us the error message
2018-03-15T06:28:22.000072
Terrence
pythondev_help_Terrence_2018-03-15T06:28:22.000072
1,521,095,302.000072
39,083
pythondev
help
line 26
2018-03-15T06:42:49.000371
Deadra
pythondev_help_Deadra_2018-03-15T06:42:49.000371
1,521,096,169.000371
39,084
pythondev
help
try this
2018-03-15T06:46:29.000161
Terrence
pythondev_help_Terrence_2018-03-15T06:46:29.000161
1,521,096,389.000161
39,085
pythondev
help
also get rid of the line `contain = container`
2018-03-15T06:46:37.000357
Terrence
pythondev_help_Terrence_2018-03-15T06:46:37.000357
1,521,096,397.000357
39,086
pythondev
help
you never end up using it
2018-03-15T06:46:48.000165
Terrence
pythondev_help_Terrence_2018-03-15T06:46:48.000165
1,521,096,408.000165
39,087
pythondev
help
or do `for value in contain:` instead of `for contain in container:`
2018-03-15T06:47:13.000018
Terrence
pythondev_help_Terrence_2018-03-15T06:47:13.000018
1,521,096,433.000018
39,088
pythondev
help
Hey guys, I’m trying to publish an open source project on PyPi. I’m running into a problem with a relative path. I use the following line to load up my logging config: `logging.config.dictConfig(yaml.safe_load(open("library/loggers/logging.yaml", 'rt')))` This line, and all others, works on my local laptop. Once I up...
2018-03-15T09:26:15.000112
Bella
pythondev_help_Bella_2018-03-15T09:26:15.000112
1,521,105,975.000112
39,089
pythondev
help
<@Bella> look for package data; you'll need to load logging.yaml content as a resource
2018-03-15T09:27:26.000602
Aleida
pythondev_help_Aleida_2018-03-15T09:27:26.000602
1,521,106,046.000602
39,090
pythondev
help
<@Aleida> I apologize but I’m very new to distributing Python code. Can you reword: &gt; look for package data
2018-03-15T09:29:55.000108
Bella
pythondev_help_Bella_2018-03-15T09:29:55.000108
1,521,106,195.000108
39,091
pythondev
help
I'm not sure distributing `logging` configuration with a packages is the way to go
2018-03-15T09:30:28.000838
Micki
pythondev_help_Micki_2018-03-15T09:30:28.000838
1,521,106,228.000838
39,092
pythondev
help
(depends on the goal of the packages)
2018-03-15T09:31:01.000666
Micki
pythondev_help_Micki_2018-03-15T09:31:01.000666
1,521,106,261.000666
39,093
pythondev
help
I’m honestly not sure if what I’m attempting to do is correct or even recommended but for now I just want to get it working. if anyone ends up using the package and feels differently, I’ll just adapt at that time.
2018-03-15T09:32:21.000328
Bella
pythondev_help_Bella_2018-03-15T09:32:21.000328
1,521,106,341.000328
39,094
pythondev
help
Right now, I imagine the library will be used by myself and maybe a few friends so I’m not to worried about this particular aspect, rather I simply want it to run successfully. Does that make sense?
2018-03-15T09:32:49.000278
Bella
pythondev_help_Bella_2018-03-15T09:32:49.000278
1,521,106,369.000278
39,095
pythondev
help
yeah sure :slightly_smiling_face: :thumbsup:
2018-03-15T09:34:46.000009
Micki
pythondev_help_Micki_2018-03-15T09:34:46.000009
1,521,106,486.000009
39,096
pythondev
help
Cool. Thanks for the input though, I’ll keep that in mind for future changes!
2018-03-15T09:35:07.000423
Bella
pythondev_help_Bella_2018-03-15T09:35:07.000423
1,521,106,507.000423
39,097
pythondev
help
when making a package you need to specify the non python file you want included
2018-03-15T09:35:22.000305
Micki
pythondev_help_Micki_2018-03-15T09:35:22.000305
1,521,106,522.000305
39,098
pythondev
help
<@Micki> Follow up question. How do you get your package to perform logging then?
2018-03-15T09:38:30.000705
Bella
pythondev_help_Bella_2018-03-15T09:38:30.000705
1,521,106,710.000705
39,099
pythondev
help
I agree with <@Micki>’s original point, and one thing to consider is that simply wrapping that in a check to see if the configuration exists before running the configuration would fix your problem and result in the logger remaining unconfigured by default - in a way it does solve your problem
2018-03-15T09:38:45.000624
Zack
pythondev_help_Zack_2018-03-15T09:38:45.000624
1,521,106,725.000624
39,100
pythondev
help
<@Zack> If I do as you say, wouldn’t my logging from a PyPi installation always not have a configuration and then look like garbage?
2018-03-15T09:40:25.000525
Bella
pythondev_help_Bella_2018-03-15T09:40:25.000525
1,521,106,825.000525
39,101
pythondev
help
I don't. Usually a package is going to be used by something else. So you (the user) can configure your logging there
2018-03-15T09:40:45.000585
Micki
pythondev_help_Micki_2018-03-15T09:40:45.000585
1,521,106,845.000585
39,102
pythondev
help
it would probably simply not log at all, which is what I’d consider ideal from a user of a library perspective.
2018-03-15T09:40:46.000032
Zack
pythondev_help_Zack_2018-03-15T09:40:46.000032
1,521,106,846.000032
39,103
pythondev
help
Oh, never thought of that. I just imagined users would want to see my log output. Ok. That’s super clear to me.
2018-03-15T09:41:42.000686
Bella
pythondev_help_Bella_2018-03-15T09:41:42.000686
1,521,106,902.000686
39,104
pythondev
help
So all I have to do is catch the missing file, like <@Zack> suggested and then somehow disable all the log output throughout the file if that config is missing correct?
2018-03-15T09:42:19.000094
Bella
pythondev_help_Bella_2018-03-15T09:42:19.000094
1,521,106,939.000094
39,105
pythondev
help
leaving it unconfigured should be enough as I recall - I think it won’t log at all if it’s not configured
2018-03-15T09:43:05.000371
Zack
pythondev_help_Zack_2018-03-15T09:43:05.000371
1,521,106,985.000371
39,106
pythondev
help
double check that of course
2018-03-15T09:43:16.000114
Zack
pythondev_help_Zack_2018-03-15T09:43:16.000114
1,521,106,996.000114
39,107
pythondev
help
Will do. Thank you guys! Much apprecaited. I’m going to try to fix this at lunch.
2018-03-15T09:43:38.000287
Bella
pythondev_help_Bella_2018-03-15T09:43:38.000287
1,521,107,018.000287
39,108
pythondev
help
for an example here is the logging file for <@Hyo> <https://github.com/pyslackers/sirbot-pyslackers/blob/master/logging.yml>
2018-03-15T09:44:30.000079
Micki
pythondev_help_Micki_2018-03-15T09:44:30.000079
1,521,107,070.000079
39,109
pythondev
help
you can see that I configure a logger for `slack`, an outside library
2018-03-15T09:45:04.000789
Micki
pythondev_help_Micki_2018-03-15T09:45:04.000789
1,521,107,104.000789
39,110
pythondev
help
<@Micki> :taco: for the example code
2018-03-15T09:50:49.000127
Zack
pythondev_help_Zack_2018-03-15T09:50:49.000127
1,521,107,449.000127
39,111
pythondev
help
_… i forgot how to use heytaco, woops_
2018-03-15T10:04:12.000198
Bella
pythondev_help_Bella_2018-03-15T10:04:12.000198
1,521,108,252.000198
39,112
pythondev
help
<@Micki> Ok. I’m looking at this now. I’m going to have to look some stuff up as its not super clear to me right now. Thank you
2018-03-15T10:04:37.000457
Bella
pythondev_help_Bella_2018-03-15T10:04:37.000457
1,521,108,277.000457
39,113
pythondev
help
I'm loading about 1700 1080p (portrait) images into numpy arrays (with a shape of 1920x1080 cause it's grayscale) and putting them into a python list. This takes about 2.5GB of memory. My intuition was that I could just replace this list with a three dimensional array. Unfortunately initializing this array with `np.zer...
2018-03-15T10:45:37.000015
Faustino
pythondev_help_Faustino_2018-03-15T10:45:37.000015
1,521,110,737.000015
39,114
pythondev
help
maybe try specifying the type. it seems default is `float64`, which probably takes up more space than you need ``` dtype : data-type, optional The desired data-type for the array, e.g., numpy.int8. Default is numpy.float64 ``` <https://docs.scipy.org/doc/numpy/reference/generated/numpy.zeros.html>
2018-03-15T10:58:23.000844
Linh
pythondev_help_Linh_2018-03-15T10:58:23.000844
1,521,111,503.000844
39,115
pythondev
help
<@Linh> Thanks, that was it! :taco:
2018-03-15T11:10:27.000286
Faustino
pythondev_help_Faustino_2018-03-15T11:10:27.000286
1,521,112,227.000286
39,116
pythondev
help
Turns out adding it to a list is still significantly faster than inserting it into the preallocated array (20s as opposed to 60s), so guess I'll just stick with the list.
2018-03-15T11:11:27.000076
Faustino
pythondev_help_Faustino_2018-03-15T11:11:27.000076
1,521,112,287.000076
39,117
pythondev
help
not sure what you are doing with those images but generators could maybe help you
2018-03-15T11:12:36.000135
Micki
pythondev_help_Micki_2018-03-15T11:12:36.000135
1,521,112,356.000135
39,118
pythondev
help
You mean just loading/processing them as required, for example one at a time or in batches? That's a good idea, but would require a significantly larger rewrite unfortunately.
2018-03-15T11:15:25.000279
Faustino
pythondev_help_Faustino_2018-03-15T11:15:25.000279
1,521,112,525.000279
39,119
pythondev
help
yes. It's usually made to optimise the needed memory
2018-03-15T11:16:03.000512
Micki
pythondev_help_Micki_2018-03-15T11:16:03.000512
1,521,112,563.000512
39,120
pythondev
help
<@Micki> Thanks for the idea :taco: That's something we might do at a later time.
2018-03-15T11:17:35.000786
Faustino
pythondev_help_Faustino_2018-03-15T11:17:35.000786
1,521,112,655.000786
39,121
pythondev
help
has anyone ever worked with connecting to a DB that uses bastion as a proxy and then the actual db ? does that make sense? I’m trying to write a script that will connect to my db who’s ssh host is bastion so I can query our DB via my script
2018-03-15T11:20:53.000440
Romona
pythondev_help_Romona_2018-03-15T11:20:53.000440
1,521,112,853.00044
39,122
pythondev
help
<@Romona> i believe so yes
2018-03-15T11:57:52.000515
Elisha
pythondev_help_Elisha_2018-03-15T11:57:52.000515
1,521,115,072.000515
39,123