Skip to main content

Home/ Python Programming/ Group items tagged control

Rss Feed Group items tagged

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.
Jac Londe

Eli Bendersky's website » Python metaclasses by example - 12 views

    • Mauro De Giorgi
       
      Start read from here
  • Study and understand this example and you’ll grasp most of what one needs to know about writing metaclasses.
  • To control the creation and initialization of the class in the metaclass, you can implement the metaclass’s __new__ method and/or __init__ constructor [6]. Most real-life metaclasses will probably override just one of them. __new__ should be implemented when you want to control the creation of a new object (class in our case), and __init__ should be implemented when you want to control the initialization of the new object after it has been created.
  • ...3 more annotations...
  • It’s important to note here that these print-outs are actually done at class creation time, i.e. when the module containing the class is being imported for the first time. Keep this detail in mind for later.
  • So when the call to MyMeta is done above, what happens under the hood is this:
  • Python metaclasses by example
Jac Londe

Pulover's Macro Creator - 0 views

  • Pulover’s Macro Creator is a Free Automation Tool and Script Generator. It is based on AutoHotkey language and provides users with multiple automation functions, as well as a built-in recorder. “Pulover’s Macro Creator is very handy as a means of automating various tasks without possessing  programming knowledge.” 
  • It’s more than a Macro Recorder! You can add not only keystrokes and mouse actions to your scripts but also manage windows, controls, files, strings, search images/pixels and even create If/Else Statements to control the flow of your macros! From simple repetitive tasks to complex automation projects, Pulover’s Macro Creator will save you hours of monotonous work. Everything with a friendly and intuitive interface.
reckoner reckoner

ONLamp.com -- Introduction to Stackless Python - 0 views

  • What's the relation between these benefits and Stackless's implementation details? Here's a quick sketch: Continuations are the general-purpose concurrency construct. A continuation represents all the future computations of a particular program. Capturing all this control flow in a single conceptual object makes it programmable: It becomes possible to calculate or reason over the control flow. In particular, there's great scope for optimizing assignment of different calculations to different processes or threads or even hosts.
reckoner reckoner

Allen's Weblog: PyMeta: How and Why - 0 views

  • One of the main difficulties I've had using parser generators has been the difficulty of figuring out why a grammar didn't work. Fixing shift-reduce and reduce-reduce conflicts seemed like voodoo to me, and though I slightly understand better how to fix such things now it's still a different mode of thinking that I don't want to try to get into when I just want to parse something simple. PyMeta uses a variation on the Parsing Expression Grammar (PEG) approach to parsing. The chief consequence of this is there's no possibility of ambiguity in a parse: a successful parse will yield exactly one result, and you can trace the control flow through the grammar to figure out how it got there.
reckoner reckoner

Charming Python: Inside Python's implementations - 0 views

  • To attempt to explain it in the simplest terms, a continuation is a representation, at a particular point in a program, of everything the program is capable of doing subsequently. A continuation is a potential that depends on initial conditions. Rather than loop in a traditional way, it is possible to invoke the same continuation recursively with different initial conditions. One broad claim I have read is that continuations, in a theoretical sense, are more fundamental and underlie every other control structure. Don't worry if these ideas cause your brain to melt; that is a normal reaction.
reckoner reckoner

pyPortMidi - 0 views

  • pyPortMidi is a Python wrapper I wrote for PortMidi. PortMidi is a cross-platform C library for realtime MIDI control. Using pyPortMidi, you can send and receive MIDI data in realtime from Python.
reckoner reckoner

pyWinAuto - 0 views

  • pywinauto is a set of python modules to automate the Microsoft Windows GUI. At it's simplest it allows you to send mouse and keyboard actions to windows dialogs and controls.
reckoner reckoner

The Eric Python IDE - 0 views

  • Eric is a full featured Python and Ruby editor and IDE, written in python. It is based on the cross platform Qt gui toolkit, integrating the highly flexible Scintilla editor control. It is designed to be usable as everdays' quick and dirty editor as well as being usable as a professional project management tool integrating many advanced features Python offers the professional coder. Current stable version is eric4 based on Qt4. For Qt3 based systems eric3 is still available.
  •  
    more windows xp  friendly and all in python.
1 - 12 of 12
Showing 20 items per page