# How do I restart my program when its finished converting?

Page 1 of 1

## 8 Replies - 4704 Views - Last Post: 24 January 2012 - 11:11 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=263888&amp;s=1dbfa749d61bf93b3348e156496f39f7&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 mariomix10

Reputation: 0
• Posts: 5
• Joined: 22-January 12

# How do I restart my program when its finished converting?

Posted 22 January 2012 - 11:51 PM

```q = 'quit'
ft = 'feet'
inc = 'inches'
yrds = 'yards'
x = input("What is the measurement type? Use inc, yrds or, ft. if you wish to quit, type q.")
if(x== 'quit'):
print("Thankyou for useing this software")
quit

if(x=='feet'):
ft=input("What distance in feet?")
x = input("Convert feet into what? Use yrds, or inc")
if(x=='inches'):
print 'your conversion of feet to inches is:', ft/12, \
quit
if(x=='yards'):
print'your conversion of feet to yards is:', t*0.33333333, \
quit

if(x=='inches'):
inc = input("What distance in inches?")
x = input("Convert into what? Use ft, or yrds")
if(x=='yards'):
print 'your conversion of inches to yards is:', inc/36,

if(x=='feet'):
print 'Your conversion of inches to feet is:', inc/12, \
execfile

if(x=='yards'):
yrds = input('What distance in yards?')
x = input("What is your conversion type? Use inc or, ft.")
if(x=='feet'):
print 'your conversion of yards to feet is:', yrds/0.33333333, \

if(x=='inches'):
print "Your conversion of yards to inches is", yrds*36, \
```

This is using python just so you know.

Is This A Good Question/Topic? 0

## Replies To: How do I restart my program when its finished converting?

### #2 no2pencil

Reputation: 5637
• Posts: 28,119
• Joined: 10-May 07

## Re: How do I restart my program when its finished converting?

Posted 22 January 2012 - 11:57 PM

mariomix10, on 23 January 2012 - 01:51 AM, said:

This is using python just so you know.

** moved to python **

• Saucy!

Reputation: 6154
• Posts: 23,783
• Joined: 23-August 08

## Re: How do I restart my program when its finished converting?

Posted 23 January 2012 - 03:00 PM

Ummm...wrap the main routines in a loop?

```x = input("What is the measurement type? Use inc, yrds or, ft. if you wish to quit, type q.")
if(x== 'quit'):
print("Thankyou for useing this software")
quit
```

Don't lie to your users. They need to type 'quit', not 'q'.

### #4 no2pencil

Reputation: 5637
• Posts: 28,119
• Joined: 10-May 07

## Re: How do I restart my program when its finished converting?

Posted 23 January 2012 - 06:35 PM

JackOfAllTrades, on 23 January 2012 - 05:00 PM, said:

Don't lie to your users. They need to type 'quit', not 'q'.

ROFL!
```#Aggravation ware 2.0
x = input("Press space to quit.")
if(x=='q'):
print("Thank you for using this software")
quit

```

### #5 mariomix10

Reputation: 0
• Posts: 5
• Joined: 22-January 12

## Re: How do I restart my program when its finished converting?

Posted 23 January 2012 - 10:09 PM

no2pencil, on 23 January 2012 - 06:35 PM, said:

JackOfAllTrades, on 23 January 2012 - 05:00 PM, said:

Don't lie to your users. They need to type 'quit', not 'q'.

ROFL!
```#Aggravation ware 2.0
x = input("Press space to quit.")
if(x=='q'):
print("Thank you for using this software")
quit

```

Oh god. LOL

### #6 mariomix10

Reputation: 0
• Posts: 5
• Joined: 22-January 12

## Re: How do I restart my program when its finished converting?

Posted 23 January 2012 - 10:16 PM

JackOfAllTrades, on 23 January 2012 - 03:00 PM, said:

Ummm...wrap the main routines in a loop?

```x = input("What is the measurement type? Use inc, yrds or, ft. if you wish to quit, type q.")
if(x== 'quit'):
print("Thankyou for useing this software")
quit
```

Don't lie to your users. They need to type 'quit', not 'q'.

Such as... What? Sorry, I'm new to python scripting.

