User Profile

Collapse

Profile Sidebar

Collapse
wocosc
wocosc
Joined: Mar 5 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • wocosc
    replied to Military Time
    I would like to store the current time and then convert it to military time and then print it on screen. Any help would be great..
    See more | Go to post

    Leave a comment:


  • wocosc
    started a topic Military Time

    Military Time

    I have a quick question.. How can get python to take whatever time of day it is, and output it as military time? I already know how to get it to return the specific time.
    See more | Go to post

  • wocosc
    replied to GUI Output Text
    Code:
    from graphics import *
    
    def main():
        win = GraphWin("BMI Calculator", 1200,700)
        win.setCoords(0.0, 0.0, 3.0, 4.0)
    
        ## Draw the interface
        Text(Point(1,3), " Height (inches):").draw(win)
        Text(Point(1,3.5), "Weight (lbs):").draw(win)
        Text(Point(1,1), "Body Mass Index:").draw(win)
        ht = Entry(Point(2,3), 5)
    ...
    See more | Go to post
    Last edited by bartonc; Mar 28 '07, 04:07 AM. Reason: added [code][/code] tags

    Leave a comment:


  • wocosc
    replied to GUI Output Text
    so i put the text i want to display in the (string)?...
    See more | Go to post

    Leave a comment:


  • wocosc
    replied to GUI Output Text
    Here is the code. The Cases (1,2,3,4) has the text that needs to be displayed if the certain condition is met.

    Code:
    from graphics import *
    
    def main():
    	win = GraphWin("BMI Calculator", 1200,700)
    	win.setCoords(0.0, 0.0, 3.0, 4.0)
    
    	## Draw the interface
    	Text(Point(1,3), " Height (inches):").draw(win)
    	Text(Point(1,3.5), "Weight (lbs):").draw(win)
    	Text(Point(1,1),
    ...
    See more | Go to post

    Leave a comment:


  • wocosc
    replied to GUI Output Text
    I am really just using Python v2.5 . I am not supposed to use other gui's. Really, we are just using the graphics .py file to make our gui....
    See more | Go to post

    Leave a comment:


  • wocosc
    started a topic GUI Output Text

    GUI Output Text

    I have my gui set up, and I am using a loop to set up output text to be displayed in the gui if the conditions are met. However, what handler do i use to display the text in the gui?
    See more | Go to post

  • wocosc
    replied to What is your OS and Python Version
    I am running windows xp with Python v2.5. I also have Activestate Komodo IDE 4.0...
    See more | Go to post

    Leave a comment:


  • wocosc
    started a topic BMI Calculator with GUI

    BMI Calculator with GUI

    Alright.. I have the basic interface of the Body Mass Index worked out. However, I dont know how to get the feet,inches, and weight to be be multiplied:
    Code:
    (w / (h * 12 + x) * (h * 12 + x)) * 703)
    Here is my code for the BMI Calculator:
    Code:
    from graphics import *
    from math import *
    def main():
        win = GraphWin("BMI Calculator", 800, 600)
        win.setCoords(-2.0, -2.0, 11, 11.5)
    ...
    See more | Go to post

  • wocosc
    started a topic Copy and Reverse

    Copy and Reverse

    So far, I have:

    from string import *
    def reverse():
    fname = raw_input("Ente r a Filename: ")
    infile = open(fname, 'r')
    data = infile.read()
    list(data)
    print fname[-1:1]



    I need python to read the file (whichever the user wants to open), but print it in reverse and save it. I know I need to treat the file as a string, but I am obviously not...
    See more | Go to post

  • wocosc
    replied to Line Numbers
    Code:
    def display3():
        fname = raw_input("Enter a Filename: ")
        infile = open(fname, 'r')
        data = infile.read()
        print data
        counter = 1
        print counter, infile
        counter +=1
    so I would presume that this would work. However, when I run it, it does not print the numbers.. It prints the file, and then

    "1 <open file 'auston', mode 'r' at...
    See more | Go to post

    Leave a comment:


  • wocosc
    started a topic Line Numbers

    Line Numbers

    Ok, lol.. I am back again. How can I get python to print line numbers if i have python already loading text from a .txt file. I just need it to print out the line numbers with the text that it is importing and printing.
    See more | Go to post

  • wocosc
    replied to copy and rename a file
    Hey, Thanks y'all... Y'all have been a tremendous help in such a short time..
    See more | Go to post

    Leave a comment:


  • wocosc
    replied to copy and rename a file
    My exact requirement is:
    Write an interactive program Copy() that makes a copy of a
    file. It should prompt the user for the name of the existing file
    and then name for the new file that will be created. The new
    file should be an exact duplicate of the original.
    See more | Go to post

    Leave a comment:


  • wocosc
    replied to copy and rename a file
    So what I need to figure now is for the program to prompt for the file
    raw_input("What is the original file: ")
    raw_input("What is the new name: ")

    Which I know how to do, just not in this sense. But thanks for the original response so quickly, I do understand what that code does, I just dont know how to insert the about code to work. So if anyone can help with this conundrum, I would appreciate...
    See more | Go to post

    Leave a comment:


  • wocosc
    replied to copy and rename a file
    Nevermind, I got it working, but I can't figure out how to write it as a .txt instead of a file.

    *************** *************** *************** *************** ********
    Code:
    def copy():
        fIn = open(r"auston")  # use raw strings for windows file names
        name= raw_input("Enter the new file name: ")
        fOut = open(name, "w")
        for line in fIn:
            fOut.write(line)
    ...
    See more | Go to post

    Leave a comment:


  • wocosc
    replied to copy and rename a file
    Cool, thanks.. Maybe its just me, but I do understand your code, however, I can not figure out how to insert a line where the user can enter the name of the new file.. But I will work on it. I really do appreciate your help.....
    See more | Go to post

    Leave a comment:


  • wocosc
    started a topic copy and rename a file

    copy and rename a file

    Hey,
    I have a problem. I was presented a problem where I need to open a file and then copy and rename it. We are still using really basic commands, but I am pretty lost with this. I know how to open a file and get python to read it. Any help would be great.
    See more | Go to post
No activity results to display
Show More
Working...