https://github.com/kragniz/whalie
Jimble your while loops.
https://github.com/kragniz/whalie
Last synced: about 2 months ago
JSON representation
Jimble your while loops.
- Host: GitHub
- URL: https://github.com/kragniz/whalie
- Owner: kragniz
- Created: 2013-07-19T23:39:53.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-09-21T14:18:30.000Z (over 10 years ago)
- Last Synced: 2025-03-29T15:11:14.449Z (3 months ago)
- Language: Python
- Size: 146 KB
- Stars: 15
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#Whalie - Halie Style While Loops
*Are while loops not exotic enough for you? Have you ever wanted to make
debugging your software much harder for no real reason? Are you a mechanical
engineer and have misinterpreted what a while loop actually does and want to
emulate your dreams?*If any of those apply to you, you still shouldn't use this module.
To use whalie loops, import the module and haliese your code.
```python
import whalie
whalie.halieise(__file__)
```Now, instead of the contents of `while` loops executing while the condition is
`True`, they will now loop only while the condition is still being calculated.#Example
```python
#test.py
import time
import whalie
whalie.halieise(__file__)def long_thing():
print 'starting long thing'
time.sleep(4)
print 'ended long thing'while long_thing():
time.sleep(0.5)
print 'doing something'print 'ended program'
``````bash
$ python test.py
starting long thing
doing something
doing something
doing something
doing something
doing something
doing something
doing something
ended long thing
doing something
ended program
```