ANN: SCSIPYTHON added to Sourceforge

2006-03-23 Thread sam
I have updated and moved my SCSI diagnostic tools from starship to sourceforge. I will be still maintaining these files at both locations as long as starship exists. These tools allow low level tests to be conducted on storage devices under the Windows operating system. These routines access all

Re: Using PyExcelerator

2006-03-23 Thread rbsharp
I would agree with the author, pyExcelerator is good at writing Excel but xlrd is better at reading. I was recently forced to use them in tandem because pyExcelerator had problems reading an Excel sheet and xlrd had no problems. greetings, Richard Sharp John Machin wrote: On 23/03/2006 9:01

Re: import random module

2006-03-23 Thread Just
In article [EMAIL PROTECTED], Carl Banks [EMAIL PROTECTED] wrote: Ben Finney wrote: DataSmash [EMAIL PROTECTED] writes: * random.py: import random Now that you've tripped over this ambiguity of Python's current 'import' behaviour, you may be interested to know that the

where is os.path.expanduser?

2006-03-23 Thread Kevin F
where is this code looking for the .imap file? I am on OSX and am not sure where to put the file it is looking for. f = open(os.path.expanduser('~/.imap')) -- http://mail.python.org/mailman/listinfo/python-list

Re: don't understand popen2

2006-03-23 Thread Martin P. Hellwig
Donn Cave wrote: cut Anyway, it seems unlikely he would get that INVARG error for this reason. That's an error from the host operating system, not the interpreter, and it mostly likely refers to the file descriptor. Since it works for me, I guess his problem is basically this: | (python

os.path.expanduser ... where is this?

2006-03-23 Thread Kevin F
I have a code that opens an .imap file in os.path.expanduser. Unfortunately, I am on OS X and have no idea where that directory is. I am wondering how I can change this code to just open the .imap file in the directory where the code is saved. f = open(os.path.expanduser('~/.imap')) p.s.

Re: Server.sendmail with no to_addrs parameter.

2006-03-23 Thread Tim Roberts
EdWhyatt [EMAIL PROTECTED] wrote: Ok, totally unrelated, and on that subject, I will make sure I always have a recipient in the To: field. - hey it works if I do that anyway! OK, I'm a bit concerned that the answer to the original question has been lost. The difference between the SMTP envelope

Re: where is os.path.expanduser?

2006-03-23 Thread Peter Otten
Kevin F wrote: where is this code looking for the .imap file? I am on OSX and am not sure where to put the file it is looking for. f = open(os.path.expanduser('~/.imap')) Your interactive interpreter has the answer import os os.path.expanduser(~) '/home/peter' that will most likely

Re: Can't get the real contents form page in internet as the tag no-chche

2006-03-23 Thread Tim Roberts
dongdong [EMAIL PROTECTED] wrote: using web browser can get page's content formally, but when use urllib2.open(http://tech.163.com/2004w11/12732/2004w11_1100059465339.html;).read() the result is htmlheadMETA HTTP-EQUIV=REFRESH CONTENT=0;URL=http://tech.163.com/04/1110/12/14QUR2BR0009159H.html;

Re: where is os.path.expanduser?

2006-03-23 Thread Kevin F
Peter Otten wrote: Kevin F wrote: where is this code looking for the .imap file? I am on OSX and am not sure where to put the file it is looking for. f = open(os.path.expanduser('~/.imap')) Your interactive interpreter has the answer import os os.path.expanduser(~)

Re: Per instance descriptors ?

