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
from nagare import presentation | |
class Counter(object): | |
def __init__(self): | |
self.val = 0 | |
def increase(self): | |
self.val += 1 |
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
from nagare import presentation | |
class Welcome(object): | |
message = "Hello World!" | |
@presentation.render_for(Welcome) | |
def render(welcome, h, *args): | |
""" | |
HTML fragment is associated with `Welcome` class as its default view. |
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
stackless /usr/lib/python2.7/dist-packages/virtualenv.py ~/Projects/nagaredemo | |
workon nagaredemo | |
cdvirtualenv | |
pip install nagare | |
nagare-admin create-app demos | |
cd demos/ | |
stackless setup.py develop | |
nagare-admin serve demos |
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
kid # 3 is spending your money on candy. | |
3 kids sent to the store | |
kid # 2 is spending your money on candy. | |
kid # 1 is spending your money on candy. |
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
kid # 3 is spending your money on candy. | |
kid # 2 is spending your money on candy. | |
kid # 1 is spending your money on candy. | |
3 kids sent to the store |
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
#!/usr/bin/env stackless | |
import stackless | |
def sendKidsToShops(): | |
kids = 3 | |
ch.send(kids) | |
print kids, "kids sent to the store" | |
def buySweeties(): |
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
$stackless | |
Python 2.7.2 Stackless 3.1b3 060516 (default, Jan 2 2013, 22:39:14) | |
[GCC 4.6.3] on linux3 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> exit() |
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
elif os.sep == '/': | |
sitepackages.append(os.path.join(prefix, "lib", | |
"python" + sys.version[:3], | |
"site-packages")) | |
sitepackages.append(os.path.join(prefix, "lib", | |
"python" + sys.version[:3], | |
"dist-packages")) | |
sitepackages.append(os.path.join(prefix, "lib", "site-python")) |
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
sudo ln -s /usr/lib/python2.7/dist-packages/ /opt/stackless/lib/python2.7/site-packages | |
sudo ln -s /usr/local/lib/python2.7/dist-packages/ /opt/stackless/lib/python2.7/dist-packages | |
sudo ln -s /opt/stackless/bin/python /usr/bin/stackless | |
sudo vi /opt/stackless/lib/python2.7/site.py |
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
Python build finished, but the necessary bits to build these modules were not found: | |
_bsddb bsddb185 dl | |
imageop linuxaudiodev ossaudiodev | |
sunaudiodev | |
To find the necessary bits, look in setup.py in detect_modules() for the module's name. | |
Failed to build these modules: | |
_curses _curses_panel |