### #7 sysop_fb

Reputation: 0
• Posts: 5
• Joined: 22-January 12

## Re: How do I restart my program when its finished converting?

Posted 24 January 2012 - 01:23 PM

Such as a while loop which lets you loop a block of code an undefined number of times.

```def main():
x = raw_input("Hit q to quit: ")
while(x != 'quit'):
print("Haha you wish it was that easy!")
x = raw_input("Hit q to quit: ")

main()

```

### #8 mariomix10

Reputation: 0
• Posts: 5
• Joined: 22-January 12

## Re: How do I restart my program when its finished converting?

Posted 24 January 2012 - 10:51 PM

sysop_fb, on 24 January 2012 - 01:23 PM, said:

Such as a while loop which lets you loop a block of code an undefined number of times.

```def main():
x = raw_input("Hit q to quit: ")
while(x != 'quit'):
print("Haha you wish it was that easy!")
x = raw_input("Hit q to quit: ")

main()

```

Ok, now every time I run the program, it dosen't play the prompt.
```q = 'quit'
ft = 'feet'
inc = 'inches'
yrds = 'yards'
def main():
x = input("What is the measurement type? Use inc, yrds or, ft. if you wish to quit, type q.")
while (x== 'quit'):
print("Thankyou for useing this software")
quit
while(x=='feet'):
ft=input("What distance in feet?")
x = input("Convert feet into what? Use yrds, or inc")
while(x=='inches'):
print 'your conversion of feet to inches is:', ft/12, \
main ()

while(x=='yards'):
print'your conversion of feet to yards is:', t*0.33333333, \
main()

while(x=='inches'):
inc = input("What distance in inches?")
x = input("Convert into what? Use ft, or yrds")
while(x=='yards'):
print 'your conversion of inches to yards is:', inc/36,
main()

while(x=='feet'):
print 'Your conversion of inches to feet is:', inc/12, \
main()

while(x=='yards'):
yrds = input('What distance in yards?')
x = ('What is your conversion? Use ft, or inc.')
while(x=='feet'):
print 'your conversion of yards to feet is:', yrds/0.33333333, \
main()

while(x=='inches'):
print "Your conversion of yards to inches is", yrds*36, \
main()

```

### #9 mariomix10

Reputation: 0
• Posts: 5
• Joined: 22-January 12

## Re: How do I restart my program when its finished converting?

Posted 24 January 2012 - 11:11 PM

mariomix10, on 24 January 2012 - 10:51 PM, said:

sysop_fb, on 24 January 2012 - 01:23 PM, said:

Such as a while loop which lets you loop a block of code an undefined number of times.

```def main():
x = raw_input("Hit q to quit: ")
while(x != 'quit'):
print("Haha you wish it was that easy!")
x = raw_input("Hit q to quit: ")

main()

```

Ok, now every time I run the program, it dosen't play the prompt.
```q = 'quit'
ft = 'feet'
inc = 'inches'
yrds = 'yards'
def main():
x = input("What is the measurement type? Use inc, yrds or, ft. if you wish to quit, type q.")
while (x== 'quit'):
print("Thankyou for useing this software")
quit
while(x=='feet'):
ft=input("What distance in feet?")
x = input("Convert feet into what? Use yrds, or inc")
while(x=='inches'):
print 'your conversion of feet to inches is:', ft/12, \
main ()

while(x=='yards'):
print'your conversion of feet to yards is:', t*0.33333333, \
main()

while(x=='inches'):
inc = input("What distance in inches?")
x = input("Convert into what? Use ft, or yrds")
while(x=='yards'):
print 'your conversion of inches to yards is:', inc/36,
main()

while(x=='feet'):
print 'Your conversion of inches to feet is:', inc/12, \
main()

while(x=='yards'):
yrds = input('What distance in yards?')
x = ('What is your conversion? Use ft, or inc.')
while(x=='feet'):
print 'your conversion of yards to feet is:', yrds/0.33333333, \
main()

while(x=='inches'):
print "Your conversion of yards to inches is", yrds*36, \
main()

```

... Oh nvm, Just re read your last comment, I'm good. Thanks.