2006-03-23 Thread bruno at modulix
Michael Spencer wrote: Bruno Desthuilliers wrote: (snip) BTW, there may be other use case for per-instance descriptors... Agreed. Per-instance descriptors could be interesting (that's why the subject line caught my attention). But your solution involves a custom __getattribute__ in

IMAP mailwatcher w/Tkinter

2006-03-23 Thread Kevin F
I've been trying to implement this script, it polls an IMAP inbox for unread messages and displays the sender and subject in a scrollable window using Tkinter. However, when I try to change the search parameters on line 55 from 'unread' (UNSEEN) to 'read' (SEEN), the tkinter window doesn't

Re: Use of Python with GDAL. How to speed up ?

2006-03-23 Thread Julien Fiore
Thank you Serge for this generous reply, Vectorized code seems a great choice to compute the distance. If I understand well, vectorized code can only work when you don't need to access the values of the array, but only need to know the indices. This works well for the distance, but I need to

Re: Per instance descriptors ?

2006-03-23 Thread bruno at modulix
Steven Bethard wrote: bruno at modulix wrote: Hi I'm currently playing with some (possibly weird...) code, and I'd have a use for per-instance descriptors, (snip) class MyClass2(MyClass1): def __getattribute__(self, key): v = MyClass1.__getattribute__(self, key)

Re: __slots__

2006-03-23 Thread Ziga Seilnacht
David Isaac wrote: 1. Without a __dict__ variable, instances cannot be assigned new variables not listed in the __slots__ definition. So this seemed an interesting restriction to impose in some instances, but I've noticed that this behavior is being called by some a side effect the reliance

Integrating python with smalltalk

2006-03-23 Thread nelson
Hi all, sorry if it isn't the right group (and sorry for the cross post, but it's a cross- question :P ), but i'm not sure where to post. I have a python library and i want to be able to call it from smalltalk (the squeak implementation in particular..). I was just wondering if there is a

Probelem about image size and dimensions

2006-03-23 Thread gongcheng_g
I got a piece of python script to upload file and it can upload it to different folders on server depend on the type of file is image or not. but I also want to restrict the size and dimensions of file if it is a image file.Could anyone help me out? Parameter List:id, file, title='',folder

Strange metaclass behaviour

2006-03-23 Thread Christian Eder
Hi, I think I have discovered a problem in context of metaclasses and multiple inheritance in python 2.4, which I could finally reduce to a simple example: Look at following code: class M_A (type) : def __new__ (meta, name, bases, dict) : print M.__new__, meta, name, bases

Re: Probelem about image size and dimensions

2006-03-23 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: I got a piece of python script to upload file and it can upload it to different folders on server depend on the type of file is image or not. but I also want to restrict the size and dimensions of file if it is a image file.Could anyone help me out? Use PIL, the

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-23 Thread [EMAIL PROTECTED]
Hello, The solution that would have the most utility would be one where the elements are generated one-by-one, loop-like, so that they can be used in the body of a loop, and to avoid the fact that even with exclusion the cardinality of the target set EX^n could be in the millions even with a full

Re: Linear regression in NumPy

2006-03-23 Thread nikie
Although I think it's worth reading, it only covers the fundamental structure (what arrays are, what ufuncs are..) of NumPy. Neither of the functions dicussed in this thread (polyfit/linear_least_squares) is mentioned in the file. -- http://mail.python.org/mailman/listinfo/python-list

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-23 Thread Dinko Tenev
Dirk Thierbach wrote: If more time during preprocessing is allowed, another idea is to treat the wildcard expressions as regular expressions, convert each into a finite state machine, construct the intersection of all these state machines, minimize it and then swap final and non-final states.

Re: Can't get the real contents form page in internet as the tag no-chche

2006-03-23 Thread Diez B. Roggisch
dongdong wrote: using web browser can get page's content formally, but when use urllib2.open(http://tech.163.com/2004w11/12732/2004w11_1100059465339.html;).read() the result is htmlheadMETA HTTP-EQUIV=REFRESH CONTENT=0;URL=http://tech.163.com/04/1110/12/14QUR2BR0009159H.html; META

Re: Probelem about image size and dimensions

2006-03-23 Thread ChengGong
Thank you for your reply. I have been learning python only 2 weeks. According what u said. I tried to import Image but there 's an error on the server. here is the message Error Type: ImportError Error Value: import of Image is unauthorized -- http://mail.python.org/mailman/listinfo/python-list

Re: Good thread pool module

