Skip to main content

Home/ Python Programming/ Group items tagged Object

Rss Feed Group items tagged

reckoner reckoner

Pyro - About - 0 views

  • Pyro is short for PYthon Remote Objects. It is an advanced and powerful Distributed Object Technology system written entirely in Python, that is designed to be very easy to use. Never worry about writing network communication code again, when using Pyro you just write your Python objects like you would normally. With only a few lines of extra code, Pyro takes care of the network communication between your objects once you split them over different machines on the network. All the gory socket programming details are taken care of, you just call a method on a remote object as if it were a local object!
reckoner reckoner

osh: Object-Oriented Shell - 0 views

  • Osh (Object SHell) is a tool that integrates the processing of structured data, database access, and remote access to a cluster of nodes. These capabilities are made available through a command-line interface (CLI) and a Python application programming interface (API). Osh processes streams of Python objects using simple commands. Complex data processing is achieved by command sequences in which the output from one command is passed to the input of the next. This is similar to composing Unix commands using pipes. However, Unix commands pass strings from one command to the next, and the commands (grep, awk, sed, etc.) are heavily string-oriented. Osh commands send primitive Python types such as strings and numbers; composite types such as tuples, lists and maps; objects representing files, dates and times; or even user-defined objects.
dshekhar17

Object Tracking OpenCV Python | Divyanshu Shekhar - 0 views

  •  
    Object Tracking OpenCV Python
enzojade62

Python Proficiency: Crafting a Digital Shopping Cart - 3 views

Are you ready to sharpen your Python programming skills with a practical and engaging assignment? In this blog post, we'll tackle the creation of a digital shopping cart, providing you with an oppo...

python programming developer pythonprogrammingassignmenthelp programmingassignmenthelp pythonassignmenthelp assignmenthelp education students university

started by enzojade62 on 16 Nov 23 no follow-up yet
Mikhail K

Example-driven ZODB - 0 views

  •  
    How to use an object database with a Python, a dynamic object-oriented language
jdr santos

Boa Constructor home - 0 views

  •  
    Boa Constructor is a cross platform Python IDE and wxPython GUI Builder. It offers visual frame creation and manipulation, an object inspector, many views on the source like object browsers, inheritance hierarchies, doc string generated html documentation
reckoner reckoner

Python Idioms and Efficiency Suggestions - 0 views

  • What idioms should I use to make my code easier to read? Read "The Python Cookbook", especially the first few chapters. It's a great source of well-written Python code examples.
  • Use function factories to create utility functions. Often, especially if you're using map and filter a lot, you need utility functions that convert other functions or methods to taking a single parameter. In particular, you often want to bind some data to the function once, and then apply it repeatedly to different objects. In the above example, we needed a function that multiplied a particular field of an object by 3, but what we really want is a factory that's able to return for any field name and amount a multiplier function in that family:
  • Use zip and dict to map fields to names. zip turns a pair of sequences into a list of tuples containing the first, second, etc. values from each sequence. For example, zip('abc', [1,2,3]) == [('a',1),('b',2),('c',3)]. You can use this to save a lot of typing when you have fields in a known order that you want to map to names:
  •  
    suggestions for better programming style.
jamessidis

Best Way to Learn Numpy - 0 views

  •  
    NumPy is the fundamental package for scientific computing in Python. Numpy stands for Numerical Python. If you want to work with machine learning or data science, Numpy is a Python library you will mostly use. It is a Python library that provides a multidimensional array object for fast operations on arrays, including mathematical, logical, shape manipulation, sorting, selecting, I/O, discrete Fourier transforms, basic linear algebra, basic statistical operations, and much more.
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
reckoner reckoner

pymel - Google Code - 0 views

  • Python in Maya Done RightPymel makes python scripting with Maya work the way it should. Maya's command module is a direct translation of mel commands into python commands. The result is a very awkward and unpythonic syntax which does not take advantage of python's strengths -- particulary, a flexible, object-oriented design. Pymel builds on the cmds module by organizing many of its commands into a class hierarchy, and by customizing them to operate in a more succinct and intuitive way. Powerful new classes
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.
reckoner reckoner

PyProtocols - 0 views

  • PyProtocols extends the PEP 246 adapt() function with a new "declaration API" that lets you easily define your own protocols and adapters, and declare what adapters should be used to adapt what types, objects, or protocols.  In addition to its own Interface type, PyProtocols can also use Twisted and Zope's Interface types too.  (Of course, since Twisted and Zope interfaces aren't as flexible, only a subset of the PyProtocols API works with them.  Specific limitations are listed in the documentation.)
reckoner reckoner

XGraph plot dot showing multiple edges - networkx-discuss | Google Groups - 0 views

  • For example edge labels can be added using matplotlib "text" objects like this: import networkx as nx import pylab as plot K=nx.XGraph(name="Konigsberg", multiedges=True, selfloops=False) K.add_edges_from([("A","B","Honey Bridge"),     ("A","B","Blacksmith's Bridge"),     ("A","C","Green Bridge"),     ("A","C","Connecting Bridge"),     ("A","D","Merchant's Bridge"),     ("C","D","High Bridge"),     ("B","D","Wooden Bridge")]) pos=nx.spring_layout(K) nx.draw_nx(K,pos) xa,ya=pos['A'] xb,yb=pos['B'] plot.text((xa+xb)/2,(ya+yb)/2,"Blacksmith's Bridge") plot.show() With a little work you can get the label rotated and exactly how you want it positioned.  You can also set the node positions directly in the "pos" dictionary above.
reckoner reckoner

simple? embedding question - Object Mix - 0 views

  • PyObject *mainmod = PyImport_AddModule("__main__"); PyObject *foo = PyImport_ImportModule("foo"); Py_INCREF(foo); //Increment foo module since PyModule_AddObject() steals reference PyModule_AddObject(mainmod, "foo", foo);
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

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

Louie - 0 views

  • Louie provides Python programmers with a straightforward way to dispatch signals between objects in a wide variety of contexts. It is based on PyDispatcher, which in turn was based on a highly-rated recipe in the Python Cookbook. Louie is licensed under The BSD License.
1 - 20 of 29 Next ›
Showing 20 items per page