New Python Projects
New Python Projects
I'm in here looking for some ideas for how I can broaden my Python abilities. I know pretty well the concept of memory variables, and I was even messing around in an interpreter creating small functions (like returning a value or something).
How could I broaden my knowledge with small projects to work on. By the way, I decided to go with the learn as you create route here on.
How could I broaden my knowledge with small projects to work on. By the way, I decided to go with the learn as you create route here on.
Re: New Python Projects
Although OSDev.org is not the appropiate forum (maybe it's okay in General Programming?), you may want to start with something like this by the moment. I can't provide too much help until you get into basic OSDeving.
Happy New Code!
Hello World in Brainfuck :[/size]
Hello World in Brainfuck :
Code: Select all
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
Re: New Python Projects
Try to calculate the value of Pi using leibniz's series.
Last edited by Muazzam on Sat Apr 18, 2015 5:46 am, edited 2 times in total.
Re: New Python Projects
Nah, if he doesn't know Leibniz's series he won't know how to do it. After all, this is about programming, not math (related, but doing the later will distract him from the real objective). BTW, doing that is too easy.muazzam wrote:Try to calculate the value of Pi using leibniz's series.
Happy New Code!
Hello World in Brainfuck :[/size]
Hello World in Brainfuck :
Code: Select all
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
Re: New Python Projects
What about creating an (artificial (user-mode)) operating system in Python? (OSDev+Python)
Re: New Python Projects
That's good and introduces him to the matter.muazzam wrote:What about creating an (artificial (user-mode)) operating system in Python? (OSDev+Python)
Happy New Code!
Hello World in Brainfuck :[/size]
Hello World in Brainfuck :
Code: Select all
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
Re: New Python Projects
BTW, for the sake of completeness, an example, possible code for calculating Pi using Leibniz's series would be:
Code: Select all
x = 1
add = False
denom = 3
for i in range(32): # Change this if you want more or less precision
if add:
x += 1.0 / denom
add = False
else:
x -= 1.0 / denom
add = True
denom += 2
print x * 4
Last edited by KemyLand on Sat Apr 18, 2015 11:14 am, edited 1 time in total.
Happy New Code!
Hello World in Brainfuck :[/size]
Hello World in Brainfuck :
Code: Select all
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
Re: New Python Projects
I think it would be more accurate to say that that is one possible way of coding the solution, rather than saying it is the code. It's a rather inefficient and wordy solution, not one that I would like to see used, but it certainly works.
Re: New Python Projects
Well, my Python code has never been too Pythonic and/or short. Now editing the post according to your observations.iansjack wrote:I think it would be more accurate to say that that is one possible way of coding the solution, rather than saying it is the code. It's a rather inefficient and wordy solution, not one that I would like to see used, but it certainly works.
Happy New Code!
Hello World in Brainfuck :[/size]
Hello World in Brainfuck :
Code: Select all
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
Re: New Python Projects
Do you mean like simply printing a prompt to the screen?muazzam wrote:What about creating an (artificial (user-mode)) operating system in Python? (OSDev+Python)
-
- Member
- Posts: 29
- Joined: Tue Jan 20, 2015 8:33 pm
Re: New Python Projects
I'm not 100% sure what muazzam meant but I think the idea of creating a shell in Python would be a really fun little project to get started with - something that prints a prompt out and lets you start other programs, explore the filesystem, etcSeanMc wrote:Do you mean like simply printing a prompt to the screen?muazzam wrote:What about creating an (artificial (user-mode)) operating system in Python? (OSDev+Python)
Re: New Python Projects
I meant a shell and OS with a way to start programs, an API, a 'new' file system (yes, it is also fun), as well as, if you like, a multi-tasking kernel (scheduler), (software) virtual memory. If you like, you can also create a text editor for your OS, emulator for running other OSs and maybe a graphical interface (GUI).SeanMc wrote: Do you mean like simply printing a prompt to the screen?
-
- Member
- Posts: 29
- Joined: Tue Jan 20, 2015 8:33 pm
Re: New Python Projects
That's a bit extreme for someone who is 'messing around with functions in the interpreter' I thinkmuazzam wrote:I meant a shell and OS with a way to start programs, an API, a 'new' file system (yes, it is also fun), as well as, if you like, a multi-tasking kernel (scheduler), (software) virtual memory. If you like, you can also create a text editor for your OS, emulator for running other OSs and maybe a graphical interface (GUI).SeanMc wrote: Do you mean like simply printing a prompt to the screen?
Re: New Python Projects
That is impossible with Python isn't it?
Re: New Python Projects
Python can implement this quite easily, but I think it is a ridiculously over-ambitious project for a beginner.
For the time being I would stick to simple things, perhaps a few basic games (e.g. the traditional "guess a number game"). You must surely be able to think of things to program - if not, what is your motivation to learn in the first place?
For the time being I would stick to simple things, perhaps a few basic games (e.g. the traditional "guess a number game"). You must surely be able to think of things to program - if not, what is your motivation to learn in the first place?