473,773 Members | 2,334 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

writing my own extension

hi,

i use a lot the enumerate in my scripts and got really interested in
possibly writing my own enumerate as an extension, for which i would
want to extend it to be able to pass a start and step attribute.

can anyone point me on my way with good examples for that and how to
write extensions ?

thank you in advance

Apr 10 '07 #1
1 1805
On Apr 10, 12:52 pm, "spohle" <spo...@gmail.c omwrote:
hi,

i use a lot the enumerate in my scripts and got really interested in
possibly writing my own enumerate as an extension, for which i would
want to extend it to be able to pass a start and step attribute.

can anyone point me on my way with good examples for that and how to
write extensions ?

thank you in advance
The range() builtin has this functionality. Also check out
http://docs.python.org/lib/itertools-functions.html

As for writing extensions, check out the following links:

http://docs.python.org/inst/tweak-flags.html
http://docs.python.org/dist/describing-extensions.html
http://www.geocities.com/foetsch/pyt...ing_python.htm
http://cxx.sourceforge.net/
http://www.vrplumber.com/programming/mstoolkit/

Interesting notes on iterators with (or without) a "step()":

http://mail.python.org/pipermail/pyt...ry/022007.html
http://www.thescripts.com/forum/thread556059.html
http://aspn.activestate.com/ASPN/Coo.../Recipe/498272

Mike

Apr 10 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2182
by: Ever Olano | last post by:
Hi. I have the following questions regarding writing a PHP extension. You don't have to answer all questions. Please answer everything you can. I'd really appreciate it. 1. What is the most common version that's used out there? If I wrote an extension for PHP 4, would it work for PHP 5? Also, is PHP 3 very different? 2. My extension will need to use an external C++ (not C) library. That should be all right, right?
3
3077
by: Csaba Gabor | last post by:
Firefox's configuration settings (Prefs.js) can be accomplished via the interface at about:config. Q1. Is there any such setting that can be repeatedly altered via javascript (in a vanilla security environment), without having to request preivileges? By altered, I mean having it remain in effect the next time Firefox is restarted. Q2. If the answer to Q1 is affirmative, is there any such setting that could have an event associated...
0
2146
by: robert | last post by:
Hi all, I'm having a hard time resolving a namespace issue in my wsdl. Here's an element that explains my question, with the full wsdl below: <definitions name="MaragatoService" targetNamespace="http://swaMaragatoNS" xmlns:tns="http://swaMaragatoNS" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
4
1663
by: jackpod | last post by:
Hi, I have been trying to write an image to a database table BLOB field in MySQL but when I try to retrieve the image to display it, it shows as being empty. Are there any special considerations I need to take into account when reading and writing images to a DB? Thanks.
7
5453
by: Paolo Pantaleo | last post by:
Hi, I need to write a software that allow to see the desktop and hear the microphone capture of a remote PC across a network. I need to do that for a unviresity assignement. The software must run on Windows. Since I like Python very much I am thinking to write that software in Python. Do you thinkit is a good choice? Are there libraries for audio compression (OGG or MP3 or maybe GSM or something like realaudio) and video compression...
5
1897
by: thewritersclub | last post by:
Hi guys! I'm new to python so please be aware that I'm probably missing the obvious. Here's my problem... Traceback (most recent call last): File "<pyshell#37>", line 1, in <module> f = open('c:\\' + t + '.csv', 'a') IOError: No such file or directory: 'c:\\AUX.csv'
118
4696
by: Chuck Cheeze | last post by:
This might be in the wrong group, but... Here is an example of my data: entry_id cat_id 1 20 2 25 3 30 4 25 5 35
16
1574
by: inhahe | last post by:
Can anyone give me pointers/instructions/a template for writing a Python extension in assembly (or better, HLA)?
2
1933
by: Jeff Gaines | last post by:
I am in the process of upgrading to XP 64. VS2008 is running fine but one of my apps, which adds functionality to the Explorer context menu, just won't work under XP 64. Googling resulted in my finding an article saying that MSFT recommends against writing shell extensions in managed code and does not consider them a supported scenario. So, can anybody point me to any articles relating to writing shell extensions in non managed code...
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10264
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9914
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7463
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4012
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.