Skip to main content

Home/ Python Programming/ Group items tagged coding

Rss Feed Group items tagged

reckoner reckoner

Lightweight Approach to AOP (aspect-oriented programming) in Python - 0 views

  • aspects.py library provides means to intercept function calls. Functions and methods (also in Python standard library and third party code) can be wrapped so that when they are called, the wrap is invoked first. Depending on the wrap, the execution of the original function can be omitted, or the function can be called arbitrarily many times. Wraps are able to modify the arguments and the return value of the original function. In the terminology of aspect-oriented programming, the library allows applying advices (wraps) to call join points of methods and functions in around fashion.
  •  
    aspect-oriented programming
reckoner reckoner

PerryGeo » A quick Cython introduction - 0 views

  • I love python for its beautiful code and practicality. But it’s not going to win a pure speed race with most languages. Most people think of speed and ease-of-use as polar opposites - probably because they remember the pain of writing C. Cython tries to eliminate that duality and lets you have python syntax with C data types and functions - the best of both worlds. Keeping in mind that I’m by no means an expert at this, here are my notes based on my first real experiment with Cython:
reckoner reckoner

tinypy :: home - 0 views

  • tinypy is a minimalist implementation of python in 64k of code
reckoner reckoner

difference between classmethod and staticmethod in Python2.2 - 0 views

  • Use a staticmethod when you know which class you want to access as you are writing the code.
  • Use a classmethod if you have a class hierarchy and want the method to operate on the actual class used in the call rather than the class where it was defined:
reckoner reckoner

Preexisting code indentation - Vim Tips Wiki - a Wikia wiki - 0 views

  • lternative: if your file has indent 4 and you want an indent of 3 and gg=G is not working as expected, try :set inde=indent(v:lnum)/4*3 then go ahead with the well known gg=G use tabs or spaces, doesn't matter
reckoner reckoner

profitpy -module for automated stock trading - 0 views

  • ProfitPy is a set of libraries and tools for the development, testing, and execution of automated stock trading systems Specifically, ProfitPy is a collection of Python packages, modules, and scripts that work together to help you implement an automated stock trading program (or programs). The package features: A library with classes for accounts, orders, tickers, and more A GUI program for executing and plotting trades in real-time A GUI tool to collect ticker data for off-line use A CLI tool to back-test trading strategies Dozens of technical indicators and plotting widgets to display them An X11 keystroke tool for automating the TWS application
reckoner reckoner

Command line programs are classes, too! - 0 views

  • I hope this article encourages you to think about your command line programs in a different light, and to treat them as first class objects. Using inheritance to share code is so common in other areas of development that it is hardly given a second thought in most cases. As has been shown with the SQLiteAppBase programs, the same technique can be just as powerful when applied to building command line programs, saving development time and testing effort as a result. CommandLineApp has been used as the foundation for dozens of types of programs, and could be just what you need the next time you have to write a new command line program.
reckoner reckoner

Kill process based on window name (win32) - 0 views

  • Re: Kill process based on window name (win32) Thank you Roger. Your advice did the trick. For anyone interested, the basic code to terminate a process (politely) would be something like this (hwnd is retrieved using win32gui.EnumerateWindows): # Get the window's process id's t, p = win32process.GetWindowThreadProcessId(hwnd) # Ask window nicely to close win32gui.PostMessage(hwnd, win32con.WM_CLOSE, 0, 0) # Allow some time for app to close time.sleep(10) # If app didn't close, force close try: handle = win32api.OpenProcess(win32con.PROCESS_TERMINATE, 0, p) if handle: win32api.TerminateProcess(handle,0) win32api.CloseHandle(handle) except: pass:
reckoner reckoner

[IPython-user] setting breakpoints in code - 0 views

  • Robin, Give this a try: from IPython.Debugger import Tracer; debugger = Tracer() debugger() #add this line where you want to break barr
reckoner reckoner

dkbza - TeXmacs Python - 0 views

  • A 'Mathematica Notebook' styled interface to Python from within TeXmacs. Blocks of code can be run independently of their order, and full multiline blocks, i.e. function remain visible and easily modifiable.
