Search:

Type: Posts; User: Torajima; Keyword(s):

Page 1 of 3 1 2 3

Search: Search took 0.04 seconds.

  1. Re: How to flush input buffer with Python/Curses/Getch?

    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.
  2. Re: What is your favorite experimental virus? (preferably that your wrote)

    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...
  3. Replies
    48
    Views
    5,620

    Poll: Re: Which brace style do you prefer?

    Definitely Pico... I started doing this style on my own, didn't know there was a name for it.
  4. Replies
    12
    Views
    606

    Re: [Python] Confused by namespace problem...

    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...
  5. Replies
    12
    Views
    606

    Re: [Python] Confused by namespace problem...

    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,...
  6. Replies
    12
    Views
    606

    Re: [Python] Confused by namespace problem...

    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.
  7. Replies
    12
    Views
    606

    Re: [Python] Confused by namespace problem...

    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?
  8. Replies
    12
    Views
    606

    [Python] Confused by namespace problem...

    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...
  9. Replies
    20
    Views
    1,151

    Re: Python help!

    Oops, you're right. Still, with no external dependencies, I imagine it would be easier to make it work on a cellphone.
  10. Replies
    20
    Views
    1,151

    Re: Python help!

    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]
    ...
  11. Replies
    8
    Views
    436

    Re: Confused by error in python

    You didn't define the variable named choice1.

    Unless it's text, then it should be "choice1"
  12. Replies
    13
    Views
    659

    Re: Advanced Challenges???

    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...
  13. Replies
    1,058
    Views
    351,051

    Re: What's your Favorite IDE?

    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:

    ...
  14. Replies
    20
    Views
    1,151

    Re: Python help!

    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...
  15. Replies
    1,058
    Views
    351,051

    Re: What's your Favorite IDE?

    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...
  16. Replies
    28
    Views
    3,232

    Re: Announcing pywarrior, new python/text editor

    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.
  17. Re: Python editiing a variable a user chooses?

    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...
  18. Replies
    28
    Views
    3,232

    Re: Announcing pywarrior, new python/text editor

    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...
  19. Replies
    28
    Views
    3,232

    Re: Announcing pywarrior, new python/text editor

    I just released version 1.04 which fixes this bug, thanks for pointing it out to me.
  20. Replies
    28
    Views
    3,232

    Re: Announcing pywarrior, new python/text editor

    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.
  21. Replies
    28
    Views
    3,232

    Re: Announcing pywarrior, new python/text editor

    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...
  22. Replies
    28
    Views
    3,232

    Re: Announcing pywarrior, new python/text editor

    Okay, I figured out the easiest way to make color work on the Macintosh.

    Just open Terminal Preferences and change 'xterm' to 'xterm-color'.
    ...
  23. Replies
    28
    Views
    3,232

    Re: Announcing pywarrior, new python/text editor

    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...
  24. Replies
    28
    Views
    3,232

    Re: Announcing pywarrior, new python/text editor

    What version of OS X are you using?

    And what did you type to enable it?

    Thanks!
  25. Re: [SOLVED] Python - Scan webpage and list its containing links (urls)

    Might be a better way, but here's how I got the links:

    import urllib
    mypath =...
Results 1 to 25 of 64
Page 1 of 3 1 2 3