CBT In Python. V2 By Fleshbone - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › CBT In Python. V2 By Fleshbone (5682 Views)
| CBT In Python. V2 By Fleshbone by phililp(op): 12:04pm On May 27, 2017 |
hi guys... about a week ago. fleshbone shared with us his first CBT code.. in python 2.7 so i re-wrote the code in python 3... here it is... wasnt good as the first though.. pls its open to criticism.. thanks from time import * name() subject_selector() |
| Re: CBT In Python. V2 By Fleshbone by fleshbone(m): 5:03pm On May 27, 2017 |
This is impressive boss (phililp) Am not on a pc now, I would go through it better later in the day when am back home. Kudos. antieverything should see this. Am sure he has a lot to share too. |
| Re: CBT In Python. V2 By Fleshbone by pythonkid(m): 6:10pm On May 27, 2017 |
fleshbone:Pls contact me in private |
| Re: CBT In Python. V2 By Fleshbone by fleshbone(m): 8:09pm On May 27, 2017 |
pythonkid:Sorry sir, I don't know how to send private messages here. |
| Re: CBT In Python. V2 By Fleshbone by Nobody: 11:08pm On May 27, 2017 |
Philip, i ran the codes it was pretty clean. Except for some typos. it's okay .But really, as for me i don't think writing a code for an exam and the [/b]questions seen to be contained in the codes[b] is "fresh". i will rather create a text_file on my PC and the Program access the text_file for the question and answer, i feel its neater and more okay. i'll try and work on this too + i think am interested in the GUI. fleshbone , thanks for stirring something up. |
| Re: CBT In Python. V2 By Fleshbone by airsaylongcon: 11:55pm On May 27, 2017 |
Why are you guys reinventing the wheel? Loads of Open Source CBT software exist to do what you are trying to do. I'd like to know what new addition you are making to already existing solutions? |
| Re: CBT In Python. V2 By Fleshbone by fleshbone(m): 3:11am On May 28, 2017 |
kayoph:We are actually all learning. Would love to see ur version of the program anyway so we can all get beTter. Thank to you too. Am currently reading a book about GUI Using Tkinter module. I would come up with something soon. |
| Re: CBT In Python. V2 By Fleshbone by phililp(op): 7:14am On May 28, 2017 |
airsaylongcon:sorry but i think its important we start from somwhere... u dont expect a beginner to create new kinda AI. we learning bro |
| Re: CBT In Python. V2 By Fleshbone by phililp(op): 7:16am On May 28, 2017 |
kayoph:thanks for the hint.... about the GUI... u working on it too?? |
| Re: CBT In Python. V2 By Fleshbone by phililp(op): 7:19am On May 28, 2017 |
fleshbone:pls boss.... what the name of the book... is it E-book. been using videos from thenewbostom.. need a book too |
| Re: CBT In Python. V2 By Fleshbone by Nobody: 12:51pm On May 28, 2017 |
airsaylongcon:maybe you call it re-inventing the wheel... Maybe you are way ahead of us in this. But i believe guys here in this thread aren't really claiming any professionalism in app development. And i also believe that we all grow by going from known to unknown.... and every person that thought outside the box first of all knows what's within the box and saw it insufficiency... Reviewing open source codes are really cool in fact i do that on GIThub but the truth is if i don't practice some certain things i will i know that i know them. No one here is satisfied with this level we all want to improve, at least for me and doing what has been done is a way of learning how it is been done... it's not about what you did now but the understanding is what matters. Then when i review some code, i can be like "oh, so this stuff can be done like this" or be like "i think if this stuff is done this way it will help reduce resources consumption... or be like "wow, am just seeing this". Whichever way it goes, the contribution towards or knowledge added is built on something you'd learnt earlier... i also want to bring new ideas into existing ones but how will i do that if i don't know hot the existing one works. Threads like this is just for simple stunt pulling. I believe Albert Einstein would have solved questions USING the UNDERSTANDING of Newton's equation until he reasoned that Newton might actually be wrong. Or should we now tag new guys in the "Hello World level" as re-inventing the wheel? No!...The sole-aim of this is to LEARN. I know you are trying to stir up an awakening in us to look more into what we can give and add to existing ideas and not to be complacent but it looked more like an attack on the learning process. |
| Re: CBT In Python. V2 By Fleshbone by Nobody: 12:56pm On May 28, 2017 |
phililp:Yea i will be working on it this night.. And see what's up in the morrow. fleshbone:Yh, i have written my version last night. Also, I will try and work on the GUI this night.. But i don't know how to post it like phililp did.. I don't what the indentation compromised. Phililp, how did you post yours? |
| Re: CBT In Python. V2 By Fleshbone by fleshbone(m): 1:02pm On May 28, 2017 |
kayoph:use this tag paste your code here |
| Re: CBT In Python. V2 By Fleshbone by Nobody: 1:31pm On May 28, 2017 |
from time import * import random Better to write from time import whatever_you're_actually_going_to_use_from_the_time_module from random import whatever_you're_actually_going_to_use_from_the_random_module Hope you don't mind if I ask what this line time.sleep(2) is doing in the student name class Re-write the last two lines as def main(): if __name__=="__main__": name() subject_selector The above are more about best practices than about code correctness though. Your questions is a dictionary. How are you indexing into it like a list? I'm trying to understand what you intend to do in that for loop. I'll post my code for you to take a look |
| Re: CBT In Python. V2 By Fleshbone by Nobody: 1:33pm On May 28, 2017 |
fleshbone:I guess you have a github account. Just post it on github and provide a link. Its the best way. |
| Re: CBT In Python. V2 By Fleshbone by Nobody: 1:56pm On May 28, 2017 |
Hmmmm. I've looked at your code a little closer. Your for loop has some problems I'll try and do a line by line comment and post a link here: Meanwhile check out this chapter of ATBS https://automatetheboringstuff.com/chapter8/ Its free. Also, I just created a github repo. From time to time I'll be using it for stuff like this here on nairaland. You can see all codes here https://github.com/Parousiaic/nairaland_programming |
| Re: CBT In Python. V2 By Fleshbone by fleshbone(m): 2:31pm On May 28, 2017 |
TheLordIsGr8:Sorry I didn't expect it to show that way. Here is an html tag for code '<code>paste your code in here</code>'. But instead of '<' use '['. And for '>', Use ']'. |
| Re: CBT In Python. V2 By Fleshbone by phililp(op): 2:47pm On May 28, 2017 |
TheLordIsGr8:thanks sir; 'll keep these corrections in mind... but what exactly does the if _name_ == _main_ do ? |
| Re: CBT In Python. V2 By Fleshbone by phililp(op): 2:52pm On May 28, 2017 |
kayoph:thanks sir! but the thing is i really dunno how to do the text_file thing.. can u just give me a crash course one it?? pls... just a little light lemme build on |
| Re: CBT In Python. V2 By Fleshbone by phililp(op): 3:00pm On May 28, 2017 |
kayoph:dunno what i did O ... just copied from my IDE and pasted.. then later modified. |
| Re: CBT In Python. V2 By Fleshbone by phililp(op): 3:42pm On May 28, 2017 |
kayoph:YAS!!! i remember now.... this was what happened. i first wrote the five first line of the post then summited(forgot to past the code).. then came back and modified and pasted the code... thats it |
| Re: CBT In Python. V2 By Fleshbone by Nobody: 3:46pm On May 28, 2017*. Modified: 4:06pm On May 28, 2017 |
phililp:I'm a sort of beginning pythonista myself. But I believe I've been digging a bit longer than you. So I'm learning as well. So in this jupyter notebook I try to explain the whole thing to myself. You can view it here https://github.com/Parousiaic/nairaland_programming/blob/master/python_dunder_main.ipynb Let me know if there's anything you don't get |
| Re: CBT In Python. V2 By Fleshbone by Nobody: 4:38pm On May 28, 2017*. Modified: 9:14pm On Jul 20, 2017 |
*modified Guys, this the link for my version: https://github.com/olamigokayphils/Nairaland_cbt Make sure to read the Readme Review it. it's Open to criticism fam. |
| Re: CBT In Python. V2 By Fleshbone by Nobody: 4:52pm On May 28, 2017 |
phililp:Man, leave the "Sir" thing. you can refer to me as simply "kayoph"... Check out the code on the hub first and see if you grab anything concerning the text_file thing. |
| Re: CBT In Python. V2 By Fleshbone by fleshbone(m): 5:59pm On May 28, 2017 |
kayoph:Here is the code Kayoph wants to display.
|
| Re: CBT In Python. V2 By Fleshbone by fleshbone(m): 6:05pm On May 28, 2017 |
The Book. (Slide) am using for learning the GUI is 'An Introduction to GUI programming with Tkinter - Erik Spence' |
| Re: CBT In Python. V2 By Fleshbone by Nobody: 6:35pm On May 28, 2017 |
thanks fleshbone This is the screenshot for the cbt.txt file:
|
| Re: CBT In Python. V2 By Fleshbone by antieverything(m): 7:42pm On May 28, 2017 |
nice one! |
| Re: CBT In Python. V2 By Fleshbone by phililp(op): 8:21pm On May 28, 2017 |
TheLordIsGr8:thanks Man! i now understand everything about the __name__ == __main your explanation nearly confused me though now working on the txt file... thanks again! |
| Re: CBT In Python. V2 By Fleshbone by badthinds: 9:09pm On May 28, 2017 |
airsaylongcon:I try pointing this out to guys I see here on nairaland...on the long run, they see me as a hater Well, my abstract thinking have blessed me with many fresh original ideas I can't wait to unleash... |
| Re: CBT In Python. V2 By Fleshbone by Nobody: 7:35am On May 29, 2017 |
phililp:Sure. It takes some time to wrap one's head around some things. But with patience you'll get there. I keep updating the file as I realize better ways to explain it. |
| Re: CBT In Python. V2 By Fleshbone by Nobody: 7:45am On May 29, 2017 |
kayoph:Hello Kay. I wish to make an observation about your naming scheme. You created a repository. The name of the repo shouldn't have any extensions. It looks like the repo is a python file which is not the case. The name of your repo should be the project name. I will think something like "Nairaland CBT." The exam part is redundant in so far as T stands for Test. Unless you have something else in mind. For your code file which you called "The main code", you should give the file a good descriptive name and add an extension. Remember, no spaces in file names. Don't even use dashes. Underscores are your best friend. |
Who Wants To Learn Programming In Python Easily Without Stress? READ THIS • *New Video: Data Types and Data Structures in Python [Tutorials] • Web Programming Tutorial In Python. • 2 • 3 • 4
Retrieving/selecting A Particular Number Of Random Rows From A Database Table • Android Tab With Swipe Views In Android Studio • Nigerian Online Chat App
.
?