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
<@Floy>
2018-02-19T11:03:00.000498
Janelle
pythondev_help_Janelle_2018-02-19T11:03:00.000498
1,519,038,180.000498
34,824
pythondev
help
it is sommerville
2018-02-19T11:03:09.000660
Janelle
pythondev_help_Janelle_2018-02-19T11:03:09.000660
1,519,038,189.00066
34,825
pythondev
help
sorry, that doesn’t mean anything to me. if you had said ckeditor, I’d know what you’re talking about :slightly_smiling_face:
2018-02-19T11:04:06.000082
Floy
pythondev_help_Floy_2018-02-19T11:04:06.000082
1,519,038,246.000082
34,826
pythondev
help
yeah
2018-02-19T11:04:16.000233
Janelle
pythondev_help_Janelle_2018-02-19T11:04:16.000233
1,519,038,256.000233
34,827
pythondev
help
but i am new to programming
2018-02-19T11:04:31.000663
Janelle
pythondev_help_Janelle_2018-02-19T11:04:31.000663
1,519,038,271.000663
34,828
pythondev
help
so couldnt explain it better
2018-02-19T11:04:44.000492
Janelle
pythondev_help_Janelle_2018-02-19T11:04:44.000492
1,519,038,284.000492
34,829
pythondev
help
sorry for it
2018-02-19T11:04:50.000168
Janelle
pythondev_help_Janelle_2018-02-19T11:04:50.000168
1,519,038,290.000168
34,830
pythondev
help
hai guys i need little bit help regarding the exporting the pdf file i am using reportlab library for exporting the pdf ,in django i am getting data from database not the static data i want to print any blogs or any idea pls
2018-02-19T11:32:32.000142
Vonda
pythondev_help_Vonda_2018-02-19T11:32:32.000142
1,519,039,952.000142
34,831
pythondev
help
<@Vonda> Reportlab is a beast, most things you will find on top google search results will give you part of the story - it's hard to say what direction is right because there are a few ways to do things and most blog posts just show one way that works
2018-02-19T12:08:51.000374
Huong
pythondev_help_Huong_2018-02-19T12:08:51.000374
1,519,042,131.000374
34,832
pythondev
help
I suggest just trying to do something very simple, follow any blog that pops up top on Google and review the reportlab documentation pdf as mucha s you can tolerate
2018-02-19T12:09:18.000301
Huong
pythondev_help_Huong_2018-02-19T12:09:18.000301
1,519,042,158.000301
34,833
pythondev
help
You are forced to learn it to some extent if you want anything interesting to happen
2018-02-19T12:09:34.000501
Huong
pythondev_help_Huong_2018-02-19T12:09:34.000501
1,519,042,174.000501
34,834
pythondev
help
Plugging it into Django to serve it from a view is extremely easy, but don't even worry about that for now, make a management command or something where you have access to your models and just focus on getting output from reportlab
2018-02-19T12:11:47.000419
Huong
pythondev_help_Huong_2018-02-19T12:11:47.000419
1,519,042,307.000419
34,835
pythondev
help
The Django docs have a section about serving .pdf that is trivial to follow
2018-02-19T12:11:59.000456
Huong
pythondev_help_Huong_2018-02-19T12:11:59.000456
1,519,042,319.000456
34,836
pythondev
help
Unless you prefer to review it during dev it by serving it from a view, I guess that is up to you
2018-02-19T12:12:25.000144
Huong
pythondev_help_Huong_2018-02-19T12:12:25.000144
1,519,042,345.000144
34,837
pythondev
help
Would it be correct to say that Factory Patterns are unnecessary in Python?
2018-02-19T12:56:04.000098
Hank
pythondev_help_Hank_2018-02-19T12:56:04.000098
1,519,044,964.000098
34,838
pythondev
help
I'm not a design pattern expert by any means but I'd say that it unnecessary in so far as python is more flexible to programming paradigms other than object oriented (versus lets say java) but if you are writing code in strict oo fashion then using factories would provide the same benefit in python as it would in any o...
2018-02-19T13:59:02.000405
Leanora
pythondev_help_Leanora_2018-02-19T13:59:02.000405
1,519,048,742.000405
34,839
pythondev
help
I’m always wary of conflating the pattern with its implementation. Think of it like this, you’ve probably worked with an MVC framework now if you move to a different one how its implemented changes but how its designed does not and so you’re able to still understand at a conceptual level what’s going on
2018-02-19T15:09:14.000367
Jama
pythondev_help_Jama_2018-02-19T15:09:14.000367
1,519,052,954.000367
34,840
pythondev
help
Hello folks, I need a little help here
2018-02-19T16:02:48.000203
Gabrielle
pythondev_help_Gabrielle_2018-02-19T16:02:48.000203
1,519,056,168.000203
34,841
pythondev
help
there are any method which returns a model fields? but when this method is a ContentType
2018-02-19T16:04:27.000010
Gabrielle
pythondev_help_Gabrielle_2018-02-19T16:04:27.000010
1,519,056,267.00001
34,842
pythondev
help
this is my Model, and as you may see the "model field" is a ContentType FK.
2018-02-19T16:07:09.000245
Gabrielle
pythondev_help_Gabrielle_2018-02-19T16:07:09.000245
1,519,056,429.000245
34,843
pythondev
help
So, I wanna get the fields of this "model field"
2018-02-19T16:07:29.000373
Gabrielle
pythondev_help_Gabrielle_2018-02-19T16:07:29.000373
1,519,056,449.000373
34,844
pythondev
help
any suggestions on a good way to learn more about python and sql
2018-02-19T16:15:22.000025
Salvador
pythondev_help_Salvador_2018-02-19T16:15:22.000025
1,519,056,922.000025
34,845
pythondev
help
<@Gabrielle> I think this should help: <https://stackoverflow.com/questions/7627745/django-get-foreign-key-model>
2018-02-19T16:27:55.000149
Henrietta
pythondev_help_Henrietta_2018-02-19T16:27:55.000149
1,519,057,675.000149
34,846
pythondev
help
<@Salvador> The interaction between the two often occurs through an ORM, a middle layer, such as sqlalchemy or ponyORM or peewee or others. You can write straight SQL queries but a SQL Alchemy tutorial might be a good place to start. Also...
2018-02-19T16:28:54.000174
Monroe
pythondev_help_Monroe_2018-02-19T16:28:54.000174
1,519,057,734.000174
34,847
pythondev
help
<@Salvador> <https://www.udacity.com/course/intro-to-relational-databases--ud197>
2018-02-19T16:28:57.000331
Henrietta
pythondev_help_Henrietta_2018-02-19T16:28:57.000331
1,519,057,737.000331
34,848
pythondev
help
there's SQLite which is a data-store that has properties very similar to SQL. It is included with Python and may (or may not) be a good step to get started in python and datastores
2018-02-19T16:29:46.000139
Monroe
pythondev_help_Monroe_2018-02-19T16:29:46.000139
1,519,057,786.000139
34,849
pythondev
help
Assuming you don't know sql, try that course otherwise use an ORM like <@Monroe> recommends
2018-02-19T16:30:16.000129
Henrietta
pythondev_help_Henrietta_2018-02-19T16:30:16.000129
1,519,057,816.000129
34,850
pythondev
help
cool which check out all of those
2018-02-19T16:30:49.000243
Salvador
pythondev_help_Salvador_2018-02-19T16:30:49.000243
1,519,057,849.000243
34,851
pythondev
help
thank you !
2018-02-19T16:30:59.000363
Salvador
pythondev_help_Salvador_2018-02-19T16:30:59.000363
1,519,057,859.000363
34,852
pythondev
help
<https://www.fullstackpython.com/object-relational-mappers-orms.html>
2018-02-19T16:32:05.000269
Monroe
pythondev_help_Monroe_2018-02-19T16:32:05.000269
1,519,057,925.000269
34,853
pythondev
help
<@Henrietta> Perhaps I didn't explain myself good enough. Anyway I wrote this
2018-02-19T16:41:07.000223
Gabrielle
pythondev_help_Gabrielle_2018-02-19T16:41:07.000223
1,519,058,467.000223
34,854
pythondev
help
I don't know if this is the proper way but it works.
2018-02-19T16:42:24.000216
Gabrielle
pythondev_help_Gabrielle_2018-02-19T16:42:24.000216
1,519,058,544.000216
34,855
pythondev
help
Neither do I, glad it works!
2018-02-19T16:42:44.000401
Henrietta
pythondev_help_Henrietta_2018-02-19T16:42:44.000401
1,519,058,564.000401
34,856
pythondev
help
:+1:
2018-02-19T16:43:02.000026
Gabrielle
pythondev_help_Gabrielle_2018-02-19T16:43:02.000026
1,519,058,582.000026
34,857
pythondev
help
i have a list of objects that I imported from a CSV. I can loop through the list and confirm the object name. however, i can't reference it using list.objectName.
2018-02-19T21:18:11.000051
Coreen
pythondev_help_Coreen_2018-02-19T21:18:11.000051
1,519,075,091.000051
34,858
pythondev
help
is there a way to access a particular member of a list using a key, without iterating over the full list? is that only possible with a dictionary
2018-02-19T21:36:47.000172
Coreen
pythondev_help_Coreen_2018-02-19T21:36:47.000172
1,519,076,207.000172
34,859
pythondev
help
you can use a lambda for that
2018-02-19T21:38:41.000154
Floy
pythondev_help_Floy_2018-02-19T21:38:41.000154
1,519,076,321.000154
34,860
pythondev
help
eg `results = filter(lambda x: x.objectName == some_value, list_of_objects)`
2018-02-19T21:39:26.000036
Floy
pythondev_help_Floy_2018-02-19T21:39:26.000036
1,519,076,366.000036
34,861
pythondev
help
ok, but probably not the right object type? i assume lower performance?
2018-02-19T21:40:16.000195
Coreen
pythondev_help_Coreen_2018-02-19T21:40:16.000195
1,519,076,416.000195
34,862
pythondev
help
sorry?
2018-02-19T21:40:27.000016
Floy
pythondev_help_Floy_2018-02-19T21:40:27.000016
1,519,076,427.000016
34,863
pythondev
help
no
2018-02-19T21:40:39.000047
Kacie
pythondev_help_Kacie_2018-02-19T21:40:39.000047
1,519,076,439.000047
34,864
pythondev
help
you’re looking at O(N) here at minimum, assuming the list isn’t sorted
2018-02-19T21:40:49.000148
Floy
pythondev_help_Floy_2018-02-19T21:40:49.000148
1,519,076,449.000148
34,865
pythondev
help
csv files are not ideal
2018-02-19T21:40:50.000217
Kacie
pythondev_help_Kacie_2018-02-19T21:40:50.000217
1,519,076,450.000217
34,866
pythondev
help
for that reason
2018-02-19T21:40:57.000192
Kacie
pythondev_help_Kacie_2018-02-19T21:40:57.000192
1,519,076,457.000192
34,867
pythondev
help
you have to search all the items to determine if they are there or not like <@Floy> is saying
2018-02-19T21:41:16.000096
Kacie
pythondev_help_Kacie_2018-02-19T21:41:16.000096
1,519,076,476.000096
34,868
pythondev
help
Good evening everyone! I hope your night is going well. I have a question about my Scrapy project. I am trying to scrape walmart data and put it into a database so I can play around with it. I am new to scrapy so would anyone be willing to check this out? It's showing that it's not able to scrape the page. Is my spide...
2018-02-19T21:41:24.000039
Chi
pythondev_help_Chi_2018-02-19T21:41:24.000039
1,519,076,484.000039
34,869
pythondev
help
<@Kacie>I was approaching the problem as if the file were already read into a list
2018-02-19T21:41:49.000177
Floy
pythondev_help_Floy_2018-02-19T21:41:49.000177
1,519,076,509.000177
34,870
pythondev
help
meh either way, you would have to iterate on it first at some point and then dump it to a json/dict or something to access randomly like he/she wants
2018-02-19T21:42:23.000255
Kacie
pythondev_help_Kacie_2018-02-19T21:42:23.000255
1,519,076,543.000255
34,871
pythondev
help
yep
2018-02-19T21:42:44.000127
Floy
pythondev_help_Floy_2018-02-19T21:42:44.000127
1,519,076,564.000127
34,872
pythondev
help
<@Chi> scrapy does observe some site's robots.txt
2018-02-19T21:42:58.000216
Kacie
pythondev_help_Kacie_2018-02-19T21:42:58.000216
1,519,076,578.000216
34,873
pythondev
help
meaning don't scrape them
2018-02-19T21:43:10.000166
Kacie
pythondev_help_Kacie_2018-02-19T21:43:10.000166
1,519,076,590.000166
34,874
pythondev
help
but you can override that
2018-02-19T21:43:13.000142
Kacie
pythondev_help_Kacie_2018-02-19T21:43:13.000142
1,519,076,593.000142
34,875
pythondev
help
but if the data is loaded via ajax request, then scrapy won’t work
2018-02-19T21:43:30.000232
Floy
pythondev_help_Floy_2018-02-19T21:43:30.000232
1,519,076,610.000232
34,876
pythondev
help
yeah, at that point its time to get fancy with specific scripts
2018-02-19T21:43:48.000083
Kacie
pythondev_help_Kacie_2018-02-19T21:43:48.000083
1,519,076,628.000083
34,877
pythondev
help
<@Coreen> did you get your answer?
2018-02-19T21:44:26.000142
Kacie
pythondev_help_Kacie_2018-02-19T21:44:26.000142
1,519,076,666.000142
34,878
pythondev
help
for that particular page, checking the network requests in browser dev tools shows the actual data is being loaded by ajax request
2018-02-19T21:44:45.000194
Floy
pythondev_help_Floy_2018-02-19T21:44:45.000194
1,519,076,685.000194
34,879
pythondev
help
Well, that certainly sounds like fun. Would you guys mind pointing me in the right direction for that kinda stuff?
2018-02-19T21:44:55.000100
Chi
pythondev_help_Chi_2018-02-19T21:44:55.000100
1,519,076,695.0001
34,880
pythondev
help
you need to use a headless browser to load the page and render the content
2018-02-19T21:45:18.000207
Floy
pythondev_help_Floy_2018-02-19T21:45:18.000207
1,519,076,718.000207
34,881
pythondev
help
then go from there
2018-02-19T21:45:25.000190
Floy
pythondev_help_Floy_2018-02-19T21:45:25.000190
1,519,076,725.00019
34,882
pythondev
help
thanks, yes i think i should probably switch to a dictionary instead
2018-02-19T21:45:27.000247
Coreen
pythondev_help_Coreen_2018-02-19T21:45:27.000247
1,519,076,727.000247
34,883
pythondev
help
Awesome, I'm looking into that now. Thank you very much!
2018-02-19T21:45:37.000066
Chi
pythondev_help_Chi_2018-02-19T21:45:37.000066
1,519,076,737.000066
34,884
pythondev
help
otherwise, look into walmart’s api and see if you can use that instead
2018-02-19T21:45:39.000219
Floy
pythondev_help_Floy_2018-02-19T21:45:39.000219
1,519,076,739.000219
34,885
pythondev
help
<https://www.codementor.io/codementorteam/how-to-scrape-an-ajax-website-using-python-qw8fuitvi>
2018-02-19T21:45:54.000184
Kacie
pythondev_help_Kacie_2018-02-19T21:45:54.000184
1,519,076,754.000184
34,886
pythondev
help
at some point you have to become a detective with scrapy
2018-02-19T21:46:11.000129
Kacie
pythondev_help_Kacie_2018-02-19T21:46:11.000129
1,519,076,771.000129
34,887
pythondev
help
also realize scrapy is not the end all tool
2018-02-19T21:46:29.000159
Kacie
pythondev_help_Kacie_2018-02-19T21:46:29.000159
1,519,076,789.000159
34,888
pythondev
help
and know the difference where the data is coming from
2018-02-19T21:46:29.000211
Floy
pythondev_help_Floy_2018-02-19T21:46:29.000211
1,519,076,789.000211
34,889
pythondev
help
That has all been very helpful, I appreciate it! :)
2018-02-19T21:46:48.000260
Chi
pythondev_help_Chi_2018-02-19T21:46:48.000260
1,519,076,808.00026
34,890
pythondev
help
<@Coreen> dictionary would be certainly helpful for randomly accessing keys :slightly_smiling_face:
2018-02-19T21:47:16.000192
Kacie
pythondev_help_Kacie_2018-02-19T21:47:16.000192
1,519,076,836.000192
34,891
pythondev
help
as long as you pick the right key
2018-02-19T21:47:28.000046
Floy
pythondev_help_Floy_2018-02-19T21:47:28.000046
1,519,076,848.000046
34,892
pythondev
help
otherwise ¯\_(ツ)_/¯
2018-02-19T21:47:35.000076
Floy
pythondev_help_Floy_2018-02-19T21:47:35.000076
1,519,076,855.000076
34,893
pythondev
help
FWIW, I’d look into dumping the file into a db
2018-02-19T21:47:59.000084
Floy
pythondev_help_Floy_2018-02-19T21:47:59.000084
1,519,076,879.000084
34,894
pythondev
help
like sqlite if you don’t need something like mysql or postgres
2018-02-19T21:48:14.000112
Floy
pythondev_help_Floy_2018-02-19T21:48:14.000112
1,519,076,894.000112
34,895
pythondev
help
or thats a good one
2018-02-19T21:48:35.000173
Kacie
pythondev_help_Kacie_2018-02-19T21:48:35.000173
1,519,076,915.000173
34,896
pythondev
help
well, i have about 100 total values. for now a static text file is easier than setting up a database, but i could do it
2018-02-19T21:51:16.000048
Coreen
pythondev_help_Coreen_2018-02-19T21:51:16.000048
1,519,077,076.000048
34,897
pythondev
help
sqlite is afile
2018-02-19T21:51:31.000155
Kacie
pythondev_help_Kacie_2018-02-19T21:51:31.000155
1,519,077,091.000155
34,898
pythondev
help
but yep :slightly_smiling_face:
2018-02-19T21:51:36.000205
Kacie
pythondev_help_Kacie_2018-02-19T21:51:36.000205
1,519,077,096.000205
34,899
pythondev
help
if its that small just load the csv into memory and play with it
2018-02-19T21:51:58.000221
Kacie
pythondev_help_Kacie_2018-02-19T21:51:58.000221
1,519,077,118.000221
34,900
pythondev
help
i'll also want to load all of the values at once i think. i'm loading the values into a platform someone else built, and i think all of the values i want will need to be loaded
2018-02-19T21:52:04.000121
Coreen
pythondev_help_Coreen_2018-02-19T21:52:04.000121
1,519,077,124.000121
34,901
pythondev
help
so searching, etc., not critical advantage
2018-02-19T21:52:18.000050
Coreen
pythondev_help_Coreen_2018-02-19T21:52:18.000050
1,519,077,138.00005
34,902
pythondev
help
well yeah ,depending on the size
2018-02-19T21:52:30.000190
Kacie
pythondev_help_Kacie_2018-02-19T21:52:30.000190
1,519,077,150.00019
34,903
pythondev
help
i'm just new to Python and want to make sure I use the right variable types
2018-02-19T21:52:31.000224
Coreen
pythondev_help_Coreen_2018-02-19T21:52:31.000224
1,519,077,151.000224
34,904
pythondev
help
yeah so definitely a dictionary is a solid choice
2018-02-19T21:52:47.000054
Kacie
pythondev_help_Kacie_2018-02-19T21:52:47.000054
1,519,077,167.000054
34,905
pythondev
help
you can grab values super fast with the correct key
2018-02-19T21:53:02.000230
Kacie
pythondev_help_Kacie_2018-02-19T21:53:02.000230
1,519,077,182.00023
34,906
pythondev
help
if i have a dictionary of objects, i'll reference it as my_dict['objname].property?
2018-02-19T21:53:47.000056
Coreen
pythondev_help_Coreen_2018-02-19T21:53:47.000056
1,519,077,227.000056
34,907
pythondev
help
umm
2018-02-19T21:53:57.000004
Kacie
pythondev_help_Kacie_2018-02-19T21:53:57.000004
1,519,077,237.000004
34,908
pythondev
help
``` csv_dictionary = {} ```
2018-02-19T21:54:13.000208
Kacie
pythondev_help_Kacie_2018-02-19T21:54:13.000208
1,519,077,253.000208
34,909
pythondev
help
then
2018-02-19T21:54:18.000158
Kacie
pythondev_help_Kacie_2018-02-19T21:54:18.000158
1,519,077,258.000158
34,910
pythondev
help
``` csv_dictionary['proper_key'] ```
2018-02-19T21:54:35.000107
Kacie
pythondev_help_Kacie_2018-02-19T21:54:35.000107
1,519,077,275.000107
34,911
pythondev
help
thats one way
2018-02-19T21:54:40.000189
Kacie
pythondev_help_Kacie_2018-02-19T21:54:40.000189
1,519,077,280.000189
34,912
pythondev
help
thats the 'standard'
2018-02-19T21:54:55.000175
Kacie
pythondev_help_Kacie_2018-02-19T21:54:55.000175
1,519,077,295.000175
34,913
pythondev
help
or ```csv_dictionary.get('proper_key') ```
2018-02-19T21:55:12.000189
Kacie
pythondev_help_Kacie_2018-02-19T21:55:12.000189
1,519,077,312.000189
34,914
pythondev
help
umm so i guess in your question, it depends on what that object is?
2018-02-19T21:56:20.000194
Kacie
pythondev_help_Kacie_2018-02-19T21:56:20.000194
1,519,077,380.000194
34,915
pythondev
help
assuming ```Object1``` has a method called ```pizza``` you would do ```my_dict['key_to_first_object'].pizza()```
2018-02-19T21:57:24.000173
Kacie
pythondev_help_Kacie_2018-02-19T21:57:24.000173
1,519,077,444.000173
34,916
pythondev
help
yes, i think that answers my question. the key is not necessarily the name of the object for this example, right? that makes sense if i undertand it correctly
2018-02-19T22:01:33.000076
Coreen
pythondev_help_Coreen_2018-02-19T22:01:33.000076
1,519,077,693.000076
34,917
pythondev
help
nope its whatever you want it to be
2018-02-19T22:01:44.000080
Kacie
pythondev_help_Kacie_2018-02-19T22:01:44.000080
1,519,077,704.00008
34,918
pythondev
help
so if you had an object/string/whatever called Object1
2018-02-19T22:02:07.000047
Kacie
pythondev_help_Kacie_2018-02-19T22:02:07.000047
1,519,077,727.000047
34,919
pythondev
help
you could make the key for that object in the dictionary called 'pikachu'
2018-02-19T22:02:21.000238
Kacie
pythondev_help_Kacie_2018-02-19T22:02:21.000238
1,519,077,741.000238
34,920
pythondev
help
so ```my_dict['pikachu'] == Object1 ```
2018-02-19T22:02:43.000138
Kacie
pythondev_help_Kacie_2018-02-19T22:02:43.000138
1,519,077,763.000138
34,921
pythondev
help
and the name 'Object1' wouldn't factor into displaying any properties or calling any method of the object when stored in the dictionary
2018-02-19T22:03:08.000083
Coreen
pythondev_help_Coreen_2018-02-19T22:03:08.000083
1,519,077,788.000083
34,922
pythondev
help
uhh if youre starting out no
2018-02-19T22:03:32.000020
Kacie
pythondev_help_Kacie_2018-02-19T22:03:32.000020
1,519,077,812.00002
34,923