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
but with your existing definiton, it doesn’t do anything
2019-01-31T12:12:29.385400
Hiroko
pythondev_help_Hiroko_2019-01-31T12:12:29.385400
1,548,936,749.3854
5,621
pythondev
help
remember, methods have scope. so if you’re defining a variable inside a method, that method isn’t available outside. so, calling `jupiter` above just has `j_seconds` available inside that method with no way to access it
2019-01-31T12:13:16.386700
Hiroko
pythondev_help_Hiroko_2019-01-31T12:13:16.386700
1,548,936,796.3867
5,622
pythondev
help
because you haven’t done `return seconds * 11.862615`
2019-01-31T12:13:34.387400
Hiroko
pythondev_help_Hiroko_2019-01-31T12:13:34.387400
1,548,936,814.3874
5,623
pythondev
help
Hi, how can I make freetds use ntlmv2 for AD authentication on a container? ( pymssql/sqlalchemy/database related question)
2019-01-31T12:13:47.387700
Charlyn
pythondev_help_Charlyn_2019-01-31T12:13:47.387700
1,548,936,827.3877
5,624
pythondev
help
<@Hiroko> that is a lot for me to digest, I’ll give it some thought and thank you for the help!
2019-01-31T12:20:22.388300
Leopoldo
pythondev_help_Leopoldo_2019-01-31T12:20:22.388300
1,548,937,222.3883
5,625
pythondev
help
yes, OOP is pretty difficult to grasp your head around at times
2019-01-31T12:20:51.388700
Hiroko
pythondev_help_Hiroko_2019-01-31T12:20:51.388700
1,548,937,251.3887
5,626
pythondev
help
and there are times you’re just too confused to articulate the question that you’re confused with :smile:
2019-01-31T12:21:10.389100
Hiroko
pythondev_help_Hiroko_2019-01-31T12:21:10.389100
1,548,937,270.3891
5,627
pythondev
help
I very much feel like that right now
2019-01-31T12:21:27.389600
Leopoldo
pythondev_help_Leopoldo_2019-01-31T12:21:27.389600
1,548,937,287.3896
5,628
pythondev
help
been there, done that :slightly_smiling_face:
2019-01-31T12:21:40.389900
Hiroko
pythondev_help_Hiroko_2019-01-31T12:21:40.389900
1,548,937,300.3899
5,629
pythondev
help
lol thank you
2019-01-31T12:21:47.390200
Leopoldo
pythondev_help_Leopoldo_2019-01-31T12:21:47.390200
1,548,937,307.3902
5,630
pythondev
help
what might help is to think of `class ...` as a blueprint
2019-01-31T12:21:54.390500
Hiroko
pythondev_help_Hiroko_2019-01-31T12:21:54.390500
1,548,937,314.3905
5,631
pythondev
help
it contains the stuff to create the thing you want and the behavior you deem necessary
2019-01-31T12:22:10.390900
Hiroko
pythondev_help_Hiroko_2019-01-31T12:22:10.390900
1,548,937,330.3909
5,632
pythondev
help
and instances, eg, `c = SpaceAge(...)`, just follow that blueprint
2019-01-31T12:22:52.391500
Hiroko
pythondev_help_Hiroko_2019-01-31T12:22:52.391500
1,548,937,372.3915
5,633
pythondev
help
Could you make it even simpler for me. What goes in the first parenthesis of Class SpaceAge(?)
2019-01-31T12:24:32.392700
Leopoldo
pythondev_help_Leopoldo_2019-01-31T12:24:32.392700
1,548,937,472.3927
5,634
pythondev
help
And where does that (?) need to be defined?
2019-01-31T12:24:56.393200
Leopoldo
pythondev_help_Leopoldo_2019-01-31T12:24:56.393200
1,548,937,496.3932
5,635
pythondev
help
it defines what things that class should have by default
2019-01-31T12:26:18.394000
Hiroko
pythondev_help_Hiroko_2019-01-31T12:26:18.394000
1,548,937,578.394
5,636
pythondev
help
if nothing is specified, or the params are omitted, it just inherits from `object`, which is the base python class
2019-01-31T12:26:44.394600
Hiroko
pythondev_help_Hiroko_2019-01-31T12:26:44.394600
1,548,937,604.3946
5,637
pythondev
help
look at my example above with Shape and Circle
2019-01-31T12:27:08.394900
Hiroko
pythondev_help_Hiroko_2019-01-31T12:27:08.394900
1,548,937,628.3949
5,638
pythondev
help
we want Circle to have the properties of Shape, because a circle is a shape, right?
2019-01-31T12:27:31.395300
Hiroko
pythondev_help_Hiroko_2019-01-31T12:27:31.395300
1,548,937,651.3953
5,639
pythondev
help
it has area, boundaries, color, etc
2019-01-31T12:27:51.395800
Hiroko
pythondev_help_Hiroko_2019-01-31T12:27:51.395800
1,548,937,671.3958
5,640
pythondev
help
so you can define those properties in Shape, and have Circle say “hey, no need to rewrite all that code, I can just pull it in for myself”
2019-01-31T12:28:22.396500
Hiroko
pythondev_help_Hiroko_2019-01-31T12:28:22.396500
1,548,937,702.3965
5,641
pythondev
help
Hmm ok that makes sense.
2019-01-31T12:29:02.396900
Leopoldo
pythondev_help_Leopoldo_2019-01-31T12:29:02.396900
1,548,937,742.3969
5,642
pythondev
help
so, each class has a constructor, and in puython, thats the `__init__(self)` method
2019-01-31T12:29:30.397500
Hiroko
pythondev_help_Hiroko_2019-01-31T12:29:30.397500
1,548,937,770.3975
5,643
pythondev
help
now, `self` is an explicit way for you to refer to a specific instance of a class
2019-01-31T12:29:56.398100
Hiroko
pythondev_help_Hiroko_2019-01-31T12:29:56.398100
1,548,937,796.3981
5,644
pythondev
help
ok I understand so far
2019-01-31T12:30:17.398700
Leopoldo
pythondev_help_Leopoldo_2019-01-31T12:30:17.398700
1,548,937,817.3987
5,645
pythondev
help
you know, just like you can have a whole bunch of M&amp;Ms in your hands, doesn’t
2019-01-31T12:30:18.398800
Hiroko
pythondev_help_Hiroko_2019-01-31T12:30:18.398800
1,548,937,818.3988
5,646
pythondev
help
one can be green, another can be red, etc
2019-01-31T12:30:32.399200
Hiroko
pythondev_help_Hiroko_2019-01-31T12:30:32.399200
1,548,937,832.3992
5,647
pythondev
help
each M&amp;M is an instance of a class, if you will
2019-01-31T12:30:44.399700
Hiroko
pythondev_help_Hiroko_2019-01-31T12:30:44.399700
1,548,937,844.3997
5,648
pythondev
help
<@Leopoldo> This is a pretty good introduction to object oriented programming concepts <https://www.makeuseof.com/tag/object-oriented-programming-explained/>
2019-01-31T12:30:52.400000
Clemmie
pythondev_help_Clemmie_2019-01-31T12:30:52.400000
1,548,937,852.4
5,649
pythondev
help
thank you <@Clemmie> I will read this as well
2019-01-31T12:32:20.400500
Leopoldo
pythondev_help_Leopoldo_2019-01-31T12:32:20.400500
1,548,937,940.4005
5,650
pythondev
help
ok <@Hiroko> makes sense. I get a little confused where things are being defined and where to apply those.
2019-01-31T12:33:58.401300
Leopoldo
pythondev_help_Leopoldo_2019-01-31T12:33:58.401300
1,548,938,038.4013
5,651
pythondev
help
But I’m getting a little more of an understanding.
2019-01-31T12:34:07.401800
Leopoldo
pythondev_help_Leopoldo_2019-01-31T12:34:07.401800
1,548,938,047.4018
5,652
pythondev
help
To be slightly more explicit about the the first line of the class definition, `class SpaceAge(?)`, putting something where the `?` is is optional. That slot is where you say, "This class that I'm defining inherits it's methods and attributes from this other class". It's a way to reuse code without having to violate th...
2019-01-31T12:36:35.404300
Carmen
pythondev_help_Carmen_2019-01-31T12:36:35.404300
1,548,938,195.4043
5,653
pythondev
help
You can inherit from multiple other classes, just separating those class names from each other with a comma, and it will give you all the attributes and methods from each of them.
2019-01-31T12:37:13.405200
Carmen
pythondev_help_Carmen_2019-01-31T12:37:13.405200
1,548,938,233.4052
5,654
pythondev
help
If you don't inherit from another class explicitly, the system will say your class inherits from the built-in Object class.
2019-01-31T12:38:02.406700
Carmen
pythondev_help_Carmen_2019-01-31T12:38:02.406700
1,548,938,282.4067
5,655
pythondev
help
That is really helpful <@Carmen> I wouldn’t enter anything there unless I want it inherited from another class
2019-01-31T12:38:19.407000
Leopoldo
pythondev_help_Leopoldo_2019-01-31T12:38:19.407000
1,548,938,299.407
5,656
pythondev
help
Precisely.
2019-01-31T12:38:24.407200
Carmen
pythondev_help_Carmen_2019-01-31T12:38:24.407200
1,548,938,304.4072
5,657
pythondev
help
Can I inherit a value from a variable? Like my e_seconds? Or would I need to create another class with that value?
2019-01-31T12:39:19.408600
Leopoldo
pythondev_help_Leopoldo_2019-01-31T12:39:19.408600
1,548,938,359.4086
5,658
pythondev
help
you can inherit from classes or methods
2019-01-31T12:40:09.409300
Hiroko
pythondev_help_Hiroko_2019-01-31T12:40:09.409300
1,548,938,409.4093
5,659
pythondev
help
No, because your variable is not a class. It's an instance of a class (in your case, an integer).
2019-01-31T12:40:10.409400
Carmen
pythondev_help_Carmen_2019-01-31T12:40:10.409400
1,548,938,410.4094
5,660
pythondev
help
but that;s a distinction that really doesn’t matter at this point
2019-01-31T12:40:27.410200
Hiroko
pythondev_help_Hiroko_2019-01-31T12:40:27.410200
1,548,938,427.4102
5,661
pythondev
help
Ooo, method inheritance is something new for me. *Googles*
2019-01-31T12:40:33.410500
Carmen
pythondev_help_Carmen_2019-01-31T12:40:33.410500
1,548,938,433.4105
5,662
pythondev
help
look for mixins
2019-01-31T12:40:39.410700
Hiroko
pythondev_help_Hiroko_2019-01-31T12:40:39.410700
1,548,938,439.4107
5,663
pythondev
help
ok <@Hiroko> <@Carmen>
2019-01-31T12:40:48.410800
Leopoldo
pythondev_help_Leopoldo_2019-01-31T12:40:48.410800
1,548,938,448.4108
5,664
pythondev
help
thank you both
2019-01-31T12:40:55.411000
Leopoldo
pythondev_help_Leopoldo_2019-01-31T12:40:55.411000
1,548,938,455.411
5,665
pythondev
help
Oooooh, you're talking about overriding previously defined methods, yes?
2019-01-31T12:41:17.411400
Carmen
pythondev_help_Carmen_2019-01-31T12:41:17.411400
1,548,938,477.4114
5,666
pythondev
help
or adding in new ones that really don’t belong to a specific class
2019-01-31T12:41:39.411700
Hiroko
pythondev_help_Hiroko_2019-01-31T12:41:39.411700
1,548,938,499.4117
5,667
pythondev
help
Aha. Then yes, I'm familiar with that. I just hadn't ever heard of it described as inheriting from a method.
2019-01-31T12:42:03.412200
Carmen
pythondev_help_Carmen_2019-01-31T12:42:03.412200
1,548,938,523.4122
5,668
pythondev
help
ah, gotcha
2019-01-31T12:42:13.412400
Hiroko
pythondev_help_Hiroko_2019-01-31T12:42:13.412400
1,548,938,533.4124
5,669
pythondev
help
you can do it both, from class or from method
2019-01-31T12:42:25.412700
Hiroko
pythondev_help_Hiroko_2019-01-31T12:42:25.412700
1,548,938,545.4127
5,670
pythondev
help
Can you toss me an example link? My google-fu isn't coming up with what I think you're talking about.
2019-01-31T12:43:35.413000
Carmen
pythondev_help_Carmen_2019-01-31T12:43:35.413000
1,548,938,615.413
5,671
pythondev
help
damn, could have sworn i had a link to function mixin
2019-01-31T12:46:30.413700
Hiroko
pythondev_help_Hiroko_2019-01-31T12:46:30.413700
1,548,938,790.4137
5,672
pythondev
help
but no, mixins are a simple class
2019-01-31T12:46:37.414000
Hiroko
pythondev_help_Hiroko_2019-01-31T12:46:37.414000
1,548,938,797.414
5,673
pythondev
help
Hm. Perhaps something in an older version of Python?
2019-01-31T12:52:05.414500
Carmen
pythondev_help_Carmen_2019-01-31T12:52:05.414500
1,548,939,125.4145
5,674
pythondev
help
I think you can inherit from anything, but your MRO stack may get confused. I mean by default it inherits from `object` and everything is an object, right?
2019-01-31T12:54:09.415500
Clemmie
pythondev_help_Clemmie_2019-01-31T12:54:09.415500
1,548,939,249.4155
5,675
pythondev
help
This sounds like a job for some experimentation.
2019-01-31T13:02:34.415800
Carmen
pythondev_help_Carmen_2019-01-31T13:02:34.415800
1,548,939,754.4158
5,676
pythondev
help
```def some_function(): pass class SomeClass(some_function): pass```
2019-01-31T13:04:46.417100
Carmen
pythondev_help_Carmen_2019-01-31T13:04:46.417100
1,548,939,886.4171
5,677
pythondev
help
`TypeError: function() argument 1 must be code, not str`
2019-01-31T13:04:46.417200
Clemmie
pythondev_help_Clemmie_2019-01-31T13:04:46.417200
1,548,939,886.4172
5,678
pythondev
help
Exactly that.
2019-01-31T13:04:51.417500
Carmen
pythondev_help_Carmen_2019-01-31T13:04:51.417500
1,548,939,891.4175
5,679
pythondev
help
Hello everyone, I have one query that did python through error ``` ValueError: Attempted relative import in non-package ``` , if i still have ``` __init__.py ``` file in directory.
2019-01-31T13:05:34.418100
Carissa
pythondev_help_Carissa_2019-01-31T13:05:34.418100
1,548,939,934.4181
5,680
pythondev
help
if yes, then whats that case
2019-01-31T13:05:51.418400
Carissa
pythondev_help_Carissa_2019-01-31T13:05:51.418400
1,548,939,951.4184
5,681
pythondev
help
the struture i have -&gt; project / -&gt; folder1 -&gt; folder 2 . . -&gt; file1 -&gt; file 2 -&gt; __init__.py
2019-01-31T13:08:03.420500
Carissa
pythondev_help_Carissa_2019-01-31T13:08:03.420500
1,548,940,083.4205
5,682
pythondev
help
now when i do relative import of file 1 in file 2 then this error comes ``` ValueError: Attempted relative import in non-package ```
2019-01-31T13:08:37.421500
Carissa
pythondev_help_Carissa_2019-01-31T13:08:37.421500
1,548,940,117.4215
5,683
pythondev
help
What is your import line?
2019-01-31T13:09:21.421700
Carmen
pythondev_help_Carmen_2019-01-31T13:09:21.421700
1,548,940,161.4217
5,684
pythondev
help
``` from .file1 import function ```
2019-01-31T13:10:04.422200
Carissa
pythondev_help_Carissa_2019-01-31T13:10:04.422200
1,548,940,204.4222
5,685
pythondev
help
I believe your issue is that your top level package isn't available in the python path, so the import is failing, even as a relative import.
2019-01-31T13:13:23.422900
Carmen
pythondev_help_Carmen_2019-01-31T13:13:23.422900
1,548,940,403.4229
5,686
pythondev
help
<https://stackoverflow.com/questions/11536764/how-to-fix-attempted-relative-import-in-non-package-even-with-init-py/27876800#27876800>
2019-01-31T13:13:30.423100
Carmen
pythondev_help_Carmen_2019-01-31T13:13:30.423100
1,548,940,410.4231
5,687
pythondev
help
Also take a look at <https://stackoverflow.com/a/11537218> and <https://stackoverflow.com/questions/11536764/how-to-fix-attempted-relative-import-in-non-package-even-with-init-py/27876800#comment25547861_11537218>
2019-01-31T13:15:33.423700
Carmen
pythondev_help_Carmen_2019-01-31T13:15:33.423700
1,548,940,533.4237
5,688
pythondev
help
thanks <@Carmen>, Can you tell me what do you mean by top level package.
2019-01-31T13:16:08.424800
Carissa
pythondev_help_Carissa_2019-01-31T13:16:08.424800
1,548,940,568.4248
5,689
pythondev
help
I was referring to `project`, the package/module that you're nesting everything inside.
2019-01-31T13:16:35.425300
Carmen
pythondev_help_Carmen_2019-01-31T13:16:35.425300
1,548,940,595.4253
5,690
pythondev
help
Ohh!!, thanks for your help <@Carmen>, i will see it. and again thanks for help.
2019-01-31T13:22:55.426200
Carissa
pythondev_help_Carissa_2019-01-31T13:22:55.426200
1,548,940,975.4262
5,691
pythondev
help
hi guys, do anyone know what's the proper way to storage/manage dates for multiple timezones?
2019-01-31T13:40:11.427800
Monika
pythondev_help_Monika_2019-01-31T13:40:11.427800
1,548,942,011.4278
5,692
pythondev
help
Store them timezone aware with a locale
2019-01-31T13:42:14.428400
Clemmie
pythondev_help_Clemmie_2019-01-31T13:42:14.428400
1,548,942,134.4284
5,693
pythondev
help
from a design perspective is it typically better practice to assign class attributes through a property decorator, vs directly assigning them within a classes init method
2019-01-31T14:10:30.429400
Caridad
pythondev_help_Caridad_2019-01-31T14:10:30.429400
1,548,943,830.4294
5,694
pythondev
help
if it's a class attribute I feel like you shouldn't touch it from an instance like that
2019-01-31T14:15:53.429900
Bethany
pythondev_help_Bethany_2019-01-31T14:15:53.429900
1,548,944,153.4299
5,695
pythondev
help
maybe class attribute is the wrong word
2019-01-31T14:19:26.430200
Caridad
pythondev_help_Caridad_2019-01-31T14:19:26.430200
1,548,944,366.4302
5,696
pythondev
help
i guess why wouldnt someone just always use a property decorator
2019-01-31T14:19:45.430600
Caridad
pythondev_help_Caridad_2019-01-31T14:19:45.430600
1,548,944,385.4306
5,697
pythondev
help
seems like with the decorator even if you dont need some validation logic or transformation logic, you always get the benefit of adding that later if you wanted to with setters and getters
2019-01-31T14:20:29.431500
Caridad
pythondev_help_Caridad_2019-01-31T14:20:29.431500
1,548,944,429.4315
5,698
pythondev
help
Who has work on machine learning here on language translation ???
2019-01-31T14:21:50.432600
Dara
pythondev_help_Dara_2019-01-31T14:21:50.432600
1,548,944,510.4326
5,699
pythondev
help
i guess the question is more, when do you use property decorators vs `__init__` to set something on a python object
2019-01-31T14:27:25.433500
Caridad
pythondev_help_Caridad_2019-01-31T14:27:25.433500
1,548,944,845.4335
5,700
pythondev
help
seems like the decorator is necessary if you want to do a more complex calculation on something set within the `__init__` method
2019-01-31T14:28:44.434700
Caridad
pythondev_help_Caridad_2019-01-31T14:28:44.434700
1,548,944,924.4347
5,701
pythondev
help
i am getting an error invalid character in identifier in this code from PIL import ImageGrab, ImageOps import pyautogui import time from numpy import * class Cordinates(): replayBtn = (480, 400) dinosaur = (246, 405) # x = 320 (cordinate to check for tree) # y = 415 (cordinate of half tree def restart...
2019-01-31T14:33:59.435600
Ula
pythondev_help_Ula_2019-01-31T14:33:59.435600
1,548,945,239.4356
5,702
pythondev
help
can anyone help me out !
2019-01-31T14:34:06.435800
Ula
pythondev_help_Ula_2019-01-31T14:34:06.435800
1,548,945,246.4358
5,703
pythondev
help
<@Caridad> property decorators are for when you want to add some logic to `instance.x = 2`
2019-01-31T14:40:43.436400
Bethany
pythondev_help_Bethany_2019-01-31T14:40:43.436400
1,548,945,643.4364
5,704
pythondev
help
and you can define them while still setting them in `__init__`
2019-01-31T14:41:02.437100
Bethany
pythondev_help_Bethany_2019-01-31T14:41:02.437100
1,548,945,662.4371
5,705
pythondev
help
so they're orthogonal in that sense
2019-01-31T14:41:10.437300
Bethany
pythondev_help_Bethany_2019-01-31T14:41:10.437300
1,548,945,670.4373
5,706
pythondev
help
ok that makes sense
2019-01-31T14:42:23.438700
Caridad
pythondev_help_Caridad_2019-01-31T14:42:23.438700
1,548,945,743.4387
5,707
pythondev
help
and nothing's stopping you from adding in a `@property` later, so I wouldn't do it until you know you want it
2019-01-31T14:42:53.439100
Bethany
pythondev_help_Bethany_2019-01-31T14:42:53.439100
1,548,945,773.4391
5,708
pythondev
help
yea that makes more sense using it that way, not sure why i thought they were more independent than that
2019-01-31T14:43:32.439600
Caridad
pythondev_help_Caridad_2019-01-31T14:43:32.439600
1,548,945,812.4396
5,709
pythondev
help
like you have to use one or the other
2019-01-31T14:44:21.440300
Caridad
pythondev_help_Caridad_2019-01-31T14:44:21.440300
1,548,945,861.4403
5,710
pythondev
help
thanks for the insight! <@Bethany> :taco:
2019-01-31T14:44:35.440700
Caridad
pythondev_help_Caridad_2019-01-31T14:44:35.440700
1,548,945,875.4407
5,711
pythondev
help
is there a better way or more pythonic way to do this check?
2019-01-31T14:56:18.441500
Adolfo
pythondev_help_Adolfo_2019-01-31T14:56:18.441500
1,548,946,578.4415
5,712
pythondev
help
```if not scan_info or "scan" not in scan_info:```
2019-01-31T14:56:20.441700
Adolfo
pythondev_help_Adolfo_2019-01-31T14:56:20.441700
1,548,946,580.4417
5,713
pythondev
help
On which line? Also, you'd be better to embed all this code as a snippet on Slack…
2019-01-31T15:04:13.441900
Melynda
pythondev_help_Melynda_2019-01-31T15:04:13.441900
1,548,947,053.4419
5,714
pythondev
help
given the lack of context that looks perfectly fine to me
2019-01-31T15:26:26.442900
Shamika
pythondev_help_Shamika_2019-01-31T15:26:26.442900
1,548,948,386.4429
5,715
pythondev
help
```i am getting an error invalid character in identifier in this code from PIL import ImageGrab, ImageOps import pyautogui import time from numpy import * class Cordinates(): replayBtn = (480, 400) dinosaur = (246, 405) # x = 320 (cordinate to check for tree) # y = 415 (cordinate of half tree def rest...
2019-01-31T15:37:35.443100
Leana
pythondev_help_Leana_2019-01-31T15:37:35.443100
1,548,949,055.4431
5,716
pythondev
help
would help to know where the error is?
2019-01-31T15:38:56.443400
Hiroko
pythondev_help_Hiroko_2019-01-31T15:38:56.443400
1,548,949,136.4434
5,717
pythondev
help
I tried asking that already, up here: <https://pythondev.slack.com/archives/C07EFMZ1N/p1548965053441900?thread_ts=1548963239.435600&amp;cid=C07EFMZ1N>
2019-01-31T16:03:21.443700
Melynda
pythondev_help_Melynda_2019-01-31T16:03:21.443700
1,548,950,601.4437
5,718
pythondev
help
ha, missed that entirely
2019-01-31T16:08:55.444000
Hiroko
pythondev_help_Hiroko_2019-01-31T16:08:55.444000
1,548,950,935.444
5,719
pythondev
help
sorry!
2019-01-31T16:08:58.444200
Hiroko
pythondev_help_Hiroko_2019-01-31T16:08:58.444200
1,548,950,938.4442
5,720