2006-03-23 Thread Rene Pijlman
Dennis Lee Bieber: Raymond Hettinger: Because of the GIL, thread pools are not as useful in Python as you might expect -- they execute one at a time and do not take advantage of hyper-threading or multiple processors. If that kind of efficiency is If the task is I/O bound (something

Re: Probelem about image size and dimensions

2006-03-23 Thread Diez B. Roggisch
ChengGong wrote: Thank you for your reply. I have been learning python only 2 weeks. According what u said. I tried to import Image but there 's an error on the server. here is the message Error Type: ImportError Error Value: import of Image is unauthorized Are you by chance running under

Re: Server.sendmail with no to_addrs parameter.

2006-03-23 Thread Arne Ludwig
Sorry to have caused all that confusion. The quote from RFC822 I gave is really confusing and is indeed not relevant to the original question. As Tim pointed out, the to_addrs parameter in smtplib.py::sendmail is translated to the SMTP RCPT TO and thus must contain all the intended recipients

Re: Can't get the real contents form page in internet as the tag no-chche

2006-03-23 Thread dongdong
oh~~~! offer my thanks to Tim Roberts and all persons above! I see now, it's the different url causes! contents can only be got from the later (real ) url. I made a mistick not to look at the different urls taking effect. -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows getting local ip address

2006-03-23 Thread Erno Kuusela
The traditional right way (tm) to do this is to call getsockname() on the (a?) socket that's connected to the guy you want to tell your address to. This picks the right address in case you have several. If you don't have a socket handy, you can make a connectionless UDP socket and connect() it to

Re: Probelem about image size and dimensions

2006-03-23 Thread ChengGong
Diez, I asked the administrator that they won't allow me to import Image and PIL in Zope. I am wondering that how can I get the height and width and the size of the image in this situation? Can I just use dtmlto get Image's addtributs? Cheng --

question: how to clare the absolute url in a html file

2006-03-23 Thread dongdong
is there any lib to help to clear the absolute url in a html file? for example, 'http://www.sina.com/' should be clear ,but /image/asd.gif should be reserved. -- http://mail.python.org/mailman/listinfo/python-list

RELEASED Python 2.4.3, release candidate 1

2006-03-23 Thread Anthony Baxter
On behalf of the Python development team and the Python community, I'm happy to announce the release of Python 2.4.3 (release candidate 1). Python 2.4.3 is a bug-fix release. See the release notes at the website (also available as Misc/NEWS in the source distribution) for details of the more

Re: Probelem about image size and dimensions

2006-03-23 Thread Diez B. Roggisch
ChengGong wrote: Diez, I asked the administrator that they won't allow me to import Image and PIL in Zope. I am wondering that how can I get the height and width and the size of the image in this situation? Can I just use dtmlto get Image's addtributs? No. At least not easily. You'd have

Re: question: how to clare the absolute url in a html file

2006-03-23 Thread Diez B. Roggisch
dongdong wrote: is there any lib to help to clear the absolute url in a html file? for example, 'http://www.sina.com/' should be clear ,but /image/asd.gif should be reserved. Built-in string-manipulation is your friend: abcdef/ghi.replace(abcdef, ) Diez --

Re: Windows getting local ip address

2006-03-23 Thread Arne Ludwig
That man is a genius: s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect((gmail.com,80)) print s.getsockname() ('192.168.0.174', 2768) s.close() Should work on Windows as well. -- http://mail.python.org/mailman/listinfo/python-list

Simple but fundamental: How to import a jython class?

2006-03-23 Thread aziz . hammadi
I wrote a jython class bus I can not use it in another jython script :-( Example: -- X.py-- class X: def hello(): print Hello -- Y.py-- import X x = X() x.hello() I get TypeError: call of non function (module

Re: question: how to clare the absolute url in a html file

2006-03-23 Thread dongdong
to Diez B. Roggisch : no, I won't to use this way, its efficiency is very low as I need to replace all the 'a href=http:.//' tags into whitespace. I think whether there is any lib's function to do this. -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple but fundamental: How to import a jython class?

2006-03-23 Thread Frank Schenk
[EMAIL PROTECTED] wrote: I wrote a jython class bus I can not use it in another jython script :-( Example: -- X.py-- class X: def hello(): print Hello -- Y.py-- import X x = X() x.hello() I get

PIL: Breaking/Wrapping lines automatically

2006-03-23 Thread Jorge Godoy
Hi! Is there something I can do in PIL to restrict a line to a certain size and have it to break/wrap into a newline automatically? (Or by using some code, of course...) I'm trying to add information to barcodes and since the label space is fixed I'd like to use all the horizontal space I can

Re: Some info

2006-03-23 Thread Fulvio
Alle 22:14, mercoledì 22 marzo 2006, Sybren Stuvel ha scritto: different partitions might have, though. Then again, it all depends on the filesystems in use. Then I should make some extra programming to catch these info, according to which OS will run it :-( Regarding the names, CDROMs DVD

Re: Remote teamwork anecdotes

2006-03-23 Thread Ed Leafe
On Mar 20, 2006, at 9:51 PM, Alex Martelli wrote: While what *I* want, ideally, is pair programming -- somebody sitting right at my side, alternating with me in controlling keyboard and mouse, and in verbalizing what he or she is coding -- that's part of the huge productivity boost I

Building files within a package

2006-03-23 Thread schwehr
Hi All, I am creating a python package that contains a whole pile of functions that build lookup tables. Since these lookup tables will not be changing, I would like to have setup.py create a lut_static.py fie from the lookup table code (lut.py). What is the best way to do this so that when I

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-23 Thread Dr.Ruud
[EMAIL PROTECTED] schreef: The solution that would have the most utility would be one where the elements are generated one-by-one, loop-like, so that they can be used in the body of a loop, and to avoid the fact that even with exclusion the cardinality of the target set EX^n could be in the

Re: Simple but fundamental: How to import a jython class?

2006-03-23 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: I wrote a jython class bus I can not use it in another jython script :-( Example: -- X.py-- class X: def hello(): print Hello -- Y.py-- import X x = X() x.hello() I get

Re: don't understand popen2

2006-03-23 Thread Sion Arrowsmith
Martin P. Hellwig [EMAIL PROTECTED] wrote: std_out, std_in = popen2.popen2(F:\coding\pwSync\popen_test\testia.py) ^^ Your problem is, I suspect, nothing to do with popen2(), which is supported by the fact that the only thing other than

Re: Simple but fundamental: How to import a jython class?

2006-03-23 Thread aziz . hammadi
Thanks Frank. It works :_) -- http://mail.python.org/mailman/listinfo/python-list

Re: COM Client / Server creation?

2006-03-23 Thread Dan
What went wrong... Operator Error. My appologies. If typed in correctly the example works perfectly. I was using the PythonWin shell and when I started to type in it suggested CDispatch and I typed that in. I will be looking to pick up a copy of the book if I continue to use Python. I still do not

Re: Breaking/Wrapping lines automatically

2006-03-23 Thread Fredrik Lundh
Jorge Godoy wrote: Is there something I can do in PIL to restrict a line to a certain size and have it to break/wrap into a newline automatically? (Or by using some code, of course...) there's no standard function for this purpose, no. here's a somewhat rough implementation, based on a WCK

Re: Can XML-RPC performance be improved?

2006-03-23 Thread Sion Arrowsmith
[EMAIL PROTECTED] wrote: Diez Sion Arrowsmith wrote: I've got an established client-server application here where there is now a need to shovel huge amounts of data (structured as lists of lists) between the two, and the performance bottleneck has become the amount of time

Re: don't understand popen2

2006-03-23 Thread Fredrik Lundh
Sion Arrowsmith wrote: F:\coding\pwSync\popen_test\testia.py 'F:\\coding\\pwSync\\popen_test\testia.py' this might make it more obvious that something's not quite right with that string literal: print F:\coding\pwSync\popen_test\testia.py F:\coding\pwSync\popen_test estia.py /F

Re: datetime iso8601 string input

2006-03-23 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: Why not dt = datetime.datetime(*time.strptime(s, %Y-%m-%dT%H:%M:%S)[0:6]) ? Maybe due to neglection of the 7th commandment? Most of the other commandments can be ignored while coding Python, but the 7th certainly applies here.

Re: question: how to clare the absolute url in a html file

2006-03-23 Thread Diez B. Roggisch
dongdong wrote: to Diez B. Roggisch : no, I won't to use this way, its efficiency is very low as I need to replace all the 'a href=http:.//' tags into whitespace. I think whether there is any lib's function to do this. Why do you think it is slow? It repelaces _all_ occurrences, in

Re: Breaking/Wrapping lines automatically

2006-03-23 Thread Jorge Godoy
Fredrik Lundh [EMAIL PROTECTED] writes: Jorge Godoy wrote: Is there something I can do in PIL to restrict a line to a certain size and have it to break/wrap into a newline automatically? (Or by using some code, of course...) there's no standard function for this purpose, no. here's a

Re: Breaking/Wrapping lines automatically

2006-03-23 Thread Jorge Godoy
Jorge Godoy [EMAIL PROTECTED] writes: Then I'd have to have some means to determine the width of the char (I'm using a TrueType font due to my need of using Unicode text) to calculate how many words I can put on a single line... Hmmm... It looks like your code does that! Thanks! I'll give

Convert Word .doc to Acrobat .pdf files

2006-03-23 Thread kbperry
Hi all, Background: I need some help. I am trying to streamline a process for one of our technical writers. He is using Perforce (version control system), and is constantly changing his word documents, and then converts them to both .pdf and Web page format (to publish to the web). He has a

Re: Probelem about image size and dimensions

2006-03-23 Thread ChengGong
Hi Diez, They do not allow me to do what u said above. so I do not have any idea what is supposed to do. however i am think that if I can get the id of the image, i have chance to modify it. This is what i programed but it is an empty page, I but it in images folder dtml-var standard_html_header

Re: Server applications - avoiding sleep

2006-03-23 Thread rodmc
Hi Lev, Sounds interesting. As I am quite new to Python an example program would be most welcome. My email address is contained in the message. Best, rod -- http://mail.python.org/mailman/listinfo/python-list

Re: Probelem about image size and dimensions

2006-03-23 Thread ChengGong
Is that because I can not import PIL ? then i can not use codes above to show all image id? -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange metaclass behaviour

2006-03-23 Thread Ziga Seilnacht
Christian Eder wrote: Hi, I think I have discovered a problem in context of metaclasses and multiple inheritance in python 2.4, which I could finally reduce to a simple example: I don't know if this is a bug; but I will try to expain what is happening; here is an example similar to yours:

Re: Default/editable string to raw_input

2006-03-23 Thread Sion Arrowsmith
Sybren Stuvel [EMAIL PROTECTED] wrote: Paraic Gallagher enlightened us with: While I agree in principal to your opinion, the idea is that an absolute moron would be able to configure a testcell with smallest amount of effort possible. Then explain to me why learning how to use your program to

Re: Can XML-RPC performance be improved?

2006-03-23 Thread Sion Arrowsmith
[EMAIL PROTECTED] wrote: Steve I suppose there *was* a good reason for using XML-RPC in the Steve first place? I don't know about the OP, but in my case it was a drop-dead simple cross-language RPC protocol. I am the OP and *I* don't know if there was a good reason for using XML-RPC in

Re: Help: why python odbc module can not fetch all over?

2006-03-23 Thread zxo102
Hi Dennis, Thanks for your effort. I really appreciate it. It works for me now. Ouyang -- http://mail.python.org/mailman/listinfo/python-list

python/py2exe running in background

2006-03-23 Thread Astan Chee
Hi, Im using py2exe to convert my python scripts to .exe. Im trying to get my scripts and .exes to only run (utilize full CPU) when my PC is idle (kinda like [EMAIL PROTECTED]). Do i only need to modify GIL parameters or is there more to acomplishing this? Thanks --

definition of sub-functions in the hotshot profiler

2006-03-23 Thread Lars Woetmann
what is the definition of sub-functions in the hotshot profiler? and just as important what is not sub-functions from the output I can see that functions I made and functions in /usr/lib/python2.4/textwrap.py is considered sub-functions, but I call a lot of other functions in the python library

Re: Strange metaclass behaviour

2006-03-23 Thread Michele Simionato
Ziga Seilnacht wrote: - Since D does not have a __metaclass__ attribute, its type is determined from its bases. - Since A is the first base, its type (M_A) is called; unfortunately this is not the way metaclasses are supposed to work; the most derived metaclass should be

Re: SWIGing problem

2006-03-23 Thread Jaap Spies
Robert Kern wrote: Tommy Grav wrote: This might not be the venue to ask this but I do not know where else to turn. I am trying to install a package that is swig'ed from some C code. Unfortunately the readme file isn't to informative. Does anyone know which libraries to link to to remove the

wxpython error message?

2006-03-23 Thread Kenneth Xie
I made some mistake in my codes, so there was a window with a text field appeared. But before I could read the message in the text field, the window disappeared. So I can't figure out what's the problem with my codes. What should I do to make the message window last a little longer? Thank you. --

Re: removing file by inode

2006-03-23 Thread Grant Edwards
On 2006-03-23, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: is it possible to remove a file by it's inode and not it's filename using Python? What do you mean remove a file? -- Grant Edwards grante Yow! Life is a POPULARITY at

Re: Convert Word .doc to Acrobat .pdf files

2006-03-23 Thread Thomas Guettler
I wrote a script which uses OpenOffice. It can convert and read a lot of formats. #!/usr/bin/env python #Old: !/optlocal/OpenOffice.org/program/python # (c) 2003-2006 Thomas Guettler http://www.tbz-pariv.de/ # OpenOffice1.1 comes with its own python interpreter. # This Script needs to be run

path to modules per import statement

2006-03-23 Thread AndyL
Hi, is there any way to specify the path to modules within import statement (like in Java)? For instance: import my.path.module would load module from ./my/path/module.py? Thx, A. -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange metaclass behaviour

2006-03-23 Thread Michele Simionato
Christian Eder wrote: Hi, I think I have discovered a problem in context of metaclasses and multiple inheritance in python 2.4, which I could finally reduce to a simple example: Look at following code: class M_A (type) : def __new__ (meta, name, bases, dict) : print

encoding problems (é and è)

2006-03-23 Thread bussiere bussiere
hi i'am making a program for formatting string, or i've added : #!/usr/bin/python # -*- coding: utf-8 -*- in the begining of my script but str = str.replace('Ç', 'C') str = str.replace('é', 'E') str = str.replace('É', 'E') str = str.replace('è', 'E') str =

Re: Strange metaclass behaviour

2006-03-23 Thread Christian Eder
Ziga Seilnacht wrote: I hope that above explanation helps. Thanks for your support. I now understand what happens here, but I'm not really happy with the situation. Your solution is a nice workaround, but in a quite huge and complex class framework with a lot a custom metaclasses you don't

Re: Convert Word .doc to Acrobat .pdf files

2006-03-23 Thread Duncan Booth
kbperry wrote: Hi all, Background: I need some help. I am trying to streamline a process for one of our technical writers. He is using Perforce (version control system), and is constantly changing his word documents, and then converts them to both .pdf and Web page format (to publish to

Re: Default/editable string to raw_input

2006-03-23 Thread Sybren Stuvel
Sion Arrowsmith enlightened us with: You're assuming that the tester is already familiar with a text editor. Indeed. Someone working on a test suite sounded like someone who knows how to work with a text editor. And then they would have to learn the syntax of the configuration file, and the

Re: path to modules per import statement

2006-03-23 Thread [EMAIL PROTECTED]
For instance: import my.path.module would load module from ./my/path/module.py? Yeah, just do that. I don't understand the question, it works just like this today. -- http://mail.python.org/mailman/listinfo/python-list

Re: wxpython error message?

2006-03-23 Thread Larry Bates
Kenneth Xie wrote: I made some mistake in my codes, so there was a window with a text field appeared. But before I could read the message in the text field, the window disappeared. So I can't figure out what's the problem with my codes. What should I do to make the message window last a little

[no subject]

2006-03-23 Thread cm012b5105
Hi there i am hoping some one could help me out with a small problem i am in the process of learning python. I am trying to write an interactive programme, This is a short example. if s = raw_input (hello whats your name? ) if s=='carmel': print Ahh the bosss wife What i would like to

Re: path to modules per import statement

2006-03-23 Thread [EMAIL PROTECTED]
As an example, let's say you have a main module at /usr/code/Main.py and you have a module you'd like to import at /usr/code/util/Util.py, you can do this: import util.Util If you are using PyDev and Eclipse to develop your Python code, you can set the base directory to reference module imports

Re: path to modules per import statement

2006-03-23 Thread Arne Ludwig
Maybe he means: sys.path.append('/my/path') -- http://mail.python.org/mailman/listinfo/python-list

Python has a new Logo

2006-03-23 Thread Xah Lee
Python has a new logo! See http://python.org/ And it is a fantastic logo. Xah [EMAIL PROTECTED] ∑ http://xahlee.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python has a new Logo

2006-03-23 Thread Felipe Almeida Lessa
Em Qui, 2006-03-23 às 07:43 -0800, Xah Lee escreveu: Python has a new logo! Really? :) See http://python.org/ And it is a fantastic logo. LOL, sorry for the trolling, but we already had loads of (good) discussions about it some time ago... -- Felipe. --

Re: removing file by inode

2006-03-23 Thread Arne Ludwig
Good answer. :) I seriously doubt it is possible except for the trivial solution: def remove_a_file(inode): os.system (find / -inum %d | xargs rm -f % (inode)) PS. Don't blame me if this function destroys your hard disk. I wrote it off the top of my head. --

Re: Convert Word .doc to Acrobat .pdf files

2006-03-23 Thread kbperry
Thanks for the replys! I need to stick with Word (not my choice, but I would rather keep everything like he has it). Duncan, I was just trying the printing thing. When installing Adobe Acrobat, it installs a printer called Adobe PDF, and I have been trying to print to there, but the Save window

Re: encoding problems (é and è)

2006-03-23 Thread Christoph Zwerschke
bussiere bussiere wrote: hi i'am making a program for formatting string, i've added : #!/usr/bin/python # -*- coding: utf-8 -*- in the begining of my script but str = str.replace('Ç', 'C') ... doesn't work it put me and , instead of remplacing é by E Are your sure your script and

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-23 Thread Dirk Thierbach
Dinko Tenev [EMAIL PROTECTED] wrote: Dirk Thierbach wrote: If more time during preprocessing is allowed, another idea is to treat the wildcard expressions as regular expressions, convert each into a finite state machine, construct the intersection of all these state machines, minimize it and

Re: question: how to clare the absolute url in a html file

2006-03-23 Thread Arne Ludwig
Perhaps this is what he means: re.sub(http://[^/]*/,/,http://palle.fi/wing/walla.htm;) '/wing/walla.htm' -- http://mail.python.org/mailman/listinfo/python-list

Re: Python has a new Logo

2006-03-23 Thread Xah Lee
is there larger versions of the logo? and, any usage restrictions? i also like to find out the the artist name. Any pointer is appreciated. Thanks. Xah [EMAIL PROTECTED] ∑ http://xahlee.org/ Felipe Almeida Lessa wrote: Em Qui, 2006-03-23 às 07:43 -0800, Xah Lee escreveu: Python has a

Re: encoding problems (é and è)

2006-03-23 Thread Larry Bates
Seems to work fine for me. x=éÇ x=x.replace('é','E') 'E\xc7' x=x.replace('Ç','C') x 'E\xc7' x=x.replace('Ç','C') x 'EC' You should also be able to use .upper() method to uppercase everything in the string in a single statement: tstr=ligneA.upper() Note: you should never use 'str' as a

Re: Convert Word .doc to Acrobat .pdf files

2006-03-23 Thread Duncan Booth
kbperry wrote: Thanks for the replys! I need to stick with Word (not my choice, but I would rather keep everything like he has it). That shouldn't be a problem: you can use stick with Word for editing the documents and just use OpenOffice to do the conversion. Duncan, I was just

Re: Python has a new Logo

2006-03-23 Thread [EMAIL PROTECTED]
Yawn. Go start indenting, and stop using Perl. If Python has such a nice logo, why waste any more time with Perl? -- http://mail.python.org/mailman/listinfo/python-list

Re: Linear regression in NumPy

2006-03-23 Thread Robert Kern
nikie wrote: Although I think it's worth reading, it only covers the fundamental structure (what arrays are, what ufuncs are..) of NumPy. Neither of the functions dicussed in this thread (polyfit/linear_least_squares) is mentioned in the file. Both functions are described in the full book.

Re: raw_input (was no subject)

2006-03-23 Thread Tim Williams (gmail)
On 23/03/06, cm012b5105 [EMAIL PROTECTED] wrote: Hi there i am hoping some one could help me out with a small problem i am in the process of learning python. I am trying to write an interactive programme, This is a short example. if s = raw_input (hello what's your name? ) if

Re: multiple assignment

2006-03-23 Thread Steven Bethard
Anand wrote: Wouldn't it be nice to say id, *tokens = line.split(',') id, tokens_str = line.split(',', 1) But then you have to split tokens_str again. id, tokens_str = line.split(',', 1) tokens = tokens_str.split(',') Sorry, it wasn't clear that you needed the tokens from the original

Re: Per instance descriptors ?

2006-03-23 Thread Steven Bethard
bruno at modulix wrote: Steven Bethard wrote: Could you explain again why you don't want baaz to be a class-level attribute? Because the class is a decorator for many controller functions, and each controller function will need it's own set of descriptors, so I don't want to mess with the

raw_input

2006-03-23 Thread cm012b5105
Hi there i am hoping some one could help me out with a small problem i am in the process of learning python. I am trying to write an interactive programme, This is a short example. if s = raw_input (hello what's your name? ) if s=='carmel ': print Ahh the boss's wife

Confused: appending to a list

2006-03-23 Thread DataSmash
I'm confused. Why is it that when I say while len(list) 5:, I get 5 items in my list. If I say while len(list) 6:, I get 6 items in the list and so on. I would think if I said less than 5, I would get 4 items. Can anyone explain this? Thanks. R.D. # Start an empty list list = [] while

Re: Confused: appending to a list

2006-03-23 Thread Felipe Almeida Lessa
Em Qui, 2006-03-23 às 08:31 -0800, DataSmash escreveu: I'm confused. Why is it that when I say while len(list) 5:, I get 5 items in my list. while len(list) 5: implies that the loop will stop only when len(list) = 5. HTH, -- Felipe. -- http://mail.python.org/mailman/listinfo/python-list

Re: removing file by inode

2006-03-23 Thread Grant Edwards
On 2006-03-23, Arne Ludwig [EMAIL PROTECTED] wrote: Good answer. :) I seriously doubt it is possible except for the trivial solution: [...] I don't know if there is a Linux equivalent, but under SunOS there was a way to delete a file given it's i-node. And that's all it did was delete the

Re: Confused: appending to a list

2006-03-23 Thread Diez B. Roggisch
DataSmash wrote: I'm confused. Why is it that when I say while len(list) 5:, I get 5 items in my list. If I say while len(list) 6:, I get 6 items in the list and so on. I would think if I said less than 5, I would get 4 items. Can anyone explain this? Yes - you loop until the condition

  1   2   3   >