Support Forums
Temperature Converter (for all temperatures) - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: Python Programming Language (https://www.supportforums.net/forumdisplay.php?fid=32)
+---- Thread: Temperature Converter (for all temperatures) (/showthread.php?tid=2663)



Temperature Converter (for all temperatures) - uber1337 - 11-07-2009

Hey guys I made this for chemistry and I thought I would share
Temperature Converter
Code:
#Credits:
#Nevets04(I can't even count how much of his contributions helped me learn)
#Mr.FeellingLeSS(For the script that clears the shell for XP and Vista)
#Me?

import os
import platform

def clearer():
    systemver=platform.release()
    if systemver=='XP':
        os.system("cls")
    elif systemver=='Vista':
        os.system("clear")
    else:
        os.system("clear")
clearer()

print '***************************** *'
print '*         Welcome!                             '
print '*     To the uber1337                        '
print '*   Temperature Converter                 '
print '******************************'
raw_input('Press Enter to continue')
clearer()
print 'For Farenheit to Celsius, Press:1'
print  'For Farenheit to Kelvin, Press:2'
print 'For Celsius to Farenheit, Press:3'
print    'For Celsius to Kelvin, Press:4'
print    'For Kelvin to Celsius, Press:5'
print  'For Kelvin to Farenheit, Press:6'
x = input('What is it that you want to convert?:')
clearer()
def choice():
    if x==1:
        a = input('Enter your degrees Farenheit here:')
        print (a - 32) * 5/9
    if x==2:
        b = input('Enter your degrees Farenheit here:')
        print (b - 32) * 5/9 + 273
    if x==3:
        c = input('Enter your degrees Celsius here:')
        print c * 9/5 + 32
    if x==4:
        d = input('Enter your degrees Celsius here:')
        print d + 273
    if x==5:
        e = input('Enter your degrees Kelvin here:')
        print e - 273
    if x==6:
        f = input('Enter your degrees Kelvin here:')
        print (f - 273) * 9/5 + 32
choice()
raw_input()
Blackhat


RE: Temperature Converter (for all temperatures) - Kenji Harima - 11-07-2009

Thanks dude! Is it ok if I take and customize it into something else thats not a converter.


RE: Temperature Converter (for all temperatures) - uber1337 - 11-07-2009

Sure! That's what the open source community is all about! Not that it matters but what are you making it into???


RE: Temperature Converter (for all temperatures) - Kenji Harima - 11-07-2009

I'm making a script that when you run it in python it opens a tutorial menu for different lessons in python.


RE: Temperature Converter (for all temperatures) - uber1337 - 11-07-2009

(11-07-2009, 05:26 PM)conrados1 Wrote: I'm making a script that when you run it in python it opens a tutorial menu for different lessons in python.

ooh I like it... a python program that teaches python! lol Yeye


RE: Temperature Converter (for all temperatures) - Kenji Harima - 11-07-2009

I couldn't get it so I made one that shows a background in python. Next time I'll make one that teaches python. Smile