Re: Lists and Sublists

2007-10-24 Thread Amit Khemka
On 10/24/07, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > dineshv a écrit : > > We have a list of N (>2,000) keywords (of datatype string). Each of > > the N keywords has associated with it a list of names of varying > > numbers. For example, keyword(1) will have a list of L1 names > > associ

Re: Python - why don't this script work?

2007-10-24 Thread Ohmster
[EMAIL PROTECTED] wrote in news:1193127053.740024.144730 @q5g2000prf.googlegroups.com: > > Do note that the reason you may not see images is that the website > has, '''correctly''', identified your program as an automated bot and > blocked it access to things... Probably so, I did not get anythi

Re: japanese encoding iso-2022-jp in python vs. perl

2007-10-24 Thread Leo Kislov
On Oct 23, 3:37 am, kettle <[EMAIL PROTECTED]> wrote: > Hi, >   I am rather new to python, and am currently struggling with some > encoding issues.  I have some utf-8-encoded text which I need to > encode as iso-2022-jp before sending it out to the world. I am using > python's encode functions: > -

Re: Iteration for Factorials

2007-10-24 Thread Hendrik van Rooyen
"Jon Ribbens" wrote: > On 2007-10-23, Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > > Yuk. Reminds me of one of the Hitachi processors that > > has a single depth hardware "link register" that tells a > > subroutine where it was called from. > > That's how ARM processors work, and they're e

Re: Speed of Nested Functions & Lambda Expressions

2007-10-24 Thread Duncan Booth
beginner <[EMAIL PROTECTED]> wrote: > It is really convenient to use nested functions and lambda > expressions. What I'd like to know is if Python compiles fn_inner() > only once and change the binding of v every time fn_outer() is called > or if Python compile and generate a new function object e

"realtime" fs mirror application (backup, Python and Linux inotify)

2007-10-24 Thread Roc Zhou
Recently I started an open source project "cutils" on the sourceforge: http://sourceforge.net/projects/crablfs/ The document can be found at: http://crablfs.sourceforge.net/#ru_data_man This project's mirrord/fs_mirror tool is a near realtime file system mirroring application across 2 or more

Re: basic web auth and verification

2007-10-24 Thread Ralf Schönian
[EMAIL PROTECTED] schrieb: > Trying to figure out how to add login verfication. I believe it is > logging me in, but theres no way to really tell..any ideas? or > tutorials out there that can exaplain this to me? > > Thanks > > import urllib,urllib2,cookielib > > passlst = open(passfile, 'r').re

Re: japanese encoding iso-2022-jp in python vs. perl

2007-10-24 Thread kettle
Thanks Leo, and everyone else, these were very helpful replies. The issue was exactly as Leo described, and I apologize for not being aware of it, and thus not quite reporting it correctly. At the moment I don't care about round-tripping between half-width and full-width kana, rather I need only

trying to remember how to do inline code "testing"

2007-10-24 Thread Alex Hunsley
I can remember Python having a feature which allowed you to add some simple tests to your code, something like adding console output to your actual python script, like so: >>> 1+1 2 >>> 2*7 14 ... then python would actually run these queries and check that the expected results occurred. I

Re: trying to remember how to do inline code "testing"

2007-10-24 Thread Diez B. Roggisch
Alex Hunsley wrote: > I can remember Python having a feature which allowed you to add some > simple tests to your code, something like adding console output to your > actual python script, like so: > > > >>> 1+1 > 2 > >>> 2*7 > 14 > > > ... then python would actually run these queries and ch

Re: trying to remember how to do inline code "testing"

2007-10-24 Thread Alex Hunsley
Diez B. Roggisch wrote: > Alex Hunsley wrote: > >> I can remember Python having a feature which allowed you to add some >> simple tests to your code, something like adding console output to your >> actual python script, like so: >> >> >> >>> 1+1 >> 2 >> >>> 2*7 >> 14 >> >> >> ... then python wou

building a linux executable

