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
<@Conchita> my bad, need preserve the order of the dict. convert unordered dict to an ordered dict
2019-04-22T04:23:56.150600
Nena
pythondev_help_Nena_2019-04-22T04:23:56.150600
1,555,907,036.1506
19,821
pythondev
help
Where is the disorder?
2019-04-22T04:24:32.150800
Conchita
pythondev_help_Conchita_2019-04-22T04:24:32.150800
1,555,907,072.1508
19,822
pythondev
help
What is not in order?
2019-04-22T04:24:38.151000
Conchita
pythondev_help_Conchita_2019-04-22T04:24:38.151000
1,555,907,078.151
19,823
pythondev
help
okay, when i create a variable and save this dict, it creates a hash for each key which is totally random and implements a reference to the key and fetched value accordingly. this changes the order of the dict. need to preserve the order
2019-04-22T04:26:35.151200
Nena
pythondev_help_Nena_2019-04-22T04:26:35.151200
1,555,907,195.1512
19,824
pythondev
help
Use `collections.OrderedDict`
2019-04-22T05:03:04.151400
Chester
pythondev_help_Chester_2019-04-22T05:03:04.151400
1,555,909,384.1514
19,825
pythondev
help
There could be lots of heuristics, but a few would be if to ensure your function does ‘only one thing’, and if you find lots of scopes ie high ‘cyclomatic complexity’. I personally like making code read almost like a series of sentences, and each sentence is a well names fn.
2019-04-22T06:09:09.155400
Oretha
pythondev_help_Oretha_2019-04-22T06:09:09.155400
1,555,913,349.1554
19,826
pythondev
help
The object oriented approach would presumably be something like polymorphic cost and a sum fn that iterates over a list of assets to get a total
2019-04-22T06:25:33.156900
Oretha
pythondev_help_Oretha_2019-04-22T06:25:33.156900
1,555,914,333.1569
19,827
pythondev
help
<@Nena> You need ``` import collections collections.OrderedDict(dict) ```
2019-04-22T06:47:14.157900
Valeri
pythondev_help_Valeri_2019-04-22T06:47:14.157900
1,555,915,634.1579
19,828
pythondev
help
Anyone out there using VS Code? I am curious about experienced people’s dev workflow. In particular in statically typed I am used to jumping into definitions left right and center and seeing how packages/modules are put together, what fns and objects available etc. I don’t want to look up on the web but have everything self service within the editor. What do people do in practice?
2019-04-22T06:53:00.161900
Oretha
pythondev_help_Oretha_2019-04-22T06:53:00.161900
1,555,915,980.1619
19,829
pythondev
help
Nice, taking notes
2019-04-22T07:05:42.162000
Conchita
pythondev_help_Conchita_2019-04-22T07:05:42.162000
1,555,916,742.162
19,830
pythondev
help
<@Oretha> do you have the python vscode package installed?
2019-04-22T07:09:40.162500
Hiroko
pythondev_help_Hiroko_2019-04-22T07:09:40.162500
1,555,916,980.1625
19,831
pythondev
help
note that there’s a limit to what can be done compared with java and c# because while python is strongly typed, it is not static so there’s lots of things that will only be available at runtime
2019-04-22T07:10:30.163500
Hiroko
pythondev_help_Hiroko_2019-04-22T07:10:30.163500
1,555,917,030.1635
19,832
pythondev
help
Yep, I’ve got myself set up and can step into a certain amount of stuff but it is fairy limited. Understandably some stuff only at runtime, but I am curious to know best practice. Eg if I have a dictionary keys() in python3 that gives a View. Id like to explore what I can do with it without resorting to the web. For productivity reasons I am guessing people use a repl in parallel or other ways of exploring code - after all the code is the documentation. So am curious how people work in practice (and some IDE eg Spyder may offer more out the box in this regard).
2019-04-22T07:30:53.169900
Oretha
pythondev_help_Oretha_2019-04-22T07:30:53.169900
1,555,918,253.1699
19,833
pythondev
help
Is your concern about needing to go to the web becauase of access issues (like on a train or somewhere without internet) or just because you prefer not to break your flow and say in the editor?
2019-04-22T07:33:02.171000
Karoline
pythondev_help_Karoline_2019-04-22T07:33:02.171000
1,555,918,382.171
19,834
pythondev
help
The second. I prefer going to the web if I need something in depth, but don’t want to do that to understand how a module or class are put together. I want to avoid breaking flow and feel more productive if I can do all in one place. Eg for the above understanding views by looking at code, autocomplete options, unit test code etc.
2019-04-22T07:45:43.175500
Oretha
pythondev_help_Oretha_2019-04-22T07:45:43.175500
1,555,919,143.1755
19,835
pythondev
help
makes sense. for me - it's a combination of the method completion, exploration via the REPL, and yeah the web and/or Dash (and offline docs tool)
2019-04-22T07:47:12.176500
Karoline
pythondev_help_Karoline_2019-04-22T07:47:12.176500
1,555,919,232.1765
19,836
pythondev
help
is the standard method completion not working for you?
2019-04-22T07:48:01.177400
Karoline
pythondev_help_Karoline_2019-04-22T07:48:01.177400
1,555,919,281.1774
19,837
pythondev
help
It does some of the time, but eg at runtime I don’t have additional options I know how to use ( eg i have a deep stack, an object, and want to understand that object in more detail)
2019-04-22T07:49:39.179600
Oretha
pythondev_help_Oretha_2019-04-22T07:49:39.179600
1,555,919,379.1796
19,838
pythondev
help
so it's more a question then of the runtime interaction of the code and the objects used?
2019-04-22T07:50:47.181200
Karoline
pythondev_help_Karoline_2019-04-22T07:50:47.181200
1,555,919,447.1812
19,839
pythondev
help
Ultimately I just want to know what people find works for them - I know it may not match what you get in eg a good scala IDE.
2019-04-22T07:50:48.181300
Oretha
pythondev_help_Oretha_2019-04-22T07:50:48.181300
1,555,919,448.1813
19,840
pythondev
help
Probably yes, that would be one pinch point. And how best to explore core libraries.
2019-04-22T07:51:51.182700
Oretha
pythondev_help_Oretha_2019-04-22T07:51:51.182700
1,555,919,511.1827
19,841
pythondev
help
For that sort of thing I usually find myself using the debugger
2019-04-22T07:52:22.183100
Karoline
pythondev_help_Karoline_2019-04-22T07:52:22.183100
1,555,919,542.1831
19,842
pythondev
help
Makes sense. Not at a screen right now but maybe I haven’t made enough of it. If anyone else has commentary on their most productive workflow (web-light) then I am interested to hear the variations!
2019-04-22T07:57:35.185200
Oretha
pythondev_help_Oretha_2019-04-22T07:57:35.185200
1,555,919,855.1852
19,843
pythondev
help
This message was deleted.
2019-04-22T08:10:50.190400
Alejandrina
pythondev_help_Alejandrina_2019-04-22T08:10:50.190400
1,555,920,650.1904
19,844
pythondev
help
Please don't cross-post. I'll remove this message as <#C0LMFRMB5|django> is probably the best place for this.
2019-04-22T08:26:49.190500
Karoline
pythondev_help_Karoline_2019-04-22T08:26:49.190500
1,555,921,609.1905
19,845
pythondev
help
Ouch - blame my slack newbiness - just realised I should have searched channels and posted in editors or similar. I best lurk quietly for a bit!
2019-04-22T08:42:27.192300
Oretha
pythondev_help_Oretha_2019-04-22T08:42:27.192300
1,555,922,547.1923
19,846
pythondev
help
nah you are fine - it's really not a huge issue to post in the wrong channel, what we discourage is posting the same thing in multiple channels especially in succession
2019-04-22T08:44:56.193100
Karoline
pythondev_help_Karoline_2019-04-22T08:44:56.193100
1,555,922,696.1931
19,847
pythondev
help
mostly just to avoid multiple parallel conversations starting
2019-04-22T08:45:26.193400
Karoline
pythondev_help_Karoline_2019-04-22T08:45:26.193400
1,555,922,726.1934
19,848
pythondev
help
is it possible to use a Docker container (Linux) on windows and the win32com library? I need to download some mail from outlook
2019-04-22T08:47:42.194000
Alvina
pythondev_help_Alvina_2019-04-22T08:47:42.194000
1,555,922,862.194
19,849
pythondev
help
there are some .NET things you can get running under Linux
2019-04-22T08:48:52.194700
Karoline
pythondev_help_Karoline_2019-04-22T08:48:52.194700
1,555,922,932.1947
19,850
pythondev
help
is it a requirement that the container be linux? there are windows containers as well.
2019-04-22T08:49:14.195200
Karoline
pythondev_help_Karoline_2019-04-22T08:49:14.195200
1,555,922,954.1952
19,851
pythondev
help
hm, I have a lot of linux containers running
2019-04-22T08:51:02.195500
Alvina
pythondev_help_Alvina_2019-04-22T08:51:02.195500
1,555,923,062.1955
19,852
pythondev
help
I have not messed with a windows container at all
2019-04-22T08:51:10.195800
Alvina
pythondev_help_Alvina_2019-04-22T08:51:10.195800
1,555,923,070.1958
19,853
pythondev
help
I've never personally used them, but it's potentially an option - although it's my understanding you can't mix the two (Linux and Windows) containers on the same machine, and the Windows containers only work on Windows as you'd expect.
2019-04-22T08:53:06.197400
Karoline
pythondev_help_Karoline_2019-04-22T08:53:06.197400
1,555,923,186.1974
19,854
pythondev
help
you might have more luck asking in <#C297RQP0X|os_linux> or <#C5XHHMXHB|os_windows> though - for now though I'd just ignore the docker aspect of it. the key question is whether you can use win32com on linux.
2019-04-22T08:54:12.198300
Karoline
pythondev_help_Karoline_2019-04-22T08:54:12.198300
1,555,923,252.1983
19,855
pythondev
help
ah right, thanks
2019-04-22T09:06:18.198500
Alvina
pythondev_help_Alvina_2019-04-22T09:06:18.198500
1,555,923,978.1985
19,856
pythondev
help
Is there anyway to send stdout,stderr from subprocess.Popen or subprocess.call to my logger from standard logging module?
2019-04-22T10:34:35.200100
Kam
pythondev_help_Kam_2019-04-22T10:34:35.200100
1,555,929,275.2001
19,857
pythondev
help
i have this function
2019-04-22T10:34:54.200300
Kam
pythondev_help_Kam_2019-04-22T10:34:54.200300
1,555,929,294.2003
19,858
pythondev
help
None
2019-04-22T10:35:20.200400
Kam
pythondev_help_Kam_2019-04-22T10:35:20.200400
1,555,929,320.2004
19,859
pythondev
help
communicate doesn't seem to work.
2019-04-22T10:35:47.201100
Kam
pythondev_help_Kam_2019-04-22T10:35:47.201100
1,555,929,347.2011
19,860
pythondev
help
You might want to explain why it does not work
2019-04-22T10:59:20.201500
Jonas
pythondev_help_Jonas_2019-04-22T10:59:20.201500
1,555,930,760.2015
19,861
pythondev
help
`<https://docs.python.org/3.7/library/subprocess.html#subprocess.run>` is a better method to use
2019-04-22T10:59:30.201700
Jonas
pythondev_help_Jonas_2019-04-22T10:59:30.201700
1,555,930,770.2017
19,862
pythondev
help
`output = subprocess.run('lftp', '...', capture_output=True)`
2019-04-22T10:59:54.202400
Jonas
pythondev_help_Jonas_2019-04-22T10:59:54.202400
1,555,930,794.2024
19,863
pythondev
help
then just `output.stderr` and `output.stdout`
2019-04-22T11:00:09.202800
Jonas
pythondev_help_Jonas_2019-04-22T11:00:09.202800
1,555,930,809.2028
19,864
pythondev
help
shove that into the logger?
2019-04-22T11:00:24.203200
Kam
pythondev_help_Kam_2019-04-22T11:00:24.203200
1,555,930,824.2032
19,865
pythondev
help
sure
2019-04-22T11:00:27.203400
Jonas
pythondev_help_Jonas_2019-04-22T11:00:27.203400
1,555,930,827.2034
19,866
pythondev
help
Let me try, thank you.
2019-04-22T11:01:13.204300
Kam
pythondev_help_Kam_2019-04-22T11:01:13.204300
1,555,930,873.2043
19,867
pythondev
help
oh is it also available for 3.6?
2019-04-22T11:01:53.205100
Kam
pythondev_help_Kam_2019-04-22T11:01:53.205100
1,555,930,913.2051
19,868
pythondev
help
actually it just uses kwargs['stdout'] = PIPE kwargs['stderr'] = PIPE in src code
2019-04-22T11:06:20.205900
Kam
pythondev_help_Kam_2019-04-22T11:06:20.205900
1,555,931,180.2059
19,869
pythondev
help
so i can just do stdout=PIPE, stderr=PIPE
2019-04-22T11:06:37.206200
Kam
pythondev_help_Kam_2019-04-22T11:06:37.206200
1,555,931,197.2062
19,870
pythondev
help
Morning, all. I don't think I'm setting this class up correctly. Could guide me through what I'm missing?
2019-04-22T11:12:08.206800
Milly
pythondev_help_Milly_2019-04-22T11:12:08.206800
1,555,931,528.2068
19,871
pythondev
help
that `pass` will confuse things
2019-04-22T11:12:54.207300
Clemmie
pythondev_help_Clemmie_2019-04-22T11:12:54.207300
1,555,931,574.2073
19,872
pythondev
help
also `Insulin` is a string and needs quotes
2019-04-22T11:13:20.207700
Clemmie
pythondev_help_Clemmie_2019-04-22T11:13:20.207700
1,555,931,600.2077
19,873
pythondev
help
and `pat_1=Patient` (notice the uppercase P)
2019-04-22T11:13:49.208500
Clemmie
pythondev_help_Clemmie_2019-04-22T11:13:49.208500
1,555,931,629.2085
19,874
pythondev
help
oh!! I didn't know capitalization matters:woman-facepalming: okay. thank you <@Clemmie>
2019-04-22T11:14:43.209300
Milly
pythondev_help_Milly_2019-04-22T11:14:43.209300
1,555,931,683.2093
19,875
pythondev
help
:thumbsup:
2019-04-22T11:14:56.209500
Clemmie
pythondev_help_Clemmie_2019-04-22T11:14:56.209500
1,555,931,696.2095
19,876
pythondev
help
<@Clemmie> what does error mean? "this constructor takes no arguments" do you know?
2019-04-22T11:16:42.210400
Milly
pythondev_help_Milly_2019-04-22T11:16:42.210400
1,555,931,802.2104
19,877
pythondev
help
this error*
2019-04-22T11:16:54.210600
Milly
pythondev_help_Milly_2019-04-22T11:16:54.210600
1,555,931,814.2106
19,878
pythondev
help
It means you are passing arguments that a constructor doesn’t use. But in your case that is a red herring - the `pass` is mixing things up
2019-04-22T11:17:41.211300
Clemmie
pythondev_help_Clemmie_2019-04-22T11:17:41.211300
1,555,931,861.2113
19,879
pythondev
help
get rid of it
2019-04-22T11:17:45.211500
Clemmie
pythondev_help_Clemmie_2019-04-22T11:17:45.211500
1,555,931,865.2115
19,880
pythondev
help
oh, I removed it like you suggested, but i'm still getting that error.
2019-04-22T11:18:26.212000
Milly
pythondev_help_Milly_2019-04-22T11:18:26.212000
1,555,931,906.212
19,881
pythondev
help
show the whole code and the error
2019-04-22T11:18:42.212300
Clemmie
pythondev_help_Clemmie_2019-04-22T11:18:42.212300
1,555,931,922.2123
19,882
pythondev
help
never mind - `__init__` requires 2 underscores before and after - you only have one
2019-04-22T11:19:02.212700
Clemmie
pythondev_help_Clemmie_2019-04-22T11:19:02.212700
1,555,931,942.2127
19,883
pythondev
help
Error: pat_1=patient('NatalieGarcia','Dr.Bryson', 'Insulin', 30) TypeError: this constructor takes no arguments
2019-04-22T11:19:29.213300
Milly
pythondev_help_Milly_2019-04-22T11:19:29.213300
1,555,931,969.2133
19,884
pythondev
help
<@Milly> Mind the P in patience
2019-04-22T11:19:33.213700
Valeri
pythondev_help_Valeri_2019-04-22T11:19:33.213700
1,555,931,973.2137
19,885
pythondev
help
It should be uppercase
2019-04-22T11:19:40.213900
Valeri
pythondev_help_Valeri_2019-04-22T11:19:40.213900
1,555,931,980.2139
19,886
pythondev
help
Oh the class name is always captial?
2019-04-22T11:19:56.214200
Milly
pythondev_help_Milly_2019-04-22T11:19:56.214200
1,555,931,996.2142
19,887
pythondev
help
by convention, yes
2019-04-22T11:20:06.214500
Clemmie
pythondev_help_Clemmie_2019-04-22T11:20:06.214500
1,555,932,006.2145
19,888
pythondev
help
Also
2019-04-22T11:20:12.215000
Valeri
pythondev_help_Valeri_2019-04-22T11:20:12.215000
1,555,932,012.215
19,889
pythondev
help
Oh. Let me fix that.
2019-04-22T11:20:19.215400
Milly
pythondev_help_Milly_2019-04-22T11:20:19.215400
1,555,932,019.2154
19,890
pythondev
help
It's __init__
2019-04-22T11:20:19.215500
Valeri
pythondev_help_Valeri_2019-04-22T11:20:19.215500
1,555,932,019.2155
19,891
pythondev
help
Double underscores
2019-04-22T11:20:27.215800
Valeri
pythondev_help_Valeri_2019-04-22T11:20:27.215800
1,555,932,027.2158
19,892
pythondev
help
You need to fix that too
2019-04-22T11:20:49.216000
Valeri
pythondev_help_Valeri_2019-04-22T11:20:49.216000
1,555,932,049.216
19,893
pythondev
help
are you coming from another programming language <@Milly>?
2019-04-22T11:22:39.216900
Clemmie
pythondev_help_Clemmie_2019-04-22T11:22:39.216900
1,555,932,159.2169
19,894
pythondev
help
Ah okay thank you <@Clemmie> &amp; <@Valeri>! I'm really just taking programming up for the first time now. I have dabbled in HTML but I don't consider it my first language. I'm just learning python now and its been running me around in circles.
2019-04-22T11:24:21.218700
Milly
pythondev_help_Milly_2019-04-22T11:24:21.218700
1,555,932,261.2187
19,895
pythondev
help
I don't think I have a good foundation, but I'm trying lol
2019-04-22T11:24:43.219100
Milly
pythondev_help_Milly_2019-04-22T11:24:43.219100
1,555,932,283.2191
19,896
pythondev
help
Keep trying :rareparrot:
2019-04-22T11:25:16.219500
Valeri
pythondev_help_Valeri_2019-04-22T11:25:16.219500
1,555,932,316.2195
19,897
pythondev
help
Haha, definitely. <@Valeri>
2019-04-22T11:26:02.220100
Milly
pythondev_help_Milly_2019-04-22T11:26:02.220100
1,555,932,362.2201
19,898
pythondev
help
None
2019-04-22T11:27:47.220300
Kam
pythondev_help_Kam_2019-04-22T11:27:47.220300
1,555,932,467.2203
19,899
pythondev
help
if i use this
2019-04-22T11:27:54.220700
Kam
pythondev_help_Kam_2019-04-22T11:27:54.220700
1,555,932,474.2207
19,900
pythondev
help
it seem subprocess adds '\n' to the argument since i get and error for source path
2019-04-22T11:28:39.221600
Kam
pythondev_help_Kam_2019-04-22T11:28:39.221600
1,555,932,519.2216
19,901
pythondev
help
`b'mirror: Access failed: No such file (/feeds/cts/2019/04/19)\n'`
2019-04-22T11:28:59.221800
Kam
pythondev_help_Kam_2019-04-22T11:28:59.221800
1,555,932,539.2218
19,902
pythondev
help
where as
2019-04-22T11:29:13.222100
Kam
pythondev_help_Kam_2019-04-22T11:29:13.222100
1,555,932,553.2221
19,903
pythondev
help
```download_cmd = subprocess.call(['lftp', f'sftp://{ftp_instance["user"]}:{ftp_instance["password"]}@{ftp_instance["host"]}', \ '-e', f'mirror -P 8 {ftp_instance["source"]} {ftp_instance["target"]}; bye])```
2019-04-22T11:29:59.222600
Kam
pythondev_help_Kam_2019-04-22T11:29:59.222600
1,555,932,599.2226
19,904
pythondev
help
works
2019-04-22T11:30:02.222800
Kam
pythondev_help_Kam_2019-04-22T11:30:02.222800
1,555,932,602.2228
19,905
pythondev
help
you have an unterminated quote somewhere
2019-04-22T11:31:05.223300
Karoline
pythondev_help_Karoline_2019-04-22T11:31:05.223300
1,555,932,665.2233
19,906
pythondev
help
Okay, looking.
2019-04-22T11:31:37.223700
Kam
pythondev_help_Kam_2019-04-22T11:31:37.223700
1,555,932,697.2237
19,907
pythondev
help
the `\` isn't needed - don't think that's it but remove it?
2019-04-22T11:31:42.223900
Karoline
pythondev_help_Karoline_2019-04-22T11:31:42.223900
1,555,932,702.2239
19,908
pythondev
help
my bad, never mind the question.
2019-04-22T11:34:12.224200
Kam
pythondev_help_Kam_2019-04-22T11:34:12.224200
1,555,932,852.2242
19,909
pythondev
help
there is no data for that date.
2019-04-22T11:34:19.224500
Kam
pythondev_help_Kam_2019-04-22T11:34:19.224500
1,555,932,859.2245
19,910
pythondev
help
I ran subprocess.run with date argument which doesn't have data in ftp source.
2019-04-22T11:34:51.225100
Kam
pythondev_help_Kam_2019-04-22T11:34:51.225100
1,555,932,891.2251
19,911
pythondev
help
Sorry for confusion.
2019-04-22T11:35:06.225300
Kam
pythondev_help_Kam_2019-04-22T11:35:06.225300
1,555,932,906.2253
19,912
pythondev
help
Also guys i get this output in the logger
2019-04-22T11:40:31.225700
Kam
pythondev_help_Kam_2019-04-22T11:40:31.225700
1,555,933,231.2257
19,913
pythondev
help
```INFO b'Total: 1 directory, 53 files, 0 symlinks\nNew: 53 files, 0 symlinks\n4642393333 bytes transferred in 715 seconds (6.19M/s)\n' 2019-04-22 15:39:51,508 ERROR b''```
2019-04-22T11:40:37.225900
Kam
pythondev_help_Kam_2019-04-22T11:40:37.225900
1,555,933,237.2259
19,914
pythondev
help
is there a way to format it proper way with newlines and all?
2019-04-22T11:41:13.226500
Kam
pythondev_help_Kam_2019-04-22T11:41:13.226500
1,555,933,273.2265
19,915
pythondev
help
try slapping `.decode("utf-8")` on the end of your string
2019-04-22T11:48:13.227200
Claudine
pythondev_help_Claudine_2019-04-22T11:48:13.227200
1,555,933,693.2272
19,916
pythondev
help
You get bytes back. There is an option to read as text
2019-04-22T11:48:21.227600
Jonas
pythondev_help_Jonas_2019-04-22T11:48:21.227600
1,555,933,701.2276
19,917
pythondev
help
it's a byte string, you want to convert it to a regular string
2019-04-22T11:48:30.228100
Claudine
pythondev_help_Claudine_2019-04-22T11:48:30.228100
1,555,933,710.2281
19,918
pythondev
help
Or you can decode it manually
2019-04-22T11:48:31.228200
Jonas
pythondev_help_Jonas_2019-04-22T11:48:31.228200
1,555,933,711.2282
19,919
pythondev
help
yeah there is
2019-04-22T11:52:49.228400
Kam
pythondev_help_Kam_2019-04-22T11:52:49.228400
1,555,933,969.2284
19,920