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
lines 145 and 148 (and I'm sure others in the code you didn't post) call main(). Are you also calling main() at the bottom near/next to menu()? No, right? Otherwise you'd get dup menu().
2017-07-29T16:06:29.405728
Deedee
pythondev_help_Deedee_2017-07-29T16:06:29.405728
1,501,344,389.405728
88,003
pythondev
help
so try `if __name__ ....` to call `main()`. and use `main()` to start you off and maintain control of flow/logic, and when to quit.
2017-07-29T16:08:09.414093
Deedee
pythondev_help_Deedee_2017-07-29T16:08:09.414093
1,501,344,489.414093
88,004
pythondev
help
Ok I'll try that
2017-07-29T16:19:58.468932
Susanne
pythondev_help_Susanne_2017-07-29T16:19:58.468932
1,501,345,198.468932
88,005
pythondev
help
<@Susanne> This is just an example of how I've done this in the past <https://github.com/khdc-me/PracticePython_org/blob/master/Exercise032.py> NOTE: There are a lot of things that I would change if I had to redo this game, but it can serve as a basic guide for what you are trying to do. Again, don't follow this outright, but use it for ideas.
2017-07-29T16:30:55.517659
Deedee
pythondev_help_Deedee_2017-07-29T16:30:55.517659
1,501,345,855.517659
88,006
pythondev
help
so youre saying get rid of the main()‘s and just slap a if __name__ == “__main__” on the bottom?
2017-07-29T17:48:13.844812
Susanne
pythondev_help_Susanne_2017-07-29T17:48:13.844812
1,501,350,493.844812
88,007
pythondev
help
no. scroll up to 11:30am. and read my reply to your previous msg
2017-07-29T17:51:13.856278
Deedee
pythondev_help_Deedee_2017-07-29T17:51:13.856278
1,501,350,673.856278
88,008
pythondev
help
Also read this
2017-07-29T17:57:56.882326
Deedee
pythondev_help_Deedee_2017-07-29T17:57:56.882326
1,501,351,076.882326
88,009
pythondev
help
Here is the revised code
2017-07-29T18:52:56.090628
Susanne
pythondev_help_Susanne_2017-07-29T18:52:56.090628
1,501,354,376.090628
88,010
pythondev
help
<@Deedee>
2017-07-29T18:54:35.096809
Susanne
pythondev_help_Susanne_2017-07-29T18:54:35.096809
1,501,354,475.096809
88,011
pythondev
help
remove line 167
2017-07-29T18:55:38.100755
Deedee
pythondev_help_Deedee_2017-07-29T18:55:38.100755
1,501,354,538.100755
88,012
pythondev
help
did you look at the link I sent you to the 'example'?
2017-07-29T18:56:46.104892
Deedee
pythondev_help_Deedee_2017-07-29T18:56:46.104892
1,501,354,606.104892
88,013
pythondev
help
Yes I did? so how are you able to call main then?
2017-07-29T18:57:33.107835
Susanne
pythondev_help_Susanne_2017-07-29T18:57:33.107835
1,501,354,653.107835
88,014
pythondev
help
it just does.
2017-07-29T18:57:44.108488
Deedee
pythondev_help_Deedee_2017-07-29T18:57:44.108488
1,501,354,664.108488
88,015
pythondev
help
so this way, main() runs if this is run as a script... a stand-alone script.
2017-07-29T18:58:04.109712
Deedee
pythondev_help_Deedee_2017-07-29T18:58:04.109712
1,501,354,684.109712
88,016
pythondev
help
like, you create a hello world and run it from terminal by `python helloworld.py` ``` def main(): print "Hello World" if __name__ == '__main__': main() ```
2017-07-29T18:59:10.113976
Deedee
pythondev_help_Deedee_2017-07-29T18:59:10.113976
1,501,354,750.113976
88,017
pythondev
help
but I dont have scripts on my function Im using that function to call functions
2017-07-29T18:59:50.116479
Susanne
pythondev_help_Susanne_2017-07-29T18:59:50.116479
1,501,354,790.116479
88,018
pythondev
help
but in raelity main is kinda of a useless function tbh
2017-07-29T19:00:08.118183
Susanne
pythondev_help_Susanne_2017-07-29T19:00:08.118183
1,501,354,808.118183
88,019
pythondev
help
would you suggest getting rid of hte main functino?
2017-07-29T19:02:11.127652
Susanne
pythondev_help_Susanne_2017-07-29T19:02:11.127652
1,501,354,931.127652
88,020
pythondev
help
no
2017-07-29T19:04:53.138195
Deedee
pythondev_help_Deedee_2017-07-29T19:04:53.138195
1,501,355,093.138195
88,021
pythondev
help
find a way to make it work, not just w/ the `main()` function, but through it.
2017-07-29T19:07:13.147538
Deedee
pythondev_help_Deedee_2017-07-29T19:07:13.147538
1,501,355,233.147538
88,022
pythondev
help
yea its not working ill just stick to calling the main function normally
2017-07-29T19:10:43.160330
Susanne
pythondev_help_Susanne_2017-07-29T19:10:43.160330
1,501,355,443.16033
88,023
pythondev
help
I really do not how you’re running it and its working? lol
2017-07-29T19:16:20.181088
Susanne
pythondev_help_Susanne_2017-07-29T19:16:20.181088
1,501,355,780.181088
88,024
pythondev
help
careful. Keep it civil. This IS 'calling the main function normally'
2017-07-29T19:17:11.184329
Deedee
pythondev_help_Deedee_2017-07-29T19:17:11.184329
1,501,355,831.184329
88,025
pythondev
help
I literally just copied and pasted your most recent code and ran it.
2017-07-29T19:17:45.186345
Deedee
pythondev_help_Deedee_2017-07-29T19:17:45.186345
1,501,355,865.186345
88,026
pythondev
help
You're close. And having it all segmented into various functions is will make it very easy for you to make the small tweaks that it needs.
2017-07-29T19:18:45.190027
Deedee
pythondev_help_Deedee_2017-07-29T19:18:45.190027
1,501,355,925.190027
88,027
pythondev
help
Stare at it... fight with it. It'll click.
2017-07-29T19:19:03.191065
Deedee
pythondev_help_Deedee_2017-07-29T19:19:03.191065
1,501,355,943.191065
88,028
pythondev
help
Are you sure you are using the code I just posted on here?
2017-07-29T19:19:33.192858
Susanne
pythondev_help_Susanne_2017-07-29T19:19:33.192858
1,501,355,973.192858
88,029
pythondev
help
30 mins ago?
2017-07-29T19:19:49.193745
Susanne
pythondev_help_Susanne_2017-07-29T19:19:49.193745
1,501,355,989.193745
88,030
pythondev
help
cuz idk man it aint clicking
2017-07-29T19:20:05.194726
Susanne
pythondev_help_Susanne_2017-07-29T19:20:05.194726
1,501,356,005.194726
88,031
pythondev
help
And I only did it to see if it would run, and if not... see what errors it produced. &lt;-- in fact, when you run it, what errors do you get?
2017-07-29T19:22:31.204007
Deedee
pythondev_help_Deedee_2017-07-29T19:22:31.204007
1,501,356,151.204007
88,032
pythondev
help
It doesnt even run I get nothing
2017-07-29T19:23:28.207439
Susanne
pythondev_help_Susanne_2017-07-29T19:23:28.207439
1,501,356,208.207439
88,033
pythondev
help
I run and then it stops
2017-07-29T19:24:35.211959
Susanne
pythondev_help_Susanne_2017-07-29T19:24:35.211959
1,501,356,275.211959
88,034
pythondev
help
yeah, well I was asked a username and password and all
2017-07-29T19:24:37.212098
Deedee
pythondev_help_Deedee_2017-07-29T19:24:37.212098
1,501,356,277.212098
88,035
pythondev
help
I wasn’t at all
2017-07-29T19:24:49.212963
Susanne
pythondev_help_Susanne_2017-07-29T19:24:49.212963
1,501,356,289.212963
88,036
pythondev
help
had to type that in then type it in again before it produced that main menu
2017-07-29T19:25:00.213614
Deedee
pythondev_help_Deedee_2017-07-29T19:25:00.213614
1,501,356,300.213614
88,037
pythondev
help
maybe <http://repl.it|repl.it> doesn’t run if __name statement
2017-07-29T19:25:20.215026
Susanne
pythondev_help_Susanne_2017-07-29T19:25:20.215026
1,501,356,320.215026
88,038
pythondev
help
hahaha maybe. I can't confirm or deny. But if it doesn't work, then so be it... change 158 and 159 to just call main(). And ask someone why it doesn't work the way we're talking about here. Now, back to your original question... It's obvious that lines 50 and 51 are not the correct spots to declare the lists. Did you look into passing lists to functions?
2017-07-29T19:32:50.243514
Deedee
pythondev_help_Deedee_2017-07-29T19:32:50.243514
1,501,356,770.243514
88,039
pythondev
help
No I haven't
2017-07-29T19:36:13.255470
Susanne
pythondev_help_Susanne_2017-07-29T19:36:13.255470
1,501,356,973.25547
88,040
pythondev
help
Well I believe i have been this entire time
2017-07-29T19:39:17.266077
Susanne
pythondev_help_Susanne_2017-07-29T19:39:17.266077
1,501,357,157.266077
88,041
pythondev
help
Where would you recommend calling the lists?
2017-07-29T19:39:55.268113
Susanne
pythondev_help_Susanne_2017-07-29T19:39:55.268113
1,501,357,195.268113
88,042
pythondev
help
where do you think it should go? step through what you have, carefully. Did you write this out on paper first?
2017-07-29T19:45:06.286355
Deedee
pythondev_help_Deedee_2017-07-29T19:45:06.286355
1,501,357,506.286355
88,043
pythondev
help
No I didn't
2017-07-29T19:47:54.296459
Susanne
pythondev_help_Susanne_2017-07-29T19:47:54.296459
1,501,357,674.296459
88,044
pythondev
help
I was thinking about putting it after menu but before the books function and then returning those values
2017-07-29T19:48:22.298293
Susanne
pythondev_help_Susanne_2017-07-29T19:48:22.298293
1,501,357,702.298293
88,045
pythondev
help
That's pretty much the one problem I've been having this whole time lol
2017-07-29T19:49:52.303311
Susanne
pythondev_help_Susanne_2017-07-29T19:49:52.303311
1,501,357,792.303311
88,046
pythondev
help
no. that's the only thing you asked about. There are multiple probs :joy:
2017-07-29T19:55:17.322615
Deedee
pythondev_help_Deedee_2017-07-29T19:55:17.322615
1,501,358,117.322615
88,047
pythondev
help
like, line 129, type 'one' instead of '1'
2017-07-29T19:55:37.323756
Deedee
pythondev_help_Deedee_2017-07-29T19:55:37.323756
1,501,358,137.323756
88,048
pythondev
help
lines 12 and 13 in register() don't make sense.
2017-07-29T19:56:17.326339
Deedee
pythondev_help_Deedee_2017-07-29T19:56:17.326339
1,501,358,177.326339
88,049
pythondev
help
and much more. but one thing at a time.
2017-07-29T19:56:25.326840
Deedee
pythondev_help_Deedee_2017-07-29T19:56:25.326840
1,501,358,185.32684
88,050
pythondev
help
Well 129 is just a print statement
2017-07-29T19:56:55.328535
Susanne
pythondev_help_Susanne_2017-07-29T19:56:55.328535
1,501,358,215.328535
88,051
pythondev
help
So I can make it a little more clear if anything
2017-07-29T19:57:09.329465
Susanne
pythondev_help_Susanne_2017-07-29T19:57:09.329465
1,501,358,229.329465
88,052
pythondev
help
109*
2017-07-29T19:57:23.330278
Deedee
pythondev_help_Deedee_2017-07-29T19:57:23.330278
1,501,358,243.330278
88,053
pythondev
help
Again it's still a print statement
2017-07-29T19:58:29.334320
Susanne
pythondev_help_Susanne_2017-07-29T19:58:29.334320
1,501,358,309.33432
88,054
pythondev
help
I'm deleting the list item by the index
2017-07-29T19:58:45.335269
Susanne
pythondev_help_Susanne_2017-07-29T19:58:45.335269
1,501,358,325.335269
88,055
pythondev
help
Line 109 says: `num = int(input("Which book would you like to find?"))`
2017-07-29T19:59:03.336437
Deedee
pythondev_help_Deedee_2017-07-29T19:59:03.336437
1,501,358,343.336437
88,056
pythondev
help
Line 129 says `num = int(input("Which book would you like to sell?"))`
2017-07-29T19:59:26.337912
Deedee
pythondev_help_Deedee_2017-07-29T19:59:26.337912
1,501,358,366.337912
88,057
pythondev
help
that's user input, not a print statement.
2017-07-29T19:59:36.338475
Deedee
pythondev_help_Deedee_2017-07-29T19:59:36.338475
1,501,358,376.338475
88,058
pythondev
help
Oh my bad
2017-07-29T20:02:42.351498
Susanne
pythondev_help_Susanne_2017-07-29T20:02:42.351498
1,501,358,562.351498
88,059
pythondev
help
Well that would work
2017-07-29T20:03:20.353741
Susanne
pythondev_help_Susanne_2017-07-29T20:03:20.353741
1,501,358,600.353741
88,060
pythondev
help
Lines 52 and 53: ``` for i in range(0, len(inventory)): print(inventory[i]) ``` should be ``` for i in inventory: print(inventory) ``` but `i` should be more describptive, like `movie_title` or whatever.
2017-07-29T20:03:52.355714
Deedee
pythondev_help_Deedee_2017-07-29T20:03:52.355714
1,501,358,632.355714
88,061
pythondev
help
anyway... let's look at where you said you'd post the list
2017-07-29T20:05:24.361301
Deedee
pythondev_help_Deedee_2017-07-29T20:05:24.361301
1,501,358,724.361301
88,062
pythondev
help
&gt; after menu but before the books function and then returning those values What would that look like?
2017-07-29T20:07:00.366863
Deedee
pythondev_help_Deedee_2017-07-29T20:07:00.366863
1,501,358,820.366863
88,063
pythondev
help
Since you mention 'returning values', how does register and login work? In your own words.
2017-07-29T20:08:52.373653
Deedee
pythondev_help_Deedee_2017-07-29T20:08:52.373653
1,501,358,932.373653
88,064
pythondev
help
It would allow me to use this values into another function when I call a specific using the return values as parameters
2017-07-29T20:37:06.472072
Susanne
pythondev_help_Susanne_2017-07-29T20:37:06.472072
1,501,360,626.472072
88,065
pythondev
help
how do you see that code happening? can you type it up here?
2017-07-29T20:38:55.477931
Deedee
pythondev_help_Deedee_2017-07-29T20:38:55.477931
1,501,360,735.477931
88,066
pythondev
help
okay.. so I asked about this b/c that's not how `return` works
2017-07-29T20:49:43.514136
Deedee
pythondev_help_Deedee_2017-07-29T20:49:43.514136
1,501,361,383.514136
88,067
pythondev
help
let's start building this bad boy. I'm guessing the first step is that the user has to register, right?
2017-07-29T20:51:15.519377
Deedee
pythondev_help_Deedee_2017-07-29T20:51:15.519377
1,501,361,475.519377
88,068
pythondev
help
yea
2017-07-29T20:51:24.519904
Susanne
pythondev_help_Susanne_2017-07-29T20:51:24.519904
1,501,361,484.519904
88,069
pythondev
help
they create a username and a password
2017-07-29T20:51:37.520566
Susanne
pythondev_help_Susanne_2017-07-29T20:51:37.520566
1,501,361,497.520566
88,070
pythondev
help
so we'll start w/
2017-07-29T20:51:47.520979
Deedee
pythondev_help_Deedee_2017-07-29T20:51:47.520979
1,501,361,507.520979
88,071
pythondev
help
the password has to be 6 characters or more
2017-07-29T20:51:48.521030
Susanne
pythondev_help_Susanne_2017-07-29T20:51:48.521030
1,501,361,508.52103
88,072
pythondev
help
we'll move this into comments under that code snipet
2017-07-29T20:52:52.524387
Deedee
pythondev_help_Deedee_2017-07-29T20:52:52.524387
1,501,361,572.524387
88,073
pythondev
help
I need a register and login
2017-07-29T21:31:45.664980
Susanne
pythondev_help_Susanne_2017-07-29T21:31:45.664980
1,501,363,905.66498
88,074
pythondev
help
Ok and I'm assuming we'll use it in a little bit, right?
2017-07-29T21:40:07.694276
Susanne
pythondev_help_Susanne_2017-07-29T21:40:07.694276
1,501,364,407.694276
88,075
pythondev
help
ok
2017-07-29T21:50:28.730308
Susanne
pythondev_help_Susanne_2017-07-29T21:50:28.730308
1,501,365,028.730308
88,076
pythondev
help
Im just trying to figure out which extensions to download for sublime
2017-07-29T21:50:45.731157
Susanne
pythondev_help_Susanne_2017-07-29T21:50:45.731157
1,501,365,045.731157
88,077
pythondev
help
<@Deedee> You wanna move this over to the dm?
2017-07-29T22:05:50.786499
Susanne
pythondev_help_Susanne_2017-07-29T22:05:50.786499
1,501,365,950.786499
88,078
pythondev
help
<#C080T8XT2|job_board>
2017-07-30T06:34:46.349152
Rafaela
pythondev_help_Rafaela_2017-07-30T06:34:46.349152
1,501,396,486.349152
88,079
pythondev
help
how would one who is used to MVC based web frameworks organize controllers in `aiohttp`. The closes thing seems like class based views but they cannot contain a RESTful resource. Or am I missing something?
2017-07-30T08:15:15.699554
Fern
pythondev_help_Fern_2017-07-30T08:15:15.699554
1,501,402,515.699554
88,080
pythondev
help
<@Fern> what makes you think they can't "contain a restful resource"? Aiohttp is lower level framework, but you can design it any way you please
2017-07-30T09:12:57.919649
Beula
pythondev_help_Beula_2017-07-30T09:12:57.919649
1,501,405,977.919649
88,081
pythondev
help
how to do you access the key of a specific dictionary?
2017-07-30T10:26:54.239476
Susanne
pythondev_help_Susanne_2017-07-30T10:26:54.239476
1,501,410,414.239476
88,082
pythondev
help
how do you*
2017-07-30T10:27:52.243481
Susanne
pythondev_help_Susanne_2017-07-30T10:27:52.243481
1,501,410,472.243481
88,083
pythondev
help
<@Susanne> Can you show what you're trying to get data out of? Normally it's just `dictionary['key_to_get']` to get the value out
2017-07-30T10:28:22.245703
Beula
pythondev_help_Beula_2017-07-30T10:28:22.245703
1,501,410,502.245703
88,084
pythondev
help
There's also the view method if you want to see the available keys: `dictionary.keys()`
2017-07-30T10:29:01.248356
Beula
pythondev_help_Beula_2017-07-30T10:29:01.248356
1,501,410,541.248356
88,085
pythondev
help
Is it line 5 and you are trying to check if the input value is in the books dictionary?
2017-07-30T10:31:20.259171
Beula
pythondev_help_Beula_2017-07-30T10:31:20.259171
1,501,410,680.259171
88,086
pythondev
help
First, be sure to not override built-ins (`while str not in`, `str` is a built in). I also believe that you want `i` instead of `str` there
2017-07-30T10:32:05.262692
Beula
pythondev_help_Beula_2017-07-30T10:32:05.262692
1,501,410,725.262692
88,087
pythondev
help
But you can just check `if key in dict: print('Yay, it exists!')`
2017-07-30T10:32:36.265100
Beula
pythondev_help_Beula_2017-07-30T10:32:36.265100
1,501,410,756.2651
88,088
pythondev
help
but i isn’t going to print out
2017-07-30T10:34:29.273977
Susanne
pythondev_help_Susanne_2017-07-30T10:34:29.273977
1,501,410,869.273977
88,089
pythondev
help
I ran the for loop but when I go to select I, I get ‘dict_items’ object cannot be interpreted as an integer
2017-07-30T10:36:29.282915
Susanne
pythondev_help_Susanne_2017-07-30T10:36:29.282915
1,501,410,989.282915
88,090
pythondev
help
Oh, yeah you can't use integers in a dict - you are asking the user to give you an int and then looking that up in the dict
2017-07-30T10:39:01.293643
Beula
pythondev_help_Beula_2017-07-30T10:39:01.293643
1,501,411,141.293643
88,091
pythondev
help
If you want to do that, you need to keep track of what keys the integers correlate with
2017-07-30T10:39:18.294982
Beula
pythondev_help_Beula_2017-07-30T10:39:18.294982
1,501,411,158.294982
88,092
pythondev
help
Thats im trying to do by converting it into a tuple
2017-07-30T10:39:51.297261
Susanne
pythondev_help_Susanne_2017-07-30T10:39:51.297261
1,501,411,191.297261
88,093
pythondev
help
but i guess that doesnt work
2017-07-30T10:40:04.298296
Susanne
pythondev_help_Susanne_2017-07-30T10:40:04.298296
1,501,411,204.298296
88,094
pythondev
help
Dictionaries don't keep order until python 3.6, just an FYI - so that could work if you save it to a variable first, then ask for input
2017-07-30T10:40:57.302534
Beula
pythondev_help_Beula_2017-07-30T10:40:57.302534
1,501,411,257.302534
88,095
pythondev
help
So maybe something like: ``` &gt;&gt;&gt; options = list(enumerate(d.items())) &gt;&gt;&gt; options [(0, ('Game of Thrones', 50.0))] &gt;&gt;&gt; for i, (k, v) in options: ... print("select", i," for ", k) ... select 0 for Game of Thrones &gt;&gt;&gt; options[0] (0, ('Game of Thrones', 50.0)) ```
2017-07-30T10:42:03.307069
Beula
pythondev_help_Beula_2017-07-30T10:42:03.307069
1,501,411,323.307069
88,096
pythondev
help
Actually in that case, probably better to just do `options = list(d.items())` which will give you a list of tuples, then from there the `i` value is the array index
2017-07-30T10:44:09.316320
Beula
pythondev_help_Beula_2017-07-30T10:44:09.316320
1,501,411,449.31632
88,097
pythondev
help
‘float’ object is not iterable
2017-07-30T10:46:41.327203
Susanne
pythondev_help_Susanne_2017-07-30T10:46:41.327203
1,501,411,601.327203
88,098
pythondev
help
that was the error I got
2017-07-30T10:46:46.327571
Susanne
pythondev_help_Susanne_2017-07-30T10:46:46.327571
1,501,411,606.327571
88,099
pythondev
help
Looking <@Susanne>
2017-07-30T10:51:14.347653
Beula
pythondev_help_Beula_2017-07-30T10:51:14.347653
1,501,411,874.347653
88,100
pythondev
help
just a minute
2017-07-30T10:51:18.347949
Beula
pythondev_help_Beula_2017-07-30T10:51:18.347949
1,501,411,878.347949
88,101
pythondev
help
ok
2017-07-30T10:51:19.348030
Susanne
pythondev_help_Susanne_2017-07-30T10:51:19.348030
1,501,411,879.34803
88,102