Skip to main content

Home/ Python Programming/ Group items tagged #Programming

Rss Feed Group items tagged

reckoner reckoner

IpythonOnConsole - IPython - 0 views

  • IPython on resizeable Win32 Console If you are on win32, you might want to use Console, an open source replacement for that inflexible old win32 terminal. Here's how. Install IPython using the .exe installer. Download stable version of Console (1.5 at this time). Create a shortcut to console.exe, right-click -> properties. Set target to e.g. C:\opt\Console\console.exe -c "/k python c:\python25\scripts\ipython.py -p sh" you can also create a tab dedicated to Ipython (and have other dedicated to other shells or command-line app). go to edit->settings->tabs : click on the add button and fill the following fields : * title : ipython ico : C:\Python24\py.ico shell : cmd.exe /k "ipython" start-up dir : whatever is good for you. note that python.exe need to be in the path Using IPython with Version 2 of Console use the -r option for creating the shortcut, e.g. C:\opt\Console2\console.exe -r "/k python c:\python25\scripts\ipython.py -p sh" Some advantages of Console2 over normal console (for IPython use) Distinctive taskbar icon Can reside in system tray There are many other benefits, so it's well worth setting up Example config for Console-2.00b120-Beta (you need to edit the xml file): http://vvtools.googlecode.com/svn/trunk/config/console.xml If you have problems with ctrl+C killing Console2 immediately, launch ipython from a normal Console2 session manually.
reckoner reckoner

DebuggingExercise - Software Carpentry at Virginia Tech Wiki - 0 views

  • This tutorial teaches the fundamental concepts of symbolic debuggers. We will be using Winpdb to debug Python scripts. The concepts that you learn here, however, are fundamental to working with debuggers in general. At the end of the exercise, you should feel comfortable with using symbolic debuggers and have an inherent understanding of why these tools prove to reduce time and effort needed in debugging without altering the code itself to do so.
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

Python - Notes - 0 views

  •  
    includes material on Python 3.0
reckoner reckoner

partiallydisassembled.net - 0 views

  • Neat script I wrote for a friend to annotate a Python script with the types observed during a run of the program
  •  
    Neat script I wrote for a friend to annotate a Python script with the types observed during a run of the program.
reckoner reckoner

stdout in pyscripter - PyScripter | Google Groups - 0 views

  • PyScripter and most Python IDEs redirect sys.stdout.  Also GUI apps like PyScripter have no standard output.  What you need to do is PyObject *f = PySys_GetObject("stdout") and then use PyFile_WriteString for writing to the sys.stdout. This is what Python itself is doing and I think this is the best way
  •  
    PyScripter and most Python IDEs redirect sys.stdout. Also GUI apps like PyScripter have no standard output. What you need to do is PyObject *f = PySys_GetObject("stdout") and then use PyFile_WriteString for writing to the sys.stdout. This is what Python itself is doing and I think this is the best way for printing from C extensions anyway.
reckoner reckoner

py vs pyc - 0 views

  • When running "python test.py" the interpreter will first precompile the test.py source file, and then execute it. When running "python test.pyc", the interpreter will go straight to the execution of the script.
reckoner reckoner

Python Package Index : Contextual 0.7a1.dev - 0 views

  • Replace globals with context-safe variables and services
reckoner reckoner

PyLinda: PyLinda - Distributed Computing Made Easy - 0 views

  • Linda is an widely studied distributed computing environment, centered around the notion of a tuple space. A tuple space is a bag (also called a multi-set) of tuples. A tuple is an ordered, typed chunk of data. Tuple spaces exist independently of processes in the system, and the data placed into a tuple space also exist independently. See "Generative communication in Linda" (1985) and "Multiple tuple spaces in Linda" both by David Gelernter for more information on Linda.
reckoner reckoner

psychotic - accelerate python code - 0 views

  • sychotic is an innovative optimizing compiler for Python code. It has unique features, the most important of which is that it breaks through the ConstantTimeBarrier. It is very easy to use and has an interface similar to that of the popular Psyco project. Below, you can see a usage example. You can also learn about HowItWorks, the ProjectHistory and KnownIssues. You can also browse the easy-to-understand source especially the alysis.py analyzer module and the dingo.py runtime bootstrap. There is an introductory screencast available (less than 5 minutes long). Usage
reckoner reckoner

Re: Python in Excel - 0 views

  • You can use Microsoft Script Control. If you have the win32 extensions of python, you can use python in place of vb in this control -open the VBA script editor - In menus/Tools/References add Microsoft Script Control -Make a new module and declare a new MsScriptControl.ScriptControl Global sc as new MsScriptControl.ScriptControl -Initialize the language attibute with python - Note that you and users of your document must have python and its win32 extensions installed. Activestate python distribustion include it. You can put sc.language="python" in the routine Workbook_Open() Now you can import python modules using ExecuteStatement method of the control in vba and have results from python functions with eval method. One interesting thing is that you can pass an object to the control with AddObject method and have python manipulate it. And so on..
  • Global sc As New MSScriptControl.ScriptControl Public Function os_getcwd() sc.Language = "python" sc.ExecuteStatement ("import os") os_getcwd = sc.Eval("os.getcwd()") End Function With this you can set your Excel formula to =os_getcwd() For me it returns "C:\Documents and Settings\Administrator\My Documents", which I needed to know at the time so I didn't have to screw around with the ever annoying pythonpath. You can put the first two lines of the function in the Workbook_Open hook, but I don't know where that is. I hope to use more Python in Excel soon. Hmm, actually, I suppose you can put those first two lines of the function after the Global declaration as well. I know just about zero VBScript and didn't get a chance to do anything else beyond proof of concept yet. I figured I would write something dynamic which allowed more transparent access to Python, maybe allowing formula like =py("os.getcwd()"), etc.
‹ Previous 21 - 40 of 213 Next › Last »
Showing 20 items per page