Skip to main content

Home/ Mac Attack/ Group items tagged input

Rss Feed Group items tagged

Benjamin Bandt-Horn

Game programming - Wikipedia, the free encyclopedia - 0 views

  • The central component of any game, from a programming standpoint, is the game loop. The game loop allows the game to run smoothly regardless of a user's input or lack thereof. Most traditional software programs respond to user input and do nothing without it. For example, a word processor formats words and text as a user types. If the user doesn't type anything, the word processor does nothing. Some functions may take a long time to complete, but all are initiated by a user telling the program to do something. Games, on the other hand, must continue to operate regardless of a user's input. The game loop allows this. A highly simplified game loop, in pseudocode, might look something like this: while( user doesn't exit ) check for user input run AI move enemies resolve collisions draw graphics play sounds end while
  •  
    The central component of any game, from a programming standpoint, is the game loop. The game loop allows the game to run smoothly regardless of a user's input or lack thereof.
Benjamin Bandt-Horn

17.1 subprocess -- Subprocess management - 0 views

  • The subprocess module allows you to spawn new processes, connect to their input/output/error pipes, and obtain their return codes. This module intends to replace several other, older modules and functions, such as: os.system os.spawn* os.popen* popen2.* commands.*
  •  
    The subprocess module allows you to spawn new processes, connect to their input/output/error pipes, and obtain their return codes. This module intends to replace several other, older modules and functions, such as: os.system os.spawn* os.popen* popen2.* commands.*
Benjamin Bandt-Horn

[SLUT] - 0 views

  • ABOUT Slut is a programming framework for generative, synthetic, interactive, network-enabled graphics. Slut generates images from processes. Such processes may be simple "construction plans" or they may depend on user input. They may be drawn from incoming network data or messages that are sent to the network. Produced images may be adaptive, accumulative or static. They may look and feel like computer games or they may inform like scientific visualizations. They may be lyrical, cynical, political, intrusive (literally over the network), simply beautiful or banal.
  •  
    ABOUT Slut is a programming framework for generative, synthetic, interactive, network-enabled graphics. Slut generates images from processes. Such processes may be simple "construction plans" or they may depend on user input. They may be drawn from incoming network data or messages that are sent to the network. Produced images may be adaptive, accumulative or static. They may look and feel like computer games or they may inform like scientific visualizations. They may be lyrical, cynical, political, intrusive (literally over the network), simply beautiful or banal.
Benjamin Bandt-Horn

25.2. doctest - Test interactive Python examples - Python v2.7.6 documentation - 0 views

  • common ways to use doctest: To check that a module’s docstrings are up-to-date by verifying that all interactive examples still work as documented. To perform regression testing by verifying that interactive examples from a test file or a test object work as expected. To write tutorial documentation for a package, liberally illustrated with input-output examples. Depending on whether the examples or the expository text are emphasized, this has the flavor of “literate testing” or “executable documentation”.
  • Running the module as a script causes the examples in the docstrings to get executed and verified
  • The file content is treated as if it were a single giant docstring; the file doesn’t need to contain a Python program! For example, perhaps example.txt contains this
  • ...8 more annotations...
  • You can instruct the Python interpreter to run the doctest module directly from the standard library and pass the file name(s) on the command line:
  • if M.__test__ exists and “is true”, it must be a dict, and each entry maps a (string) name to a function object, class object, or string
  • Which Docstrings Are Examined?
  • Any expected output must immediately follow the final '>>> ' or '... ' line containing the code, and the expected output (if any) extends to the next '>>> ' or all-whitespace line.
  • Execution Context?
  • Directives
  • Whitespace is not allowed between the + or - and the directive option name. The directive option name can be any of the option flag names explained above
  • Unittest
  •  
    Freaking Amazing.
Benjamin Bandt-Horn

The Foundry Community :: Forums :: Using a 3D Mouse (video demo) - 0 views

  • Using a 3D mouse with modo 601
  •  
    Using a 3D mouse with modo 601 on a Mac
Benjamin Bandt-Horn

The Python Computer Graphics Kit - 0 views

  • The Python Computer Graphics Kit is an Open Source software package containing a collection of Python modules, plugins and utilities that are meant to be useful for any domain where you have to deal with 3D data of any kind, be it for visualization, creating photorealistic images, Virtual Reality or even games.
  • Provides access to specialized input hardware such as SpaceMouse/SpaceBall, data glove or tablet via wrappers around the 3DxWare SDK by 3Dconnexion, the Wintab Developer Kit by LCS/Telegraphics and the Data Glove SDK by Fifth Dimension Technologies.
  •  
    The Python Computer Graphics Kit is an Open Source software package containing a collection of Python modules, plugins and utilities that are meant to be useful for any domain where you have to deal with 3D data of any kind, be it for visualization, creating photorealistic images, Virtual Reality or even games.
Benjamin Bandt-Horn

Unicode and new style string formatting ~ The Voidspace Techie Blog - 0 views

  • Unicode and new style string formatting Python 2.6 and Python 3 gain a new style of string formatting, which is apparently based on the string formatting in C#. I wasn't a big fan of the string formatting in C# and so wasn't very excited about it moving into Python, but as is to be expected it has grown a bit on me.
  • As always, the best solution is to not mix Unicode and byte-strings but to keep all strings in Unicode and only perform the encode when actually needed.
  • So why does this behaviour matter? Well it particularly matters for framework authors formatting messages based on 'user' input. This is the case with unittest, which creates error messages when tests fail. The error messages internally in unittest are byte-strings and they are often mixed with user supplied messages using string formatting. We use old-style (% based) formatting, so if the user supplies byte-strings then the resulting messages will be byte-strings. If the user supplies Unicode strings then the resulting messages will be in Unicode. Because all the internal unittest messages are ascii only we can guarantee than an implicit decode to Unicode will succeed - so the user can choose the output type by varying the type of the messages they provide.
  •  
     Python 2.6 and Python 3 gain a new style of string formatting, which is apparently based on the string formatting in C#. I wasn't a big fan of the string formatting in C# and so wasn't very excited about it moving into Python, but as is to be expected it has grown a bit on me.
1 - 7 of 7
Showing 20 items per page