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
Thanks dude
2017-12-18T11:40:04.000140
Krysta
pythondev_help_Krysta_2017-12-18T11:40:04.000140
1,513,597,204.00014
104,603
pythondev
help
orrrrr
2017-12-18T11:40:07.000078
Corrinne
pythondev_help_Corrinne_2017-12-18T11:40:07.000078
1,513,597,207.000078
104,604
pythondev
help
```import re desired_output = "'Y_BEAUTWD', 'GREYCHK', 'jpg'" test_str = "Y_BEAUTWD_GREYCHK_A.jpg" r_comp = re.compile(r""" (?P<item_1>\w{1}\_[a-zA-Z]+)\_ # Group 1 (?P<item_2>[a-zA-Z]+)\_\w\. # Group 2 (?P<ext>\w+)$ # Group 3 """, re.VERBOSE) match = re.search(r_comp, test_str)...
2017-12-18T11:48:45.000180
Corrinne
pythondev_help_Corrinne_2017-12-18T11:48:45.000180
1,513,597,725.00018
104,605
pythondev
help
Output..
2017-12-18T11:49:11.000648
Corrinne
pythondev_help_Corrinne_2017-12-18T11:49:11.000648
1,513,597,751.000648
104,606
pythondev
help
`{'item_1': 'Y_BEAUTWD', 'item_2': 'GREYCHK', 'ext': 'jpg'}`
2017-12-18T11:49:15.000477
Corrinne
pythondev_help_Corrinne_2017-12-18T11:49:15.000477
1,513,597,755.000477
104,607
pythondev
help
Alright <@Suellen> I elected to, for the time being, simply store the decoded rows in a list instead of streaming the content
2017-12-18T11:52:37.000197
Myong
pythondev_help_Myong_2017-12-18T11:52:37.000197
1,513,597,957.000197
104,608
pythondev
help
I still think it's a resolvable issue
2017-12-18T11:58:48.000784
Suellen
pythondev_help_Suellen_2017-12-18T11:58:48.000784
1,513,598,328.000784
104,609
pythondev
help
Yeah you're probably correct.
2017-12-18T12:01:08.000128
Myong
pythondev_help_Myong_2017-12-18T12:01:08.000128
1,513,598,468.000128
104,610
pythondev
help
I'm just unsure how to go about doing it. Can I load the iterator into a separate variable then open an output file and write the rows to the csv?
2017-12-18T12:01:49.000601
Myong
pythondev_help_Myong_2017-12-18T12:01:49.000601
1,513,598,509.000601
104,611
pythondev
help
well I guess you can
2017-12-18T12:03:23.000467
Suellen
pythondev_help_Suellen_2017-12-18T12:03:23.000467
1,513,598,603.000467
104,612
pythondev
help
StringIO or something like that, which is a "file", but in memory
2017-12-18T12:03:36.000602
Suellen
pythondev_help_Suellen_2017-12-18T12:03:36.000602
1,513,598,616.000602
104,613
pythondev
help
Found what might be an answer to the issue where someone had to wrap `iter_lines()` with `codecs.iterdecode()`
2017-12-18T12:06:33.000192
Myong
pythondev_help_Myong_2017-12-18T12:06:33.000192
1,513,598,793.000192
104,614
pythondev
help
<@Suellen> it worked with the `codes.iterdecode(r.iter_lines(), 'utf-8')`
2017-12-18T12:08:27.000566
Myong
pythondev_help_Myong_2017-12-18T12:08:27.000566
1,513,598,907.000566
104,615
pythondev
help
<https://stackoverflow.com/a/38677619> second answer.
2017-12-18T12:09:01.000167
Myong
pythondev_help_Myong_2017-12-18T12:09:01.000167
1,513,598,941.000167
104,616
pythondev
help
Got it to work writing the iterator directly to the file
2017-12-18T12:11:32.000347
Myong
pythondev_help_Myong_2017-12-18T12:11:32.000347
1,513,599,092.000347
104,617
pythondev
help
Sweet
2017-12-18T12:11:34.000250
Myong
pythondev_help_Myong_2017-12-18T12:11:34.000250
1,513,599,094.00025
104,618
pythondev
help
That works as well
2017-12-18T12:18:21.000712
Myong
pythondev_help_Myong_2017-12-18T12:18:21.000712
1,513,599,501.000712
104,619
pythondev
help
Guessing the writing to csv takes care of formatting with newlines and delimiters
2017-12-18T12:18:51.000486
Myong
pythondev_help_Myong_2017-12-18T12:18:51.000486
1,513,599,531.000486
104,620
pythondev
help
Hey guys, I wanna learn more about the following topics: Distributed systems, concurrency with coroutines, threading, multiprocessing. I would be glad If you can lead me to some good resources based on your experience.
2017-12-18T12:31:26.000258
Desire
pythondev_help_Desire_2017-12-18T12:31:26.000258
1,513,600,286.000258
104,621
pythondev
help
like, general concepts?
2017-12-18T12:32:09.000071
Suellen
pythondev_help_Suellen_2017-12-18T12:32:09.000071
1,513,600,329.000071
104,622
pythondev
help
check out any of the talks by Raymond Hettinger.
2017-12-18T12:33:30.000667
Johana
pythondev_help_Johana_2017-12-18T12:33:30.000667
1,513,600,410.000667
104,623
pythondev
help
<https://www.youtube.com/watch?v=Bv25Dwe84g0>
2017-12-18T12:33:39.000131
Johana
pythondev_help_Johana_2017-12-18T12:33:39.000131
1,513,600,419.000131
104,624
pythondev
help
type triple tilda before and after code blocks
2017-12-18T12:56:35.000340
Seema
pythondev_help_Seema_2017-12-18T12:56:35.000340
1,513,601,795.00034
104,625
pythondev
help
Okay so trying to write to a csv file but getting `No such file or directory found`... It's not just creating a new csvfile...
2017-12-18T12:56:50.000333
Myong
pythondev_help_Myong_2017-12-18T12:56:50.000333
1,513,601,810.000333
104,626
pythondev
help
You need to allow it to create a new file in the open function: (filename, 'w+')
2017-12-18T12:57:44.000476
Johnie
pythondev_help_Johnie_2017-12-18T12:57:44.000476
1,513,601,864.000476
104,627
pythondev
help
we are getting the following error in our code, not sure how to fix this issue. We are using Flask for our frameworking for web `[error] return compile(expr, filename, mode, PyCF_ONLY_AST)` `[error] TypeError: compile() expected string without null bytes`
2017-12-18T12:58:21.000680
Chong
pythondev_help_Chong_2017-12-18T12:58:21.000680
1,513,601,901.00068
104,628
pythondev
help
:astonished:
2017-12-18T12:58:29.000523
Suellen
pythondev_help_Suellen_2017-12-18T12:58:29.000523
1,513,601,909.000523
104,629
pythondev
help
lol
2017-12-18T12:58:35.000532
Johana
pythondev_help_Johana_2017-12-18T12:58:35.000532
1,513,601,915.000532
104,630
pythondev
help
Might want a snippet lol
2017-12-18T12:58:43.000587
Myong
pythondev_help_Myong_2017-12-18T12:58:43.000587
1,513,601,923.000587
104,631
pythondev
help
:point_up:
2017-12-18T12:58:57.000460
Johana
pythondev_help_Johana_2017-12-18T12:58:57.000460
1,513,601,937.00046
104,632
pythondev
help
<@Chong> Left side of the text input area there is a `+` symbol. If you click it you can upload long pieces of code that are condensed and more easily readible
2017-12-18T12:59:39.000294
Myong
pythondev_help_Myong_2017-12-18T12:59:39.000294
1,513,601,979.000294
104,633
pythondev
help
What `mode` passed to `open`?
2017-12-18T12:59:40.000010
Suellen
pythondev_help_Suellen_2017-12-18T12:59:40.000010
1,513,601,980.00001
104,634
pythondev
help
we talk about sharing code in the intro doc :point_up:
2017-12-18T13:00:11.000517
Johana
pythondev_help_Johana_2017-12-18T13:00:11.000517
1,513,602,011.000517
104,635
pythondev
help
and <@Johana> is the Flask guru. If anyone knows it's him
2017-12-18T13:00:29.000263
Myong
pythondev_help_Myong_2017-12-18T13:00:29.000263
1,513,602,029.000263
104,636
pythondev
help
pfft
2017-12-18T13:00:35.000619
Johana
pythondev_help_Johana_2017-12-18T13:00:35.000619
1,513,602,035.000619
104,637
pythondev
help
i’m ok. your error seems to indicate you have a null for some string value that you should have a value for.
2017-12-18T13:01:14.000288
Johana
pythondev_help_Johana_2017-12-18T13:01:14.000288
1,513,602,074.000288
104,638
pythondev
help
idk what PyCF_ONLY_AST is
2017-12-18T13:01:35.000352
Johana
pythondev_help_Johana_2017-12-18T13:01:35.000352
1,513,602,095.000352
104,639
pythondev
help
I'm sitting here wondering why my csv file wont create itself... help
2017-12-18T13:01:42.000470
Myong
pythondev_help_Myong_2017-12-18T13:01:42.000470
1,513,602,102.00047
104,640
pythondev
help
its part of the AST module
2017-12-18T13:01:45.000120
Chong
pythondev_help_Chong_2017-12-18T13:01:45.000120
1,513,602,105.00012
104,641
pythondev
help
what’s up with your csv?
2017-12-18T13:01:50.000429
Johana
pythondev_help_Johana_2017-12-18T13:01:50.000429
1,513,602,110.000429
104,642
pythondev
help
<@Myong> I'm writing to you in a thread :D
2017-12-18T13:01:54.000159
Suellen
pythondev_help_Suellen_2017-12-18T13:01:54.000159
1,513,602,114.000159
104,643
pythondev
help
Okay cool
2017-12-18T13:01:59.000845
Myong
pythondev_help_Myong_2017-12-18T13:01:59.000845
1,513,602,119.000845
104,644
pythondev
help
are you returning it as a Response?
2017-12-18T13:02:09.000218
Johana
pythondev_help_Johana_2017-12-18T13:02:09.000218
1,513,602,129.000218
104,645
pythondev
help
Yes and a bit more maybe.
2017-12-18T13:02:09.000559
Desire
pythondev_help_Desire_2017-12-18T13:02:09.000559
1,513,602,129.000559
104,646
pythondev
help
<@Johana> many fun things, mike
2017-12-18T13:02:10.000123
Myong
pythondev_help_Myong_2017-12-18T13:02:10.000123
1,513,602,130.000123
104,647
pythondev
help
My response got buried by the code block :joy:
2017-12-18T13:02:17.000068
Johnie
pythondev_help_Johnie_2017-12-18T13:02:17.000068
1,513,602,137.000068
104,648
pythondev
help
i’m actually writing some csv export code now.
2017-12-18T13:02:24.000083
Johana
pythondev_help_Johana_2017-12-18T13:02:24.000083
1,513,602,144.000083
104,649
pythondev
help
Thanks :slightly_smiling_face:
2017-12-18T13:02:25.000095
Desire
pythondev_help_Desire_2017-12-18T13:02:25.000095
1,513,602,145.000095
104,650
pythondev
help
I think it's either mode, or a directory doesn't exist
2017-12-18T13:02:26.000407
Suellen
pythondev_help_Suellen_2017-12-18T13:02:26.000407
1,513,602,146.000407
104,651
pythondev
help
<@Johnie> I tried your solution and no luck
2017-12-18T13:02:49.000696
Myong
pythondev_help_Myong_2017-12-18T13:02:49.000696
1,513,602,169.000696
104,652
pythondev
help
i’m writing a package called box-exporter that uses kennith records that uses plain SQL to take data from the db and upload it to <http://box.com|box.com>
2017-12-18T13:03:09.000125
Johana
pythondev_help_Johana_2017-12-18T13:03:09.000125
1,513,602,189.000125
104,653
pythondev
help
Oh, bummer. I was certain because I have done that more than once...
2017-12-18T13:03:14.000379
Johnie
pythondev_help_Johnie_2017-12-18T13:03:14.000379
1,513,602,194.000379
104,654
pythondev
help
then it's a non-existent output directory I think
2017-12-18T13:03:16.000454
Suellen
pythondev_help_Suellen_2017-12-18T13:03:16.000454
1,513,602,196.000454
104,655
pythondev
help
Even prepending the cwd no luck
2017-12-18T13:03:19.000093
Myong
pythondev_help_Myong_2017-12-18T13:03:19.000093
1,513,602,199.000093
104,656
pythondev
help
It was working before tho
2017-12-18T13:03:33.000308
Myong
pythondev_help_Myong_2017-12-18T13:03:33.000308
1,513,602,213.000308
104,657
pythondev
help
that's the thing
2017-12-18T13:03:35.000306
Myong
pythondev_help_Myong_2017-12-18T13:03:35.000306
1,513,602,215.000306
104,658
pythondev
help
a classic :)
2017-12-18T13:03:44.000324
Suellen
pythondev_help_Suellen_2017-12-18T13:03:44.000324
1,513,602,224.000324
104,659
pythondev
help
are you 100.1% sure?
2017-12-18T13:04:17.000246
Suellen
pythondev_help_Suellen_2017-12-18T13:04:17.000246
1,513,602,257.000246
104,660
pythondev
help
I am testing again
2017-12-18T13:04:22.000448
Myong
pythondev_help_Myong_2017-12-18T13:04:22.000448
1,513,602,262.000448
104,661
pythondev
help
Yeah I think it works I may have made an oopsie
2017-12-18T13:04:53.000703
Myong
pythondev_help_Myong_2017-12-18T13:04:53.000703
1,513,602,293.000703
104,662
pythondev
help
I also recommend the Python Cookbook. It has a whole chapter on this sort of stuff. there is even code to write a task scheduler using a queue, and also one using green threads. it’s pretty awesome and will get you coding something yourself that works.
2017-12-18T13:05:09.000243
Johana
pythondev_help_Johana_2017-12-18T13:05:09.000243
1,513,602,309.000243
104,663
pythondev
help
Yeah I did and I knew it too
2017-12-18T13:07:45.000448
Myong
pythondev_help_Myong_2017-12-18T13:07:45.000448
1,513,602,465.000448
104,664
pythondev
help
I was trying to format the string inside the `with open()` and I feel bad :upside_down_face:
2017-12-18T13:08:40.000522
Myong
pythondev_help_Myong_2017-12-18T13:08:40.000522
1,513,602,520.000522
104,665
pythondev
help
Hey <@Johana> or <@Suellen> tell me if this is not really possible. So I have a request which comes back as a stream using `iter_content`. Can I pass these to a futures `ThreadPoolExecutor.map()`
2017-12-18T13:12:13.000045
Myong
pythondev_help_Myong_2017-12-18T13:12:13.000045
1,513,602,733.000045
104,666
pythondev
help
yea, idk.
2017-12-18T13:12:59.000036
Johana
pythondev_help_Johana_2017-12-18T13:12:59.000036
1,513,602,779.000036
104,667
pythondev
help
i’ll have to look it up in the docs.
2017-12-18T13:13:16.000198
Johana
pythondev_help_Johana_2017-12-18T13:13:16.000198
1,513,602,796.000198
104,668
pythondev
help
Beacause I'm currently doing that and getting `TypeError: a bytes-like object is required, not 'NoneType'`
2017-12-18T13:15:45.000493
Myong
pythondev_help_Myong_2017-12-18T13:15:45.000493
1,513,602,945.000493
104,669
pythondev
help
and you didn’t like using it as a context manager?
2017-12-18T13:16:12.000388
Johana
pythondev_help_Johana_2017-12-18T13:16:12.000388
1,513,602,972.000388
104,670
pythondev
help
hmmm
2017-12-18T13:21:15.000200
Myong
pythondev_help_Myong_2017-12-18T13:21:15.000200
1,513,603,275.0002
104,671
pythondev
help
maybe that's it?
2017-12-18T13:21:17.000698
Myong
pythondev_help_Myong_2017-12-18T13:21:17.000698
1,513,603,277.000698
104,672
pythondev
help
Too many context managers?
2017-12-18T13:21:22.000451
Myong
pythondev_help_Myong_2017-12-18T13:21:22.000451
1,513,603,282.000451
104,673
pythondev
help
`with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor:`
2017-12-18T13:21:55.000181
Myong
pythondev_help_Myong_2017-12-18T13:21:55.000181
1,513,603,315.000181
104,674
pythondev
help
```with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor: content = tqdm_parallel_map(executor, process_request, urls) return content```
2017-12-18T13:22:15.000493
Myong
pythondev_help_Myong_2017-12-18T13:22:15.000493
1,513,603,335.000493
104,675
pythondev
help
```def write_csv(url): file_name = "{}.csv".format(os.path.splitext(os.path.basename(parse.urlparse(url).path))[0]) with open(file_name, 'wb') as f: try: r = requests.get(url, stream=True, verify=False) r.raise_for_status() except requests.HTTPError as err: pr...
2017-12-18T13:22:40.000366
Myong
pythondev_help_Myong_2017-12-18T13:22:40.000366
1,513,603,360.000366
104,676
pythondev
help
Apologies I cannot use snippets
2017-12-18T13:22:49.000468
Myong
pythondev_help_Myong_2017-12-18T13:22:49.000468
1,513,603,369.000468
104,677
pythondev
help
```def tqdm_parallel_map(executor, fn, *iterables): """ Equivalent to executor.map(fn, *iterables), but displays a tqdm-based progress bar. Does not support timeout or chunksize as executor.submit is used internally **kwargs is passed to tqdm. """ futures_list = [] for iterable in iter...
2017-12-18T13:23:17.000234
Myong
pythondev_help_Myong_2017-12-18T13:23:17.000234
1,513,603,397.000234
104,678
pythondev
help
any Sanic experts? What is the best way to send a response with an image (bytes, not static file)?
2017-12-18T13:24:12.000177
Adan
pythondev_help_Adan_2017-12-18T13:24:12.000177
1,513,603,452.000177
104,679
pythondev
help
all i know is that you gotta go fast
2017-12-18T13:25:06.000041
Frieda
pythondev_help_Frieda_2017-12-18T13:25:06.000041
1,513,603,506.000041
104,680
pythondev
help
you might want to post your question in <#C07G5276F|async>
2017-12-18T13:25:32.000700
Ciera
pythondev_help_Ciera_2017-12-18T13:25:32.000700
1,513,603,532.0007
104,681
pythondev
help
good call, thanks
2017-12-18T13:25:50.000253
Adan
pythondev_help_Adan_2017-12-18T13:25:50.000253
1,513,603,550.000253
104,682
pythondev
help
Thank you so much for your wonderful advice. I hope life brings you more good.
2017-12-18T13:26:22.000402
Desire
pythondev_help_Desire_2017-12-18T13:26:22.000402
1,513,603,582.000402
104,683
pythondev
help
n/p. you too!
2017-12-18T13:27:05.000377
Johana
pythondev_help_Johana_2017-12-18T13:27:05.000377
1,513,603,625.000377
104,684
pythondev
help
<@Ciera> were you talking to me?
2017-12-18T13:27:52.000649
Myong
pythondev_help_Myong_2017-12-18T13:27:52.000649
1,513,603,672.000649
104,685
pythondev
help
no it was for alex
2017-12-18T13:28:12.000770
Ciera
pythondev_help_Ciera_2017-12-18T13:28:12.000770
1,513,603,692.00077
104,686
pythondev
help
Ah okay
2017-12-18T13:28:17.000085
Myong
pythondev_help_Myong_2017-12-18T13:28:17.000085
1,513,603,697.000085
104,687
pythondev
help
Okay I got it to work now
2017-12-18T13:42:32.000370
Myong
pythondev_help_Myong_2017-12-18T13:42:32.000370
1,513,604,552.00037
104,688
pythondev
help
Holy cow `parse.parse_qs()` does not like to work
2017-12-18T14:45:51.000245
Myong
pythondev_help_Myong_2017-12-18T14:45:51.000245
1,513,608,351.000245
104,689
pythondev
help
Giving `parse_qs` a url with a single argument and instead of the dict key of the argument being the argument itself, it's the whole url
2017-12-18T14:47:10.000243
Myong
pythondev_help_Myong_2017-12-18T14:47:10.000243
1,513,608,430.000243
104,690
pythondev
help
Hello all! Im writing a quick and dirty program to crop multiple images from a single file and export them all to new files, but I can't remember for the life of me how to set the arguments in the command line, posting a hastebin of my code
2017-12-18T14:54:45.000346
Fabian
pythondev_help_Fabian_2017-12-18T14:54:45.000346
1,513,608,885.000346
104,691
pythondev
help
<https://hastebin.com/tenuxugehe.coffeescript>
2017-12-18T14:55:17.000146
Fabian
pythondev_help_Fabian_2017-12-18T14:55:17.000146
1,513,608,917.000146
104,692
pythondev
help
The arguments should be taken in by useing `sys.argv[n]`
2017-12-18T14:55:33.000581
Myong
pythondev_help_Myong_2017-12-18T14:55:33.000581
1,513,608,933.000581
104,693
pythondev
help
im sorry i mean typed into the command line
2017-12-18T14:55:49.000577
Fabian
pythondev_help_Fabian_2017-12-18T14:55:49.000577
1,513,608,949.000577
104,694
pythondev
help
So you are already using `sys.argv` in your code?
2017-12-18T14:56:13.000111
Myong
pythondev_help_Myong_2017-12-18T14:56:13.000111
1,513,608,973.000111
104,695
pythondev
help
Okay one sec
2017-12-18T14:56:25.000180
Myong
pythondev_help_Myong_2017-12-18T14:56:25.000180
1,513,608,985.00018
104,696
pythondev
help
yeah
2017-12-18T14:56:27.000447
Fabian
pythondev_help_Fabian_2017-12-18T14:56:27.000447
1,513,608,987.000447
104,697
pythondev
help
thank you! I appreciate the help
2017-12-18T14:56:35.000502
Fabian
pythondev_help_Fabian_2017-12-18T14:56:35.000502
1,513,608,995.000502
104,698
pythondev
help
Show a screengrab or type an example of what you normally put in here
2017-12-18T14:57:03.000539
Myong
pythondev_help_Myong_2017-12-18T14:57:03.000539
1,513,609,023.000539
104,699
pythondev
help
For argv[2] you may have to separate the x and y coordinates
2017-12-18T14:57:27.000674
Myong
pythondev_help_Myong_2017-12-18T14:57:27.000674
1,513,609,047.000674
104,700
pythondev
help
or try to input them as a tuple as such `(x, y)`
2017-12-18T14:57:45.000100
Myong
pythondev_help_Myong_2017-12-18T14:57:45.000100
1,513,609,065.0001
104,701
pythondev
help
yeah thats what im trying to do
2017-12-18T14:57:52.000236
Fabian
pythondev_help_Fabian_2017-12-18T14:57:52.000236
1,513,609,072.000236
104,702