Re: recycling internationalized garbage

2006-03-15 Thread Martin v. Löwis
Ross Ridge wrote: > It should be obvious that any 8-bit single-byte character set can > produce byte sequences that are valid in UTF-8. It is certainly possible to interpret UTF-8 data as if they were in a specific single-byte encoding. However, the text you then obtain is not meaningful in any l

Re: Queue limitations?

2006-03-15 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I should be able to add to the queue as fast as I want, right? absolutely. but if you slow the producer down, and you're only using one producer and one consumer, the chance increases that the producer and the consumer runs in perfect lockstep. you might as well *call

Re: Other languages for PVM

2006-03-15 Thread Ravi Teja
Yes! But not many. http://www.livelogix.net/logix/ Logix also allows you to create your own custom languages for Python's VM. But for some reason, there does not seem to be much interest in it's development. Odd, given that it has great potential. -- http://mail.python.org/mailman/listinfo/pyth

Re: Printable string for 'self'

2006-03-15 Thread Michael Tobis
This behavior seems to be commonly wanted by people discovering Python, and it is the rare case of something one can imagine that is really a stretch to achieve in Python. Because more or less than one name may refer to an object, in general an object can't know its name. You can get part of the w

Re: Large algorithm issue -- 5x5 grid, need to fit 5 queens plus some squares

