What's new

Python Binary, hex etc. converter

Aaron

Aaron

I'm Batman
VIP
Retired
Nevar gon' happen in your lifetime MotM Mythical Veteran
Messages
6,721
Reaction score
9,456
Points
3,070
Sin$
0
I have to do a school project in which I need to create a converter for various types of binary numbers, converting them to denary, hex etc.

It will have to have a progression bar, different categories, increasing difficulty, email the results, option to be timed and a few other things. The interface doesn't have to be too complex, something simple really.

I was just curious if there would be anything that could help me out with this. I'm not exactly an expert in Python, i just know the basics. We have months to actually create it, so i have plenty of time, I just want to start it as soon as I can so it can be good and I can get good marks; i really don't want to be rushing it with only little time left.

If you have any tips, useful sites or anything like that, I would really appreciate it.
 
Z61

Z61

Some times our saints are sinners
Retired
Programmer Forum Addict Odysseus' Summit
Messages
5,468
Reaction score
3,429
Points
1,042
Sin$
0
This is supposed to be a simple project? This sounds quite complex for a beginner project (if it is.)
Also, with Python you can convert bases very simply.
Example: Converts a binary string to base 10 (decimal) and base 16 (Hex)
Python:
int(binary, 10)
int(binary, 16)
https://docs.python.org/2/library/functions.html#int
 
Aaron

Aaron

I'm Batman
VIP
Retired
Nevar gon' happen in your lifetime MotM Mythical Veteran
Messages
6,721
Reaction score
9,456
Points
3,070
Sin$
0
This is supposed to be a simple project? This sounds quite complex for a beginner project (if it is.)
Also, with Python you can convert bases very simply.
Example: Converts a binary string to base 10 (decimal.) and base 16 (Hex)
Python:
int(binary, 10)
int(binary, 16)
https://docs.python.org/2/library/functions.html#int
It is coursework, so it counts towards the final mark that we get at the end of the year. It doesn't have to be super fancy, but it does need to be pretty complex. The coursework, being the program and lots of paperwork needs to be in for April, so we do have plenty of time. But yeah, I literally only know the basics, so I will have to learn a lot.
 
Z61

Z61

Some times our saints are sinners
Retired
Programmer Forum Addict Odysseus' Summit
Messages
5,468
Reaction score
3,429
Points
1,042
Sin$
0
It is coursework, so it counts towards the final mark that we get at the end of the year. It doesn't have to be super fancy, but it does need to be pretty complex. The coursework, being the program and lots of paperwork needs to be in for April, so we do have plenty of time. But yeah, I literally only know the basics, so I will have to learn a lot.
Ah that makes more sense.
Also, what's the point of a progressbar? If it's a decent PC at all it should be done too quick to measure with a progressbar.
 
Aaron

Aaron

I'm Batman
VIP
Retired
Nevar gon' happen in your lifetime MotM Mythical Veteran
Messages
6,721
Reaction score
9,456
Points
3,070
Sin$
0
Ah that makes more sense.
Also, what's the point of a progressbar? If it's a decent PC at all it should be done too quick to measure with a progressbar.
It is a program to test students on their knowledge of binary, so I mean a progress bar as in, question1 out of 10 etc.
 
Absim

Absim

One Take
Messages
2,002
Reaction score
1,017
Points
415
Sin$
0
It is coursework, so it counts towards the final mark that we get at the end of the year. It doesn't have to be super fancy, but it does need to be pretty complex. The coursework, being the program and lots of paperwork needs to be in for April, so we do have plenty of time. But yeah, I literally only know the basics, so I will have to learn a lot.
Is it A-levels computing science coursework?
 
Absim

Absim

One Take
Messages
2,002
Reaction score
1,017
Points
415
Sin$
0
I got an E in AS, I have to re-sit the AS year as well as A2. xD
I was in the same situation but I dropped as I had better grades in my other subject. AS level computing exam was bulls***, most of my class mates got E aswell
 
Aaron

Aaron

