Ledonial

u/Ledonial




r/learnpython•
In [24]: class Foo(): 
    ...:     def __init__(self): 
    ...:         print("INIT") 
    ...:    
    ...:     def __del__(self): 
    ...:         print("DEL") 
    ...:    
    ...:     def __enter__(self): 
    ...:         print("ENTER") 
    ...:         return self 
    ...:    
    ...:     def __exit__(self, type, value, traceback): 
    ...:         print("EXIT")                                         

In [25]: with Foo() as foo: 
    ...:     print("foo") 
    ...:                                            
INIT
ENTER
foo
EXIT

In [26]: with Foo() as foo: 
    ...:     print("foo"
22

r/Python•

https://github.com/romaintt/yapyseq : Yet Another Python Sequencer

I just want to share with you my biggest Python project (actually, I released version 1.1).
Here is an extract of the README, to explain what it is:

If you have a bunch of Python functions in a bunch of files, which can be called in various orders in function of the need, you have two choices:

  • Call these functions in classic python scripts, ordering the calls with Python statements. You have to write from scratch the conditional structures, the multiprocessing management if necessary, and eventually write a lot of code.
  • Use yapyseq to write a sequence. A sequence
56


You've reached the end of this feed.