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 | ...workin.... | 2017-07-16T11:40:48.204581 | Ruben | pythondev_help_Ruben_2017-07-16T11:40:48.204581 | 1,500,205,248.204581 | 85,503 |
pythondev | help | Ahh | 2017-07-16T11:41:22.207199 | Vonnie | pythondev_help_Vonnie_2017-07-16T11:41:22.207199 | 1,500,205,282.207199 | 85,504 |
pythondev | help | I had set up a crawler to download scripts | 2017-07-16T11:41:34.207995 | Vonnie | pythondev_help_Vonnie_2017-07-16T11:41:34.207995 | 1,500,205,294.207995 | 85,505 |
pythondev | help | Sorry | 2017-07-16T11:41:40.208457 | Vonnie | pythondev_help_Vonnie_2017-07-16T11:41:40.208457 | 1,500,205,300.208457 | 85,506 |
pythondev | help | Tweets I mean | 2017-07-16T11:41:43.208632 | Vonnie | pythondev_help_Vonnie_2017-07-16T11:41:43.208632 | 1,500,205,303.208632 | 85,507 |
pythondev | help | Is there a way I can fix it? | 2017-07-16T11:42:27.211676 | Vonnie | pythondev_help_Vonnie_2017-07-16T11:42:27.211676 | 1,500,205,347.211676 | 85,508 |
pythondev | help | <@Vonnie> This will work:
```
import json
nr = 0
for line in open("stream_BhagNawazBhag.json"):
ob = json.loads(line)
text = ob.get("text", "")
user = ob.get("user")
if user:
username = user.get("name", "")
print username
print text.encode("utf8")
print
if nr > 10:
break
else:
nr += 1
``` | 2017-07-16T11:45:56.227193 | Ruben | pythondev_help_Ruben_2017-07-16T11:45:56.227193 | 1,500,205,556.227193 | 85,509 |
pythondev | help | <@Vonnie> Getting data from Twitter is quite something else as parsing that data ;-) | 2017-07-16T11:46:34.230211 | Ruben | pythondev_help_Ruben_2017-07-16T11:46:34.230211 | 1,500,205,594.230211 | 85,510 |
pythondev | help | You should use the context manager for the file open to ensure it's closed, and use the future print function to make sure the code is 3.x compatible | 2017-07-16T11:46:53.231468 | Beula | pythondev_help_Beula_2017-07-16T11:46:53.231468 | 1,500,205,613.231468 | 85,511 |
pythondev | help | I understand. Sorry for being a noob | 2017-07-16T11:46:57.231765 | Vonnie | pythondev_help_Vonnie_2017-07-16T11:46:57.231765 | 1,500,205,617.231765 | 85,512 |
pythondev | help | Just that I got the data. Wanted to parse it | 2017-07-16T11:47:06.232400 | Vonnie | pythondev_help_Vonnie_2017-07-16T11:47:06.232400 | 1,500,205,626.2324 | 85,513 |
pythondev | help | <@Beula> Thanks for your excellent advice! | 2017-07-16T11:47:23.233584 | Ruben | pythondev_help_Ruben_2017-07-16T11:47:23.233584 | 1,500,205,643.233584 | 85,514 |
pythondev | help | <@Beula> should I install python 3 then? | 2017-07-16T11:47:45.235314 | Vonnie | pythondev_help_Vonnie_2017-07-16T11:47:45.235314 | 1,500,205,665.235314 | 85,515 |
pythondev | help | <@Ruben> :taco: nice suggestion for the op | 2017-07-16T11:47:50.235653 | Beula | pythondev_help_Beula_2017-07-16T11:47:50.235653 | 1,500,205,670.235653 | 85,516 |
pythondev | help | <@Vonnie> - Python 3 is the future of the language, so it is worth using. But for now, I wouldn't divert your attention from your current issue | 2017-07-16T11:48:43.239671 | Beula | pythondev_help_Beula_2017-07-16T11:48:43.239671 | 1,500,205,723.239671 | 85,517 |
pythondev | help | Ahh | 2017-07-16T11:48:56.240721 | Vonnie | pythondev_help_Vonnie_2017-07-16T11:48:56.240721 | 1,500,205,736.240721 | 85,518 |
pythondev | help | <@Vonnie> It depends on what you use now. Do you need any Python 3 features for your work that you can't do in Python 2? Eventually, Python 2 will become obscure indeed. | 2017-07-16T11:49:13.241964 | Ruben | pythondev_help_Ruben_2017-07-16T11:49:13.241964 | 1,500,205,753.241964 | 85,519 |
pythondev | help | <@Beula> I will keep that in mind | 2017-07-16T11:49:23.242798 | Vonnie | pythondev_help_Vonnie_2017-07-16T11:49:23.242798 | 1,500,205,763.242798 | 85,520 |
pythondev | help | ...probably 20 years into the future.... but remember 2000! Nobody saw _that_ coming. | 2017-07-16T11:49:37.243876 | Ruben | pythondev_help_Ruben_2017-07-16T11:49:37.243876 | 1,500,205,777.243876 | 85,521 |
pythondev | help | <@Ruben> for the moment, I just need to finish this | 2017-07-16T11:49:50.244797 | Vonnie | pythondev_help_Vonnie_2017-07-16T11:49:50.244797 | 1,500,205,790.244797 | 85,522 |
pythondev | help | <@Vonnie> Stick with what you have then ;-) But make a mental note to upgrade, 10 years from now. | 2017-07-16T11:50:09.246264 | Ruben | pythondev_help_Ruben_2017-07-16T11:50:09.246264 | 1,500,205,809.246264 | 85,523 |
pythondev | help | I will upgrade 2 months from now :) | 2017-07-16T11:50:21.247183 | Vonnie | pythondev_help_Vonnie_2017-07-16T11:50:21.247183 | 1,500,205,821.247183 | 85,524 |
pythondev | help | That's great | 2017-07-16T11:50:28.247765 | Ruben | pythondev_help_Ruben_2017-07-16T11:50:28.247765 | 1,500,205,828.247765 | 85,525 |
pythondev | help | Will try the code | 2017-07-16T11:50:29.247866 | Vonnie | pythondev_help_Vonnie_2017-07-16T11:50:29.247866 | 1,500,205,829.247866 | 85,526 |
pythondev | help | <@Vonnie> Also, your file should be named *BhagNawazBhag_stream.txt* instead of *stream_BhagNawazBhag.json*, because it is really not a JSON file. It is a text file with a JSON packet on every line. The program which produces this, will cause confusion by naming it with a '.json' extension. | 2017-07-16T11:51:58.254361 | Ruben | pythondev_help_Ruben_2017-07-16T11:51:58.254361 | 1,500,205,918.254361 | 85,527 |
pythondev | help | Ohhh | 2017-07-16T11:52:54.258377 | Vonnie | pythondev_help_Vonnie_2017-07-16T11:52:54.258377 | 1,500,205,974.258377 | 85,528 |
pythondev | help | I wish i had joined this group earlier | 2017-07-16T11:53:15.259954 | Vonnie | pythondev_help_Vonnie_2017-07-16T11:53:15.259954 | 1,500,205,995.259954 | 85,529 |
pythondev | help | Had spent countless hours looking for a solution | 2017-07-16T11:53:31.261187 | Vonnie | pythondev_help_Vonnie_2017-07-16T11:53:31.261187 | 1,500,206,011.261187 | 85,530 |
pythondev | help | <@Vonnie> And this is the code with mattrasband's suggestions applied:
```
from __future__ import print_function
import json
nr = 0
with open("stream_BhagNawazBhag.json") as f:
for line in f:
ob = json.loads(line)
text = ob.get("text", "")
user = ob.get("user")
if user:
username = user.get("name", "")
print(username)
print(text.encode("utf8"))
print()
if nr > 10:
break
else:
nr += 1
``` | 2017-07-16T11:54:56.268215 | Ruben | pythondev_help_Ruben_2017-07-16T11:54:56.268215 | 1,500,206,096.268215 | 85,531 |
pythondev | help | let me try it out. Thank you for that. I really appreciate the help. | 2017-07-16T11:55:38.271627 | Vonnie | pythondev_help_Vonnie_2017-07-16T11:55:38.271627 | 1,500,206,138.271627 | 85,532 |
pythondev | help | I agree that the *from future* is quite useful for all of the people who use Python 3 already, but I'm less convinced of the *with open() as f* context manager. I think the file object will be closed anyway when it goes out of scope; the context manager seems to add extra complexity and an extra indentation level. However I _do_ think a file context is useful when writing a file as part of a larger operation, so you can indeed force it to close (and flush to disk). | 2017-07-16T11:57:26.280426 | Ruben | pythondev_help_Ruben_2017-07-16T11:57:26.280426 | 1,500,206,246.280426 | 85,533 |
pythondev | help | I did try python 3 earlier but a lot of the scripts/recipes were written in 2.7, so I had to downgrade | 2017-07-16T11:58:27.285176 | Vonnie | pythondev_help_Vonnie_2017-07-16T11:58:27.285176 | 1,500,206,307.285176 | 85,534 |
pythondev | help | Uh-uh. I see. | 2017-07-16T11:58:38.286020 | Ruben | pythondev_help_Ruben_2017-07-16T11:58:38.286020 | 1,500,206,318.28602 | 85,535 |
pythondev | help | Well, it's not forbidden to use Python 2 ;-) | 2017-07-16T11:58:46.286602 | Ruben | pythondev_help_Ruben_2017-07-16T11:58:46.286602 | 1,500,206,326.286602 | 85,536 |
pythondev | help | I used it for 25 years and I'm still using it. | 2017-07-16T11:59:37.290778 | Ruben | pythondev_help_Ruben_2017-07-16T11:59:37.290778 | 1,500,206,377.290778 | 85,537 |
pythondev | help | i understand :slightly_smiling_face: Apologies for being a bit slow here | 2017-07-16T11:59:56.292729 | Vonnie | pythondev_help_Vonnie_2017-07-16T11:59:56.292729 | 1,500,206,396.292729 | 85,538 |
pythondev | help | the script worked | 2017-07-16T12:00:06.294344 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:00:06.294344 | 1,500,206,406.294344 | 85,539 |
pythondev | help | Great! And now? | 2017-07-16T12:00:11.295135 | Ruben | pythondev_help_Ruben_2017-07-16T12:00:11.295135 | 1,500,206,411.295135 | 85,540 |
pythondev | help | i can run that in the command prompt and save the output. | 2017-07-16T12:01:04.300484 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:01:04.300484 | 1,500,206,464.300484 | 85,541 |
pythondev | help | would i be able to edit the code and add some more to it? as in to get other data from it? | 2017-07-16T12:01:23.302291 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:01:23.302291 | 1,500,206,483.302291 | 85,542 |
pythondev | help | What is your ultimate goal? To extract the tweets from the file? | 2017-07-16T12:01:28.302644 | Ruben | pythondev_help_Ruben_2017-07-16T12:01:28.302644 | 1,500,206,488.302644 | 85,543 |
pythondev | help | Oh yeah sure you could extract anything and everything from it | 2017-07-16T12:01:47.304255 | Ruben | pythondev_help_Ruben_2017-07-16T12:01:47.304255 | 1,500,206,507.304255 | 85,544 |
pythondev | help | Basically I just need to make the file easier to read so I can count the number of tweets, retweets, see who tweets the most, and do a word cloud. | 2017-07-16T12:02:46.309263 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:02:46.309263 | 1,500,206,566.309263 | 85,545 |
pythondev | help | <@Vonnie> Ah, you want to do some statistics on the data. | 2017-07-16T12:03:47.314477 | Ruben | pythondev_help_Ruben_2017-07-16T12:03:47.314477 | 1,500,206,627.314477 | 85,546 |
pythondev | help | Yup. That's what the plan is. I just need to get a better idea of what people are doing and saying | 2017-07-16T12:04:12.316806 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:04:12.316806 | 1,500,206,652.316806 | 85,547 |
pythondev | help | Well, counting the tweets is not hard: that's just the number of tweet objects in your stream file. | 2017-07-16T12:04:21.317572 | Ruben | pythondev_help_Ruben_2017-07-16T12:04:21.317572 | 1,500,206,661.317572 | 85,548 |
pythondev | help | yeah i mean that was just the easiest part :slightly_smiling_face: | 2017-07-16T12:04:35.318580 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:04:35.318580 | 1,500,206,675.31858 | 85,549 |
pythondev | help | there was another script which had the functions i needed but it gave me the same error | 2017-07-16T12:05:17.322021 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:05:17.322021 | 1,500,206,717.322021 | 85,550 |
pythondev | help | Counting the number of retweets is somewhat harder, is that mentioned in the Tweet object? If so, you could fetch it and do something with it. Retweets always belong to one specific tweet, no? | 2017-07-16T12:05:30.323019 | Ruben | pythondev_help_Ruben_2017-07-16T12:05:30.323019 | 1,500,206,730.323019 | 85,551 |
pythondev | help | well i could skip that. just would prefer to see who the most prolific ones are | 2017-07-16T12:06:21.327013 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:06:21.327013 | 1,500,206,781.327013 | 85,552 |
pythondev | help | You mean, you are only interested in tweets that get a lot of retweets? | 2017-07-16T12:07:00.329913 | Ruben | pythondev_help_Ruben_2017-07-16T12:07:00.329913 | 1,500,206,820.329913 | 85,553 |
pythondev | help | well i am analysing twitter trends. have four big files. want to see who tweets the most, which ones got the most RTs, geotag them, and make a word cloud. | 2017-07-16T12:07:50.334036 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:07:50.334036 | 1,500,206,870.334036 | 85,554 |
pythondev | help | Why do you have 4 big files, and not 2 or 6 or 35? | 2017-07-16T12:08:21.336394 | Ruben | pythondev_help_Ruben_2017-07-16T12:08:21.336394 | 1,500,206,901.336394 | 85,555 |
pythondev | help | the script i followed didn't give me the option to make smaller ones | 2017-07-16T12:08:43.338036 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:08:43.338036 | 1,500,206,923.338036 | 85,556 |
pythondev | help | so basically i collected a lot of tweets for trends | 2017-07-16T12:08:55.338932 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:08:55.338932 | 1,500,206,935.338932 | 85,557 |
pythondev | help | the four files are for four trends | 2017-07-16T12:09:03.339525 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:09:03.339525 | 1,500,206,943.339525 | 85,558 |
pythondev | help | Ah, every trend gets its own stream file! | 2017-07-16T12:09:17.340572 | Ruben | pythondev_help_Ruben_2017-07-16T12:09:17.340572 | 1,500,206,957.340572 | 85,559 |
pythondev | help | yes | 2017-07-16T12:09:26.341250 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:09:26.341250 | 1,500,206,966.34125 | 85,560 |
pythondev | help | and those files are around 1 gb to 1.5 gb each | 2017-07-16T12:09:43.342477 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:09:43.342477 | 1,500,206,983.342477 | 85,561 |
pythondev | help | *who tweets the most* -> Every tweet has a 'user' object, and in there is a 'name' attribute with the name of the user who made the tweet. You could use a dictionary to store all usernames and the tweet count. You know, going from the beginning to the end of the tweets and storing the username in a dict, or incrementing the tweet count if the user is already in the dict. | 2017-07-16T12:11:39.352031 | Ruben | pythondev_help_Ruben_2017-07-16T12:11:39.352031 | 1,500,207,099.352031 | 85,562 |
pythondev | help | The when the counting is done, you could convert the dict to a list of (name, tweetcount) tuples and sort that on decreasing tweetcount. Then print out the first 10 items of the result and you have a TOP 10 of most prolific tweeters. | 2017-07-16T12:12:39.356748 | Ruben | pythondev_help_Ruben_2017-07-16T12:12:39.356748 | 1,500,207,159.356748 | 85,563 |
pythondev | help | Or is it twitterers? | 2017-07-16T12:12:46.357359 | Ruben | pythondev_help_Ruben_2017-07-16T12:12:46.357359 | 1,500,207,166.357359 | 85,564 |
pythondev | help | :stuck_out_tongue_winking_eye: | 2017-07-16T12:12:59.358414 | Ruben | pythondev_help_Ruben_2017-07-16T12:12:59.358414 | 1,500,207,179.358414 | 85,565 |
pythondev | help | Either name works :) | 2017-07-16T12:12:59.358444 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:12:59.358444 | 1,500,207,179.358444 | 85,566 |
pythondev | help | <@Vonnie> Dont worry about the file size because the construction 'for line in f: ...' doesn't load the entire file into memory. | 2017-07-16T12:13:49.362256 | Ruben | pythondev_help_Ruben_2017-07-16T12:13:49.362256 | 1,500,207,229.362256 | 85,567 |
pythondev | help | Ahh | 2017-07-16T12:14:52.367146 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:14:52.367146 | 1,500,207,292.367146 | 85,568 |
pythondev | help | So no need to iterate | 2017-07-16T12:14:58.367613 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:14:58.367613 | 1,500,207,298.367613 | 85,569 |
pythondev | help | Would I be too lazy if I asked someone here how I can do that? | 2017-07-16T12:17:11.378275 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:17:11.378275 | 1,500,207,431.378275 | 85,570 |
pythondev | help | <@Vonnie> For example, to show the Twitter users with the most tweets:
```
import json
import collections
twitterers = collections.defaultdict(int)
with open("stream_BhagNawazBhag.json") as f:
for line in f:
ob = json.loads(line)
# text = ob.get("text", "")
user = ob.get("user")
if user:
username = user.get("name", "")
if username:
twitterers[username] += 1
print "Most prolific twitterers (or tweeters? Twitter users?)"
for k, v in sorted(twitterers.iteritems(), key=lambda item: item[1], reverse=True):
msg = u"%s - %d tweets" % (k, v)
print msg.encode("utf8")
if v < 6:
break # We're not interested in people with less than 6 tweets
''' Will output:
Most prolific twitterers (or tweeters? Twitter users?)
KhalidMunawarPTI - 29 tweets
Adger Alam - 15 tweets
Mamma Mia - 12 tweets
Kashif Mughal 🇵🇰 - 12 tweets
zain ali - 9 tweets
Nuzhat Khan - 9 tweets
lubna - 9 tweets
Fahid Gill - 8 tweets
PeacefulBalochistan - 8 tweets
ⱲᎪႭᴀᏚ ҚᏂᎪⴖ 🇵🇰 - 7 tweets
Osman Kasim - 7 tweets
Maida Farid - 7 tweets
balochi - 7 tweets
Farrukh Hasan - 6 tweets
Pervez esabzai - 6 tweets
Ali Irfan - 6 tweets
PM - Imran Khan - 5 tweets
'''
``` | 2017-07-16T12:19:40.390141 | Ruben | pythondev_help_Ruben_2017-07-16T12:19:40.390141 | 1,500,207,580.390141 | 85,571 |
pythondev | help | Wow | 2017-07-16T12:20:09.392897 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:20:09.392897 | 1,500,207,609.392897 | 85,572 |
pythondev | help | That's really good | 2017-07-16T12:20:17.393703 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:20:17.393703 | 1,500,207,617.393703 | 85,573 |
pythondev | help | I need to sit down and work on my python skills after September | 2017-07-16T12:20:44.395816 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:20:44.395816 | 1,500,207,644.395816 | 85,574 |
pythondev | help | <@Vonnie> Yeah it really pays to know the data structures and the common idioms. | 2017-07-16T12:21:53.401196 | Ruben | pythondev_help_Ruben_2017-07-16T12:21:53.401196 | 1,500,207,713.401196 | 85,575 |
pythondev | help | I am sure my code can be made even better. | 2017-07-16T12:22:11.402584 | Ruben | pythondev_help_Ruben_2017-07-16T12:22:11.402584 | 1,500,207,731.402584 | 85,576 |
pythondev | help | Do you see a bug there? `not interested in people with less than 6 tweets` still, I see a line which says `PM - Imran Khan - 5 tweets`. How do you think that could be prevented? | 2017-07-16T12:23:51.410324 | Ruben | pythondev_help_Ruben_2017-07-16T12:23:51.410324 | 1,500,207,831.410324 | 85,577 |
pythondev | help | Maybe not include RTs | 2017-07-16T12:24:46.414835 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:24:46.414835 | 1,500,207,886.414835 | 85,578 |
pythondev | help | It probably has included RTs | 2017-07-16T12:24:54.415557 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:24:54.415557 | 1,500,207,894.415557 | 85,579 |
pythondev | help | No, I don't do anything with retweets in the code above. | 2017-07-16T12:25:10.416952 | Ruben | pythondev_help_Ruben_2017-07-16T12:25:10.416952 | 1,500,207,910.416952 | 85,580 |
pythondev | help | Maybe I can let that slide | 2017-07-16T12:26:39.423867 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:26:39.423867 | 1,500,207,999.423867 | 85,581 |
pythondev | help | Will just truncate the rest | 2017-07-16T12:26:45.424341 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:26:45.424341 | 1,500,208,005.424341 | 85,582 |
pythondev | help | The solution is to test _before_ outputting something, like:
```
for k, v in sorted(...):
if v < 6:
break # We're not interested in people with less than 6 tweets
msg = u"%s - %d tweets" % (k, v)
print msg
```
instead of:
```
for k, v in sorted(...):
msg = u"%s - %d tweets" % (k, v)
print msg
if v < 6:
break # We're not interested in people with less than 6 tweets
``` | 2017-07-16T12:28:20.431863 | Ruben | pythondev_help_Ruben_2017-07-16T12:28:20.431863 | 1,500,208,100.431863 | 85,583 |
pythondev | help | Ahh | 2017-07-16T12:28:48.434008 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:28:48.434008 | 1,500,208,128.434008 | 85,584 |
pythondev | help | You know what the `break` statement does? | 2017-07-16T12:30:22.442254 | Ruben | pythondev_help_Ruben_2017-07-16T12:30:22.442254 | 1,500,208,222.442254 | 85,585 |
pythondev | help | Terminate | 2017-07-16T12:31:02.445777 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:31:02.445777 | 1,500,208,262.445777 | 85,586 |
pythondev | help | Terminate what? The whole program? | 2017-07-16T12:34:34.463768 | Ruben | pythondev_help_Ruben_2017-07-16T12:34:34.463768 | 1,500,208,474.463768 | 85,587 |
pythondev | help | Inside the loop | 2017-07-16T12:35:13.466829 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:35:13.466829 | 1,500,208,513.466829 | 85,588 |
pythondev | help | Correct! The break terminates the loop in which it is placed | 2017-07-16T12:35:43.469266 | Ruben | pythondev_help_Ruben_2017-07-16T12:35:43.469266 | 1,500,208,543.469266 | 85,589 |
pythondev | help | Glad I remember some of my stuff | 2017-07-16T12:37:05.475960 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:37:05.475960 | 1,500,208,625.47596 | 85,590 |
pythondev | help | Will try this out | 2017-07-16T12:42:04.500488 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:42:04.500488 | 1,500,208,924.500488 | 85,591 |
pythondev | help | Another nice question. What's the difference between a *class* and an *instance* ? :stuck_out_tongue_winking_eye: | 2017-07-16T12:42:55.504427 | Ruben | pythondev_help_Ruben_2017-07-16T12:42:55.504427 | 1,500,208,975.504427 | 85,592 |
pythondev | help | A class consists of objects etc | 2017-07-16T12:45:11.515630 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:45:11.515630 | 1,500,209,111.51563 | 85,593 |
pythondev | help | And an instance is an object | 2017-07-16T12:45:49.518672 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:45:49.518672 | 1,500,209,149.518672 | 85,594 |
pythondev | help | I agree that an instance is an object, but not that a class 'consists of' objects. | 2017-07-16T12:47:03.524486 | Ruben | pythondev_help_Ruben_2017-07-16T12:47:03.524486 | 1,500,209,223.524486 | 85,595 |
pythondev | help | A template? | 2017-07-16T12:47:34.526885 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:47:34.526885 | 1,500,209,254.526885 | 85,596 |
pythondev | help | Mjah not bad. A *class* is indeed a kind of definition which says what data exists and what methods (functions) there are to operate on it. However, having a *Person* class doesn't give you actual persons. You'd have to _instantiate_ some Person objects and give them names, ages, etc... | 2017-07-16T12:51:42.547183 | Ruben | pythondev_help_Ruben_2017-07-16T12:51:42.547183 | 1,500,209,502.547183 | 85,597 |
pythondev | help | And in Python, as well as Swift, we can instantiate objects by calling the class as if it were a function. `fred = Person()` will instantiate an instance of the class Person and have `fred` reference it. In Javascript you have to use `new` to create a new instance of a class. | 2017-07-16T12:53:41.557055 | Ruben | pythondev_help_Ruben_2017-07-16T12:53:41.557055 | 1,500,209,621.557055 | 85,598 |
pythondev | help | In Ruby too! | 2017-07-16T12:53:58.558431 | Ruben | pythondev_help_Ruben_2017-07-16T12:53:58.558431 | 1,500,209,638.558431 | 85,599 |
pythondev | help | Ahh | 2017-07-16T12:54:28.561081 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:54:28.561081 | 1,500,209,668.561081 | 85,600 |
pythondev | help | So you like learning Python? | 2017-07-16T12:54:51.562833 | Ruben | pythondev_help_Ruben_2017-07-16T12:54:51.562833 | 1,500,209,691.562833 | 85,601 |
pythondev | help | I found it more interesting than other languages | 2017-07-16T12:55:20.565244 | Vonnie | pythondev_help_Vonnie_2017-07-16T12:55:20.565244 | 1,500,209,720.565244 | 85,602 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.