title: Multithreading - loading
body: <p>I want write loading for my script</p>
  <pre><code>thread_1 &gt;&gt; its my loading function (only print&gt;&gt; #), this is loop
  thread_2 &gt;&gt; print number 1 to 100
  </code></pre>
  <p>I want <code>thread_1</code> start after <code>thread_2</code> starts<br />
  when <code>thread_2</code> finished<br />
  I want <code>thread_1</code> stop</p>
  <p>My code in python:</p>
  <pre><code>import time
  import threading
  
  def thread_1():
     while(True):
        print('#')
        time.sleep(1)
  def thread_2():
     i=1
     n=100
     for i in range(n):
        print('a'+str(i))
  
  thread1 = threading.Thread(target=thread_1, args=())
  thread2 = threading.Thread(target=thread_2, args=())
  thread1.start()
  thread2.start()
  if(thread2.is_alive()==False):
     thread1.kill()
  </code></pre>