2007-10-24 Thread Prateek
Hello, I'm trying to package my python program into a linux executable using cx_freeze. The goal is that the user should require python on their system. I've managed to make the binaries on Fedora Core 6 and they run fine. However, when I move to Ubuntu (tested on Ubuntu Server 7.04 and xUbuntu D

Re: python 2.5 scripting in vim on windows: subprocess problem

2007-10-24 Thread Dmitry Teslenko
On 22/10/2007, Andy Kittner <[EMAIL PROTECTED]> wrote: > >> Are you running this on vim or gvim? If you are running on gvim, my > >> guess is that the handles that you are passing are not valid. In > >> either case, try creating explicit handles that are valid (such as for > >> /dev/null) and creat

Extracting/finding strings from a list

2007-10-24 Thread neillee
-- http://mail.python.org/mailman/listinfo/python-list

Better writing in python

2007-10-24 Thread Alexandre Badez
I'm just wondering, if I could write a in a "better" way this code lMandatory = [] lOptional = [] for arg in cls.dArguments: if arg is True: lMandatory.append(arg) else: lOptional.append(arg) return (lMandatory, lOptional) I think there is a better way, but I can't see how... -- htt

Re: building a linux executable

2007-10-24 Thread Bjoern Schliessmann
Prateek wrote: > I'm trying to package my python program into a linux executable > using cx_freeze. The goal is that the user should require python > on their system. > > I've managed to make the binaries on Fedora Core 6 and they run > fine. However, when I move to Ubuntu (tested on Ubuntu Serve

Re: building a linux executable

2007-10-24 Thread Paul Boddie
On 24 Okt, 14:20, Bjoern Schliessmann wrote: > > I'm sorry I cannot help, but how many linux distros have no python > installed or no packages of it? It's not usually the absence of Python that's the problem. What if your application uses various extension modules which in turn rely on various li

Re: name space problem

2007-10-24 Thread Bruno Desthuilliers
BBands a écrit : > On Oct 23, 4:20 pm, [EMAIL PROTECTED] wrote: >> Hello. Indeed the doStuff function in the doStuff module can't do 'a.b >> = 0' (the double dot was just a typo, right?) > > Yes. > >> because it doesn't know anything about an object named a. > > I was trying to understand why it

Re: Python Windows Installation

2007-10-24 Thread Bjoern Schliessmann
TheFlyingDutchman wrote: > I am trying to install Python 2.5 on Windows XP. It installs into > the root directory on C:\ instead of C:\Python25 BTW, what exactly is behind the idea to install to c:\python25 instead of %PROGRAMFILES%\python25? Regards, Björn -- BOFH excuse #339: manager in t

Re: Better writing in python

2007-10-24 Thread J. Clifford Dyer
On Wed, Oct 24, 2007 at 12:09:40PM -, Alexandre Badez wrote regarding Better writing in python: > > lMandatory = [] > lOptional = [] > for arg in cls.dArguments: > if arg is True: > lMandatory.append(arg) > else: > lOptional.append(arg) > return (lMandatory, lOptional) > > I thin

Re: Better writing in python

2007-10-24 Thread Marc 'BlackJack' Rintsch
On Wed, 24 Oct 2007 12:09:40 +, Alexandre Badez wrote: > I'm just wondering, if I could write a in a "better" way this code > > lMandatory = [] > lOptional = [] > for arg in cls.dArguments: > if arg is True: > lMandatory.append(arg) > else: > lOptional.append(arg) > return (lManda

Re: Better writing in python

2007-10-24 Thread Paul Hankin
On Oct 24, 1:09 pm, Alexandre Badez <[EMAIL PROTECTED]> wrote: > I'm just wondering, if I could write a in a "better" way this code > > lMandatory = [] > lOptional = [] > for arg in cls.dArguments: > if arg is True: > lMandatory.append(arg) > else: > lOptional.append(arg) > return (lMan

Re: Better writing in python

2007-10-24 Thread Paul Hankin
On Oct 24, 1:09 pm, Alexandre Badez <[EMAIL PROTECTED]> wrote: > I'm just wondering, if I could write a in a "better" way this code > > lMandatory = [] > lOptional = [] > for arg in cls.dArguments: > if arg is True: > lMandatory.append(arg) > else: > lOptional.append(arg) > return (lMan

Re: Better writing in python

2007-10-24 Thread Paul Hankin
On Oct 24, 1:09 pm, Alexandre Badez <[EMAIL PROTECTED]> wrote: > I'm just wondering, if I could write a in a "better" way this code > > lMandatory = [] > lOptional = [] > for arg in cls.dArguments: > if arg is True: > lMandatory.append(arg) > else: > lOptional.append(arg) > return (lMan

Re: Python Windows Installation

2007-10-24 Thread kyosohma
On Oct 24, 7:27 am, Bjoern Schliessmann wrote: > TheFlyingDutchman wrote: > > I am trying to install Python 2.5 on Windows XP. It installs into > > the root directory on C:\ instead of C:\Python25 > > BTW, what exactly is behind the idea to install to c:\python25 > instead of %PROGRAMFILES%\python

Re: Better writing in python

2007-10-24 Thread kyosohma
On Oct 24, 7:09 am, Alexandre Badez <[EMAIL PROTECTED]> wrote: > I'm just wondering, if I could write a in a "better" way this code > > lMandatory = [] > lOptional = [] > for arg in cls.dArguments: > if arg is True: > lMandatory.append(arg) > else: > lOptional.append(arg) > return (lMan

Re: Better writing in python

2007-10-24 Thread Alexandre Badez
On 10/24/07, J. Clifford Dyer <[EMAIL PROTECTED]> wrote: > > On Wed, Oct 24, 2007 at 12:09:40PM -, Alexandre Badez wrote regarding > Better writing in python: > > > > lMandatory = [] > > lOptional = [] > > for arg in cls.dArguments: > > if arg is True: > > lMandatory.append(arg) > > els

Re: Better writing in python

2007-10-24 Thread Neil Cerutti
On 2007-10-24, Alexandre Badez <[EMAIL PROTECTED]> wrote: > I'm just wondering, if I could write a in a "better" way this > code > > lMandatory = [] > lOptional = [] > for arg in cls.dArguments: > if arg is True: > lMandatory.append(arg) > else: > lOptional.append(arg) > return (lMandat

Re: Better writing in python

2007-10-24 Thread Harold Fellermann
Hi Alexandre, On Oct 24, 2:09 pm, Alexandre Badez <[EMAIL PROTECTED]> wrote: > I'm just wondering, if I could write a in a "better" way this code Please tell us, what it is you want to achieve. And give us some context for this function. > lMandatory = [] > lOptional = [] > for arg in cls.dArgum

Re: transforming list

2007-10-24 Thread Scott David Daniels
sandipm wrote: > hi james, > this is one implementation using python dictionaries. > > report ={} > for row in data: > if not row[0] in report: I'd use: if row[0] not in report: > report[row[0]] = [row[0], row[1], 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0] > if row[2]: >

ANNOUNCE: NUCULAR 0.1 Fielded Full Text Indexing [BETA]

2007-10-24 Thread aaron . watters
ANNOUNCE: NUCULAR 0.1 Fielded Full Text Indexing [BETA] Nucular is a system for creating disk based full text indices for fielded data. It can be accessed via a Python API or via a suite of command line interfaces, and an example Web based archive browser. The 0.1 release adds a bunch of features

Re: Better writing in python

2007-10-24 Thread Duncan Booth
Alexandre Badez <[EMAIL PROTECTED]> wrote: > Thanks for your try Cliff, I was very confused :P > More over I made some mistake when I post (to make it easiest). > > Here is my real code: > > with > dArguments = { > 'argName' : { > 'mandatory' : bool, # True or False > [...], # other fi

Re: Better writing in python

2007-10-24 Thread Alexandre Badez
Thanks for your try Cliff, I was very confused :P More over I made some mistake when I post (to make it easiest). Here is my real code: with dArguments = { 'argName' : { 'mandatory' : bool, # True or False [...], # other field we do not care here } } lMandatory = [] lOptional = [] fo

Re: Better writing in python

2007-10-24 Thread kyosohma
On Oct 24, 8:02 am, [EMAIL PROTECTED] wrote: > On Oct 24, 7:09 am, Alexandre Badez <[EMAIL PROTECTED]> wrote: > > > I'm just wondering, if I could write a in a "better" way this code > > > lMandatory = [] > > lOptional = [] > > for arg in cls.dArguments: > > if arg is True: > > lMandatory.app

Re: Better writing in python

2007-10-24 Thread A.T.Hofkamp
> On 2007-10-24, Alexandre Badez <[EMAIL PROTECTED]> wrote: > I'm just wondering, if I could write a in a "better" way this > code > > lMandatory = [] > lOptional = [] > for arg in cls.dArguments: > if arg is True: > lMandatory.append(arg) > else: > lOptional.append(arg) > return (lMand

Parameters in context manager's __enter__ method?

2007-10-24 Thread skip
I am working on a file locking class which I'd like to work with Python 2.5's context managers. The acquire method takes an optional timeout argument: class FileLock: ... def acquire(self, timeout=None): ... def __enter__(self): self.acquire()

Re: Is this a wx bug?

2007-10-24 Thread kyosohma
On Oct 23, 7:06 pm, Chris Carlen <[EMAIL PROTECTED]> wrote: > Hi: > > #!/usr/bin/env python > > """From listing 3.3 in 'wxPython in Action' > Demonstrates that something funny happens when you click&hold in the > frame, then drag the mouse over the button window. The > wx.EVT_ENTER_WINDOW event is

Re: Better writing in python

2007-10-24 Thread Bjoern Schliessmann
Alexandre Badez wrote: > I'm just wondering, if I could write a in a "better" way this code > [...] > I think there is a better way, but I can't see how... What's "better" for you? Shorter? More performant? More readable? Complying with best practice? Closely following a specific programming parad

Re: building a linux executable

2007-10-24 Thread Bjoern Schliessmann
Paul Boddie wrote: > It's not usually the absence of Python that's the problem. What if > your application uses various extension modules which in turn rely > on various libraries (of the .so or .a kind)? It may be more > convenient to bundle all these libraries instead of working out > the package

Re: Better writing in python

2007-10-24 Thread Paul Hankin
On Oct 24, 2:02 pm, [EMAIL PROTECTED] wrote: > On Oct 24, 7:09 am, Alexandre Badez <[EMAIL PROTECTED]> wrote: > > > I'm just wondering, if I could write a in a "better" way this code > > > lMandatory = [] > > lOptional = [] > > for arg in cls.dArguments: > > if arg is True: > > lMandatory.app

Re: escape single and double quotes

2007-10-24 Thread Michael Pelz Sherman
Thanks Gabriel. You are correct - this is even documented in the MySQLdb User's Guide (http://mysql-python.sourceforge.net/MySQLdb.html), but it's certainly not intuitive, given how python string interpolation normally works. Gabriel Genellina <[EMAIL PROTECTED]> wrote: En Tue, 23 Oct 2007 20:50

win32com.client documentation?

2007-10-24 Thread Mark Morss
I am a unix person, not new to Python, but new to Python programming on windows. Does anyone know where to find documentation on win32com.client? I have successfully installed this module and implemented some example code. But a comprehensive explanation of the objects and methods available is n

Re: Better writing in python

2007-10-24 Thread Tim Chase
> Here is my real code: > > with > dArguments = { > 'argName' : { > 'mandatory' : bool, # True or False > [...], # other field we do not care here > } > } > > lMandatory = [] > lOptional = [] > for arg in cls.dArguments: > if cls.dArguments[arg]['mandatory']: > lMandatory.append

Re: Better writing in python

2007-10-24 Thread cokofreedom
On Oct 24, 4:15 pm, Paul Hankin <[EMAIL PROTECTED]> wrote: > On Oct 24, 2:02 pm, [EMAIL PROTECTED] wrote: > > > > > On Oct 24, 7:09 am, Alexandre Badez <[EMAIL PROTECTED]> wrote: > > > > I'm just wondering, if I could write a in a "better" way this code > > > > lMandatory = [] > > > lOptional = []

Re: Anagrams

2007-10-24 Thread cokofreedom
On Oct 24, 2:28 am, Paul Hankin <[EMAIL PROTECTED]> wrote: > On Oct 23, 9:21 am, [EMAIL PROTECTED] wrote: > > > This one uses a dictionary to store prime values of each letter in the > > alphabet and for each line multiple the results of the characters > > (which is unique for each anagram) and add

Re: TeX pestilence (was Distributed RVS, Darcs, tech love)

2007-10-24 Thread Michele Dondi
On Mon, 22 Oct 2007 09:07:37 -0400, Lew <[EMAIL PROTECTED]> wrote: >Xah Lee wrote: >> i have written ... No coherent argument, I've long killfiled XL to the effect that all of his threads are ignored altogether, since the guy is "nice" enough to only take part to his own rants, but occasionally

Re: Better writing in python

2007-10-24 Thread George Sakkis
On Oct 24, 10:42 am, [EMAIL PROTECTED] wrote: > On Oct 24, 4:15 pm, Paul Hankin <[EMAIL PROTECTED]> wrote: > > > > > On Oct 24, 2:02 pm, [EMAIL PROTECTED] wrote: > > > > On Oct 24, 7:09 am, Alexandre Badez <[EMAIL PROTECTED]> wrote: > > > > > I'm just wondering, if I could write a in a "better" way

Re: building a linux executable

2007-10-24 Thread Paul Boddie
On 24 Okt, 16:10, Bjoern Schliessmann wrote: > Paul Boddie wrote: > > It's not usually the absence of Python that's the problem. What if > > your application uses various extension modules which in turn rely > > on various libraries (of the .so or .a kind)? It may be more > > convenient to bundle

Re: How to find out which functions exist?

2007-10-24 Thread mrstephengross
> import module > from inspect import getmembers, isclass > classes = getmembers(module, isclass) Ok, this makes sense. How can I do it inside the .py file I'm working on? That is, consider this: class A: pass class B: pass import inspect print inspect.getmembers(, inspect.isclass

Re: win32com.client documentation?

2007-10-24 Thread kyosohma
On Oct 24, 9:35 am, Mark Morss <[EMAIL PROTECTED]> wrote: > I am a unix person, not new to Python, but new to Python programming > on windows. Does anyone know where to find documentation on > win32com.client? I have successfully installed this module and > implemented some example code. But a c

Re: Better writing in python

2007-10-24 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : (snip) > Anyone know why towards arg is True and arg is False, arg is None is > faster than arg == None ... Perhaps reading about both the meaning of the 'is' operator might help ? the expression 'arg is True' will only eval to true if 'id(arg) == id(True)'. Now Pyt

Re: How to find out which functions exist?

2007-10-24 Thread Diez B. Roggisch
mrstephengross wrote: >> import module >> from inspect import getmembers, isclass >> classes = getmembers(module, isclass) > > Ok, this makes sense. How can I do it inside the .py file I'm working > on? That is, consider this: > > class A: > pass > class B: > pass > import inspect

Re: win32com.client documentation?

2007-10-24 Thread Matimus
On Oct 24, 7:35 am, Mark Morss <[EMAIL PROTECTED]> wrote: > I am a unix person, not new to Python, but new to Python programming > on windows. Does anyone know where to find documentation on > win32com.client? I have successfully installed this module and > implemented some example code. But a c

Re: Speed of Nested Functions & Lambda Expressions

2007-10-24 Thread beginner
On Oct 24, 2:52 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > beginner <[EMAIL PROTECTED]> wrote: > > It is really convenient to use nested functions and lambda > > expressions. What I'd like to know is if Python compiles fn_inner() > > only once and change the binding of v every time fn_outer() is

Re: How to find out which functions exist?

2007-10-24 Thread Marc 'BlackJack' Rintsch
On Wed, 24 Oct 2007 15:09:02 +, mrstephengross wrote: >> import module >> from inspect import getmembers, isclass >> classes = getmembers(module, isclass) > > Ok, this makes sense. How can I do it inside the .py file I'm working > on? That is, consider this: > > class A: > pass > cla

optparse help output

2007-10-24 Thread Dan
I've been using optparse for a while, and I have an option with a number of sub-actions I want to describe in the help section: parser.add_option("-a", "--action", help=\ """Current supported actions: create, build, import, exp_cmd and interact. create -- Vaguely depre

Re: Better writing in python

2007-10-24 Thread Marc 'BlackJack' Rintsch
On Wed, 24 Oct 2007 16:04:28 +0200, A.T.Hofkamp wrote: >> On 2007-10-24, Alexandre Badez <[EMAIL PROTECTED]> wrote: >> I'm just wondering, if I could write a in a "better" way this >> code >> >> lMandatory = [] >> lOptional = [] >> for arg in cls.dArguments: >> if arg is True: >> lMandatory.

Re: optparse help output

2007-10-24 Thread Tim Chase
> I've been using optparse for a while, and I have an option with a > number of sub-actions I want to describe in the help section: > > parser.add_option("-a", "--action", > help=\ [snipped formatted help] > """) > > Unfortunately, when I run the script with --help, this

Re: Anagrams

2007-10-24 Thread sandipm
hi, Is "all" inbuilt function in python? what it does? > from itertools import ifilter, count > > def anagram_finder(): > primes = ifilter(lambda p: all(p % k for k in xrange(2, p)), count(2)) > primeAlpha = dict(zip(string.lowercase, primes)) >

Re: basic web auth and verification

2007-10-24 Thread [EMAIL PROTECTED]
On Oct 23, 12:55 am, Ralf Schönian <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: > > > > > > > Trying to figure out how to add login verfication. I believe it is > > logging me in, but theres no way to really tell..any ideas? or > > tutorials out there that can exaplain this to me? > > >

Re: Better writing in python

2007-10-24 Thread Bruno Desthuilliers
Bjoern Schliessmann a écrit : > Alexandre Badez wrote: >> I'm just wondering, if I could write a in a "better" way this code >> [...] >> I think there is a better way, but I can't see how... > > What's "better" for you? Shorter? More performant? More readable? > Complying with best practice? Close

Re: Anagrams

2007-10-24 Thread Paul Hankin
On Oct 24, 5:03 pm, sandipm <[EMAIL PROTECTED]> wrote: > Is "all" inbuilt function in python? what it does? >>> help(all) Help on built-in function all in module __builtin__: all(...) all(iterable) -> bool Return True if bool(x) is True for all values x in the iterable. -- Paul Hankin

Re: TeX pestilence (was Distributed RVS, Darcs, tech love)

2007-10-24 Thread Byung-Hee HWANG
On Mon, 2007-10-22 at 12:19 -0400, Lew wrote: > Xah Lee <[EMAIL PROTECTED]> wrote: > >> 4. Inargurated a massive collection of documents that are invalid > >> HTML. (due to the programing moron's ingorance and need to idolize a > >> leader, and TeX's inherent problem of being a typesetting system t

Re: Anagrams

2007-10-24 Thread Tim Chase
>> Is "all" inbuilt function in python? what it does? > help(all) > Help on built-in function all in module __builtin__: > > all(...) > all(iterable) -> bool > > Return True if bool(x) is True for all values x in the iterable. It may be helpful to know that any() and all() were ad

Re: Better writing in python

2007-10-24 Thread beginner
On Oct 24, 9:04 am, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > > On 2007-10-24, Alexandre Badez <[EMAIL PROTECTED]> wrote: > > I'm just wondering, if I could write a in a "better" way this > > code > > > lMandatory = [] > > lOptional = [] > > for arg in cls.dArguments: > > if arg is True: > >

How to best send email to a low volume list?

2007-10-24 Thread chris
I need to maintain a list of subscribers to an email list for a "newsletter" that will be sent via a web form probably once a month. I anticipate low numbers--tens to maybe one hundred subscribers at the most. Just curious what the best way to code this is. Should I just loop through the addresse

Re: How to best send email to a low volume list?

2007-10-24 Thread Adam Lanier
On Wed, 2007-10-24 at 16:54 +, chris wrote: > I need to maintain a list of subscribers to an email list for a > "newsletter" that will be sent via a web form probably once a month. > I anticipate low numbers--tens to maybe one hundred subscribers at the > most. Just curious what the best way t

Re: optparse help output

2007-10-24 Thread Dan
On Oct 24, 12:06 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > > I've been using optparse for a while, and I have an option with a > > number of sub-actions I want to describe in the help section: > > > parser.add_option("-a", "--action", > > help=\ > > [snipped formatted hel

Re: optparse help output

2007-10-24 Thread Steven Bethard
Dan wrote: > On Oct 24, 12:06 pm, Tim Chase <[EMAIL PROTECTED]> wrote: >>> I've been using optparse for a while, and I have an option with a >>> number of sub-actions I want to describe in the help section: >>> parser.add_option("-a", "--action", >>> help=\ >> [snipped for

New to Vim and Vim-Python

2007-10-24 Thread Daniel Folkes
I am new to using Vim's scripts. I was wondering if anyone uses Vim-Python and how to use it? This includes things like key bindings and such. Thanks in advance, Daniel Folkes [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Mobile Startup looking for sharp coders

2007-10-24 Thread Vangati
Plusmo is Hiring! Plusmo's mission is to provide the ultimate mobile experience for users by bringing together advanced technologies and easy to use services for mobile phones. Plusmo's innovative widget service lets users run cool "widgets" on their mobile phones. There are over 20,000 widgets an

Easiest way to get exit code from os.popen()?

2007-10-24 Thread mrstephengross
Hi folks. I'm using os.popen() to run a command; according to the documentation, the filehandle.close() oepration is suppsoed to return the exit code. However, when I execute something like "exit 5", close() returns 1280. Here's the code: pipe = os.popen("exit 5") print pipe.close() # prints 1

Test for a unicode string

2007-10-24 Thread goldtech
Hi, I have a regular expression test in a script. When a unicode character get tested in the regex it gives an error: UnicodeError: ASCII decoding error: ordinal not in range(128) Question: Is there a way to test a string for unicode chars (ie. test if a string will throw the error cited above).

crontab library

2007-10-24 Thread Martin Marcher
Hello, is anyone aware of a crontab library. Possibly even more complete, something that will let me create/manipulate/delete crontab entries in a nice way and install the new crontab accordingly. I had a look at the crontab docs and never realized how complex it actually is. So before I spend t

Re: crontab library

2007-10-24 Thread Guilherme Polo
2007/10/24, Martin Marcher <[EMAIL PROTECTED]>: > Hello, > > is anyone aware of a crontab library. > > Possibly even more complete, something that will let me > create/manipulate/delete crontab entries in a nice way and install the > new crontab accordingly. > > I had a look at the crontab docs and

Socket communication problem

2007-10-24 Thread Sandy Dunlop
Hi, I'm new here, and fairly new to Python. I have been playing around with Python and started having a look at socket IO. I have written a script that communicates over a network to a server which is written in C. While trying to get this working, I have been running into a problem where the Pytho

Re: Socket communication problem

2007-10-24 Thread Sandy Dunlop
Sandy Dunlop wrote: > Hi, > I'm new here, and fairly new to Python. I have been playing around with > Python and started having a look at socket IO. I have written a script > that communicates over a network to a server which is written in C. > While trying to get this working, I have been running

Re: Socket communication problem

2007-10-24 Thread Jean-Paul Calderone
On Wed, 24 Oct 2007 20:42:49 +0100, Sandy Dunlop <[EMAIL PROTECTED]> wrote: >Hi, >I'm new here, and fairly new to Python. I have been playing around with >Python and started having a look at socket IO. I have written a script >that communicates over a network to a server which is written in C. >Whi

Re: Better writing in python

2007-10-24 Thread Alexandre Badez
On Oct 24, 3:46 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > For a 'python like' look lose the Hungarian notation (even Microsoft > have largely stopped using it) I wish I could. But my corporation do not want to apply python.org coding rules > increase the indentation to 4 spaces, Well, it is

Re: Easiest way to get exit code from os.popen()?

2007-10-24 Thread Jean-Paul Calderone
On Wed, 24 Oct 2007 19:07:44 -, mrstephengross <[EMAIL PROTECTED]> wrote: >Hi folks. I'm using os.popen() to run a command; according to the >documentation, the filehandle.close() oepration is suppsoed to return >the exit code. However, when I execute something like "exit 5", >close() returns 1

Re: TeX pestilence (was Distributed RVS, Darcs, tech love)

2007-10-24 Thread J�rgen Exner
Lew wrote: > Xah Lee wrote: >> i have written ... No coherent argument, Actually the modified title is wrong. It should be The Xah Lee pestilence Please see his posting history of off-topic random rambling for details. Oh, and PLEASE +---+ .:\:\:/:/:

Re: Easiest way to get exit code from os.popen()?

2007-10-24 Thread Karthik Gurusamy
On Oct 24, 12:07 pm, mrstephengross <[EMAIL PROTECTED]> wrote: > Hi folks. I'm using os.popen() to run a command; according to the > documentation, the filehandle.close() oepration is suppsoed to return > the exit code. However, when I execute something like "exit 5", > close() returns 1280. Here's

Re: crontab library

2007-10-24 Thread Martin Marcher
2007/10/24, Guilherme Polo <[EMAIL PROTECTED]>: > 2007/10/24, Martin Marcher <[EMAIL PROTECTED]>: > > I had a look at the crontab docs and never realized how complex it > > actually is. So before I spend time in creating such a thing maybe > > someone did it already :) > > > > When you say complex,

Re: crontab library

2007-10-24 Thread Guilherme Polo
2007/10/24, Martin Marcher <[EMAIL PROTECTED]>: > 2007/10/24, Guilherme Polo <[EMAIL PROTECTED]>: > > 2007/10/24, Martin Marcher <[EMAIL PROTECTED]>: > > > I had a look at the crontab docs and never realized how complex it > > > actually is. So before I spend time in creating such a thing maybe > >

Re: Iteration for Factorials

2007-10-24 Thread Nick Craig-Wood
Py-Fun <[EMAIL PROTECTED]> wrote: > I'm stuck trying to write a function that generates a factorial of a > number using iteration and not recursion. Any simple ideas would be > appreciated. Here is the math geek answer ;-) import math def factorial(i): n = i + 1 return math.exp(-n)*(

Re: Socket communication problem

2007-10-24 Thread Sandy Dunlop
Jean-Paul Calderone wrote: > Neither the server nor client Python programs you linked to uses the socket > API correctly. The most obvious mistake is that the code does not check the > return value of socket.send(), which you must do. > > Twisted is a third-party library which abstracts many of

Re: Iteration for Factorials

2007-10-24 Thread Lou Pecora
In article <[EMAIL PROTECTED]>, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > Py-Fun <[EMAIL PROTECTED]> wrote: > > I'm stuck trying to write a function that generates a factorial of a > > number using iteration and not recursion. Any simple ideas would be > > appreciated. > > Here is the mat

Re: building a linux executable

2007-10-24 Thread Prateek
On Oct 24, 5:25 pm, Paul Boddie <[EMAIL PROTECTED]> wrote: > On 24 Okt, 14:20, Bjoern Schliessmann > [EMAIL PROTECTED]> wrote: > > > I'm sorry I cannot help, but how many linux distros have no python > > installed or no packages of it? > > It's not usually the absence of Python that's the problem.

Re: Iteration for Factorials

2007-10-24 Thread [EMAIL PROTECTED]
On Oct 24, 4:05 pm, Lou Pecora <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > > > > > > > Py-Fun <[EMAIL PROTECTED]> wrote: > > > I'm stuck trying to write a function that generates a factorial of a > > > number using iteration and not

Re: Test for a unicode string

2007-10-24 Thread Martin Marcher
2007/10/24, goldtech <[EMAIL PROTECTED]>: > Question: Is there a way to test a string for unicode chars (ie. test > if a string will throw the error cited above). yes there ist :) >>> isinstance(u"a", basestring) True >>> isinstance(u"a", unicode) True >>> isinstance("a", unicode) False >>> isins

Re: New to Vim and Vim-Python

2007-10-24 Thread Martin Marcher
Hello, 2007/10/24, Daniel Folkes <[EMAIL PROTECTED]>: > I am new to using Vim's scripts. > I was wondering if anyone uses Vim-Python and how to use it? This > includes things like key bindings and such. are you talking about * how to use vim? * http://www.vi-improved.org/tutorial.php * how to

Re: Parameters in context manager's __enter__ method?

2007-10-24 Thread Matimus
On Oct 24, 7:06 am, [EMAIL PROTECTED] wrote: > I am working on a file locking class which I'd like to work with Python > 2.5's context managers. The acquire method takes an optional timeout > argument: > > class FileLock: > ... > def acquire(self, timeout=None): > .

ANN: Wing IDE 3.0.1 Released

2007-10-24 Thread Wingware
Hi, We're happy to announce version 3.0.1 of Wing IDE, an advanced development environment for the Python programming language. It is available from: http://wingware.com/downloads This release focuses on fixing minor usability issues found in Wing 3.0 and improves and expands the VI keyboard per

Re: win32com.client documentation?

2007-10-24 Thread Colin J. Williams
Mark Morss wrote: > I am a unix person, not new to Python, but new to Python programming > on windows. Does anyone know where to find documentation on > win32com.client? I have successfully installed this module and > implemented some example code. But a comprehensive explanation of the > object

Re: Hiding tracebacks from end-users

2007-10-24 Thread Matthew Woodcraft
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > I'm writing a command-line application that is meant to be relatively > user friendly to non-technical users. > Consequently, I'd like to suppress Python's tracebacks if an error does > occur, replacing it with a more friendly error message. I'm doin

Re: Iteration for Factorials

2007-10-24 Thread marek . rocki
Tim Golden napisa (a): > It's only a moment before the metaclass and > the Twisted solution come along. :) I couldn't resist. It's not as elegant as I hoped, but hey, at least it memoizes the intermediate classes :-) class fact_0(object): value = 1 class fact_meta(object): def

Python and Combinatorics

2007-10-24 Thread none
Hello, Is there some package to calculate combinatorical stuff like (n over k), i.e., n!/(k!(n - k!) ? I know it can be written in about 3 lines of code, but still... Thanks, Ami -- http://mail.python.org/mailman/listinfo/python-list

Re: for loop

2007-10-24 Thread Shawn Minisall
I agree, but if I want to get a A on the program, thats how my professor wants the output. :) [EMAIL PROTECTED] wrote: > On Oct 22, 9:12?pm, Shawn Minisall <[EMAIL PROTECTED]> wrote: > >> Thanks, everyone! Using everyone's suggestions and points, the program >> is working great now. >>

Re: TeX pestilence (was Distributed RVS, Darcs, tech love)

2007-10-24 Thread Wildemar Wildenburger
Joachim Durchholz wrote: > And yes, it sucks in major ways. > Oh my God, I don't want to, but I just have to ask: Why? /W -- http://mail.python.org/mailman/listinfo/python-list

Re: name space problem

2007-10-24 Thread BBands
Thank you. jab -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >