<div class="gmail_quote">On Fri, Jun 25, 2010 at 11:41 PM, F C <span dir="ltr"><<a href="mailto:amarantos@live.com.au">amarantos@live.com.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>
Hi there,<br><br>- I have recently decided to learn Python. <br>- It is my
first programming language.<br>- I am new to programming.<br>- I know XHTML
and CSS, and a few lines of PHP.<br>- I only started learning a couple of
days ago.<br></div></blockquote><div><br></div><div>Well congratulations on starting what many of us feel is a wonderful journey! And probably most of us feel is an excellent choice for starting out.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>What I want to do is create a simple blog system.<br>Where
I can<br>- create posts, edit them and post them online <br></div></blockquote><div><br></div><div>An ambitious goal... And a fairly achievable one (though of course you still have plenty to learn at this point. I'd guess most of us who have been programming in Python for a few years could probably knock something out in a day or two, but I wouldn't expect results near that quick as you'll have to learn both programming concepts and a language. But Python excels at being a simple language to learn so you can ignore more of the "advanced" programming topics until you're ready)</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><br>Thus
far, people have pointed me to frameworks.<br>From what I see, the
framework does the work for you...<br>I want to code the blog from
scratch...after all - I want to learn the language - I don't want
something to do the work for me.<br><br>I truly do not know where to
start, because most of the tutorials are segmented, and I don't know how
to structure the <br>program, let alone what commands to include.<br><br>I
would appreciate it if someone could give me some structure advice on
how to tackle this.<br></div></blockquote><div><br></div><div>Well, here's what I would do:</div><div><br></div><div>1) Build a *simple* web form - an entry for a title, a text area for the text of the post, and a submit/save button. You can add features later as you feel you need them (like a login window), but for now simple is better.</div>
<div><br></div><div>2) Write a program that connects to a database (SQLite is included in most Python installs) and allows you to insert and retrieve posts. You'll need to learn some SQL syntax for this.</div><div><br>
</div><div>3) Hook the two together.</div><div><br></div><div>4) Enjoy the satisfaction of "completing" your first project.</div><div><br></div><div><br></div><div>I've really simplified the tasks here - you'll have to get a web host that gives you access to python (or host it yourself), learn how to work with Python+HTML (it's not that difficult, but you'll be learning several concepts at once which adds some to the complexity), learn the SQL language in addition to Python... and whatever else happens to pop up. </div>
<div><br></div><div>The important thing is to be able to look at the problem and break it up into chunks. If you ask yourself these two questions: "What do I need next?" "What can I do *now* to accomplish that?" you'll find yourself moving rapidly towards finishing your project. That's how I came up with those tasks - "What do I need next?" "Well, I can't post a blog without somewhere to enter the post." - so that's the first task. What's next? Well, I have to have a way to save the blog posts. Ooh, a database is ideal for collecting data so I can easily retrieve it. So I'll need to be able to connect to the DB somehow.</div>
<div><br></div><div>Once you get more familiar with programming and concepts, you'll start to be able to break problems up into much more manageable chunks, and you'll start to see where you can logically break your programs up into different modules and functions - pieces of code that you can reuse as part of a larger program.</div>
<div><br></div><div>Anyhow, good luck, and HTH!</div><div>-Wayne</div></div>