Ok...I figured it out. You have to make everything that accesses that pipe run at the same time with &.
Kind of obvious now that I think about it :)
[resolved]
User Profile
Collapse
-
For now I'm using the "write to a file in /tmp/" method...it works pretty good.Leave a comment:
-
Multiple Pipes (shell scripting)
I have a script which starts out with:
ls -lhagG | grep ^d
ls -lhagG | grep ^-
but I would like to be able to do something like this:
ls -lhagG ls's output to grep ^d and then ls's output to grep ^-
so I don't have to run ls twice. I can't find a howto I can understand. I think what I need to use is named pipes but I'm not sure. -
I started with the free ebook "How to Think Like a Computer Scientist - Learning With Python" and once I outgrew that, I refer only to Python's included reference manual (its very good for intermediate use but not a good start). I think you'll find Python very easy to grasp. Good luck and happy coding.Leave a comment:
-
optparse: usage
I tried this:
Code:usage = "Something, by Spacecoyote\nusage: %prog file [options]" parser = OptionParser(usage)
and I expected:Code:test.py --help
but I got:Code:Something, by Spacecoyote usage: test.py file [options]
Is there an easy way to make optparse not force the usage prompt to start...Code:usage: Something, by Spacecoyote usage: test.py file [options]
-
I figured out how to do what I wanted to do (before you guys posted :p). But I'll have a look at these.Leave a comment:
-
Know a good pickle howto?
I need to know how to use pickle (and its brethren) correctly. Does anyone know of a good tutorial? The python manual is a bit too dense on this subject. -
Ubuntu Dapper:
Python 2.4
gedit
Windows XP:
Python 2.5 (don't really use it right now)
Python 2.4 (I need it for pygame)
IDLE
Linux on Gamepark Holdings' GP2X handheld:
A weird build of python 2.4, not by me. I wish to later make a better one.Leave a comment:
-
Well, I've found another more useful way to do it.
But there are cases where it is necessary to have a class inside a class.
In pygame, for example, to make a sprite you make a class which inherits pygame.sprite.S prite and then overload whatever you need to (ie __init__).
Then you have your functions which are inside a class (becuase programs are separated into subprograms which are separted into functions,...Leave a comment:
-
Beyond "Self"
Hello,
I have a class inside a class. I want to set a variable "rect" in that class "textrender " to the value of a variable "rect" in the parent class "textbox". I don't know how to do this.
...Code:class textbox(pygame.sprite.Sprite): # Textbox class def __init__(self): rect=*something* class textrender(pygame.sprite.Sprite):
-
-
r = c >> 11 works and
b = c & 0x001f works,
g is the tough one......Leave a comment:
-
Hmm...
43039 =
1010100000011111
so:
r=10101=21
g=000000=0
b=11111=31...Leave a comment:
-
Unfortunately, that doesn't seem to work :(
If I substitute (for example) the value 43039, r, g, and b still equal 31, so it apparently only works for 65535......Leave a comment:
-
bitshifting help
Okay, so I have a 16 bit positive value (0-65535) representing a color in 565 RGB notation, that is 5 bits for red, 6 bits for green, and 5 bits for blue.
I need to separate the red, green, and blue values out so I may give them to a function that takes red, green, and blue values separately.
So, thinking back to C, I figured I could use bitshifts. But when I do, it appears the bits wrap around. So is this even possible...
No activity results to display
Show More
Leave a comment: