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
I lost the link of the driver
2018-02-09T04:32:30.000145
Lorna
pythondev_help_Lorna_2018-02-09T04:32:30.000145
1,518,150,750.000145
33,724
pythondev
help
What I can do about that?
2018-02-09T04:32:44.000489
Lorna
pythondev_help_Lorna_2018-02-09T04:32:44.000489
1,518,150,764.000489
33,725
pythondev
help
you can make a fixture that prepares a driver and returns it
2018-02-09T04:34:01.000408
Barney
pythondev_help_Barney_2018-02-09T04:34:01.000408
1,518,150,841.000408
33,726
pythondev
help
``` list1 = [1, 2, 3] list2 = [6, 7, 8] print([i for i in range(10) if i not in list1 and list2]) ```
2018-02-09T04:34:29.000180
Micki
pythondev_help_Micki_2018-02-09T04:34:29.000180
1,518,150,869.00018
33,727
pythondev
help
without testing what would you thing this print ? <@Gwyn>
2018-02-09T04:34:58.000430
Micki
pythondev_help_Micki_2018-02-09T04:34:58.000430
1,518,150,898.00043
33,728
pythondev
help
``` @pytest.fixture(scope='session') def driver(): # Create a `driver` with some configuration. _driver = webdriver.Firefox() SetUp(_driver, URL) return _driver ```
2018-02-09T04:35:08.000002
Barney
pythondev_help_Barney_2018-02-09T04:35:08.000002
1,518,150,908.000002
33,729
pythondev
help
and then make your tests like this: ``` def test_sign_up_success(driver): ... ```
2018-02-09T04:35:49.000087
Barney
pythondev_help_Barney_2018-02-09T04:35:49.000087
1,518,150,949.000087
33,730
pythondev
help
py.test will automatically run the fixture and give each test a working `driver` instance
2018-02-09T04:36:09.000452
Barney
pythondev_help_Barney_2018-02-09T04:36:09.000452
1,518,150,969.000452
33,731
pythondev
help
0, 4, 5, 9, 10 ?
2018-02-09T04:46:16.000448
Gwyn
pythondev_help_Gwyn_2018-02-09T04:46:16.000448
1,518,151,576.000448
33,732
pythondev
help
Just tested now, apparently no :thinking_face:
2018-02-09T04:46:41.000374
Gwyn
pythondev_help_Gwyn_2018-02-09T04:46:41.000374
1,518,151,601.000374
33,733
pythondev
help
`[0, 4, 5, 6, 7, 8, 9]`
2018-02-09T04:46:45.000309
Gwyn
pythondev_help_Gwyn_2018-02-09T04:46:45.000309
1,518,151,605.000309
33,734
pythondev
help
got it
2018-02-09T04:47:33.000446
Gwyn
pythondev_help_Gwyn_2018-02-09T04:47:33.000446
1,518,151,653.000446
33,735
pythondev
help
:thumbsup:
2018-02-09T04:47:39.000171
Micki
pythondev_help_Micki_2018-02-09T04:47:39.000171
1,518,151,659.000171
33,736
pythondev
help
so what's the "correct" way
2018-02-09T04:47:55.000279
Micki
pythondev_help_Micki_2018-02-09T04:47:55.000279
1,518,151,675.000279
33,737
pythondev
help
I needed to "explicitely" say what I want for `i`
2018-02-09T04:47:56.000350
Gwyn
pythondev_help_Gwyn_2018-02-09T04:47:56.000350
1,518,151,676.00035
33,738
pythondev
help
```&gt;&gt;&gt; print([i for i in range(10) if i not in list1 and i not in list2])```
2018-02-09T04:48:03.000348
Gwyn
pythondev_help_Gwyn_2018-02-09T04:48:03.000348
1,518,151,683.000348
33,739
pythondev
help
yep
2018-02-09T04:48:36.000479
Micki
pythondev_help_Micki_2018-02-09T04:48:36.000479
1,518,151,716.000479
33,740
pythondev
help
Cool thanks :smile:
2018-02-09T04:49:07.000144
Gwyn
pythondev_help_Gwyn_2018-02-09T04:49:07.000144
1,518,151,747.000144
33,741
pythondev
help
<@Noel> :point_up: maybe ask something like this too. It's a similar gotcha than the default argument
2018-02-09T04:51:10.000241
Micki
pythondev_help_Micki_2018-02-09T04:51:10.000241
1,518,151,870.000241
33,742
pythondev
help
Quick one, I want to get the below ```ukUrl = ['<https://www.google.com/>'] def some_function(url): # This is what I want to see below # ukUrl some_function(url=ukUrl)```
2018-02-09T05:10:28.000023
Dorie
pythondev_help_Dorie_2018-02-09T05:10:28.000023
1,518,153,028.000023
33,743
pythondev
help
So instead of getting the url string I want to get the list name instead
2018-02-09T05:10:50.000070
Dorie
pythondev_help_Dorie_2018-02-09T05:10:50.000070
1,518,153,050.00007
33,744
pythondev
help
you want the name of the variable ?
2018-02-09T05:11:35.000421
Micki
pythondev_help_Micki_2018-02-09T05:11:35.000421
1,518,153,095.000421
33,745
pythondev
help
Yea
2018-02-09T05:13:54.000090
Dorie
pythondev_help_Dorie_2018-02-09T05:13:54.000090
1,518,153,234.00009
33,746
pythondev
help
i don't think you can do that, at least easily
2018-02-09T05:15:05.000283
Fumiko
pythondev_help_Fumiko_2018-02-09T05:15:05.000283
1,518,153,305.000283
33,747
pythondev
help
can I ask what's the goal ?
2018-02-09T05:15:12.000358
Micki
pythondev_help_Micki_2018-02-09T05:15:12.000358
1,518,153,312.000358
33,748
pythondev
help
maybe some debugging module could let you
2018-02-09T05:15:15.000298
Fumiko
pythondev_help_Fumiko_2018-02-09T05:15:15.000298
1,518,153,315.000298
33,749
pythondev
help
Thanks guys. I'll try it
2018-02-09T05:16:35.000110
Lorna
pythondev_help_Lorna_2018-02-09T05:16:35.000110
1,518,153,395.00011
33,750
pythondev
help
```ukUrl = ['<https://www.google.com/>'] usUrl = ['<https://www.google.com/>'] deUrl = ['<https://www.google.com/>'] def some_function(url): # Assuming url passes the variable name if url.__contains__("uk"): do something if url.__contains__("us"): do something if url.__contains__("de"):...
2018-02-09T05:17:33.000350
Dorie
pythondev_help_Dorie_2018-02-09T05:17:33.000350
1,518,153,453.00035
33,751
pythondev
help
<https://stackoverflow.com/questions/2749796/how-to-get-the-original-variable-name-of-variable-passed-to-a-function> apparently possible but the warning ` To make it clear, I don't recommend using this AT ALL, it will break, it's a mess, it won't help you in anyway, but it's doable for entertainment/education purposes....
2018-02-09T05:17:55.000408
Fumiko
pythondev_help_Fumiko_2018-02-09T05:17:55.000408
1,518,153,475.000408
33,752
pythondev
help
So I'm using the same function but passing different urls each time and need it to print out something depending on url
2018-02-09T05:18:19.000401
Dorie
pythondev_help_Dorie_2018-02-09T05:18:19.000401
1,518,153,499.000401
33,753
pythondev
help
youd be better using a dictionary and having the region as an attribute
2018-02-09T05:18:57.000248
Jacquelyn
pythondev_help_Jacquelyn_2018-02-09T05:18:57.000248
1,518,153,537.000248
33,754
pythondev
help
``` URLS = { 'uk': ['<https://www.google.com/>'] 'us': ['<https://www.google.com/>'] 'de': ['<https://www.google.com/>'] } def some_function(country): # Assuming url passes the variable name url = URLS[country] some_function('uk') some_function('us') some_function('de') ```
2018-02-09T05:19:10.000138
Micki
pythondev_help_Micki_2018-02-09T05:19:10.000138
1,518,153,550.000138
33,755
pythondev
help
^
2018-02-09T05:19:19.000303
Jacquelyn
pythondev_help_Jacquelyn_2018-02-09T05:19:19.000303
1,518,153,559.000303
33,756
pythondev
help
would something like this work for you ?
2018-02-09T05:19:29.000145
Micki
pythondev_help_Micki_2018-02-09T05:19:29.000145
1,518,153,569.000145
33,757
pythondev
help
I tried to put the driver, URL Firefox in another file with global settings, but the browser opened and stopped, the "home_page.click_sign_up()" didn't work.
2018-02-09T05:20:47.000052
Lorna
pythondev_help_Lorna_2018-02-09T05:20:47.000052
1,518,153,647.000052
33,758
pythondev
help
thanks <@Micki> this works nicely
2018-02-09T05:30:42.000464
Dorie
pythondev_help_Dorie_2018-02-09T05:30:42.000464
1,518,154,242.000464
33,759
pythondev
help
<@Barney> Your tip was work. Thanks!!! Now I'll try to get "....Firefox..." and change to global setup for others test_files can use it. :+1:
2018-02-09T05:43:04.000440
Lorna
pythondev_help_Lorna_2018-02-09T05:43:04.000440
1,518,154,984.00044
33,760
pythondev
help
Hey guys, Is there anyway i can see the GET, POST requests like you do on a localhost on my staging server using ssh?
2018-02-09T05:53:38.000001
Tanesha
pythondev_help_Tanesha_2018-02-09T05:53:38.000001
1,518,155,618.000001
33,761
pythondev
help
django ? there is probably a setting to activate the access logs
2018-02-09T05:54:43.000437
Micki
pythondev_help_Micki_2018-02-09T05:54:43.000437
1,518,155,683.000437
33,762
pythondev
help
Yeah its django, i have ssh'd into the server remotely, i'll have a look around to see if i can access any logs
2018-02-09T05:56:13.000214
Tanesha
pythondev_help_Tanesha_2018-02-09T05:56:13.000214
1,518,155,773.000214
33,763
pythondev
help
hmmm
2018-02-09T05:56:35.000398
Tanesha
pythondev_help_Tanesha_2018-02-09T05:56:35.000398
1,518,155,795.000398
33,764
pythondev
help
I cannot figure out why emails are not sending out on the staging server. Nothing in the logs + no error shown when i trigger the event that sends them.
2018-02-09T06:06:13.000239
Tanesha
pythondev_help_Tanesha_2018-02-09T06:06:13.000239
1,518,156,373.000239
33,765
pythondev
help
I have it in a try: except: statement ``` except Exception as e: print(str(e)) ``` But this is giving me nothing can anyone recommend another way to determine why its not sending?
2018-02-09T06:13:29.000157
Tanesha
pythondev_help_Tanesha_2018-02-09T06:13:29.000157
1,518,156,809.000157
33,766
pythondev
help
<@Tanesha> What's in the `try` block? (feel free to omit address(es) etc)
2018-02-09T07:41:50.000329
Elijah
pythondev_help_Elijah_2018-02-09T07:41:50.000329
1,518,162,110.000329
33,767
pythondev
help
Do you have an email server running locally on the staging server, or do you connect to something remote?
2018-02-09T07:42:49.000186
Elijah
pythondev_help_Elijah_2018-02-09T07:42:49.000186
1,518,162,169.000186
33,768
pythondev
help
Hey, I need help. My test (pytest) give me an error like that:
2018-02-09T08:24:06.000280
Lorna
pythondev_help_Lorna_2018-02-09T08:24:06.000280
1,518,164,646.00028
33,769
pythondev
help
driver = &lt;web.page_objects.set_up.SetUp object at 0x10d95e710&gt; &gt; lambda driver: self._driver.find_element_by_id("nav-bar-sign-up-button")) E AttributeError: 'SetUp' object has no attribute 'find_element_by_id' ../page_objects/home_page.py:12: AttributeError It's working when the test open the browser...
2018-02-09T08:24:09.000433
Lorna
pythondev_help_Lorna_2018-02-09T08:24:09.000433
1,518,164,649.000433
33,770
pythondev
help
Please use triple backquotes to format your code
2018-02-09T08:28:57.000277
Gwyn
pythondev_help_Gwyn_2018-02-09T08:28:57.000277
1,518,164,937.000277
33,771
pythondev
help
or do a snippet
2018-02-09T08:29:00.000493
Gwyn
pythondev_help_Gwyn_2018-02-09T08:29:00.000493
1,518,164,940.000493
33,772
pythondev
help
```Like so```
2018-02-09T08:29:04.000394
Gwyn
pythondev_help_Gwyn_2018-02-09T08:29:04.000394
1,518,164,944.000394
33,773
pythondev
help
<@Gwyn> Sorry about that!
2018-02-09T08:29:49.000212
Lorna
pythondev_help_Lorna_2018-02-09T08:29:49.000212
1,518,164,989.000212
33,774
pythondev
help
<https://get.slack.help/hc/en-us/articles/202288908-Format-your-messages#code-blocks>
2018-02-09T08:40:24.000057
Floy
pythondev_help_Floy_2018-02-09T08:40:24.000057
1,518,165,624.000057
33,775
pythondev
help
good thing to know about with slack formatting. Can take some getting used to, but it makes things more readable
2018-02-09T08:40:43.000328
Floy
pythondev_help_Floy_2018-02-09T08:40:43.000328
1,518,165,643.000328
33,776
pythondev
help
<@Floy> Thanks!
2018-02-09T08:42:19.000289
Lorna
pythondev_help_Lorna_2018-02-09T08:42:19.000289
1,518,165,739.000289
33,777
pythondev
help
what is a good online reference for idiomatic python?
2018-02-09T09:52:54.000450
Gia
pythondev_help_Gia_2018-02-09T09:52:54.000450
1,518,169,974.00045
33,778
pythondev
help
for instance, i now want to see examples of inheritance
2018-02-09T09:53:17.000328
Gia
pythondev_help_Gia_2018-02-09T09:53:17.000328
1,518,169,997.000328
33,779
pythondev
help
I was looking at <http://www.diveintopython3.net>
2018-02-09T09:54:42.000649
Gia
pythondev_help_Gia_2018-02-09T09:54:42.000649
1,518,170,082.000649
33,780
pythondev
help
but it's more meant as a learning resource than as a reference book
2018-02-09T09:55:04.000732
Gia
pythondev_help_Gia_2018-02-09T09:55:04.000732
1,518,170,104.000732
33,781
pythondev
help
The docs on <http://python.org|python.org>? At least if you want reference documentation. You could also look at the tutorial that's part of their docs.
2018-02-09T10:15:35.000079
Elijah
pythondev_help_Elijah_2018-02-09T10:15:35.000079
1,518,171,335.000079
33,782
pythondev
help
i cant find inheritance in the docs..
2018-02-09T10:26:50.000010
Gia
pythondev_help_Gia_2018-02-09T10:26:50.000010
1,518,172,010.00001
33,783
pythondev
help
i did find it in the tutorial but only described very briefly
2018-02-09T10:27:10.000332
Gia
pythondev_help_Gia_2018-02-09T10:27:10.000332
1,518,172,030.000332
33,784
pythondev
help
<@Gia> <https://docs.python.org/3/tutorial/classes.html> that's the one you're looking for
2018-02-09T10:29:29.000449
Barney
pythondev_help_Barney_2018-02-09T10:29:29.000449
1,518,172,169.000449
33,785
pythondev
help
it's the best reference really
2018-02-09T10:29:43.000077
Barney
pythondev_help_Barney_2018-02-09T10:29:43.000077
1,518,172,183.000077
33,786
pythondev
help
Thanks, but the only example on inheritance seems to be ``` class DerivedClassName(BaseClassName): &lt;statement-1&gt; . . . &lt;statement-N&gt; ```
2018-02-09T10:30:37.000660
Gia
pythondev_help_Gia_2018-02-09T10:30:37.000660
1,518,172,237.00066
33,787
pythondev
help
There are no examples of overriding `__init__` etc
2018-02-09T10:31:07.000213
Gia
pythondev_help_Gia_2018-02-09T10:31:07.000213
1,518,172,267.000213
33,788
pythondev
help
&gt; There’s nothing special about instantiation of derived classes: DerivedClassName() creates a new instance of the class. Method references are resolved as follows: the corresponding class attribute is searched, descending down the chain of base classes if necessary, and the method reference is valid if this yields ...
2018-02-09T10:32:56.000367
Barney
pythondev_help_Barney_2018-02-09T10:32:56.000367
1,518,172,376.000367
33,789
pythondev
help
`__init__` isn't really different from any other method
2018-02-09T10:33:15.000323
Barney
pythondev_help_Barney_2018-02-09T10:33:15.000323
1,518,172,395.000323
33,790
pythondev
help
except it's automatically called when you create an instance
2018-02-09T10:33:27.000132
Barney
pythondev_help_Barney_2018-02-09T10:33:27.000132
1,518,172,407.000132
33,791
pythondev
help
all rules of inheritance work the same
2018-02-09T10:33:34.000758
Barney
pythondev_help_Barney_2018-02-09T10:33:34.000758
1,518,172,414.000758
33,792
pythondev
help
You can override any method, and you can still access the original one that you've overridden, by using `super()`
2018-02-09T10:33:48.000847
Barney
pythondev_help_Barney_2018-02-09T10:33:48.000847
1,518,172,428.000847
33,793
pythondev
help
and that's basically it, the whole principle is really simple, but it can be challenging to wrap your head around it
2018-02-09T10:34:39.000230
Barney
pythondev_help_Barney_2018-02-09T10:34:39.000230
1,518,172,479.00023
33,794
pythondev
help
if you have any questions -- feel free to ask
2018-02-09T10:36:04.000602
Barney
pythondev_help_Barney_2018-02-09T10:36:04.000602
1,518,172,564.000602
33,795
pythondev
help
Do I use `super()` or `BaseClass.methodname(self, args)`?
2018-02-09T10:39:48.000680
Gia
pythondev_help_Gia_2018-02-09T10:39:48.000680
1,518,172,788.00068
33,796
pythondev
help
I prefer to use `super()` everywhere, except when it's not possible. ``` class A(Base): def __init__(*args, **kwargs): super().__init__(*args, **kwargs) # call init from the base class ... ... ```
2018-02-09T10:41:19.000317
Barney
pythondev_help_Barney_2018-02-09T10:41:19.000317
1,518,172,879.000317
33,797
pythondev
help
if you want to use a method that is inherited from a base class just use `self.name_of_method()`
2018-02-09T10:42:33.000838
Fumiko
pythondev_help_Fumiko_2018-02-09T10:42:33.000838
1,518,172,953.000838
33,798
pythondev
help
aside: raymond hettinger had a nice video on multiple inheritance and, in particular, using super() <https://www.youtube.com/watch?v=EiOglTERPEo>
2018-02-09T10:42:35.000624
Fumiko
pythondev_help_Fumiko_2018-02-09T10:42:35.000624
1,518,172,955.000624
33,799
pythondev
help
all his talks are awesome
2018-02-09T10:42:52.000288
Davina
pythondev_help_Davina_2018-02-09T10:42:52.000288
1,518,172,972.000288
33,800
pythondev
help
the one on concurrency is a must watch too.
2018-02-09T10:43:03.000128
Davina
pythondev_help_Davina_2018-02-09T10:43:03.000128
1,518,172,983.000128
33,801
pythondev
help
he has a nice set of simple examples of classes in that talk
2018-02-09T10:43:09.000381
Fumiko
pythondev_help_Fumiko_2018-02-09T10:43:09.000381
1,518,172,989.000381
33,802
pythondev
help
raymond's talks are great. the concurrency, super, pep8, class development, and idiomatic talks are very useful to watch
2018-02-09T10:44:01.000283
Fumiko
pythondev_help_Fumiko_2018-02-09T10:44:01.000283
1,518,173,041.000283
33,803
pythondev
help
speaking of which, the ~idiomatic python~ *class development toolkit* (messed up the name) talk also has some nice pointers on how to do interesting things with classes (multiple inheritance, "private" and name-mangled methods, properties, etc)
2018-02-09T10:44:51.000018
Fumiko
pythondev_help_Fumiko_2018-02-09T10:44:51.000018
1,518,173,091.000018
33,804
pythondev
help
The pep8 one is brilliant
2018-02-09T10:52:23.000614
Elijah
pythondev_help_Elijah_2018-02-09T10:52:23.000614
1,518,173,543.000614
33,805
pythondev
help
Thanks for the links guys!
2018-02-09T10:53:36.000190
Gia
pythondev_help_Gia_2018-02-09T10:53:36.000190
1,518,173,616.00019
33,806
pythondev
help
he's awesome :slightly_smiling_face:
2018-02-09T10:53:42.000744
Gia
pythondev_help_Gia_2018-02-09T10:53:42.000744
1,518,173,622.000744
33,807
pythondev
help
The "Python's Class Development Toolkit" one is probably the one I managed to get the most out of at the time I saw it.
2018-02-09T10:55:38.000021
Elijah
pythondev_help_Elijah_2018-02-09T10:55:38.000021
1,518,173,738.000021
33,808
pythondev
help
It points out some important aspects of the engineering side of things, in some of his jokes. I guess that's a big part why I enjoy his talks actually, even the jokes have some sort of wisdom in it at times :slightly_smiling_face:
2018-02-09T10:57:17.000653
Elijah
pythondev_help_Elijah_2018-02-09T10:57:17.000653
1,518,173,837.000653
33,809
pythondev
help
101
2018-02-09T11:16:07.000389
Sadye
pythondev_help_Sadye_2018-02-09T11:16:07.000389
1,518,174,967.000389
33,810
pythondev
help
It was one of enlightenment moments in my career
2018-02-09T11:16:46.000792
Sadye
pythondev_help_Sadye_2018-02-09T11:16:46.000792
1,518,175,006.000792
33,811
pythondev
help
It's the moment when you're like Neo say "woah" and instantly become a better programmer
2018-02-09T11:17:23.000409
Sadye
pythondev_help_Sadye_2018-02-09T11:17:23.000409
1,518,175,043.000409
33,812
pythondev
help
it seems that super() automatically passes self?
2018-02-09T11:29:49.000384
Gia
pythondev_help_Gia_2018-02-09T11:29:49.000384
1,518,175,789.000384
33,813
pythondev
help
sure
2018-02-09T11:35:45.000440
Barney
pythondev_help_Barney_2018-02-09T11:35:45.000440
1,518,176,145.00044
33,814
pythondev
help
python3, yes
2018-02-09T11:36:03.000418
Floy
pythondev_help_Floy_2018-02-09T11:36:03.000418
1,518,176,163.000418
33,815
pythondev
help
python2, no
2018-02-09T11:36:06.000402
Floy
pythondev_help_Floy_2018-02-09T11:36:06.000402
1,518,176,166.000402
33,816
pythondev
help
is it good practice to name the function args when passing them?
2018-02-09T11:40:40.000794
Gia
pythondev_help_Gia_2018-02-09T11:40:40.000794
1,518,176,440.000794
33,817
pythondev
help
eg, def foo(a,b,c): ..
2018-02-09T11:40:51.000346
Gia
pythondev_help_Gia_2018-02-09T11:40:51.000346
1,518,176,451.000346
33,818
pythondev
help
foo(a=1,b=2,c=3)
2018-02-09T11:40:59.000645
Gia
pythondev_help_Gia_2018-02-09T11:40:59.000645
1,518,176,459.000645
33,819
pythondev
help
I did a open source contribution for the first time, and I got a reply saying that my code doesn't follow pep8 convention. Is there any tool that will automatically convert my code into such fashion?
2018-02-09T11:41:35.000383
Ellen
pythondev_help_Ellen_2018-02-09T11:41:35.000383
1,518,176,495.000383
33,820
pythondev
help
I think there is an autopep8 package <@Ellen>, I usually just use flake8 as I write
2018-02-09T11:49:16.000566
Rigoberto
pythondev_help_Rigoberto_2018-02-09T11:49:16.000566
1,518,176,956.000566
33,821
pythondev
help
or use an ide/editor with a pep8 linter running
2018-02-09T11:49:29.000884
Floy
pythondev_help_Floy_2018-02-09T11:49:29.000884
1,518,176,969.000884
33,822
pythondev
help
+1 for editor linting
2018-02-09T11:49:51.000319
Rigoberto
pythondev_help_Rigoberto_2018-02-09T11:49:51.000319
1,518,176,991.000319
33,823