I'm Batman
VIP
Retired
Nevar gon' happen in your lifetime MotM Mythical Veteran
Messages
6,721
Reaction score
9,456
Points
3,070
Sin$
0
I was in the same situation but I dropped as I had better grades in my other subject. AS level computing exam was bulls***, most of my class mates got E aswell
I got better grades in everything else, but I hated law which I could have carried on, so this was the only way of not doing it. I have to go to 2 AS lessons a week, which isn't too bad as I finish my work early, so it isn't too bad.
 
Absim

Absim

One Take
Messages
2,002
Reaction score
1,017
Points
415
Sin$
0
I got better grades in everything else, but I hated law which I could have carried on, so this was the only way of not doing it. I have to go to 2 AS lessons a week, which isn't too bad as I finish my work early, so it isn't too bad.
That isn't that bad I guess. As long as you put your head down now and get them good grades, you'll be fine. Good luck and sorry for going off topic
 
denz

denz

The Kingslayer
Retired
MotM End of the Year 2014 Trifecta
Messages
10,043
Reaction score
6,290
Points
2,110
Sin$
7
It is a program to test students on their knowledge of binary, so I mean a progress bar as in, question1 out of 10 etc.

Progress bar, not sure of python as im learning java but im guessing you need to do a counter of sorts. Ie when each question is answered for example you do a counter.

Ie in java would be
Code:
questionCounter = questionCounter + 1;

But you have to get that in python and find a way to display it.? 
I got an E in AS, I have to re-sit the AS year as well as A2. xD

How do you get an E at as? What type of work did you have to produce?
 
Aaron

Aaron

I'm Batman
VIP
Retired
Nevar gon' happen in your lifetime MotM Mythical Veteran
Messages
6,721
Reaction score
9,456
Points
3,070
Sin$
0
Progress bar, not sure of python as im learning java but im guessing you need to do a counter of sorts. Ie when each question is answered for example you do a counter.

Ie in java would be
Code:
questionCounter = questionCounter + 1;

But you have to get that in python and find a way to display it.?
Yeah, I have only done some basic GUI stuff, so I will have to look in to that. This ain't going to be easy.
 
denz

denz

The Kingslayer
Retired
MotM End of the Year 2014 Trifecta
Messages
10,043
Reaction score
6,290
Points
2,110
Sin$
7
Yeah, I have only done some basic GUI stuff, so I will have to look in to that. This ain't going to be easy.

No its not,

Thinking of your project made me think of mine. Have to do a group programming project this school year :dead:
 
Z61

Z61

Some times our saints are sinners
Retired
Programmer Forum Addict Odysseus' Summit
Messages
5,468
Reaction score
3,429
Points
1,042
Sin$
0
No its not,

Thinking of your project made me think of mine. Have to do a group programming project this school year :dead:
That sounds like it would be fun. Do NOT do all of the work, that will make you hate the hell out of whoever is in your group.
 
denz

denz

The Kingslayer
Retired
MotM End of the Year 2014 Trifecta
Messages
10,043
Reaction score
6,290
Points
2,110
Sin$
7
That sounds like it would be fun. Do NOT do all of the work, that will make you hate the hell out of whoever is in your group.

Haven't read spec yet but regardless its 2nd year university so i don't think there will be much slacking from anyone :biggrin:
 
Y

YYes

Enthusiast
Messages
177
Reaction score
52
Points
85
Sin$
7
You could do a progress bar in the command line; an example would be arch linux' package manager's (pacman). Does it have to be GUI?
And I could see a progress bar being used when converting a list of numbers.
 
Aaron

Aaron

I'm Batman
VIP
Retired
Nevar gon' happen in your lifetime MotM Mythical Veteran
Messages
6,721
Reaction score
9,456
Points
3,070
Sin$
0
You could do a progress bar in the command line; an example would be arch linux' package manager's (pacman). Does it have to be GUI?
And I could see a progress bar being used when converting a list of numbers.
It is only a testing system, so a number will be displayed in say binary, then the user must enter the denary equivalent. The system will then determine if this is correct or not, if it is it will add one to the final score. The progress bar will simply be there to indicate which question the user is on.
 
Top Bottom
Login
Register