title: Stop a function from printing using the disassembler in Python?
body: <p>I have this function here and it looks like this when disassembled:</p>
  
  <pre><code>def game_on():    
      def other_function():
          print('Statement within a another function')
      print("Hello World")
      sys.exit()
      print("Statement after sys.exit")
  
  8           0 LOAD_CONST               1 (&lt;code object easter_egg at 0x0000000005609C90, file "filename", line 8&gt;)
                3 LOAD_CONST               2 ('game_on.&lt;locals&gt;.other_function')
                6 MAKE_FUNCTION            0
                9 STORE_FAST               0 (other_function)
  
  10          12 LOAD_GLOBAL              0 (print)
               15 LOAD_CONST               3 ('Hello World')
               18 CALL_FUNCTION            1 (1 positional, 0 keyword pair)
               21 POP_TOP
  
  11          22 LOAD_GLOBAL              1 (sys)
               25 LOAD_ATTR                2 (exit)
               28 CALL_FUNCTION            0 (0 positional, 0 keyword pair)
               31 POP_TOP
  
  12          32 LOAD_GLOBAL              0 (print)
               35 LOAD_CONST               4 ('second print statement')
               38 CALL_FUNCTION            1 (1 positional, 0 keyword pair)
               41 POP_TOP
               42 LOAD_CONST               5 (None)
               45 RETURN_VALUE
  </code></pre>
  
  <p>Is there a way to modify the bytecode so it doesn't print "Hello world." It's like I want to skip line 10 and continue to 11. </p>
  
  <p>There's a lot of material like inspectors and <code>settrace</code> but it's not very direct. does anyone have any info on this or can someone point me to what I could do? </p>