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
add an __init__.py file
2019-04-26T06:06:44.105000
Leida
pythondev_help_Leida_2019-04-26T06:06:44.105000
1,556,258,804.105
20,521
pythondev
help
into `Faker` that is
2019-04-26T06:08:03.105400
Leida
pythondev_help_Leida_2019-04-26T06:08:03.105400
1,556,258,883.1054
20,522
pythondev
help
how to pass variable to an .exe py function?
2019-04-26T06:49:17.106100
Arturo
pythondev_help_Arturo_2019-04-26T06:49:17.106100
1,556,261,357.1061
20,523
pythondev
help
for example is this ok; ``` import sys def join_and_lower_mml_cmd(mml_cmd): try: split_mml = mml_cmd.split() joined_mml = ''.join(split_mml).lower() return joined_mml except Exception as e: print(str(e)) file = open('error.txt', w) file.write(str(e)) if __name__ == "__main__": if len(sys.argv)>1: join_and_lower_mml_cmd(sys.argv[1]) ```
2019-04-26T06:53:23.106400
Arturo
pythondev_help_Arturo_2019-04-26T06:53:23.106400
1,556,261,603.1064
20,524
pythondev
help
em sort of
2019-04-26T07:34:37.106900
Leida
pythondev_help_Leida_2019-04-26T07:34:37.106900
1,556,264,077.1069
20,525
pythondev
help
actually, seems fine
2019-04-26T07:37:59.108300
Leida
pythondev_help_Leida_2019-04-26T07:37:59.108300
1,556,264,279.1083
20,526
pythondev
help
got any errors with it?
2019-04-26T07:38:04.108500
Leida
pythondev_help_Leida_2019-04-26T07:38:04.108500
1,556,264,284.1085
20,527
pythondev
help
only the split is odd
2019-04-26T07:38:56.108800
Leida
pythondev_help_Leida_2019-04-26T07:38:56.108800
1,556,264,336.1088
20,528
pythondev
help
`split()` splits on whitespace on default and args are also split by whitespace, so i dont see how you can further split `sys.argv[1]`
2019-04-26T07:39:46.109700
Leida
pythondev_help_Leida_2019-04-26T07:39:46.109700
1,556,264,386.1097
20,529
pythondev
help
and then rejoining it again?
2019-04-26T07:40:18.110300
Leida
pythondev_help_Leida_2019-04-26T07:40:18.110300
1,556,264,418.1103
20,530
pythondev
help
yeah its really annoying
2019-04-26T07:40:28.110600
Arturo
pythondev_help_Arturo_2019-04-26T07:40:28.110600
1,556,264,428.1106
20,531
pythondev
help
what is the goal?
2019-04-26T07:40:33.111000
Leida
pythondev_help_Leida_2019-04-26T07:40:33.111000
1,556,264,433.111
20,532
pythondev
help
we have to use this in built tool at our work (don't get me started on this will save that for job advice :angry: ) and it does not have `split` or `join` methods. So we are able to create an executable python script and then run that
2019-04-26T07:41:43.112800
Arturo
pythondev_help_Arturo_2019-04-26T07:41:43.112800
1,556,264,503.1128
20,533
pythondev
help
I pass a string like so; ``` a = 'LST ABC' ``` and want to get back; ``` result = 'lstabc' ```
2019-04-26T07:42:31.114000
Arturo
pythondev_help_Arturo_2019-04-26T07:42:31.114000
1,556,264,551.114
20,534
pythondev
help
ok but right now you return `lst`
2019-04-26T07:42:48.114500
Leida
pythondev_help_Leida_2019-04-26T07:42:48.114500
1,556,264,568.1145
20,535
pythondev
help
ah ok
2019-04-26T07:42:55.115000
Arturo
pythondev_help_Arturo_2019-04-26T07:42:55.115000
1,556,264,575.115
20,536
pythondev
help
argv[1] = LST and argv[2]=ABC
2019-04-26T07:43:09.115300
Leida
pythondev_help_Leida_2019-04-26T07:43:09.115300
1,556,264,589.1153
20,537
pythondev
help
they are already split into argument variables list
2019-04-26T07:43:31.115900
Leida
pythondev_help_Leida_2019-04-26T07:43:31.115900
1,556,264,611.1159
20,538
pythondev
help
are there always 2 parts to add together?
2019-04-26T07:43:51.116600
Leida
pythondev_help_Leida_2019-04-26T07:43:51.116600
1,556,264,631.1166
20,539
pythondev
help
also I changed it to instead of returning the variable, to save to a text file but didn't seem to work; ``` import sys def join_and_lower_mml_cmd(mml_cmd): try: split_mml = mml_cmd.split() joined_mml = ''.join(split_mml).lower() file = open("D:\file_name.txt", "w") file.write(joined_mml) except Exception as e: print(str(e)) file = open("error.txt", "w") file.write(str(e)) if __name__ == "__main__": if len(sys.argv)>1: join_and_lower_mml_cmd(sys.argv[1]) ```
2019-04-26T07:44:08.117000
Arturo
pythondev_help_Arturo_2019-04-26T07:44:08.117000
1,556,264,648.117
20,540
pythondev
help
yes always two parts
2019-04-26T07:44:16.117200
Arturo
pythondev_help_Arturo_2019-04-26T07:44:16.117200
1,556,264,656.1172
20,541
pythondev
help
the joined_mml is saving only the first part right?
2019-04-26T07:44:41.117600
Leida
pythondev_help_Leida_2019-04-26T07:44:41.117600
1,556,264,681.1176
20,542
pythondev
help
I am not seeing anything saved
2019-04-26T07:44:52.117900
Arturo
pythondev_help_Arturo_2019-04-26T07:44:52.117900
1,556,264,692.1179
20,543
pythondev
help
don't forget I am running the exe from this tool that I have to use which is really bad
2019-04-26T07:45:16.118500
Arturo
pythondev_help_Arturo_2019-04-26T07:45:16.118500
1,556,264,716.1185
20,544
pythondev
help
so could be something to do with this
2019-04-26T07:45:25.118800
Arturo
pythondev_help_Arturo_2019-04-26T07:45:25.118800
1,556,264,725.1188
20,545
pythondev
help
best practisse with writing to files is to use the `with` context manager, you arent closing the file right now
2019-04-26T07:46:24.119600
Leida
pythondev_help_Leida_2019-04-26T07:46:24.119600
1,556,264,784.1196
20,546
pythondev
help
cool will change
2019-04-26T07:47:34.119800
Arturo
pythondev_help_Arturo_2019-04-26T07:47:34.119800
1,556,264,854.1198
20,547
pythondev
help
you could give your function `sys.argv[1:]`
2019-04-26T07:53:46.120700
Leida
pythondev_help_Leida_2019-04-26T07:53:46.120700
1,556,265,226.1207
20,548
pythondev
help
that is - everything except the what is at `argv[0]` which is the script name
2019-04-26T07:54:40.121400
Leida
pythondev_help_Leida_2019-04-26T07:54:40.121400
1,556,265,280.1214
20,549
pythondev
help
and then you can do `joined_mml = ''.join(mml_cmd).lower()`
2019-04-26T07:55:16.122200
Leida
pythondev_help_Leida_2019-04-26T07:55:16.122200
1,556,265,316.1222
20,550
pythondev
help
this joins all the arguments that you gave the script and puts them lower case
2019-04-26T07:55:43.122600
Leida
pythondev_help_Leida_2019-04-26T07:55:43.122600
1,556,265,343.1226
20,551
pythondev
help
the split is not needed
2019-04-26T07:56:02.122900
Leida
pythondev_help_Leida_2019-04-26T07:56:02.122900
1,556,265,362.1229
20,552
pythondev
help
``` with open("path_to_file", "w") as out_file: out_file.write(joined_mml)```
2019-04-26T07:58:46.123700
Leida
pythondev_help_Leida_2019-04-26T07:58:46.123700
1,556,265,526.1237
20,553
pythondev
help
this opens the file and closes it down after you are done with it
2019-04-26T07:59:56.124400
Leida
pythondev_help_Leida_2019-04-26T07:59:56.124400
1,556,265,596.1244
20,554
pythondev
help
is there any way to parse `build.gradle` file using python?
2019-04-26T08:15:34.125000
Peg
pythondev_help_Peg_2019-04-26T08:15:34.125000
1,556,266,534.125
20,555
pythondev
help
you wish to convert it to executable python or just want to read the internals?
2019-04-26T08:19:09.126200
Leida
pythondev_help_Leida_2019-04-26T08:19:09.126200
1,556,266,749.1262
20,556
pythondev
help
it seems to be text encoded so it works as any text file
2019-04-26T08:19:27.126600
Leida
pythondev_help_Leida_2019-04-26T08:19:27.126600
1,556,266,767.1266
20,557
pythondev
help
I need to read the file and modify some part of it using python
2019-04-26T08:22:12.127200
Peg
pythondev_help_Peg_2019-04-26T08:22:12.127200
1,556,266,932.1272
20,558
pythondev
help
you will have to figure out by what you locate the data you wish to change, be it whitespace or keywords
2019-04-26T08:51:05.127900
Leida
pythondev_help_Leida_2019-04-26T08:51:05.127900
1,556,268,665.1279
20,559
pythondev
help
Hello everyone, is there a way i can strip dot('.') from a float for instance 3.0.17 output as 3017. thanks in advance
2019-04-26T09:31:42.129500
Bao
pythondev_help_Bao_2019-04-26T09:31:42.129500
1,556,271,102.1295
20,560
pythondev
help
cast to a string and replace `.` with ` `
2019-04-26T09:34:05.129800
Claudine
pythondev_help_Claudine_2019-04-26T09:34:05.129800
1,556,271,245.1298
20,561
pythondev
help
I'm not sure `3.0.17` can be a float anyways, it's probably already a string
2019-04-26T09:35:20.131100
Jimmy
pythondev_help_Jimmy_2019-04-26T09:35:20.131100
1,556,271,320.1311
20,562
pythondev
help
that's is a good point
2019-04-26T09:35:28.131500
Claudine
pythondev_help_Claudine_2019-04-26T09:35:28.131500
1,556,271,328.1315
20,563
pythondev
help
it is an invalid float
2019-04-26T09:36:10.132400
Claudine
pythondev_help_Claudine_2019-04-26T09:36:10.132400
1,556,271,370.1324
20,564
pythondev
help
it's gotta be a string
2019-04-26T09:36:13.132600
Claudine
pythondev_help_Claudine_2019-04-26T09:36:13.132600
1,556,271,373.1326
20,565
pythondev
help
``` >>> foo = 3.0.17 File "<stdin>", line 1 foo = 3.0.17 ^ SyntaxError: invalid syntax >>> foo = '3.0.17' >>> foo '3.0.17' >>> float(foo) Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: invalid literal for float(): 3.0.17 ```
2019-04-26T09:36:22.133000
Claudine
pythondev_help_Claudine_2019-04-26T09:36:22.133000
1,556,271,382.133
20,566
pythondev
help
<@Claudine> I did cast to a string and replace . with `` which worked, i was think of any other way
2019-04-26T09:36:28.133100
Bao
pythondev_help_Bao_2019-04-26T09:36:28.133100
1,556,271,388.1331
20,567
pythondev
help
i think that's probably the best way
2019-04-26T09:37:20.133500
Claudine
pythondev_help_Claudine_2019-04-26T09:37:20.133500
1,556,271,440.1335
20,568
pythondev
help
you could also do it with :pray: regex :pray: but that's a bit overkill
2019-04-26T09:37:42.134000
Claudine
pythondev_help_Claudine_2019-04-26T09:37:42.134000
1,556,271,462.134
20,569
pythondev
help
haha, thanks <@Jenee> <@Jimmy> for response guys
2019-04-26T09:38:26.134600
Bao
pythondev_help_Bao_2019-04-26T09:38:26.134600
1,556,271,506.1346
20,570
pythondev
help
sorry for late reply this worked, but `sys.argv[1]` passed the whole string 'LST ABC' so I did need the original `split()` but thanks for the help, think I need to read up a bit more about sys args :taco: <@Leida>
2019-04-26T09:48:30.134800
Arturo
pythondev_help_Arturo_2019-04-26T09:48:30.134800
1,556,272,110.1348
20,571
pythondev
help
:pacman:
2019-04-26T10:08:17.135000
Leida
pythondev_help_Leida_2019-04-26T10:08:17.135000
1,556,273,297.135
20,572
pythondev
help
Hi I need some help with the following, I just cant seem to work this out. I need to use `path.join` to build the path I want. ``` base_name = os.path.dirname(__file__) input_file = apache.log output_filename = os.path.join(base_name,"test_",input_file) ``` But I get `/Users/test/Dropbox/Python/apache.log` instead of `/Users/test/Dropbox/Python/test_/apache.log`
2019-04-26T11:59:00.137800
Beata
pythondev_help_Beata_2019-04-26T11:59:00.137800
1,556,279,940.1378
20,573
pythondev
help
“test_/“ maybe?
2019-04-26T12:11:37.138500
Jonas
pythondev_help_Jonas_2019-04-26T12:11:37.138500
1,556,280,697.1385
20,574
pythondev
help
<@Beata> Can you copy and paste the exact code you're running? What you've posted shouldn't work since you don't have quotes around `apache.log`, so I'm suspecting there's a mismatch between what we're seeing and what is being executed.
2019-04-26T12:43:58.140500
Sasha
pythondev_help_Sasha_2019-04-26T12:43:58.140500
1,556,282,638.1405
20,575
pythondev
help
I found what the issue was, actually the input_file was wrong. It was a full path starting with /
2019-04-26T12:44:40.141200
Beata
pythondev_help_Beata_2019-04-26T12:44:40.141200
1,556,282,680.1412
20,576
pythondev
help
Once I removed it worked.
2019-04-26T12:44:58.141800
Beata
pythondev_help_Beata_2019-04-26T12:44:58.141800
1,556,282,698.1418
20,577
pythondev
help
Cool
2019-04-26T12:44:58.141900
Sasha
pythondev_help_Sasha_2019-04-26T12:44:58.141900
1,556,282,698.1419
20,578
pythondev
help
search or filter?
2019-04-26T16:07:42.144700
Hiroko
pythondev_help_Hiroko_2019-04-26T16:07:42.144700
1,556,294,862.1447
20,579
pythondev
help
we do have a <#C07EYDP25|webdev> channel :slightly_smiling_face:
2019-04-26T16:07:53.145000
Hiroko
pythondev_help_Hiroko_2019-04-26T16:07:53.145000
1,556,294,873.145
20,580
pythondev
help
:thumbsup:
2019-04-26T16:09:20.145700
Hiroko
pythondev_help_Hiroko_2019-04-26T16:09:20.145700
1,556,294,960.1457
20,581
pythondev
help
i am parsing this xml at my end. i needed to extract every thing inside question set.
2019-04-26T16:26:41.147600
Jerrie
pythondev_help_Jerrie_2019-04-26T16:26:41.147600
1,556,296,001.1476
20,582
pythondev
help
None
2019-04-26T16:27:02.147900
Jerrie
pythondev_help_Jerrie_2019-04-26T16:27:02.147900
1,556,296,022.1479
20,583
pythondev
help
expected result:
2019-04-26T16:27:21.148500
Jerrie
pythondev_help_Jerrie_2019-04-26T16:27:21.148500
1,556,296,041.1485
20,584
pythondev
help
None
2019-04-26T16:29:45.149300
Jerrie
pythondev_help_Jerrie_2019-04-26T16:29:45.149300
1,556,296,185.1493
20,585
pythondev
help
Trying to fix someone else's code. The expression 'num_workers = opt.num_workers' has me stumped. I don't see 'opt' having been imported. Is it some of kind of Python code for place holding or some kind of developer trick ? <https://github.com/paulgureghian/MXNet_Projects/blob/master/MXNet_Gluon.ipynb>
2019-04-26T18:21:04.153000
Clayton
pythondev_help_Clayton_2019-04-26T18:21:04.153000
1,556,302,864.153
20,586
pythondev
help
I’d be surprised if it is. However I see `import argparse`. I’d look for `opt = argparse.parse_args()`
2019-04-26T18:25:31.153200
Brain
pythondev_help_Brain_2019-04-26T18:25:31.153200
1,556,303,131.1532
20,587
pythondev
help
thanks. i'll try to use your possible solution
2019-04-26T18:29:09.153400
Clayton
pythondev_help_Clayton_2019-04-26T18:29:09.153400
1,556,303,349.1534
20,588
pythondev
help
Either there's something missing that was in the original copy of the code, they were injecting that variable somehow into the script environment, or their original code had the same not defined error.
2019-04-26T19:15:46.153600
Carmen
pythondev_help_Carmen_2019-04-26T19:15:46.153600
1,556,306,146.1536
20,589
pythondev
help
Honestly, it looks like it's just supposed to be pulling from some sort of options object. Make one or replace that with an integer representing the number of workers.
2019-04-26T19:16:20.153800
Carmen
pythondev_help_Carmen_2019-04-26T19:16:20.153800
1,556,306,180.1538
20,590
pythondev
help
You mean just hardcode an int like this : num_workers = 1 ?
2019-04-26T20:03:34.154500
Clayton
pythondev_help_Clayton_2019-04-26T20:03:34.154500
1,556,309,014.1545
20,591
pythondev
help
The code is all screwed up. The 'lr_decay' is not used in the rest of the code, and the 'lr_decay_epoch' variable is not used or defined properly: <https://www.kdnuggets.com/2018/12/implementing-resnet-mxnet-gluon-comet-ml-image-classification.html>
2019-04-26T20:05:47.156100
Clayton
pythondev_help_Clayton_2019-04-26T20:05:47.156100
1,556,309,147.1561
20,592
pythondev
help
Looks like `lr_decay` is used in this line in the `train()` function: ```new_lr =trainer.learning_rate*lr_decay```
2019-04-26T20:13:03.156600
Sasha
pythondev_help_Sasha_2019-04-26T20:13:03.156600
1,556,309,583.1566
20,593
pythondev
help
I dont see a train(). where is it ?
2019-04-26T20:15:20.157000
Clayton
pythondev_help_Clayton_2019-04-26T20:15:20.157000
1,556,309,720.157
20,594
pythondev
help
Page 2 of the article you linked.
2019-04-26T20:15:43.157200
Sasha
pythondev_help_Sasha_2019-04-26T20:15:43.157200
1,556,309,743.1572
20,595
pythondev
help
ahh, i thought that was a different article
2019-04-26T20:16:13.157800
Clayton
pythondev_help_Clayton_2019-04-26T20:16:13.157800
1,556,309,773.1578
20,596
pythondev
help
I did next post, not next page.
2019-04-26T20:17:07.158200
Clayton
pythondev_help_Clayton_2019-04-26T20:17:07.158200
1,556,309,827.1582
20,597
pythondev
help
Hello, anyone conversant with the Spyder IDE? I can't seem to figure out how to get the debugger going
2019-04-26T20:23:22.159000
Lory
pythondev_help_Lory_2019-04-26T20:23:22.159000
1,556,310,202.159
20,598
pythondev
help
I set a breakpoint (red stopsign) on line of interest, then the blue "debug file" button
2019-04-26T20:24:08.159600
Lory
pythondev_help_Lory_2019-04-26T20:24:08.159600
1,556,310,248.1596
20,599
pythondev
help
Did you attach a console to the debugger ?
2019-04-26T20:24:30.160200
Clayton
pythondev_help_Clayton_2019-04-26T20:24:30.160200
1,556,310,270.1602
20,600
pythondev
help
my console then shows a couple if ipdb&gt; prompts but then returns to the console prompt
2019-04-26T20:24:38.160500
Lory
pythondev_help_Lory_2019-04-26T20:24:38.160500
1,556,310,278.1605
20,601
pythondev
help
there is a pre-existing console, I'm not familiar with how or whether I need to attach a new one
2019-04-26T20:25:16.161300
Lory
pythondev_help_Lory_2019-04-26T20:25:16.161300
1,556,310,316.1613
20,602
pythondev
help
I think it would be an external terminal window from the environment that spyder was launched from
2019-04-26T20:27:06.162100
Clayton
pythondev_help_Clayton_2019-04-26T20:27:06.162100
1,556,310,426.1621
20,603
pythondev
help
not the ipython console
2019-04-26T20:27:21.162400
Clayton
pythondev_help_Clayton_2019-04-26T20:27:21.162400
1,556,310,441.1624
20,604
pythondev
help
View &gt;&gt; attach console window (debugging)
2019-04-26T20:28:25.163600
Clayton
pythondev_help_Clayton_2019-04-26T20:28:25.163600
1,556,310,505.1636
20,605
pythondev
help
Still dont know what the 'opt' object is all about
2019-04-26T20:29:12.163900
Clayton
pythondev_help_Clayton_2019-04-26T20:29:12.163900
1,556,310,552.1639
20,606
pythondev
help
hmm, that does look like a useful control, I have it selected now
2019-04-26T20:29:22.164200
Lory
pythondev_help_Lory_2019-04-26T20:29:22.164200
1,556,310,562.1642
20,607
pythondev
help
Running spyder through Anaconda or stand alone ?
2019-04-26T20:29:48.164700
Clayton
pythondev_help_Clayton_2019-04-26T20:29:48.164700
1,556,310,588.1647
20,608
pythondev
help
It was installed via Anaconda, but I launch it from a direct shortcut (Windows 7)
2019-04-26T20:30:17.165200
Lory
pythondev_help_Lory_2019-04-26T20:30:17.165200
1,556,310,617.1652
20,609
pythondev
help
on the desktop ?
2019-04-26T20:30:49.165500
Clayton
pythondev_help_Clayton_2019-04-26T20:30:49.165500
1,556,310,649.1655
20,610
pythondev
help
usually (or sometimes from the Start menu)
2019-04-26T20:31:15.166100
Lory
pythondev_help_Lory_2019-04-26T20:31:15.166100
1,556,310,675.1661
20,611
pythondev
help
I would just launch it from whatever env you are in via the terminal
2019-04-26T20:31:29.166400
Clayton
pythondev_help_Clayton_2019-04-26T20:31:29.166400
1,556,310,689.1664
20,612
pythondev
help
you might always be in the base env
2019-04-26T20:32:01.166700
Clayton
pythondev_help_Clayton_2019-04-26T20:32:01.166700
1,556,310,721.1667
20,613
pythondev
help
then you have to point it at the custom interpreter you want
2019-04-26T20:32:54.167600
Clayton
pythondev_help_Clayton_2019-04-26T20:32:54.167600
1,556,310,774.1676
20,614
pythondev
help
OK, I found a relevant preference (trying to find it again)
2019-04-26T20:33:05.168000
Lory
pythondev_help_Lory_2019-04-26T20:33:05.168000
1,556,310,785.168
20,615
pythondev
help
if launched from a custom env, it uses that specific python install
2019-04-26T20:33:56.168900
Clayton
pythondev_help_Clayton_2019-04-26T20:33:56.168900
1,556,310,836.1689
20,616
pythondev
help
i would also install spyder-terminal inside spyder
2019-04-26T20:34:20.169600
Clayton
pythondev_help_Clayton_2019-04-26T20:34:20.169600
1,556,310,860.1696
20,617
pythondev
help
OK, give me a moment please, thanks for the help so far ; )
2019-04-26T20:34:25.169800
Lory
pythondev_help_Lory_2019-04-26T20:34:25.169800
1,556,310,865.1698
20,618
pythondev
help
None
2019-04-26T20:35:35.170800
Clayton
pythondev_help_Clayton_2019-04-26T20:35:35.170800
1,556,310,935.1708
20,619
pythondev
help
OK, under Preferences -&gt; Run I've selected "Execute in an external system terminal". That does launch a Windows command tool with the (Pdb) prompt.
2019-04-26T20:35:43.171200
Lory
pythondev_help_Lory_2019-04-26T20:35:43.171200
1,556,310,943.1712
20,620