473,395 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Get the bug out of "Debug"!

58
Can someone tell me what are the errors in my line of code?

I am new to Python and so you will have to try and ignore my noobishness, Sorry.
Expand|Select|Wrap|Line Numbers
  1. ################################################################################
  2. # Module:   Program Starter
  3. # Author:   Shing    
  4. # Date:     11/03/07
  5. # Version:  Draft 1.0
  6. '''
  7. This module provides a starter to all your Python Programs
  8. '''
  9. ################################################################################
  10. # Log:
  11. # 11/03/07   Shing - File created
  12. ################################################################################
  13. Area = Area.py
  14. SPR = SPR.py
  15. area = import Area.py
  16. spr = import SPR.py
  17. guess = raw_input("Program?")
  18. if guess == area:
  19.     import Area.py
  20.  
  21. elif guess == spr:
  22.         import SPR.py
  23.  

################################
# area = raw_input("Import area?") This is just some old stuff....
# spr = raw_input("Import spr?")
# if area : import Area.py
# else spr : import SPR.py
################################
Mar 12 '07 #1
3 1396
bvdet
2,851 Expert Mod 2GB
Can someone tell me what are the errors in my line of code?

I am new to Python and so you will have to try and ignore my noobishness, Sorry.

################################################## ##############################
# Module: Program Starter
# Author: Shing
# Date: 11/03/07
# Version: Draft 1.0
'''
This module provides a starter to all your Python Programs
'''
################################################## ##############################
# Log:
# 11/03/07 Shing - File created
################################################## ##############################
Area = Area.py
SPR = SPR.py
area = import Area.py
spr = import SPR.py
guess = raw_input("Program?")
if guess == area:
import Area.py

elif guess == spr:
import SPR.py



################################
# area = raw_input("Import area?") This is just some old stuff....
# spr = raw_input("Import spr?")
# if area : import Area.py
# else spr : import SPR.py
################################
Please use code tags when posting code. See 'REPLY GUIDELINES'. Try something like this:
Expand|Select|Wrap|Line Numbers
  1. while True:
  2.     guess = raw_input("Program or X to exit?")
  3.     if guess.lower() == 'area':
  4.         import Area
  5.         .... do stuff ....
  6.     elif guess.lower() == 'spr'
  7.         import SPR
  8.         .... do stuff ....
  9.     elif guess.lower() == 'x':
  10.         break
  11.     else:
  12.         print 'Invalid entry'
Mar 12 '07 #2
shing
58
why do u use lower()?
Mar 14 '07 #3
bvdet
2,851 Expert Mod 2GB
why do u use lower()?
It not required. I usually convert to lower case so the user can type in caps or lowers.
Mar 14 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: John Smith | last post by:
Sorry if this is the wrong forum... Does anyone know what the difference is between a debug build and an optimised debug build in Visual Studio 2003?
10
by: John Smith | last post by:
After reading C# documentation the Conditional attribute seemed the way to go, but after inspecting the IL it seems those methods are still there and I imagine the CLR removes them. Using #if DEBUG...
2
by: Axel Dahmen | last post by:
Hi, when applying changes to the code and hitting to debug, a MessageBox pops up asking me if I want to build before debugging. Of course I want, that's why I've changed the code... Is there a...
0
by: Gianni Nitti | last post by:
If I set in web.config this: <compilation defaultLanguage="vb" debug="false"/> I receive this error: "Compiler Error Message: BC30560: 'barratop_ascx' is ambiguous in the namespace '_ASP'....
2
by: Jeremy S. | last post by:
By default, Web.config has the following section: <compilation defaultLanguage="c#" debug="true" /> note that debug="true" There is a comment - also in the default Web.config - that states...
3
by: Whiplash | last post by:
I've got a web app that has the debug parameter in the web.config file set to true. Everything works great. However, I want to set debug to false before putting the app into production. When I do...
5
by: asdf | last post by:
Hello, I was enjoying working in VS for half a year without any problems and now I cannot debug anymore. Without any really reason my Studio tells me that the page that I want to debug has - No...
1
by: Alexander Walker | last post by:
Hello I have recently published a web application using the "Publish Web Site" option of the solution explorer from Visual Studio 2005, I have published the website so that the pages could not...
3
by: André | last post by:
Hi, I put that question already, but it's still not very clear to me, so ... Assume following option in web.config= debug="false" but in one aspx page (test.aspx) <%@ debug="true" ..%>
2
by: Joe Stateson | last post by:
I added ajax to an existing web project. It runs fine but hitting F5 (debug) in Visual Studio 2005 slowly consumes resources: Kernel Memory and System Cache grow and I start seeing "Loading...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.