2006-03-15 Thread Lonnie Princehouse
It looks like a good start! Some tips- - Index your arrays starting from 0 instead of 1. It will make life easier (and it's the convention in most modern languages) - Try a two dimensional array for the board representation? A list of lists will do: brd = [ [0] * 5 for i in xrange(5) ]

Other languages for PVM

2006-03-15 Thread reinsn
Hi, I am cuurently working with Python and the PVM. I found that there is something interesting like Jython, which allows to compile python source code in *.class file. What I am looking for, are languages for the Python Virtual Machine, which means, languages that could be compiled to the Python b

Xah's Edu Corner: The Concepts and Confusions of Pre-fix, In-fix, Post-fix and Fully Functional Notations

2006-03-15 Thread Xah Lee
The Concepts and Confusions of Pre-fix, In-fix, Post-fix and Fully Functional Notations Xah Lee, 2006-03-15 Let me summarize: The LISP notation, is a functional notation, and is not a so-called pre-fix notation or algebraic notation. Algebraic notations have the concept of operators, meaning, sy

Re: pretty print, tidy, reindent.py

2006-03-15 Thread kpp9c
thanks. i didn't realize just how bare bones that mac os x install of python is. I just grabbed it from the source. cheers, -kp- -- http://mail.python.org/mailman/listinfo/python-list

Re: State of SSL in Python

2006-03-15 Thread Roger Binns
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'd like to use Python's native SSL functions because I'd like to keep > the install requirements at a minimum. I'm writing a client that will > use TLS with X509 certificate validation (and CRL checking in the > future). Will Python

Re: Large algorithm issue -- 5x5 grid, need to fit 5 queens plus some squares

2006-03-15 Thread Ben Cartwright
[EMAIL PROTECTED] wrote: > The first named clearbrd() which takes no variables, and will reset the > board to the 'no-queen' position. (snip) > The Code: > #!/usr/bin/env python > brd = [9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] > def clearbrd(): > brd = [9,0,0,0,0,0,0,0,0,0,0,0,0,

Re: comparing huge files

2006-03-15 Thread James Stroud
[EMAIL PROTECTED] wrote: > hi > i wrote some code to compare 2 files. One is the base file, the other > file i got from somewhere. I need to compare this file against the > base, > eg base file > abc > def > ghi > > eg another file > abc > def > ghi > jkl > > after compare , the base file will be

Large algorithm issue -- 5x5 grid, need to fit 5 queens plus some squares

2006-03-15 Thread [EMAIL PROTECTED]
Background: The problem I'm trying to solve is. There is a 5x5 grid. You need to fit 5 queens on the board such that when placed there are three spots left that are not threatened by the queen. My thinking: I created a list, named brd, that represents the board. I made it such that brd[1] would be

Re: Is it better to use class variables or pass parameters?

2006-03-15 Thread Terry Reedy
"Derek Basch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > So, if I am understanding what everyone is saying here. I should do my > best to distinguish between values that are part of the "state" of an > object and values that are more disposable and can change for each > computa

Re: Clearing IE history

2006-03-15 Thread Terry Reedy
>I am trying to automate the clearing of IE history using python As far as I know, the history list is only kept in a 'history' directory and not in the registry. I have occasionally cleared it manually and it look cleared back in IE. On Win9x, it is somewhere under c:/windows (or whatever i

Re: Markov process representation

2006-03-15 Thread kpp9c
hee hee works fine ... but kinda slow on my old machine... really time for a new laptop haha! still this code is so beautiful! *^-^* -- http://mail.python.org/mailman/listinfo/python-list

Re: global, globals(), _global ?

2006-03-15 Thread Alex Martelli
robert <[EMAIL PROTECTED]> wrote: ... > > Ruby does ($ means global), but, what other languages? Perl, C, C++, > > Java (taking a class's statics as Java's equivalent of other languages' ... > I though first of Ruby. > > Good C++ code uses m_ , g_ for members, globals, ... e.g. the _So

Re: Queue limitations?

2006-03-15 Thread simonwittber
[EMAIL PROTECTED] wrote: > > the queue holds references to the images, not the images themselves, > > so the size should be completely irrelevant.I use one instance of > > imageQueue. > > hmmm.. true. And it also fails when I use PIL Image objects instead of > arrays. Any idea why compressing the

Re: "pow" (power) function

2006-03-15 Thread Ben Cartwright
Russ wrote: > Ben Cartwright wrote: > > Russ wrote: > > > > Does "pow(x,2)" simply square x, or does it first compute logarithms > > > (as would be necessary if the exponent were not an integer)? > > > > > > The former, using binary exponentiation (quite fast), assuming x is an > > int or long. > >

comparing huge files

2006-03-15 Thread s99999999s2003
hi i wrote some code to compare 2 files. One is the base file, the other file i got from somewhere. I need to compare this file against the base, eg base file abc def ghi eg another file abc def ghi jkl after compare , the base file will be overwritten with "jkl". Also both files tend to grow tow

Re: "pow" (power) function

2006-03-15 Thread Russ
Ben Cartwright wrote: > Russ wrote: > > Does "pow(x,2)" simply square x, or does it first compute logarithms > > (as would be necessary if the exponent were not an integer)? > > > The former, using binary exponentiation (quite fast), assuming x is an > int or long. > > If x is a float, Python coer

Re: Markov process representation

2006-03-15 Thread kpp9c
oh ... uhmm .. i don't follow what you are saying... where should i put those lines... should the import thing go on top? -- http://mail.python.org/mailman/listinfo/python-list

collaborative web navigation tool in python (z9)

2006-03-15 Thread Andre Rodrigues
Hi all, I'm working on an experimental collaborative web navigation tool in python and zope. The basic idea is to map users interests in web pages and use this to provide persolaniled services, like recommended pages, filtered searches, etc. The address is http://andrers52.dyndns.org:8080/z9 I'

Re: Markov process representation

2006-03-15 Thread kpp9c
yes looking at this code i see a few things i haven't seem before. I am on Mac OS X 10.3.x and updating the python seems like a non trivial task at the moment.. i will try that and see where that gets me. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: MS word document generator

2006-03-15 Thread Grant Edwards
On 2006-03-15, Sybren Stuvel <[EMAIL PROTECTED]> wrote: > Raja Raman Sundararajan enlightened us with: >> Well, Office 12 will have very many features. Thats true. >> But my document needs to work in all versions of Office. >> I hope that pyRtf generated file is fully rtf compatible. :-) > > Oh co

Re: Excel ShapeRange problem with win32com

2006-03-15 Thread koia
Sorry guys, I forgot the parenthesis in xlapp.ActiveSheet.Shapes.AddLine( 0, 0, 100, 100).Select() /koia -- http://mail.python.org/mailman/listinfo/python-list

python2.4.2 + win95, import socket dll error

2006-03-15 Thread John Pote
Hi all, Can someone throw some light on this problem? (is trying to run Python 2.4.2 on an old win95 box a reasonable thing to do?) I keep my old win95 box for an old eprom programmer that won't plug into a new box (needs an ISA socket!). Also use it for network testing. No problem with Py 2.3

Re: Markov process representation

2006-03-15 Thread Jack Diederich
On Wed, Mar 15, 2006 at 04:50:31PM -0800, Paul Rubin wrote: > "kpp9c" <[EMAIL PROTECTED]> writes: > > self._all_states |= set(key[i] for key in probabilities) > > I am running: > > Python 2.3 (#1, Sep 13 2003, 00:49:11) > > generator comprehensions are new in 2.4. Try: > >self._all_state

Re: "pow" (power) function

2006-03-15 Thread Ben Cartwright
Russ wrote: > I have a couple of questions for the number crunchers out there: Sure, but the answers depend on the underlying Python implementation. And if we're talking CPython, they also depend on the underlying C implementation of libm (i.e., math.h). > Does "pow(x,2)" simply square x, or do

Re: Markov process representation

2006-03-15 Thread Paul Rubin
"kpp9c" <[EMAIL PROTECTED]> writes: > self._all_states |= set(key[i] for key in probabilities) > I am running: > Python 2.3 (#1, Sep 13 2003, 00:49:11) generator comprehensions are new in 2.4. Try: self._all_states |= set([key[i] for key in probabilities]) This does temporarily use more

Re: Markov process representation

2006-03-15 Thread kpp9c
try as i might i still get an error: File "markov.py", line 50 self._all_states |= set(key[i] for key in probabilities) I am running: Python 2.3 (#1, Sep 13 2003, 00:49:11) [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin If that helps any... Thanks! -- http://mail.pytho

Re: Very, Very Green Python User

2006-03-15 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > bruno at modulix wrote: > (snip) >>You don't even need this to use callbacks. Remember, functions and >>methods are objects, and other objects can be callable too... > > Eh?? I need an example. Of callables ? class FuncInDisguise(object): def __init__(self, nam

Re: "pow" (power) function

2006-03-15 Thread Paul Rubin
Schüle Daniel <[EMAIL PROTECTED]> writes: > >>> timeit.Timer("111**0.3").timeit() > 2.3824679851531982 > >>> timeit.Timer("pow(111,0.3)").timeit() > 4.2945041656494141 > > interesting result > seems that ** computates faster Maybe "111**0.3" parses faster than pow(111,0.3), if timeit uses eval.

Re: "pow" (power) function

2006-03-15 Thread sam
I not shure which algorithm,but I am assumeing that all Python does,is to call the underlying C pow() function. Sam -- http://mail.python.org/mailman/listinfo/python-list

Re: "pow" (power) function

2006-03-15 Thread Schüle Daniel
Russ wrote: > I have a couple of questions for the number crunchers out there: > > Does "pow(x,2)" simply square x, or does it first compute logarithms > (as would be necessary if the exponent were not an integer)? > > Does "x**0.5" use the same algorithm as "sqrt(x)", or does it use some > other

Excel ShapeRange problem with win32com

2006-03-15 Thread koia
Hi, I have a problem with adding attributes to a Line in an Excel drawing using the Python win32com interface. From recording in Excel I get the Macro: Sub Makro1() ActiveSheet.Shapes.AddLine(192.75, 63.75, 316.5, 110.25).Select Selection.ShapeRange.Line.ForeColor.SchemeColor = 10 Sel

"pow" (power) function

2006-03-15 Thread Russ
I have a couple of questions for the number crunchers out there: Does "pow(x,2)" simply square x, or does it first compute logarithms (as would be necessary if the exponent were not an integer)? Does "x**0.5" use the same algorithm as "sqrt(x)", or does it use some other (perhaps less efficient)

Re: Queue limitations?

2006-03-15 Thread mateom
I should be able to add to the queue as fast as I want, right? I tried adding time.sleep(.05) right after put(image) in the producer, and that fixes it. There is only one thread producing and one thread consuming. Thanks for the help. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python compiler

2006-03-15 Thread James Stroud
Rc wrote: > Hello everybody > I'm a newbie, fromBelgium. > My question is where can I find a compiler for free. > For Windows XP. > Thanks > Roger > Sorry for my English > > You might want to look at pyinstaller and inno setup. James -- James Stroud UCLA-DOE Institute for Genomics and Prote

Re: Need advice on reading contents of a file into memory

2006-03-15 Thread vinjvinj
Thanks. read() did not work when I opened the file with: f = open(someFilePath) But after changing to f = open(someFilePath, "rb") the read() works fine. VJ -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it better to use class variables or pass parameters?

2006-03-15 Thread Derek Basch
One more question everybody. Say you have a class that performs a series of evaluations on several strings of peptides. Let's say for the sake of argument: DMCDIYLLY FQPQNGQFI RHPENPNLL Heres the class: class PeptideEvaluator: def evaluate(self, peptide): peptide_name = peptide + "R

Re: Python Debugger / IDE ??

2006-03-15 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > My code has got big How big ? More than 50 kloc ?-) Big project doesn't imply long functions nor fat classes. > and it is an iterative program. Sorry, I don't understand what you mean by "iterative" here. -- http://mail.python.org/mailman/listinfo/python-list

Re: Printable string for 'self'

2006-03-15 Thread Bruno Desthuilliers
Don Taylor a écrit : (snip) > My overall intent is to try to build something that can record > interactions against an object so that they can be replayed later for > testing and debugging. I had in mind to generate the recording as a > sequence of Python statements. You may want to have a l

Re: Python Debugger / IDE ??

2006-03-15 Thread Christoph Zwerschke
[EMAIL PROTECTED] wrote: > I like the Pyscripter, is there any Linux version or something of it. Sorry, I forgot to mention that there is a snag in it. Since PyScripter is based on Python for Delphi, it is available for Windows only. -- Christoph -- http://mail.python.org/mailman/listinfo/pytho

State of SSL in Python

2006-03-15 Thread [EMAIL PROTECTED]
I was searching the net about SSL support in Python, and it seems that a few years ago that the native SSL functions were broken or badly wanting in comparison to third party libraries such as m2crypto, POW and pyOpenSSL. What is the state of native support now? I'd like to use Python's native SS

Re: Python compiler

2006-03-15 Thread Rene Pijlman
Rc: >My question is where can I find a compiler for free. >For Windows XP. http://www.python.org/download/ -- René Pijlman -- http://mail.python.org/mailman/listinfo/python-list

Re: Need advice on reading contents of a file into memory

2006-03-15 Thread Fredrik Lundh
"vinjvinj" wrote: > f = open(someFilePath, "rb") > content = [] > for data in content.read() >content.append(data) > fullContent = "".join(content) > > Is there a more efficient way of doing this? read reads until end of file, so unless the source is something unusual, a plain fullConten

Python compiler

2006-03-15 Thread Rc
Hello everybody I'm a newbie, fromBelgium. My question is where can I find a compiler for free. For Windows XP. Thanks Roger Sorry for my English -- http://mail.python.org/mailman/listinfo/python-list

Re: Tried Ruby (or, "what Python *really* needs" or "perldoc!")

2006-03-15 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Diez B. Roggisch wrote: >> Yes, I'm trying to make time to look at the docutils code and the >> pydoc command to see what's involved. Unfortunately, my spare >> time is vanishingly close to zero right now. > > > You heard of epydoc? http://epydoc.sourceforge.net/ > > It

Re: Loop Backwards

2006-03-15 Thread Dave
>> or (more perlish at first sight): >> for item in alist[::-1]: >> do_something_with(item) >No "or" here. The [::-1] version creates a whole new list in memory, >it's silly to believe both will behave equally (well, strictly speaking >they will, but one will use twice more memory than the othe

Re: Queue limitations?

2006-03-15 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > > the queue holds references to the images, not the images themselves, > > so the size should be completely irrelevant.I use one instance of > > imageQueue. > > hmmm.. true. And it also fails when I use PIL Image objects instead of > arrays. Any idea why compressing the

Re: Need advice on reading contents of a file into memory

2006-03-15 Thread Felipe Almeida Lessa
Em Qua, 2006-03-15 às 13:49 -0800, vinjvinj escreveu: > f = open(someFilePath, "rb") > content = [] > for data in content.read() >content.append(data) > fullContent = "".join(content) > > Is there a more efficient way of doing this? I'll be running this > operation on 10,000+ files where each

Re: Is it better to use class variables or pass parameters?

2006-03-15 Thread Derek Basch
So, if I am understanding what everyone is saying here. I should do my best to distinguish between values that are part of the "state" of an object and values that are more disposable and can change for each computation of a value. So if I create an instance of a "wallet" class and the color of the

Re: mydate.strftime('%x') and cgi script

2006-03-15 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Sibylle Koczian wrote: > I'm writing a cgi script which only needs to run in a small LAN. I tried > to show dates in a reasonable format by using > > import locale > import datetime > > locale.setlocale(locale.LC_ALL, '') > ... > dt = datetime.date.today() > print dt.strf

Need advice on reading contents of a file into memory

2006-03-15 Thread vinjvinj
f = open(someFilePath, "rb") content = [] for data in content.read() content.append(data) fullContent = "".join(content) Is there a more efficient way of doing this? I'll be running this operation on 10,000+ files where each file is an image file with size 50k-100k -- http://mail.python.org/m

Re: Button and Key Event

2006-03-15 Thread [EMAIL PROTECTED]
assuming you have a button instantiated and named myButton in 2.6 (namespace is relevant I think prior to 2.4 you had a diff namespace for wx) for this example i am guessing you are creating the button as part of a panel or some other object you are extending (ie self) self.myButton.Bind(wx.E

Re: Markov process representation

2006-03-15 Thread Scott David Daniels
kpp9c wrote: > This is wicked! I am trying to get it to work and am frantically fixing > tabs and spaces... It was cut and pasted from working code (which I pasted back to test). > but isn't line 50: > > self._all_states |= set(key[i] for key in probabilities) > > an error? isn't it supposed to

Re: MS word document generator

2006-03-15 Thread Sybren Stuvel
Raja Raman Sundararajan enlightened us with: > Well, Office 12 will have very many features. Thats true. > But my document needs to work in all versions of Office. > I hope that pyRtf generated file is fully rtf compatible. :-) Oh come on. Even Word files don't work in all versions of Office. Sy

Re: OCR question

2006-03-15 Thread [EMAIL PROTECTED]
try gocr? command line ocr for linux Not very pythonic, but I am unaware of any ocr implementations in python. It is gpl, so it should be to hard to write python wrappers if you really want to do it right. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Debugger / IDE ??

2006-03-15 Thread krypto . wizard
I like the Pyscripter, is there any Linux version or something of it. Christoph Zwerschke wrote: > [EMAIL PROTECTED] schrieb: > > Is there any editor or IDE in Python (either Windows or Linux) which > > has very good debugging facilites like MS VisualStudio has or something > > like that. > > > > I

Re: pretty print, tidy, reindent.py

2006-03-15 Thread Ron Adam
kpp9c wrote: > What ever happened to reindent.py ? This used to be part of the > distribution. Does it still work with modern versions of python? > > A lot of the code i drag off here (even if i use "show original"!) > comes out all messed up and i end up having to clean a lot of it up. I > wonder

Re: Queue limitations?

2006-03-15 Thread mateom
> the queue holds references to the images, not the images themselves, > so the size should be completely irrelevant.I use one instance of imageQueue. hmmm.. true. And it also fails when I use PIL Image objects instead of arrays. Any idea why compressing the string helps? I'm using one instance o

Re: elementtree and gbk encoding

2006-03-15 Thread Steven Bethard
Fredrik Lundh wrote: > Steven Bethard wrote: > >> Hmm... I downloaded the newest cElementTree (and I already had the >> newest ElementTree), and here's what I get: > >> >>> tree = myparser(filename, 'gbk') >> Traceback (most recent call last): >>File "", line 1, in ? >>File "", line 8,

Clearing IE history

2006-03-15 Thread david brochu jr
Hello   I am trying to automate the clearing of IE history using python but keep running into problems. I cannot seem to find a good resource online about this, and I can't find an object in InternetExplorer's object module to point me in the right direction. I would rather not have to deal with de

Re: MS word document generator

2006-03-15 Thread Raja Raman Sundararajan
Hi Michel, Well, Office 12 will have very many features. Thats true. But my document needs to work in all versions of Office. I hope that pyRtf generated file is fully rtf compatible. :-) But so far I think it is quite okay. To answer my first question: > 1. do an align right of contents inside

Re: Tried Ruby (or, "what Python *really* needs" or "perldoc!")

2006-03-15 Thread André Kelpe
msoulier wrote: > While epydoc is nice, I'll point out that one thing that Unix people > like myself really like is to be able to check docs on a remote server > that we're logged into via a terminal session. The help() function in > the interpreter is great for this, although it seems that python

Re: Tried Ruby (or, "what Python *really* needs" or "perldoc!")

2006-03-15 Thread john_sips_tea
msoulier wrote: > > [snip] > But, if Python would match Perl for docs available on the command-line, > then I'd have it all at my fingertips. I simply don't understand why > this is not being done. [snip] > > Mike Ok, well, here's my attempt to begin to make that happen: http://www.simisen.com/jm

pretty print, tidy, reindent.py

2006-03-15 Thread kpp9c
What ever happened to reindent.py ? This used to be part of the distribution. Does it still work with modern versions of python? A lot of the code i drag off here (even if i use "show original"!) comes out all messed up and i end up having to clean a lot of it up. I wonder if there is a reformatte

Re: Printable string for 'self'

2006-03-15 Thread Don Taylor
Fredrik Lundh wrote: > Q. How can my code discover the name of an object? > > A. The same way as you get the name of that cat you found on your > porch: the cat itself cannot tell you its name, and it doesn't really > care -- so the only way to find out what it's called is to ask

Re: best practices for making read-only attributes of an object

2006-03-15 Thread James Stroud
bruno at modulix wrote: > Tim Chase wrote: >> >>class Foo: > > old-style classes are deprecated, please use new-style classes: > class Foo(object): > This should be re-phrased to 'Use new-style classes, or else!' py> class Foo: ... def __init__(self, color): ... self._color = color ...

Re: MS word document generator

2006-03-15 Thread M�ta-MCI
Hi! The next MS-Office come with a new format of document, based on XML+Zip. But MS-Word can read, now, a XML file. Perhaps you can use this way. @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: MS word document generator

2006-03-15 Thread M�ta-MCI
Hi! PyRTF is old, but run OK. I use it, with some little modifs, for another usage. It was good to remember it. MCI -- http://mail.python.org/mailman/listinfo/python-list

Re: pyRTF and cells

2006-03-15 Thread Raja Raman Sundararajan
Yeah, thats a good approach. I have been fiddling around to implement that feature in elements.py and RTF specification from msdn However, I have not been successful thus far. To answer my first question: > 1. do an align right of contents inside a cell Its not possible by speficying alignment in

Re: global, globals(), _global ?

2006-03-15 Thread Duncan Booth
robert wrote: > Good C++ code uses m_ , g_ for members, globals, ... ... for some definition of 'Good'. -- http://mail.python.org/mailman/listinfo/python-list

Re: problem writing to a file each record read

2006-03-15 Thread bruno at modulix
Eduardo Biano wrote: > I am a python newbie and I have a problem with writing > each record read to a file. The expected output is 10 > rows of records, but the actual output of the code > below is only one row with a very long record (10 > records are lump into one record). Thank you in > advance

Re: Markov process representation

2006-03-15 Thread kpp9c
This is wicked! I am trying to get it to work and am frantically fixing tabs and spaces... but isn't line 50: self._all_states |= set(key[i] for key in probabilities) an error? isn't it supposed to be: self._all_states != set(key[i] for key in probabilities) -- http://mail.python.org/mailman/l

Re: pyRTF and cells

2006-03-15 Thread Tim Churches
Raja Raman Sundararajan wrote: > Hello, > I have been playing around with pyRTF module for generating rtf > documents. > Its a very nice tool that fits my basic needs. However I have a problem > controlling cells in > a table. > > I am not able to > 1. do an align right of contents inside a ce

Re: best practices for making read-only attributes of an object

2006-03-15 Thread bruno at modulix
Tim Chase wrote: > I've set up an object and would like to make certain attributes > read-only (or at least enforce it without doing extra work, as per > name-mangling or the like). Ideally, the property would be set in the > __init__, and then not be allowed to change. > > The best solution I've

Re: Very, Very Green Python User

2006-03-15 Thread hanumizzle
bruno at modulix wrote: > [EMAIL PROTECTED] wrote: > > I have used Perl for a long time, but I am something of an experimental > > person and mean to try something new. Most of my 'work' with Vector > > Linux entails the use of Perl (a bit of a misnomer as it is not now a > > paid position -- I am

pyRTF and cells

2006-03-15 Thread Raja Raman Sundararajan
Hello, I have been playing around with pyRTF module for generating rtf documents. Its a very nice tool that fits my basic needs. However I have a problem controlling cells in a table. I am not able to 1. do an align right of contents inside a cell 2. set backgroundcolor of a cell 3. I wonder i

best practices for making read-only attributes of an object

2006-03-15 Thread Tim Chase
I've set up an object and would like to make certain attributes read-only (or at least enforce it without doing extra work, as per name-mangling or the like). Ideally, the property would be set in the __init__, and then not be allowed to change. The best solution I've been able to come up wit

Re: MS word document generator

2006-03-15 Thread Raja Raman Sundararajan
Hi guys, Thanks for your note Grant. I had a look at the pyRTF and it seems to be quite impressive :-) I actually works for my needs except the below, concerning cells in a table For cells in a table, pyRTF does not support 1. ALIGN_RIGHT 2. Cell background Do you guys have any idea of how to

Re: global, globals(), _global ?

2006-03-15 Thread robert
Alex Martelli wrote: > robert <[EMAIL PROTECTED]> wrote: > > >>Using global variables in Python often raises chaos. Other languages use >>a clear prefix for globals. > > Ruby does ($ means global), but, what other languages? Perl, C, C++, > Java (taking a class's statics as Java's equivalent o

Re: list/classmethod problems

2006-03-15 Thread Magnus Lycka
ahart wrote: > I thank you all for your help and suggestions. I wasn't aware that > default values were considered class (static) values. That seems a > little odd to me, but as long as I know that's the case, I'll be fine. It's all very simple and regular: Things in the class scope is shared betw

Re: Very, Very Green Python User

2006-03-15 Thread hanumizzle
Dennis Lee Bieber wrote: > On 12 Mar 2006 17:58:43 -0800, [EMAIL PROTECTED] declaimed the > following in comp.lang.python: > > > > > Double-underscore methods are rewritten with the class name? That's an > > ugly hack, but remember I'm coming from Perl. If the language doesn't > > pull many other

Re: elementtree and gbk encoding

2006-03-15 Thread Fredrik Lundh
Steven Bethard wrote: > Hmm... I downloaded the newest cElementTree (and I already had the > newest ElementTree), and here's what I get: > >>> tree = myparser(filename, 'gbk') > Traceback (most recent call last): >File "", line 1, in ? >File "", line 8, in myparser > SyntaxError: not we

Re: stdin or optional fileinput

2006-03-15 Thread Peter Otten
the.theorist wrote: > I'll keep both those in mind for future programs. > my current fix has been > > if not args: > args = [ sys.stdin ] > else: > map( open, args ) > > and then a modification to the main loop, as you proposed. > > I thought that one day I might run into a problem open

Re: elementtree and gbk encoding

2006-03-15 Thread Steven Bethard
Fredrik Lundh wrote: > Steven Bethard wrote: > >> I'm having trouble using elementtree with an XML file that has some >> gbk-encoded text. (I can't read Chinese, so I'm taking their word for >> it that it's gbk-encoded.) I always have trouble with encodings, so I'm >> sure I'm just screwing some

Re: Tried Ruby (or, "what Python *really* needs" or "perldoc!")

2006-03-15 Thread Jason Earl
"msoulier" <[EMAIL PROTECTED]> writes: >> I have found the Python sidebar VERY helpful: > > Personally, I can't use local docs on my desktop as they may not be > the same version of the docs for the Python distro running on the > server that I'm deploying on. I usually go to python.org and use the

Re: stdin or optional fileinput

2006-03-15 Thread Fredrik Lundh
"the.theorist" wrote: > I used this bit of code to detect wether i want stdinput or not. > > if len(args)==0: > args = [ sys.stdin ] > > Now in my main loop I've written: > > for file in args: > for line in open( file ): > #do stuff > > The probelm occurs when I pass no arguments a

Popfile and Poplib - Can They Work Together?

2006-03-15 Thread Frank Churchill
Has anyone used poplib and popfile together? I've tried everything I can think of to specify SRVR in poplib: "127.0.0.1:8081" "127.0.0.1,port=8081" "localhost:8081" "localhost,port=8081" and probably a few other things, but poplib can't see that it is looking at a mail server. popfile works fin

Re: stdin or optional fileinput

2006-03-15 Thread Steve Holden
the.theorist wrote: > Steven Bethard wrote: > >>the.theorist wrote: >> >>>I was writing a small script the other day with the following CLI >>>prog [options] [file]* >>> >>>I've used getopt to parse out the possible options, so we'll ignore >>>that part, and assume for the rest of the discussion t

Re: Printable string for 'self'

2006-03-15 Thread Steve Holden
Don Taylor wrote: > Fredrik Lundh wrote: > >>objects don't have names in Python, and the source is not part of >>the running program. >> >>have you read this ? >> >>http://effbot.org/zone/python-objects.htm > > > I have now. Thank you very much. > > "objects don't have names in Python": It

Re: Threads: does Thread.start() atomically set Thread.__started ?

2006-03-15 Thread Enigma Curry
Peter, Thanks for the reference! I don't know why but for some reason I thought that I would be wading through a bunch of C code (which I know very little of). I haven't found my answer yet but this threading.py does look fairly straightforward. Thanks! -- http://mail.python.org/mailman/listinf

Re: Printable string for 'self'

2006-03-15 Thread Fredrik Lundh
Don Taylor wrote: > Fredrik Lundh wrote: > > objects don't have names in Python, and the source is not part of > > the running program. > > > > have you read this ? > > > > http://effbot.org/zone/python-objects.htm > > I have now. Thank you very much. > > "objects don't have names in Python":

problem with python zsi

2006-03-15 Thread Rafal Zawadzki
Hi. I tried earlier to write python zsi mail list, but nobody answered. I am using ZSI 1.7/2.0rc1 with TTPro Soap SDK. The wsdl file can be found here: http://demo.seapine.com/ttsoapcgi.wsdl My wsdl is the same, only different is the address of the cgi file. for example i cannot use defectRe

Re: how to get 20000 html pages content quickly from one server?

2006-03-15 Thread Zachery Bir
On Mar 15, 2006, at 11:58 AM, JuHui wrote: > in fact, I want to do a script to get news on others site. > I must use script get the content and analyze the html code, where is > the title, where is the body > so, I can't ask permission, use wget and "Physically remove the > harddrive and rein

Re: Getting started with Scipy/NumPy

2006-03-15 Thread Robert Kern
[EMAIL PROTECTED] wrote: > I installed SciPy and NumPy (0.9.5, because 0.9.6 does not work with > the current version of SciPy), and had some teething troubles. I looked > around for help and observed that the tutorial is dated October 2004, > and is not as thorough as Python's documentation. Is th

Re: FIR filtering

2006-03-15 Thread kpp9c
www.rtcmix.org -- http://mail.python.org/mailman/listinfo/python-list

Getting started with Scipy/NumPy

2006-03-15 Thread tkpmep
I installed SciPy and NumPy (0.9.5, because 0.9.6 does not work with the current version of SciPy), and had some teething troubles. I looked around for help and observed that the tutorial is dated October 2004, and is not as thorough as Python's documentation. Is there an alternative source of info

Markov process representation

2006-03-15 Thread Scott David Daniels
Here's one way (convert each set of transition percentages to a running sum up to one): import random class SingleStateMarkov(object): def __init__(self, probabilities, initial=None): self._states = states = sorted(probabilities) self._fromstate = dic

  1   2   3   >