Sorry to respond to an old thread... but I wanted people who got here from google to have an answer.
curses.flushinp() apparently does what I need it to.
Type: Posts; User: Torajima; Keyword(s):
Sorry to respond to an old thread... but I wanted people who got here from google to have an answer.
curses.flushinp() apparently does what I need it to.
I wrote a funny trojan for the Mac using Applescript.
When launched:
A dialog box opens, and says "Hey Meathead! Are you sure you want to delete your hard drive?"
If you press 'cancel', it...
Definitely Pico... I started doing this style on my own, didn't know there was a name for it.
Not modify, I only need to read the global variables, not write to them.
I simply want a function imported from a module to behave like a function defined within the main program.... look for a...
I understand what you're saying, but is there a way to override that behavior?
Here is a 'real world' example of the type of thing I'm trying to accomplish:
def truthTest(expression,...
The above example was just that, an example.
But I do need classes & functions that can communicate with one another, and passing a zillion arguments makes no sense to me.
I don't understand the reasoning behind this.
Why wouldn't a function imported from a module (into the global namespace) behave just like a function defined in that namespace?
I'm trying to access class attributes from within a function (without resorting to declaring everything 'global')
Test class:
class Animal(): pass
cat = Animal()
cat.name = 'whiskers'
Test...
Oops, you're right. Still, with no external dependencies, I imagine it would be easier to make it work on a cellphone.
Look into pyglet, as I believe it's pure python and can be distributed with your code.
Also, you should be able to add to an existing list by using append.
mylist = [1, 2, 3]
...
You didn't define the variable named choice1.
Unless it's text, then it should be "choice1"
Well.. you could always try doing the beginner challenges, and see how few lines of code you can do them in (preferably without resorting to a bunch of semi-colons)
I did the second beginner...
I've used curses to create progress indicators for CLI apps, so it's definitely not impossible! :)
When I talk about the limitations one faces when creating terminal applications, I mean:
...
You might want to look into object oriented programming.
You could create bullet objects, and each object would have it's own stats (location, animation frame, speed, etc.)
If you're using...
Talk is cheap, execution is hard.
Programmers creating terminal/CLI applications face limitations that GUI programmers don't. These limitations often force hard choices to be made, and you...
After discovering iWeb on my Macbook, I decided to create a new website for pywarrior.
http://www.mindspring.com/~torajima/pywarrior
It looks loads better than the old one.
Try this:
def __init__(self):
self.variables = {}
self.variables['x'] = raw_input()
self.variables['y'] = raw_input()
def edit(self):
h = raw_input("what do you want to...
Short answer:
I did a lot of bug fixing before releasing pywarrior, and one of the fixes broke something else.
Long answer:
According to the PEP guidelines, a text string should be able to...
I just released version 1.04 which fixes this bug, thanks for pointing it out to me.
Yeah, the key does double duty. I probably ought to explain that somewhere in the Help Guide.
Thanks, I'll try to figure out what's going on.
Thanks!
This is actually a feature. To simplify navigation, pywarrior only shows files with certain extensions (".txt", ".py", ".cpp", ".sh", etc.)
But if you press period ('.') it shows...
Okay, I figured out the easiest way to make color work on the Macintosh.
Just open Terminal Preferences and change 'xterm' to 'xterm-color'.
...
Most settings can be changed within the program, just remember to use the 'saveprefs' command afterwards (else you'll lose your changes when you quit).
But yes, you can edit the preference file...
What version of OS X are you using?
And what did you type to enable it?
Thanks!
Might be a better way, but here's how I got the links:
import urllib
mypath =...