title: Encoding error that only shows in the Interactive Window
body: <h2>Summary</h2>
  
  <p>I am making a program in python, and I've finished it, ran it in shell and it worked perfectly. However when I run the program in the Interactive Window, it produces an error while in the idle window, it doesn't.</p>
  
  <h2>Crash information</h2>
  
  <p>Picture of the error before the window crashes:</p>
  
  <p><a href="https://i.stack.imgur.com/0mEwZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0mEwZ.png" alt="Error Before crash"></a></p>
  
  <pre><code>### COFFEE SHOP APP ###
  # IMPORTS
  from Motto import ourMotto 
  import time 
  import os 
  import sys 
  # MAIN CODE
  def CoffeeShopApp(): 
      # VARIABLES
      orderCost = 0 
      smallCost = 2.00 
      mediumCost = 3.50 
      largeCost = 4.75 
      spicyCost = 5.25 
      coffeeInput = False 
      sugarCost = 0.05 
      sugarInput = False 
      syrupCost = 0.50 
      syrupInput = False 
      print("Welcome to the Michael the Moose Coffee App - Where the price is right") 
      print("You've tried BartSucks, and it sucks so now try the best")
      print("We will guide you through the ordering process and our amazing Barista 'Michelle' in Barcelona will then serve you\n") 
      print("And our amazing Barista 'Michelle' in Barcelona will then serve you\n") 
      while coffeeInput == False:
          tempSize = input( 
          """
                      What size would you like your coffee?
          Small - 2€, Medium - 3.50€, Large - 4.75€  or Spicy - 5.25€
          """
          )
          tempSize = tempSize.title() 
          if tempSize == "Small": 
              coffeeSize = "Small" 
              coffeeInput = True 
              orderCost = (orderCost + smallCost) 
          elif tempSize == "Medium": 
              coffeeSize = "Medium" 
              coffeeInput = True 
              orderCost = (orderCost + mediumCost)
          elif tempSize == "Large":
              coffeeSize = "Large"
              coffeeInput = True 
              orderCost = (orderCost + largeCost)
          elif tempSize == "Spicy":
              coffeeSize = "Spicy"
              coffeeInput = True 
              orderCost = (orderCost + spicyCost)
          else:
              print("Please enter a valid size")
              coffeeInput = False
              time.sleep(0.5)
  
      print()
      orderCost = str(orderCost)
      print("Ok, currently your order costs "+orderCost+"€")
      time.sleep(0.5)
      print()
  
      while sugarInput == False:
          tempSugar = int(input(
          """
                  How many sugars would you like added to your coffee?
          1 sugar - 0.05€, 2 sugars - 0.10€, 3 sugars - 0.15€, 4 sugars - 0.20€: 
          """
          ))
          if isinstance(tempSugar, int):
              if tempSugar &gt; 4:
                  print("Please enter a valid number of sugars")
                  sugarInput = False
                  time.sleep(0.5)
              else:
                  orderCost = float(orderCost)
                  orderCost = (orderCost + (tempSugar * sugarCost))
                  sugarInput = True
          else:
              print("Please enter a number")
  
      print()
      orderCost=str(orderCost)
      print("Ok, currently your order costs "+orderCost+"€")
      time.sleep(0.5)
      print()
  
      while syrupInput == False:
          tempSyrup = input(
          """
                         Would you like syrup? (0.50€): 
          """)
          tempSyrup = tempSyrup.title()
          if tempSyrup == "Yes":
              syrupInput = True
          elif tempSyrup == "No":
              syrupInput = True
          else:
              print("Please enter either yes/no")
              time.sleep(0.5)
  
      orderCost = str(orderCost)
      print("Alright, your final order cost comes up to: "+orderCost+"€")
      name = input("Please enter your name and our barista Michelle will get straight to work on your coffee: ")
      name = name.upper()
  
      tempSugar = str(tempSugar)
      orderCost = str(orderCost)
      lines = ['Here is your new order: It is size: '+tempSize+'',
              'There are '+tempSugar+' sugars to be put in the coffee',
              'and they have said '+tempSyrup+' to having syrup.',
              'Their name is '+name+,
              'It will cost: '+orderCost+'€',
              '',
              '',
              '',
              '',
              '',
              '',
              '',
              ourMotto]
      with open('MichelleMooseCoffeeOrders.txt', 'w') as MMC:
          for l in lines:
              MMC.write(l + '\n')
  
      MMC.close()
  
      print(
      """
                             Your order has been proccessed
              Please come and collect your order at the shop within the hour,
                            or your order will be incinerated
      """
      )
      input("Press ENTER to exit the app")
      if mode == 'Interactive' or mode == 'I':
          os.system('cls')
  
  mode = input("Are you in shell/interactive mode?")
  mode = mode.title()
  if mode == 'Interactive' or mode == 'I':
      os.system('cls')
  
  input("Slide left to sign in")
  if mode == 'Interactive' or mode == 'I':
      os.system('cls')
  
  appreal = False
  while appreal == False:
      app = input(
      """
                       What app would you like to use?
                  Coffee Shop, (more coming sometime soon)
      """
      )
      app = app.title()
      if app == 'Coffee Shop' or app == 'Cs':
          if mode == 'Interactive' or mode == 'I':
              os.system('cls')
          CoffeeShopApp()
      elif app == '':
          pass
  </code></pre>
  
  <p>Line 169 is a call for a subroutine</p>
  
  <p>Line 30 is an end of a print shaped like this:</p>
  
  <pre><code>print(
  """
  *text here*
  """
  )
  </code></pre>
  
  <p>And the line 12 seems to refer to a program in the python files.
  In the program it imports a variable from a python program in the same location as this question.</p>
  
  <h2>Related Files</h2>
  
  <p>The imported file is this:</p>
  
  <pre><code>ourMotto = ('You have been playing for over an hour. Please do not forget to take a break.')
  </code></pre>
  
  <p>It writes to a text file in the same file location named:</p>
  
  <p>MichelleMooseCoffeeOrders</p>
  
  <p>If you need me to add any more information about the program or help me format this question, then leave a comment. (I'm new to stack overflow and am still learning how to format questions so feedback helps)</p>
  
  <p>error code after utf-8 encoding:</p>
  
  <pre><code> Traceback (most recent call last):
      File"Z:\Year9\LessonWork\I.C.T\ComputerScience(Wednesday)\Programming\CoffeeShopApp\CoffeeShopApp.p, line 169, in &lt;module&gt;
        CoffeeShopApp
      File"Z:\Year9\LessonWork\I.C.T\ComputerScience(Wednesday)\Programming\CoffeeShopApp\CoffeeShopApp.py", line 30, in CoffeeShopApp
        """
    File "C:\Program Files (x86)\Python35-32\lib\encoding\cp850.py", line 12, in encode
      return codecs.charmaps_encode(input,errors,encoding_map)
  UnicodeEncodeError: 'charmap' codec can't encode character '\u20ac' in position 76:P character maps to &lt;undefined&gt;
  </code></pre>