Created
          July 5, 2017 02:53 
        
      - 
      
- 
        Save cocodrips/7cd84ae0cc1dd4330235e7e3d30bab66 to your computer and use it in GitHub Desktop. 
    yieldのサンプル
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | def a_yield_function(): | |
| max = 1000 | |
| _i = 0 | |
| while True: | |
| i = 0 | |
| frames = [] | |
| for i in range(30): | |
| if _i > max: | |
| yield (frames, 10) | |
| return | |
| frames.append(_i) | |
| _i += 1 | |
| yield (frames, 10) | |
| for frames, frame_rate in a_yield_function(): | |
| print (frame_rate, frames) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
Result: