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 a lot for the help and time.
2019-02-13T07:55:48.436100
Lorinda
pythondev_help_Lorinda_2019-02-13T07:55:48.436100
1,550,044,548.4361
8,221
pythondev
help
Np!
2019-02-13T08:06:34.436300
Ashley
pythondev_help_Ashley_2019-02-13T08:06:34.436300
1,550,045,194.4363
8,222
pythondev
help
```data = self.api_query("GET", "/data", no_json=True) self.logger.debug("Checking if data named {0} exists.".format(name)) if data and "data" in data: for data in data["data"]: if data["name"] == _name: etc..``` Anyone know how `for data in data["data"]`...
2019-02-13T08:58:27.438700
Adolfo
pythondev_help_Adolfo_2019-02-13T08:58:27.438700
1,550,048,307.4387
8,223
pythondev
help
well,if data[‘data’] is `None`, then none of your checks look for that
2019-02-13T08:59:34.439400
Hiroko
pythondev_help_Hiroko_2019-02-13T08:59:34.439400
1,550,048,374.4394
8,224
pythondev
help
`if data` checks if `data` is None
2019-02-13T08:59:45.439700
Hiroko
pythondev_help_Hiroko_2019-02-13T08:59:45.439700
1,550,048,385.4397
8,225
pythondev
help
`and 'data' in data` checks if the key `data` exists
2019-02-13T09:00:16.440400
Hiroko
pythondev_help_Hiroko_2019-02-13T09:00:16.440400
1,550,048,416.4404
8,226
pythondev
help
but `data['data']` can be None
2019-02-13T09:00:42.440900
Hiroko
pythondev_help_Hiroko_2019-02-13T09:00:42.440900
1,550,048,442.4409
8,227
pythondev
help
That makes a lot of sense, <@Hiroko> thank you. thats probably what it is.
2019-02-13T09:08:25.441400
Adolfo
pythondev_help_Adolfo_2019-02-13T09:08:25.441400
1,550,048,905.4414
8,228
pythondev
help
I'd probably wrap the check `if data["data"] is not None:` with a `try/except KeyError`
2019-02-13T09:12:39.442300
Mica
pythondev_help_Mica_2019-02-13T09:12:39.442300
1,550,049,159.4423
8,229
pythondev
help
If you haven’t figured this out yet, it is because when doing nested loops in list comprehensions the order of loops goes from the outside in, not the inside out as seems natural. So you should do ``` id_keys = [value for found in root.iterfind('xml_file_thing') for i, value in found.items()] ```
2019-02-13T09:18:42.442400
Clemmie
pythondev_help_Clemmie_2019-02-13T09:18:42.442400
1,550,049,522.4424
8,230
pythondev
help
<@Malena> Great, solved exactly what I needed :taco:
2019-02-13T09:20:24.442700
Yaeko
pythondev_help_Yaeko_2019-02-13T09:20:24.442700
1,550,049,624.4427
8,231
pythondev
help
Effectively you've got a 3-bit number.
2019-02-13T09:21:33.443100
Malena
pythondev_help_Malena_2019-02-13T09:21:33.443100
1,550,049,693.4431
8,232
pythondev
help
... orsomethinglikethat
2019-02-13T09:21:51.443300
Malena
pythondev_help_Malena_2019-02-13T09:21:51.443300
1,550,049,711.4433
8,233
pythondev
help
would you wrap the try except before the if data and "data" in data or before the for loop?
2019-02-13T09:23:32.443700
Adolfo
pythondev_help_Adolfo_2019-02-13T09:23:32.443700
1,550,049,812.4437
8,234
pythondev
help
before: ``` try: if data['data'] is not None: do_something() except KeyError: pass ```
2019-02-13T09:25:31.443900
Mica
pythondev_help_Mica_2019-02-13T09:25:31.443900
1,550,049,931.4439
8,235
pythondev
help
thank you sir!
2019-02-13T09:26:46.444100
Adolfo
pythondev_help_Adolfo_2019-02-13T09:26:46.444100
1,550,050,006.4441
8,236
pythondev
help
no worries! Let me know if you have any issues!
2019-02-13T09:27:08.444300
Mica
pythondev_help_Mica_2019-02-13T09:27:08.444300
1,550,050,028.4443
8,237
pythondev
help
testing out.. shortly
2019-02-13T09:28:07.444500
Adolfo
pythondev_help_Adolfo_2019-02-13T09:28:07.444500
1,550,050,087.4445
8,238
pythondev
help
you think
2019-02-13T09:36:43.444700
Adolfo
pythondev_help_Adolfo_2019-02-13T09:36:43.444700
1,550,050,603.4447
8,239
pythondev
help
``` if data and "data" in data and data["data"] is not None: for data in data["data"]: ```
2019-02-13T09:37:19.444900
Adolfo
pythondev_help_Adolfo_2019-02-13T09:37:19.444900
1,550,050,639.4449
8,240
pythondev
help
you don't need `if data` at the start and if you check `data["data"]` and it's not there it'll throw a `KeyError` exception
2019-02-13T09:39:22.445300
Mica
pythondev_help_Mica_2019-02-13T09:39:22.445300
1,550,050,762.4453
8,241
pythondev
help
I can _never_ get multiple loop syntax right without looking it up :confused:
2019-02-13T09:39:35.445500
Melynda
pythondev_help_Melynda_2019-02-13T09:39:35.445500
1,550,050,775.4455
8,242
pythondev
help
you either nest the conditions or do what i suggested
2019-02-13T09:39:42.445700
Mica
pythondev_help_Mica_2019-02-13T09:39:42.445700
1,550,050,782.4457
8,243
pythondev
help
Same here - the only reason I got it is because I had to just do one, looked it up, and then remembered this was asked yesterday :rolling_on_the_floor_laughing:
2019-02-13T09:42:07.445900
Clemmie
pythondev_help_Clemmie_2019-02-13T09:42:07.445900
1,550,050,927.4459
8,244
pythondev
help
if data at start checks to see the api call succeded?
2019-02-13T09:43:34.446100
Adolfo
pythondev_help_Adolfo_2019-02-13T09:43:34.446100
1,550,051,014.4461
8,245
pythondev
help
you can't do them all on the same line, plus you don't need that check it's redundant
2019-02-13T09:44:22.446400
Mica
pythondev_help_Mica_2019-02-13T09:44:22.446400
1,550,051,062.4464
8,246
pythondev
help
if there's not data then surely it was unsuccessful right?
2019-02-13T09:44:32.446600
Mica
pythondev_help_Mica_2019-02-13T09:44:32.446600
1,550,051,072.4466
8,247
pythondev
help
yea
2019-02-13T09:44:37.446800
Adolfo
pythondev_help_Adolfo_2019-02-13T09:44:37.446800
1,550,051,077.4468
8,248
pythondev
help
what happens if the query to get data fails?
2019-02-13T09:45:47.447000
Adolfo
pythondev_help_Adolfo_2019-02-13T09:45:47.447000
1,550,051,147.447
8,249
pythondev
help
you need to handle that separately, depends how the requests handles it
2019-02-13T09:46:13.447200
Mica
pythondev_help_Mica_2019-02-13T09:46:13.447200
1,550,051,173.4472
8,250
pythondev
help
depends what it returns if it fails
2019-02-13T09:46:21.447400
Mica
pythondev_help_Mica_2019-02-13T09:46:21.447400
1,550,051,181.4474
8,251
pythondev
help
it return a False so the caller can handle it accordingly
2019-02-13T09:47:49.447600
Adolfo
pythondev_help_Adolfo_2019-02-13T09:47:49.447600
1,550,051,269.4476
8,252
pythondev
help
what if im intentionally checking a condition causes a fail?
2019-02-13T09:48:10.447800
Adolfo
pythondev_help_Adolfo_2019-02-13T09:48:10.447800
1,550,051,290.4478
8,253
pythondev
help
you'll want to explicitly check for False, as it doesn't return True if it's successful, it returns the data
2019-02-13T09:49:40.448000
Mica
pythondev_help_Mica_2019-02-13T09:49:40.448000
1,550,051,380.448
8,254
pythondev
help
Whilst using the `pywinauto` library, I have managed to get the control identifiers, but I cannot seem to access the children, to click the login button and other buttons, the only button that I have been able to select is the "cancel" button. What is the correct way to get to it
2019-02-13T10:28:48.450800
Arturo
pythondev_help_Arturo_2019-02-13T10:28:48.450800
1,550,053,728.4508
8,255
pythondev
help
``` from pywinauto import application import time app = application.Application() #app.connect(path=r"C:\\WINDOWS\system32\cmd.exe") app.start(r"C:\\WINDOWS\system32\cmd.exe", wait_for_idle=False) dlg = app.top_window() dlg.type_keys('D:{ENTER}') dlg.type_keys('cd{SPACE}Software\\U2K-MV200R018C10SPC250_Client\\U2K-MV20...
2019-02-13T10:30:14.451700
Arturo
pythondev_help_Arturo_2019-02-13T10:30:14.451700
1,550,053,814.4517
8,256
pythondev
help
I wonder if iManager exposes any COM objects?
2019-02-13T10:47:27.452000
Jonas
pythondev_help_Jonas_2019-02-13T10:47:27.452000
1,550,054,847.452
8,257
pythondev
help
it might be worth looking at if it does, especially if it's a managed application.
2019-02-13T10:47:49.452400
Jonas
pythondev_help_Jonas_2019-02-13T10:47:49.452400
1,550,054,869.4524
8,258
pythondev
help
It is built in java not c++
2019-02-13T10:51:09.452900
Arturo
pythondev_help_Arturo_2019-02-13T10:51:09.452900
1,550,055,069.4529
8,259
pythondev
help
I'm not familiar with the pywinauto library or the iManager app. If there is no login button that is exposed then it's not exposing this to Windows, which means automating and clicking it will be real hard
2019-02-13T10:54:24.454100
Jonas
pythondev_help_Jonas_2019-02-13T10:54:24.454100
1,550,055,264.4541
8,260
pythondev
help
Is it using the Java UI toolkit, or do the buttons and widgets look like native Windows ones?
2019-02-13T10:55:02.454600
Jonas
pythondev_help_Jonas_2019-02-13T10:55:02.454600
1,550,055,302.4546
8,261
pythondev
help
Did you calculate it or was it immediately obvious?
2019-02-13T10:57:09.454800
Yaeko
pythondev_help_Yaeko_2019-02-13T10:57:09.454800
1,550,055,429.4548
8,262
pythondev
help
Yup was thinking it will be hard, but its odd as I was using UiPath before, and the selectors where getting it. The buttons look normal to me
2019-02-13T10:58:14.455600
Arturo
pythondev_help_Arturo_2019-02-13T10:58:14.455600
1,550,055,494.4556
8,263
pythondev
help
None
2019-02-13T10:58:43.455700
Arturo
pythondev_help_Arturo_2019-02-13T10:58:43.455700
1,550,055,523.4557
8,264
pythondev
help
I was looking at this; <http://doc.sikuli.org/> thought it might be able to help
2019-02-13T11:03:03.456300
Arturo
pythondev_help_Arturo_2019-02-13T11:03:03.456300
1,550,055,783.4563
8,265
pythondev
help
Im having a hard time figuring out the proper way to have an entire class fire. I have my main module (tkinter) which uses stored variables to be fired off within another module. i.e. enter date and date is used in the other module. the issue is that I am having to type out each function separate and i have a feeling t...
2019-02-13T11:23:01.458600
Nenita
pythondev_help_Nenita_2019-02-13T11:23:01.458600
1,550,056,981.4586
8,266
pythondev
help
What is `SSH_Invoices`? A module?
2019-02-13T11:24:34.459400
Jonas
pythondev_help_Jonas_2019-02-13T11:24:34.459400
1,550,057,074.4594
8,267
pythondev
help
correct. it is the main class name
2019-02-13T11:25:01.460200
Nenita
pythondev_help_Nenita_2019-02-13T11:25:01.460200
1,550,057,101.4602
8,268
pythondev
help
Wait, is it a module or a class?
2019-02-13T11:25:11.460700
Jonas
pythondev_help_Jonas_2019-02-13T11:25:11.460700
1,550,057,111.4607
8,269
pythondev
help
Can you do an `__init__` that takes the date and a run flag, if you pass the run flag it triggers `statements()`
2019-02-13T11:25:20.461000
Clemmie
pythondev_help_Clemmie_2019-02-13T11:25:20.461000
1,550,057,120.461
8,270
pythondev
help
class more specifically. module name is actually SSH.
2019-02-13T11:25:26.461300
Nenita
pythondev_help_Nenita_2019-02-13T11:25:26.461300
1,550,057,126.4613
8,271
pythondev
help
You might need to show some more code, there is for sure a better way
2019-02-13T11:25:59.462000
Jonas
pythondev_help_Jonas_2019-02-13T11:25:59.462000
1,550,057,159.462
8,272
pythondev
help
but it's hard to tell with a few lines
2019-02-13T11:26:06.462400
Jonas
pythondev_help_Jonas_2019-02-13T11:26:06.462400
1,550,057,166.4624
8,273
pythondev
help
would that __init__ be in the SSH module or in my main module?
2019-02-13T11:26:12.462700
Nenita
pythondev_help_Nenita_2019-02-13T11:26:12.462700
1,550,057,172.4627
8,274
pythondev
help
alright one sec
2019-02-13T11:26:18.463100
Nenita
pythondev_help_Nenita_2019-02-13T11:26:18.463100
1,550,057,178.4631
8,275
pythondev
help
Ok, so a module in Python is a file. It's all the contents of a file bundled up into an object, a 'module'
2019-02-13T11:26:35.463700
Jonas
pythondev_help_Jonas_2019-02-13T11:26:35.463700
1,550,057,195.4637
8,276
pythondev
help
Generally you never do `module.something = something_else`
2019-02-13T11:26:49.464300
Jonas
pythondev_help_Jonas_2019-02-13T11:26:49.464300
1,550,057,209.4643
8,277
pythondev
help
unless you really, really know what you're doing.
2019-02-13T11:26:55.464700
Jonas
pythondev_help_Jonas_2019-02-13T11:26:55.464700
1,550,057,215.4647
8,278
pythondev
help
It would be in `SSH_Invoices`, but at the moment you are not using instances, just `classmethod/static` calls
2019-02-13T11:27:14.465500
Clemmie
pythondev_help_Clemmie_2019-02-13T11:27:14.465500
1,550,057,234.4655
8,279
pythondev
help
Classes live in modules, and are created by doing `something = SomeClass()`. You can pass things into a class by calling it like a function: `SomeClass(some_variable, something=else)`
2019-02-13T11:27:42.466300
Jonas
pythondev_help_Jonas_2019-02-13T11:27:42.466300
1,550,057,262.4663
8,280
pythondev
help
You have `__init__` methods on classes, not modules.
2019-02-13T11:27:54.466800
Jonas
pythondev_help_Jonas_2019-02-13T11:27:54.466800
1,550,057,274.4668
8,281
pythondev
help
And when you do `SomeClass()` the `SomeClass.__init__` is called with it's arguments
2019-02-13T11:28:11.467600
Jonas
pythondev_help_Jonas_2019-02-13T11:28:11.467600
1,550,057,291.4676
8,282
pythondev
help
this is the ssh module. please notate that with been having to go back and forth trying to figure this out, I have had to make some changes that were not there originally. i.e. when I ran the module separately rather than using my main module.
2019-02-13T11:28:35.467900
Nenita
pythondev_help_Nenita_2019-02-13T11:28:35.467900
1,550,057,315.4679
8,283
pythondev
help
one sec and...
2019-02-13T11:28:46.468300
Nenita
pythondev_help_Nenita_2019-02-13T11:28:46.468300
1,550,057,326.4683
8,284
pythondev
help
this is the line that is calling all of it. now this function is really messy. Haven't been working on it too long.
2019-02-13T11:29:24.468400
Nenita
pythondev_help_Nenita_2019-02-13T11:29:24.468400
1,550,057,364.4684
8,285
pythondev
help
oh! <@Jonas> i see what your saying
2019-02-13T11:29:45.469000
Nenita
pythondev_help_Nenita_2019-02-13T11:29:45.469000
1,550,057,385.469
8,286
pythondev
help
you need to instantiate the class
2019-02-13T11:29:54.469400
Mica
pythondev_help_Mica_2019-02-13T11:29:54.469400
1,550,057,394.4694
8,287
pythondev
help
Ok, so I see a few issues here
2019-02-13T11:29:57.469500
Jonas
pythondev_help_Jonas_2019-02-13T11:29:57.469500
1,550,057,397.4695
8,288
pythondev
help
the only exception is for staticmethods :parrot:
2019-02-13T11:30:13.470100
Mica
pythondev_help_Mica_2019-02-13T11:30:13.470100
1,550,057,413.4701
8,289
pythondev
help
In general it's not great practice to do what you are doing in `.statements()`
2019-02-13T11:30:16.470300
Jonas
pythondev_help_Jonas_2019-02-13T11:30:16.470300
1,550,057,416.4703
8,290
pythondev
help
you're setting some variables, then you _expect_ people to call `run_statements()`
2019-02-13T11:30:32.470700
Jonas
pythondev_help_Jonas_2019-02-13T11:30:32.470700
1,550,057,432.4707
8,291
pythondev
help
which uses a class variable and does the right thing :tm:
2019-02-13T11:30:46.471600
Jonas
pythondev_help_Jonas_2019-02-13T11:30:46.471600
1,550,057,446.4716
8,292
pythondev
help
you could make `run_statements` accept an argument of statements
2019-02-13T11:30:55.472000
Jonas
pythondev_help_Jonas_2019-02-13T11:30:55.472000
1,550,057,455.472
8,293
pythondev
help
then when you call `statements()`, it then calls `self.run_statements([....])`?
2019-02-13T11:31:13.472700
Jonas
pythondev_help_Jonas_2019-02-13T11:31:13.472700
1,550,057,473.4727
8,294
pythondev
help
thats what im planning
2019-02-13T11:31:18.472900
Nenita
pythondev_help_Nenita_2019-02-13T11:31:18.472900
1,550,057,478.4729
8,295
pythondev
help
after i read your previous comment
2019-02-13T11:31:28.473200
Nenita
pythondev_help_Nenita_2019-02-13T11:31:28.473200
1,550,057,488.4732
8,296
pythondev
help
:+1: avoid passing state around using instance variables.
2019-02-13T11:32:10.473700
Jonas
pythondev_help_Jonas_2019-02-13T11:32:10.473700
1,550,057,530.4737
8,297
pythondev
help
So, for your `statements()` method, it needs a date
2019-02-13T11:32:21.474300
Jonas
pythondev_help_Jonas_2019-02-13T11:32:21.474300
1,550,057,541.4743
8,298
pythondev
help
so why not add this as an argument
2019-02-13T11:32:26.474600
Jonas
pythondev_help_Jonas_2019-02-13T11:32:26.474600
1,550,057,546.4746
8,299
pythondev
help
then do `SSH_invoices.statements(self.page1_sel_date.get())`?
2019-02-13T11:32:37.475100
Jonas
pythondev_help_Jonas_2019-02-13T11:32:37.475100
1,550,057,557.4751
8,300
pythondev
help
yep, thats why i ask the question from the get-go because I was like, 'there is no way i am going to find a good answer as specific as im needing using google'.
2019-02-13T11:32:37.475200
Nenita
pythondev_help_Nenita_2019-02-13T11:32:37.475200
1,550,057,557.4752
8,301
pythondev
help
You also need an instance of the class, as <@Mica> pointed out. So try doing `invoices = SSH_Invoices()`
2019-02-13T11:33:17.476100
Jonas
pythondev_help_Jonas_2019-02-13T11:33:17.476100
1,550,057,597.4761
8,302
pythondev
help
then `invoices.statements()`
2019-02-13T11:33:23.476400
Jonas
pythondev_help_Jonas_2019-02-13T11:33:23.476400
1,550,057,603.4764
8,303
pythondev
help
i plan on doing that. after reading your comment "You can pass things into a class by calling it like a function: `SomeClass(some_variable, something=else)`"
2019-02-13T11:33:33.476600
Nenita
pythondev_help_Nenita_2019-02-13T11:33:33.476600
1,550,057,613.4766
8,304
pythondev
help
:+1: awesome. One other thing, you may want to keep the `SSH_Invoices` object around for a while
2019-02-13T11:33:56.477300
Jonas
pythondev_help_Jonas_2019-02-13T11:33:56.477300
1,550,057,636.4773
8,305
pythondev
help
aaaand now i see what you mean by an instance of a class. lol
2019-02-13T11:34:02.477500
Nenita
pythondev_help_Nenita_2019-02-13T11:34:02.477500
1,550,057,642.4775
8,306
pythondev
help
it creates a SSH client which may be expensive to create
2019-02-13T11:34:04.477700
Jonas
pythondev_help_Jonas_2019-02-13T11:34:04.477700
1,550,057,644.4777
8,307
pythondev
help
so you could do `invoices = SSH_Invoices()` at the top of your module, after your imports
2019-02-13T11:34:20.478200
Jonas
pythondev_help_Jonas_2019-02-13T11:34:20.478200
1,550,057,660.4782
8,308
pythondev
help
or somewhere else that runs when the app starts.
2019-02-13T11:34:27.478500
Jonas
pythondev_help_Jonas_2019-02-13T11:34:27.478500
1,550,057,667.4785
8,309
pythondev
help
well ill let you guys know if i get it going and show you what i end up doing if i do. thanks <@Tracie> <@Jonas> <@Clemmie>
2019-02-13T11:36:12.480000
Nenita
pythondev_help_Nenita_2019-02-13T11:36:12.480000
1,550,057,772.48
8,310
pythondev
help
<@Jonas> <@Mica> :taco:
2019-02-13T11:36:43.480400
Clemmie
pythondev_help_Clemmie_2019-02-13T11:36:43.480400
1,550,057,803.4804
8,311
pythondev
help
<@Carmen> Thanks again. Couple of questions about the above snippet (didn't work): Shouldn't it be this? ``` def f3(f2, frame_list): f2_param = None return_list = [] for frame in frame_list: new_f2 = lambda frame, f2_param: f2(frame, f2_param) (other_output, f2_param) = fl_image(new_f2(frame...
2019-02-13T11:44:06.481100
Angele
pythondev_help_Angele_2019-02-13T11:44:06.481100
1,550,058,246.4811
8,312
pythondev
help
Here, f2_param is a list. So I'm getting an error when I pass it as a None. When I use the above code, it still doesn't work because fl_image (f1) does not expect a list argument (does not support variable number of arguments)
2019-02-13T11:51:46.481900
Angele
pythondev_help_Angele_2019-02-13T11:51:46.481900
1,550,058,706.4819
8,313
pythondev
help
None
2019-02-13T11:52:54.482100
Jorge
pythondev_help_Jorge_2019-02-13T11:52:54.482100
1,550,058,774.4821
8,314
pythondev
help
what do you all prefer for getting the elements of one list but not another?
2019-02-13T11:53:27.483000
Jorge
pythondev_help_Jorge_2019-02-13T11:53:27.483000
1,550,058,807.483
8,315
pythondev
help
Sets if order and duplicates don’t matter. List comprehension if they do
2019-02-13T11:53:56.483400
Clemmie
pythondev_help_Clemmie_2019-02-13T11:53:56.483400
1,550,058,836.4834
8,316
pythondev
help
Could a decorator help to override the default fl_image function call..?
2019-02-13T11:58:53.483500
Angele
pythondev_help_Angele_2019-02-13T11:58:53.483500
1,550,059,133.4835
8,317
pythondev
help
I'll be making a settings frame in the future to store all the variable info for ssh. i.e. ip, user, pass. Otherwise, works wonderfully. And this is all in my main module.
2019-02-13T12:05:19.483700
Nenita
pythondev_help_Nenita_2019-02-13T12:05:19.483700
1,550,059,519.4837
8,318
pythondev
help
I've also posted the same question to the Reddit group of the library: <https://www.reddit.com/r/moviepy/comments/aq9007/accessing_previous_frames_in_videoclipfl_image/>
2019-02-13T12:26:58.484200
Angele
pythondev_help_Angele_2019-02-13T12:26:58.484200
1,550,060,818.4842
8,319
pythondev
help
Perhaps the explanation is clearer there..
2019-02-13T12:27:16.484600
Angele
pythondev_help_Angele_2019-02-13T12:27:16.484600
1,550,060,836.4846
8,320