reckoner reckoner

Pypar -- parallel programming - 0 views

  • Pypar does not require the Python interpreter to be modified or recompiled: Parallel python programs use the standard Python and need merely import the pypar module. This means for example that you can upgrade Python independently of your parallel codes.
  • Pypar is an efficient but easy-to-use module that allows programs/scripts written in the Python programming language to run in parallel on multiple processors and communicate using message passing. Pypar provides bindings to an important subset of the message passing interface standard MPI. Other Python MPI bindings available from other developers include: PyMPI, Scientific Python and pythonMPI.
reckoner reckoner

Rutherfurd.net: SendKeys - 0 views

  • SendKeys SendKeys(keys, pause = 0.05, with_spaces = False, with_tabs = False, with_newlines = False, turn_off_numlock = True) Parameters keys : str A string of keys. pause : float The number of seconds to wait between sending each key or key combination. with_spaces : bool Whether to treat spaces as {SPACE}. If False, spaces are ignored. with_tabs : bool Whether to treat tabs as {TAB}. If False, tabs are ignored. with_newlines : bool Whether to treat newlines as {ENTER}. If False, newlines are ignored. turn_off_numlock : bool Whether to turn off NUMLOCK before sending keys.
  • Key Code BACKSPACE {BACKSPACE}, {BS}, or {BKSP} BREAK {BREAK} CAPS LOCK {CAPSLOCK} or {CAP} DEL or DELETE {DELETE} or {DEL} DOWN ARROW {DOWN} END {END} ENTER {ENTER} or ~ ESC {ESC} HELP {HELP} HOME {HOME} INS or INSERT {INSERT} or {INS} LEFT ARROW {LEFT} NUM LOCK {NUMLOCK} PAGE DOWN {PGDN} PAGE UP {PGUP} PRINT SCREEN {PRTSC} RIGHT ARROW {RIGHT} SCROLL LOCK {SCROLLLOCK} SPACE BAR {PACE} TAB {TAB} UP ARROW {UP} F1 {F1} F2 {F2} F3 {F3} F4 {F4} F5 {F5} F6 {F6} F7 {F7} F8 {F8} F9 {F9} F10 {F10} F11 {F11} F12 {F12} F13 {F13} F14 {F14} F15 {F15} F16 {F16} F17 {F17} F18 {F18} F19 {F19} F20 {F20} F21 {F21} F22 {F22} F23 {F23} F24 {F24} Keypad add {ADD} Keypad subtract {SUBTRACT} Keypad multiply {MULTIPLY} Keypad divide {DIVIDE} Left Windows(R) {LWIN} Right Windows(R) {RWIN}
reckoner reckoner

Pygments - Python syntax highlighter - 0 views

  • This is the home of Pygments. It is a generic syntax highlighter for general use in all kinds of software such as forum systems, wikis or other applications that need to prettify source code. Highlights are:
reckoner reckoner

PyReadline/Intro - IPython - 0 views

  • Install using binary installer Download installer from http://ipython.scipy.org/dist/pyreadline-1.3.win32.exe make sure no other readline is installed run installer The configuration file pyreadlineconfig.ini can be copied from Python24/lib/site-packages/pyreadline/configuration to your HOME directory (usually c:/documents and settings/YOURNAME). When using ipython pyreadline is automatically activated. If you want to use pyreadline from the interactive prompt of the python interpreter then you have to include the code in Python24/lib/site-packages/pyreadline/configuration/startup.py in your pythonstartup file or set the PYTHONSTARTUP environment variable to point to that file. Manual can be found in Python24/share/doc/pyreadline
  •  
    Need this to get ipython to work  on  python25
reckoner reckoner

Manning: wxPython in Action - 0 views

  •  
    # Sample Chapter 2 (PDF) # Sample Chapter 9 (PDF) # Source code (336 KB - last updated March 1, 2006)
« First ‹ Previous 61 - 80 of 91 Next ›
Showing 20 items per page