Skip to main content

Home/ Python Programming/ Group items tagged e-mail

Rss Feed Group items tagged

reckoner reckoner

Charming Python: Functional programming in Python, Part 1 - 0 views

  • Document options Document options requiring JavaScript are not displayed Rate this pageHelp us improve this contentLevel: IntroductoryDavid Mertz (mertz@gnosis.cx), Applied Metaphysician, Gnosis Software, Inc. 01 Mar 2001Although users usually think of Python as a procedural and object-oriented language, it actually contains everything you need for a completely functional approach to programming. This article discusses general concepts of functional programming, and illustrates ways of implementing functional techniques in Python. We'd better start with the hardest question: "What is functional programming (FP), anyway?" One answer would be to say that FP is what you do when you program in languages like Lisp, Scheme, Haskell, ML, OCAML, Clean, Mercury, or Erlang (or a few others). That is a safe answer, but not one that clarifies very much. Unfortunately, it is hard to get a consistent opinion on just what FP is, even from functional programmers themselves. A story about elephants and blind men seems apropos here. It is also safe to contrast FP with "imperative programming" (what you do in languages like C, Pascal, C++, Java, Perl, Awk, TCL, and most others, at least for the most part).
reckoner reckoner

non-interactive ipython for script - 0 views

  • Note that it's more rebust to run methods on the public IPython api.I.e. do ip = ipshell.api and then ip.magic('px import os')You can explore the api interactively by playing with _ip object.
  •  
    noninteractive ipython for regular python script
reckoner reckoner

How to get currently active window on Win32? - 0 views

  • On Sat, 15 Dec 2001 17:53:49 -0800 (PST), David Brady <daves_spam_dodging_account at yahoo.com> wrote : >More win32all questions... is it possible to get the >handle of the window that currently has the focus? >win32gui.GetActiveWindow() fails because I'm looking >for a window outside the process of my Python script. E:\>python ActivePython 2.1.1, build 212 (ActiveState) Python 2.1.1 (#20, Jul 26 2001, 11:38:51) [MSC 32 bit (Intel)] on win32 Type "copyright", "credits" or "license" for more information. >>> import win32gui >>> import time >>> for x in range(10): ... time.sleep(1) ... print x, win32gui.GetWindowText(win32gui.GetForegroundWindow()) ... 0 cmd - python 1 cmd - python 2 (Untitled) * SciTE 3 (Untitled) * SciTE 4 ActivePython Documentation 5 ActivePython Documentation 6 PythonWin 7 PythonWin 8 PythonWin
1 - 5 of 5
Showing 20 items per page