PDA

View Full Version : complete programming newb



imachavel
January 17th, 2012, 12:40 AM
x="ubuntu"
y="ubuntu"
if(x==y):
print("they are equal")

I've got this going. saved as myfirstprog.py in home folder. when python myfirstprog.py is entered in terminal, it opens like this:

they are equal

I don't want to fill this forum with a retarded newb question if it's not necessary. :P I know this **** is pretty basic. Anyway, any simple and fun ways to try and rewrite this if it doesn't get too complex?? I was looking at some of this stuff:

http://code.google.com/p/shredder/source/browse/mainGUI.py

http://code.google.com/p/shredder/source/browse/LICENSE.html

the html looks simple but yet still with html I am not too far past

<body>

<header>

just don't have a lot of code memorized. I don't know anyway whatever



maybe I don't want to be so ultra focused on python entirely. I tried saving this in python as myfirstprog.py and running it in the terminal:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>GNU General Public License v3.0 - GNU Project - Free Software Foundation (FSF)</title>
<link rel="alternate" type="application/rdf+xml"
href="http://www.gnu.org/licenses/gpl-3.0.rdf" />
</head>
<body>
<h3 style="text-align: center;">GNU GENERAL PUBLIC LICENSE</h3>
<p style="text-align: center;">Version 3, 29 June 2007</p>


invalid syntax. I should try opening it with gedit but it would give the same exact body of code and wouldn't open as body and head etc. etc. etc. Looks like I should save it as index.html and open with bluefish or something?? Yeah that worked, saved it as index.html and opened it with chromium web browser, it says:

GNU GENERAL PUBLIC LICENSE


Version 3, 29 June 2007


Ok not toooo shabby. I could forward this to a domain, but no way do I want to. Anyway that is helpful