You are not logged in.
Pages: 1
I'm truely bored here today... I made this to play with:
import sys, time
class Spinner:
def __init__(self):
self.chars = ['/','-','\','|']
self.bkspace = "%s%s" % (chr(127),chr(127))
self.current = 0
def step(self,delay=0):
print "%s%s" % (self.bkspace,self.chars[self.current]),
sys.stdout.flush()
self.current = (self.current + 1) % len(self.chars)
if delay > 0: time.sleep(delay)
if __name__ == '__main__':
spin = Spinner()
try:
while True: spin.step(0.1)
except: print ''
Enjoy.
Offline
Same here, totally pissed by the world cup freaks all over the place.
So I hacked a bit:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys, os, math, random, stat
sys.path.append('/usr/lib/python2.4/site-packages/libavg')
import avg
Player = avg.Player()
def rotate():
node = Player.getElementByID("archlogo")
node.angle += 0.2
Log = avg.Logger.get()
Log.setCategories(Log.APP |
Log.WARNING |
# Log.PROFILE |
# Log.PROFILE_LATEFRAMES |
Log.CONFIG
)
Player.loadFile("arch.avg")
Player.setInterval(10, rotate)
Player.play()
I recognize that while theory and practice are, in theory, the same, they are, in practice, different. -Mark Mitchell
Offline
Yeah... That's pretty random.
Offline
me too, me too!
#!/usr/bin/env python
import sys, time
f = open('/var/log/pacman.log', 'r')
string = f.readlines()
f.close()
doc_len = len(string)
ct = 0
pct = 0
for s in string:
ct += 1
current_stat = ((ct + 0.00) / (doc_len + 0.00)) * 100.00
if current_stat > pct:
pct += 1
current_len = len(str(pct)) + 8
sys.stdout.write(' ' + str(pct) + ' %' + 'b' * current_len)
sys.stdout.flush()
# do some stuff here, we'll sleep instead.
time.sleep(0.1)
print ''
Offline
oh oh! crash vim!
python<<PYEOF
import vim, time, thread
def wtf_kaboom(b):
while True:
b.append("hello")
time.sleep(5)
def go_kaboom():
thread.start_new_thread(wtf_kaboom,(vim.current.buffer,))
PYEOF
Copy that into vim (you'll need gvim to enable python). And the do
:so %
:python go_kaboom()
It will work fine until you switch buffers... then kaboom.
Actually it's untested on linux, but it dies hard here on Windows.
Offline
me too, me too!
#!/usr/bin/env python import sys, time f = open('/var/log/pacman.log', 'r') string = f.readlines() f.close() doc_len = len(string) ct = 0 pct = 0 for s in string: ct += 1 current_stat = ((ct + 0.00) / (doc_len + 0.00)) * 100.00 if current_stat > pct: pct += 1 current_len = len(str(pct)) + 8 sys.stdout.write(' ' + str(pct) + ' %' + 'b' * current_len) sys.stdout.flush() # do some stuff here, we'll sleep instead. time.sleep(0.1) print ''
that code rox!
Offline
print "Dusty is Brillant"
8)
Dusty[/code]
Offline
print "Dusty is Brillant"
8)
Dusty[/code]
AHAHAH!!!
dusty, tha wouldn't even compile in the forums...lol
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
why are you blowing on a taco?
Offline
Now running an svn server for your /home thats cool
Mr Green
Offline
#include <cstdio>
int main()
{
for (;;)
printf("/b|b\b-b/b|b\b-b");
}
edit: WHY IS IT STRIPPING .h OFF OF STDIO!!!!!! Grr, I edited this thing like three times and it refuses to let met use .h
It must be a C++ nazi. I'm just going to have to go C++ I guess.
Offline
Pages: 1