Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,148,785 members, 7,802,438 topics. Date: Friday, 19 April 2024 at 02:28 PM

CBT In Python. V2 By Fleshbone - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / CBT In Python. V2 By Fleshbone (4578 Views)

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)

(1) (2) (Reply) (Go Down)

CBT In Python. V2 By Fleshbone by phililp(m): 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 *
import random

def name():
student_name = str(input('please enter your name:'))
print('Welcome ', student_name, ' wait a while lets get you logged in.')
sleep(2)
return student_name

def chemistry():
questions = {1: ['question 1\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'a'],
2: ['question two\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'],
3: ['question three\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'c',],
4: ['question four\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'],
5: ['question five\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'd']}
score = 0
answer_char = ['a', 'b', 'c', 'd',]
for i in questions:
quest = questions[i]
print('\n', i,'.', quest[0])
answer = str(input('enter anser here:\n'))
answer = answer.lower()
while answer not in answer_char:
print('only enter one of the options above')
answer = str(input('enter anser here:\n'))
answer = answer.lower()

else:
answer = answer.lower()
if answer == quest[1]:
score += 2
else: pass
print ('your score is:', score)
return all

def mathematics():
questions = {1: ['question 1\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'a'],
2: ['question two\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'],
3: ['question three\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'c',],
4: ['question four\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'],
5: ['question five\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'd']}
score = 0
answer_char = ['a', 'b', 'c', 'd',]
for i in questions:
quest = questions[i]
print('\n', i,'.', quest[0])
answer = str(input('enter anser here:\n'))
answer = answer.lower()
while answer not in answer_char:
print('only enter one of the options above')
answer = str(input('enter anser here:\n'))
answer = answer.lower()

else:
answer = answer.lower()
if answer == quest[1]:
score += 2
else: pass
print ('you scored', score)
return all

def geography():
questions = {1: ['question 1\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'a'],
2: ['question two\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'],
3: ['question three\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'c',],
4: ['question four\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'],
5: ['question five\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'd']}
score = 0
answer_char = ['a', 'b', 'c', 'd',]
for i in questions:
quest = questions[i]
print('\n', i,'.', quest[0])
answer = str(input('enter anser here:\n'))
answer = answer.lower()
while answer not in answer_char:
print('only enter one of the options above')
answer = str(input('enter anser here:\n'))
answer = answer.lower()

else:
answer = answer.lower()
if answer == quest[1]:
score += 2
else: pass
print ('you score ', score)
return all

def economics():
questions = {1: ['question 1\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'a'],
2: ['question two\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'],
3: ['question three\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'c',],
4: ['question four\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'],
5: ['question five\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'd']}
score = 0
answer_char = ['a', 'b', 'c', 'd',]
for i in questions:
quest = questions[i]
print('\n', i,'.', quest[0])
answer = str(input('enter anser here:\n'))
answer = answer.lower()
while answer not in answer_char:
print('only enter one of the options above')
answer = str(input('enter anser here:\n'))
answer = answer.lower()

else:
answer = answer.lower()
if answer == quest[1]:
score += 2
else: pass
print ('you scored ', score)
return all

def agricultural_science():
questions = {1: ['question 1\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'a'],
2: ['question two\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'],
3: ['question three\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'c',],
4: ['question four\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'],
5: ['question five\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'd']}
score = 0
answer_char = ['a', 'b', 'c', 'd',]
for i in questions:
quest = questions[i]
print('\n', i,'.', quest[0])
answer = str(input('enter anser here:\n'))
answer = answer.lower()
while answer not in answer_char:
print('only enter one of the options above')
answer = str(input('enter anser here:\n'))
answer = answer.lower()

else:
answer = answer.lower()
if answer == quest[1]:
score += 2
else: pass
print ('you scored', score)
return all

def physics():
questions = {1: ['question 1\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'a'],
2: ['question two\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'],
3: ['question three\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'c',],
4: ['question four\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'],
5: ['question five\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'd']}
score = 0
answer_char = ['a', 'b', 'c', 'd',]
for i in questions:
quest = questions[i]
print('\n', i,'.', quest[0])
answer = str(input('enter anser here:\n'))
answer = answer.lower()
while answer not in answer_char:
print('only enter one of the options above')
answer = str(input('enter anser here:\n'))
answer = answer.lower()

else:
answer = answer.lower()
if answer == quest[1]:
score += 2
else: pass
print ('you scored ', score)
return all

def english():
questions = {1: ['question 1\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'a'],
2: ['question two\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'],
3: ['question three\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'c',],
4: ['question four\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'],
5: ['question five\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'd']}
score = 0
answer_char = ['a', 'b', 'c', 'd',]
for i in questions:
quest = questions[i]
print('\n', i,'.', quest[0])
answer = str(input('enter anser here:\n'))
answer = answer.lower()
while answer not in answer_char:
print('only enter one of the options above')
answer = str(input('enter anser here:\n'))
answer = answer.lower()

else:
answer = answer.lower()
if answer == quest[1]:
score += 2
else: pass
print ('you scored ', score)
return all

def biology():
questions = {1: ['question 1\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'a'],
2: ['question two\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'],
3: ['question three\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'c',],
4: ['question four\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'b'],
5: ['question five\n(A)option A here\n(B)option B here\n(C)option C here\n(D)option D here', 'd']}
score = 0
answer_char = ['a', 'b', 'c', 'd',]
for i in questions:
quest = random.choice(questions.values())
print('\n', i,'.', quest[0])
answer = str(input('enter anser here:\n'))
answer = answer.lower()
while answer not in answer_char:
print('only enter one of the options above')
answer = str(input('enter anser here:\n'))
answer = answer.lower()

else:
answer = answer.lower()
if answer == quest[1]:
score += 2
else: pass
print ('your score is ', score)
return all

def subject_selector():
print('please select the subject you want to start with\n')
subject = str(input('enter A - for Arigultural Science\n'
'enter B - for Biology\n'
'enter M - for Mathematics\n'
'enter C - for Chemistry\n'
'enter P - for Physics\n'
'enter G - for Geography\n'
'enter Eng - for English\n'
'enter Eco - for Economics\n:'))
subject = subject.lower()
choice_char = ['a', 'b', 'm', 'c', 'p', 'g', 'eng', 'eco']

while subject not in choice_char:
print('please select either', str(choice_char))
subject = str(input('enter A - for Arigultural Science\n'
'enter B - for Biology\n'
'enter M - for Mathematics\n'
'enter C - for Chemistry\n'
'enter P - for Physics\n'
'enter G - for Geography\n'
'enter Eng - for English\n'
'enter Eco - for Economics\n:'))
else:
if subject == 'a':
agricultural_science()
elif subject == 'b':
biology()
elif subject == 'm':
mathematics()
elif subject == 'c':
chemistry()
elif subject == 'p':
physics()
elif subject == 'g':
geography()
elif subject == 'eng':
english()
elif subject == 'eco':
economics()

return all


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:
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.
Pls contact me in private
Re: CBT In Python. V2 By Fleshbone by fleshbone(m): 8:09pm On May 27, 2017
pythonkid:
Pls contact me in private

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 wink.

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:
Philip, i ran the codes it was pretty clean. Except for some typos. it's okay wink.

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.


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(m): 7:14am On May 28, 2017
airsaylongcon:
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?


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(m): 7:16am On May 28, 2017
kayoph:
Philip, i ran the codes it was pretty clean. Except for some typos. it's okay wink.

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.

thanks for the hint....

about the GUI... u working on it too??
Re: CBT In Python. V2 By Fleshbone by phililp(m): 7:19am On May 28, 2017
fleshbone:



Am currently reading a book about GUI Using Tkinter module.

I would come up with something soon.

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:
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?

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.

4 Likes

Re: CBT In Python. V2 By Fleshbone by Nobody: 12:56pm On May 28, 2017
phililp:


thanks for the hint....

about the GUI... u working on it too??

Yea i will be working on it this night.. And see what's up in the morrow.


fleshbone:



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.
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:


Yea i will be working on it this night.. And see what's up in the morrow.



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?


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:



use this tag
 paste your code here 

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:


I guess you have a github account. Just post it on github and provide a link. Its the best way.


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(m): 2:47pm On May 28, 2017
TheLordIsGr8:
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



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(m): 2:52pm On May 28, 2017
kayoph:
Philip, i ran the codes it was pretty clean. Except for some typos. it's okay wink.

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.

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(m): 3:00pm On May 28, 2017
kayoph:


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?

dunno what i did O undecided undecided... just copied from my IDE and pasted.. then later modified.
Re: CBT In Python. V2 By Fleshbone by phililp(m): 3:42pm On May 28, 2017
kayoph:


Yea i will be working on it this night.. And see what's up in the morrow.



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?

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
phililp:


thanks sir; 'll keep these corrections in mind...

but what exactly does the

if _name_ == _main_ do?

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

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:


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

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:
Guys, this the link for my version:

https://github.com/olamigokayphils/CBT.py

Make sure to read the Readme

Review it. it's Open to criticism fam.

Here is the code Kayoph wants to display.



# For Niaraland Programming Thread
# CBT exam stuff
import sys
import time
from time import *
def open_file(file_name, mode):
""" Open the cbt.txt file. """
try:
the_file = open(file_name, mode)
except IOError as e:
print("Cannot locate the file", file_name, "Ending the program...", e)
sleep(2)
input("\n\nPress the enter key to exit. "wink
sys.exit()
else:
return the_file
def next_line(the_file):
"""This returns the next line from the cbt.txt file. """
line = the_file.readline()
line = line.replace("/", "\n"wink
return line
def next_block(the_file):
"""This return the next block of data from the file. """
category = next_line(the_file)
question = next_line(the_file)
answer = []
for i in range(4):
answer.append(next_line(the_file))
correct = next_line(the_file)
if correct:
correct = correct[0]
return category, question, answer, correct
def subject_selector():
print('please select the subject you want to start with\n')
subject = str(input('enter A - for Arigultural Science\n'
'enter B - for Biology\n'
'enter M - for Mathematics\n'
'enter C - for Chemistry\n'
'enter P - for Physics\n'
'enter G - for Geography\n'
'enter Eng - for English\n'
'enter N - for Nairaland CBT\n:'))
subject = subject.lower()
choice_char = ["n"]
while subject not in choice_char:
print("Only the file for Niaraland CBT was created. Abeg No vex!"wink
print("\nKindly select 'N' in the option"wink
subject = str(input('\nenter A - for Arigultural Science\n'
'enter B - for Biology\n'
'enter M - for Mathematics\n'
'enter C - for Chemistry\n'
'enter P - for Physics\n'
'enter G - for Geography\n'
'enter Eng - for English\n'
'enter N - for Nairaland CBT\n:'))
if subject == "n":
welcome()
def welcome():
"""welcome the student. """
print("\t\tWElcome to the nairaland CBT Examination.\n"wink
def dmain():
student_name = input("Enter your name to begin the test:"wink
while not student_name:
student_name = input("Enter your name to begin the test."wink
print(student_name, ", VERIFYING DETAILS..."wink
sleep(2)
subject_selector()
start = time()
cbt_file = open_file("cbt.txt", "r"wink
title = next_line(cbt_file)
score = 0
#getting the first block
category, question, answer, correct = next_block(cbt_file)
while category:
#the question
print(category)
print(question)
for i in range(4):
print("\t", i + 1, "-", answer[i])
#gettin the answer
answer = input("What is your answer?: "wink
#verify answer
if answer == correct:
score += 1
else:
score += 0
#getting the next_block
category, question, answer, correct = next_block(cbt_file)
cbt_file.close()
print("That was the last question!"wink
stop = time()
print("SUBMITTING..."wink
sleep(2)
print("Your Final score is", score, ", you used", stop - start, "seconds"wink
#Runniniggggggggggggggg
dmain()
input("\n\nPress the enter key to exit. "wink
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:

1 Like

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(m): 8:21pm On May 28, 2017
TheLordIsGr8:


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

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:
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?
I try pointing this out to guys I see here on nairaland...on the long run, they see me as a hater grin

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:


thanks Man! i now understand everything about the __name__ == __main

your explanation nearly confused me though


now working on the txt file...

thanks again!

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:
Guys, this the link for my version:

https://github.com/olamigokayphils/CBT.py

Make sure to read the Readme

Review it. it's Open to criticism fam.

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.

1 Like

(1) (2) (Reply)

How To Make Simple Animation Videos..tips,tricks & Tools / Help Needed To Get A Scammer / Appointment Scheduler In Asp

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 94
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.