LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 624 users online 221672 members 897 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Memberlist | Dictionary | News | FAQ
Member Spotlight
akallen
Supportiveness: 0.00%
Mood: Flirty
You have 1 new message.
Emergency Help
Until you sign up you can't do much. Yes, it's free.

Sign Up Now
Membername:
Password:
Already have an account?
Invite Friends
Active Members
Groups
Contests
Moderators
5 online / 29 MPM
Fresh Topics
  LiveWire / Technical Forums / Programming & Application Development / Viewing Topic

Calling all programmers!
Replies: 1Last Post Nov. 16, 2008 2:15am by Solitude
Welcome to LiveWire!
We're Stronger Together.
Join the Community
Single page for this topic Email Print Favorite
( BluShift )


Wealthy Hobo

Patron
Reply
Hey everyone... I posted this question yesterday. I'm just starting to learn Python, and I'm working on a program for my IP 20 class. We were supposed to do it in QBasic, but I really can't justify learning QB, being *ahem* useless and all, so I decided to pick up a little Python.

I'm quite fluent in batch, so you can probably see that influence in here, (yes, I FLIPPED SHIT when I realized there was no "GOTO" command)

So here's my beta code for my "noteleaver" program...

# This is where I get all the important stuff imported

import os
import time
os.system("CLS")

# Splash screen start (lame I know)

print "Hello, and welcome to the..."
time.sleep(1)
print
print "     Note"
time.sleep(1)
os.system("CLS")
print "Hello, and welcome to the..."
print
print "     NoteLeaver"
time.sleep(1)
os.system("CLS")

# End of splash
# Enter name and everything

name = raw_input( 'Please enter your name: ' )
print
print "Please type your message below: "
print
mess = raw_input()
print
print
code = raw_input( "enter a passcode to lock this note: " )
print "Thank you, %s. Your note has been left" % name
time.sleep(3)
os.system("CLS")
print
print "    You have a new message from %s" % name
raw_input()
os.system("CLS")
print "This note has been locked"
print
use = raw_input( "enter the passcode to view: " )

# password system (I think it's reletively secure)

while True:
  if use == code:
      break
  os.system("CLS")
  print "That passcode is wrong. Try again."
  time.sleep(1)
  use = raw_input( "enter the passcode to view: " )
  os.system("CLS")
os.system("CLS")
print "The message is as follows:"
print "-----------------------"
print "From: %s" % name
print
print "      %s" % mess
print
print "------------------------"
raw_input( "press any key to exit" )

# End of program    

Basically, It's like leaving a little password protected sticky note on someones screen.

So if anybody took the time to go through that (yes I put the hashed comments in there just for you guys :3) I would like to know if there is anything I could do to make it "better." I realize it is fairly spaghetti. Any clever functions or easier ways to do something? Am i re-inventing the wheel?

-------
I live in 3D


1:35 pm on Nov. 7, 2008 | Joined: July 2008 | Days Active: 128
Join to learn more about BluShift Manitoba, Canada | GLBT Ally Male | Posts: 1,226 | Points: 4,207
LiveWire Humor
Solitude


Enlightened One

Patron
Reply
wtf is that?

-------
Thank you Isobel

For modding the deep thoughts and random shitty theism forum
Aka "Religion and Philosophy: The forum that makes a case for Eugenics

2:15 am on Nov. 16, 2008 | Joined: July 2008 | Days Active: 313
Join to learn more about Solitude Spain | Lesbian Female | Posts: 12,309 | Points: 15,390
Single page for this topic Email Print Favorite

Quick Reply

You are signed in as our guest.

Looking for something else?
 

  LiveWire / Technical Forums / Programming & Application Development / Viewing Topic