python怎么清除数据_清除python使用的数据?

Inches = float(25.4)

Surface_Inches = "**********Surface in Inches**********"

Enter_Number = "**********Enter Number in MM**********"

Final_Number = "**********Number in Inches**********"

WTF = "Sorry I could not recognize that, please try again"

keep_running = True

help = """

Commands:

type (exit, quit, end, or kill) to exit the program

type RA to enter Surface finish conversion

If you are in Surface conversion mode

you must enter Ra number in MM that

needs converted to Inches.

"""

import time

import math

import os

print("Welcome to the converter")

time.sleep(.75)

print("I can convert units of measurement from MM to Inches")

time.sleep(.75)

while keep_running:

print("Enter Number or type RA for Surface conversion")

print(Enter_Number)

number = (input())

if number in('end', 'quit', 'exit', 'kill'):

break

elif number in('clear'):

os.system('CLS')

elif number in('help'):

print(help)

elif number in('Ra', 'RA', 'ra', 'rA', 'Surface', 'Finish'):

print("Enter the Surface Finish in MM")

Surface = (input())

if Surface in('help'):

print(" ")

print(help)

print(" ")

else:

try:

Surface_Finish = float(Surface)

except ValueError:

print(WTF)

else:

Surface_IN_Finish = Surface_Finish/Inches

Answer = (float(Surface_IN_Finish *1000))

if Answer < 1 : #if the converted results is less than 1 the answers 1

Answer = 1

print(Surface_Inches)

print(" ")

print('\t', " %.0f" % Answer)

print(" ")

print(Surface_Inches)

else:

try:

MM = float(number)

except ValueError: #checks to see if the user input is a number

time.sleep(0.5)

print(WTF)

else:

Results = float(MM \ Inches)

Final_Form = ("%.3f%" % Results) #creates a float that goes to 3 decimal places

print(Final_Number)

print(" ")

print('\t', " ", Final_form)

print(" ")

print(Final_Number)

from tkinter import Tk #Imports the Tk Module

final_form2 = (str(final_form))

r = Tk()

r.withdraw() # I have no idea what this does

r.clipboard_clear()

r.clipboard_append(final_form2) #appends final_form2 to clipboard

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值