Re: Can dictionary values access their keys?

2005-04-08 Thread Scott David Daniels
Matthew Thorley wrote: This may be a very rudimentary question, but here goes: From your questions, I believe you are not thinking of values as being distinct from the names and data structures that refer to them. What is the parent of 23 in the following expression? 1 + 11 * 2 If you know that

Re: redirect stdout

2005-04-08 Thread Joshua Ginsberg
Use *NIX magic. Make a named pipe to a python program that pushes stdin to syslog and when you execute your program, redirect stdout to the named pipe. -jag <>Joshua Ginsberg -- [EMAIL PROTECTED] Brainstorm Internet Network Operations 970-247-1442 x131 On Apr 8, 2005, at 10:52 AM, Neal Becker wr

PPC OSX vs. x86 Linux

2005-04-08 Thread Joshua Ginsberg
Hello -- I writing some python code to do some analysis of my mail logs. I took a 10,000 line snippet from them (the files are about 5-6 million usually) to test my code with. I'm developing it on a Powerbook G4 1.2GHz with 1.25GB of RAM and the Apple distributed Python* and I tested my code on

redirect stdout

2005-04-08 Thread Neal Becker
I'd like to build a module that would redirect stdout to send it to a logging module. I want to be able to use a python module that expects to print results using "print" or "sys.stdout.write()" and without modifying that module, be able to redirect it's stdout to a logger which will send the

Re: Installing Python 2.4 on Linux

2005-04-08 Thread Joseph Garvin
Another solution is to just install 2.4 and then make an alias for yum='/usr/bin/python2.3 yum' or whatever the path is :) Edward Diener wrote: > I can install Python 2.4 on the Fedora 3 Linux system, but after I do > a number of Linux utilities and commands, like yum, stop working > because they

Re: Can dictionary values access their keys?

2005-04-08 Thread Steve Holden
Matthew Thorley wrote: This may be a very rudimentary question, but here goes: If I have a simple dictionary, where the value is a class or function, is there an interface through which it can discover what its key is? Similar to index() for list. No, because mapping types (of which dict is the can

Re: Installing Python 2.4 on Linux

2005-04-08 Thread Edward Diener
John Ridley wrote: --- Edward Diener <[EMAIL PROTECTED]> wrote: [snip] I do not know whether this is a Python problem or a Fedora 3 problem but I thought I would ask here first and see if anybody else had the same problem. I imagine the problem might exist on other Linux systems. On my Mandrake

Re: Installing Python 2.4 on Linux

2005-04-08 Thread Edward Diener
David Fraser wrote: Edward Diener wrote: I can install Python 2.4 on the Fedora 3 Linux system, but after I do a number of Linux utilities and commands, like yum, stop working because they were dependent on the Python 2.3 installation. What happens is that Python 2.4 replaces the /usr/bin/python

Re: Can dictionary values access their keys?

2005-04-08 Thread Matthew Thorley
Axel Straschil wrote: > > For unique values, I did something like that couple of weeks ago, the > thing you would need is the getKey thing, it's fast, but needs much > memory for big structures becouse I use two dicts. Thanks for the tip, I may give that a try. I'll be interested to see what kind

Re: Interpreter problem

2005-04-08 Thread Steve Holden
tuba_ranger wrote: Yes! I moved the file (which I had created on a windows box using a mounted drive), created a new one on the Linux box, typed in the shabang in Linux, then copied the old file (sans shabang) to the new file. It runs like a champ. My sysadmin suggests we run all of our files th

Re: Interpreter problem

2005-04-08 Thread Steve Holden
rbt wrote: Steve Holden wrote: rbt wrote: Steve Holden wrote: Greg Lindstrom wrote: I am using python 2.3.5 on a Linux system and have an odd problem dealing with the 'sha-bang' line. I have a file, driver.py which starts with #!/usr/bin/python and works fine (that is, when I type in ./driver.p

Re: Can dictionary values access their keys?

2005-04-08 Thread Diez B. Roggisch
Matthew Thorley wrote: > Can you please elaborate on this? Eh, just have two dicts that are the inverse of each other. You could do that by subclassinc dict: class mydict(dict): def __init__(self): self.__inverse_mapping = {} def __setitem__(self, key, value): dict.__set

Re: How to name Exceptions that aren't Errors

2005-04-08 Thread Steve Holden
Leif K-Brooks wrote: Steve Holden wrote: I've even used an exception called Continue to overcome an irksome restriction in the language (you used not to be able to continue a loop from an except clause). Out of curiosity, how could you use an exception to do that? I would think you would need to

Re: Can dictionary values access their keys?

2005-04-08 Thread Axel Straschil
Hello! > If I have a simple dictionary, where the value is a class or function, > is there an interface through which it can discover what its key is? The key of a value may not be unique, so you can also get a tupe of keys, like dict(a=1, b=1), the key's of 1 are a and b. For unique values, I d

Re: How to name Exceptions that aren't Errors

2005-04-08 Thread Scott David Daniels
Leif K-Brooks wrote: Steve Holden wrote: I've even used an exception called Continue to overcome an irksome restriction in the language (you used not to be able to continue a loop from an except clause). Out of curiosity, how could you use an exception to do that? I would think you would need to

Re: args attribute of Exception objects

2005-04-08 Thread Jeremy Bowers
On Fri, 08 Apr 2005 09:32:37 +, SÃbastien de Menten wrote: > Hi, > > When I need to make sense of a python exception, I often need to parse the > string exception in order to retrieve the data. What exactly are you doing with this info? (Every time I started to do this, I found a better way

Re: curious problem with large numbers

2005-04-08 Thread Scott David Daniels
Steve Holden wrote: Scott David Daniels wrote: Terry Reedy wrote: On my Windows machine with 2.2.1, I get exactly what you expected: 1e1 1.#INF ... If you get wrong behavior on a later version, then a bug has been introduced somewhere, even perhaps in VC 7, used for 2.4. Nope, it is also there

Re: Can dictionary values access their keys?

2005-04-08 Thread Matthew Thorley
Can you please elaborate on this? -Matthew Diez B. Roggisch wrote: >>keeping a additional mapping between values and keys. > -- http://mail.python.org/mailman/listinfo/python-list

Re: Can dictionary values access their keys?

2005-04-08 Thread Diez B. Roggisch
> > Is there a way to do something like that with dicts? Not without searching the dict's items through, or keeping a additional mapping between values and keys. > > On a similar note, if one object is part of another, is there a way for > the 'child' obj to discover what/who the 'parent' objec

Re: text processing problem

2005-04-08 Thread Matt
Maurice LING wrote: > Matt wrote: > > I'd HIGHLY suggest purchasing the excellent > href="http://www.oreilly.com/catalog/regex2/index.html";>Mastering > > Regular Expressions by Jeff Friedl. Although it's mostly geared > > towards Perl, it will answer all your questions about regular > > express

Tutorial at Python-UK, Oxford, 19 May - handful of places left

2005-04-08 Thread Andy Robinson
Michele Simionato is giving a full day tutorial titled "The Wonders of Python" at the UK Python Conference, Randolph Hotel, Oxford on 19 May. (This replaces Alex Martelli, who is now working for Google in California). The program is here: https://www.accu.org/conference/python_tutorial.html Thi

Re: Ó¿Ò, THE GREATEST NEWS EVER ! °º¤ø,¸¸,ø¤º°`°º¤ø°º¤ø,¸¸,ø¤º°`°º¤ø°º¤ø,¸¸,ø¤º°`°º¤ø°º¤ø,¸¸,ø¤º°`°º¤ø

2005-04-08 Thread Tom Reese
Joe Spammer wrote: bah! I thought maybe they found a huge forest of rosewood trees in Brazil. Tom (disappointed) Reese -- http://mail.python.org/mailman/listinfo/python-list

Re: Rotating arbitrary sets of elements within a list

2005-04-08 Thread phil_nospam_schmidt
[EMAIL PROTECTED] wrote: > I'm trying to come up with a good algorithm to do the following: > > Given a list 'A' to be operated on, and a list 'I' of indices into 'A', > rotate the i'th elements of 'A' left or right by one position. Ok, here's what I've got. It seems to work right, but can it be

Re: How to name Exceptions that aren't Errors

2005-04-08 Thread Leif K-Brooks
Steve Holden wrote: I've even used an exception called Continue to overcome an irksome restriction in the language (you used not to be able to continue a loop from an except clause). Out of curiosity, how could you use an exception to do that? I would think you would need to catch it and then use

Testing that a value is set.

2005-04-08 Thread erinhouston
I am using winGuiAuto to test a program. I want to check that a varible is set. In the following code I am doing if(len(str(hwnd)) < 0) What is the python way? def clickNdSyncStopButton(hwnd=None): if(hwnd == None): hwnd = winGuiAuto.findTopWindow("NDSync") if(len(str(hwnd)) < 0)

Re: Interpreter problem

2005-04-08 Thread rbt
Steve Holden wrote: rbt wrote: Steve Holden wrote: Greg Lindstrom wrote: I am using python 2.3.5 on a Linux system and have an odd problem dealing with the 'sha-bang' line. I have a file, driver.py which starts with #!/usr/bin/python and works fine (that is, when I type in ./driver.py at the co

THE GREATEST NEWS EVER ! °º¤ø,¸¸,ø¤º°`°º¤ø°º¤ø,¸¸,ø¤º°`°º¤ø°º¤ø,¸¸,ø¤º°`°º¤ø°º¤ø,¸¸,ø¤º°`°º¤ø°º¤ø,¸¸,ø¤º°`°º¤ø°º¤ø,¸¸,ø¤º°`°º¤ø°º¤ø,¸¸,ø¤º°`°º¤ø°º¤ø,¸¸,ø¤º°`°º¤ø°º¤ø,¸¸,ø¤º°`°º¤ø°º¤ø,¸¸,ø¤º°`°º¤ø°º¤ø,¸¸,ø¤º°`°º¤ø

2005-04-08 Thread RonGrossi_38131
http://www.print-it-011.blogspot.com << The Greatest News Ever ! -- http://mail.python.org/mailman/listinfo/python-list

Re: dynamic loading of code, and avoiding package/module name collisions.

2005-04-08 Thread Paul Clinch
Dear "John Perks and Sarah Mount", > Long story short: what I'm looking for is information on how have a Python > app that: > * embeds an editor (or wxNoteBook full of editors) > * loads code from the editors' text pane into the app > * executes bits of it > * then later unloads to make way for an

Can dictionary values access their keys?

2005-04-08 Thread Matthew Thorley
This may be a very rudimentary question, but here goes: If I have a simple dictionary, where the value is a class or function, is there an interface through which it can discover what its key is? Similar to index() for list. For a list, assuming I new what the parent list was I could do something

Re: Interpreter problem

2005-04-08 Thread tuba_ranger
Yes! I moved the file (which I had created on a windows box using a mounted drive), created a new one on the Linux box, typed in the shabang in Linux, then copied the old file (sans shabang) to the new file. It runs like a champ. My sysadmin suggests we run all of our files through dos2unix befo

Re: Interpreter problem

2005-04-08 Thread Steve Holden
rbt wrote: Steve Holden wrote: Greg Lindstrom wrote: I am using python 2.3.5 on a Linux system and have an odd problem dealing with the 'sha-bang' line. I have a file, driver.py which starts with #!/usr/bin/python and works fine (that is, when I type in ./driver.py at the command prompt the fi

Re: import statement - package visibility problem

2005-04-08 Thread Paul Clinch
Laszlo, ... > Importing from a not package related source code is not a problem, > really. My problem is about importing inside a package. > > Lib/Server/Db/__init__.py __can__ import Lib/Server/Db/Adapters usign > relative paths, but > > Lib/Server/Db/Adapters/PostgreSQLConnection.py __can

__iadd__ and __isub__ map to += and -= but don't return result

2005-04-08 Thread Anthra Norell
Hi!   If I am missing a point here, what could it be? Watch the hot spots (***)   Frederic     #     # Python 2.4, Windows ME  X = 0, Y = 1    class Vertex (list):    def __init__ (self, *coordinates): self [:] = l

Re: Rotating arbitrary sets of elements within a list

2005-04-08 Thread wes weston
[EMAIL PROTECTED] wrote: I'm trying to come up with a good algorithm to do the following: Given a list 'A' to be operated on, and a list 'I' of indices into 'A', rotate the i'th elements of 'A' left or right by one position. Here's are some examples: A = [a, b, c, d, e, f] I = [0, 3, 4] rotate(A, I

Re: unknown encoding problem

2005-04-08 Thread Peter Otten
Uwe Mayer wrote: > I need to read in a text file which seems to be stored in some unknown > encoding. Opening and reading the files content returns: > f.read() > '\x00 \x00 \x00<\x00l\x00o\x00g\x00E\x00n\x00t\x00r\x00y\x00... > > Each character has a \x00 prepended to it. I suspect its some

Re: Interpreter problem

2005-04-08 Thread rbt
Steve Holden wrote: Greg Lindstrom wrote: I am using python 2.3.5 on a Linux system and have an odd problem dealing with the 'sha-bang' line. I have a file, driver.py which starts with #!/usr/bin/python and works fine (that is, when I type in ./driver.py at the command prompt the file runs as

Re: compound strip() string problem

2005-04-08 Thread Jeffrey Froman
Dylan Wilson wrote: > Now i need to compond that string remove the whitespace if you will.Well > i read up on strip(), lstrip() and rstrip() and all i could deduce was > that they striped the whitespace from the start and/or end of the > string.But I tried that anyway and failed.Is there an easier

Rotating arbitrary sets of elements within a list

2005-04-08 Thread phil_nospam_schmidt
I'm trying to come up with a good algorithm to do the following: Given a list 'A' to be operated on, and a list 'I' of indices into 'A', rotate the i'th elements of 'A' left or right by one position. Here's are some examples: A = [a, b, c, d, e, f] I = [0, 3, 4] rotate(A, I, 'left') --> [b, c,

Re: Interpreter problem

2005-04-08 Thread Ruud de Jong
Greg Lindstrom schreef: I am using python 2.3.5 on a Linux system and have an odd problem dealing with the 'sha-bang' line. I have a file, driver.py which starts with #!/usr/bin/python and works fine (that is, when I type in ./driver.py at the command prompt the file runs as expected). I have

Re: Interpreter problem

2005-04-08 Thread Steve Holden
Greg Lindstrom wrote: I am using python 2.3.5 on a Linux system and have an odd problem dealing with the 'sha-bang' line. I have a file, driver.py which starts with #!/usr/bin/python and works fine (that is, when I type in ./driver.py at the command prompt the file runs as expected). I have a

Re: Matplotlib question-- Numeric or numarray?

2005-04-08 Thread John Hunter
> "Matt" == Matt Feinstein <[EMAIL PROTECTED]> writes: Matt> I'm working my way through the matplotlib documentation & Matt> there's a point that's ambiguous-- the pdf file (dated Matt> Mar. 1, 2005) warns of dire consequences if I use the Matt> 'wrong' array package-- e.g., pu

Re: Parent module idea dropped? [Python import parent package]

2005-04-08 Thread Laszlo Zsolt Nagy
So finally I got the answer: there was a "parent package" feature in the ni module but it was dropped of its awkwardness. This is not a big loss but this is exatly the feature that I need. Is there a person on this list who was against the "parent package" idea? He must know the answer or a wo

Re: Positions of regexp groups

2005-04-08 Thread John Machin
On Fri, 8 Apr 2005 13:18:27 + (UTC), [EMAIL PROTECTED] (Magnus Lie Hetland) wrote: >Just a quick question: Does anyone have a simple way of finding the >positions (start, end) of the groups in a regexp match? AFAICS, the re >API can only return the contents...? These documented methods of the

[ANN] Voidspace Pythonutils Updates

2005-04-08 Thread Fuzzyman
Lots of updates to the Voidspace modules and recipes. Update to the Firedrop plugins see : http://www.voidspace.org.uk/python/programs.shtml#firedrop New version of FireSpell the spell checker (based on PyEnchant by Ryan Kelly) New plugin called FireMail which lets you send blog entries (or articl

unknown encoding problem

2005-04-08 Thread Uwe Mayer
Hi, I need to read in a text file which seems to be stored in some unknown encoding. Opening and reading the files content returns: >>> f.read() '\x00 \x00 \x00<\x00l\x00o\x00g\x00E\x00n\x00t\x00r\x00y\x00... Each character has a \x00 prepended to it. I suspect its some kind of unicode - how do

Re: Positions of regexp groups

2005-04-08 Thread Tim Peters
[Magnus Lie Hetland] > Just a quick question: Does anyone have a simple way of finding the > positions (start, end) of the groups in a regexp match? AFAICS, the re > API can only return the contents...? Read the docs for match objects, esp. the start(), end(), and span() methods. -- http://mail.p

Positions of regexp groups

2005-04-08 Thread Magnus Lie Hetland
Just a quick question: Does anyone have a simple way of finding the positions (start, end) of the groups in a regexp match? AFAICS, the re API can only return the contents...? -- Magnus Lie HetlandFall seven times, stand up eight http://hetland.org

Re: Sockets

2005-04-08 Thread Dave Brueck
Dan wrote: >On Thu, 7 Apr 2005 21:52:11 -0500, [EMAIL PROTECTED] wrote: >>Python strings always carry their length, and can have embedded NULs. >> s.write("\0\1\2\3") >>should write 4 bytes to the socket 's'. > >I'm taking binary data from a database, so it's not really a Python >string. Is ther

Interpreter problem

2005-04-08 Thread Greg Lindstrom
I am using python 2.3.5 on a Linux system and have an odd problem dealing with the 'sha-bang' line. I have a file, driver.py which starts with #!/usr/bin/python and works fine (that is, when I type in ./driver.py at the command prompt the file runs as expected). I have another file, myotherfi

Re: curious problem with large numbers

2005-04-08 Thread Ivan Van Laningham
Hi All-- Windows XP, uwin running on Athlon XP 3000+: 0 [/c/users/ivanlan][1] python Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> 1e1 1.#INF >>> Metta, Ivan Michael Spencer wrote: > >

Re: [JIM_SPAM] Microsoft supporting a .NET version of Python...

2005-04-08 Thread Jim Hargrave
oops - Sorry for the posting. This wasn't meant for the newsgroup :-) J Steve Holden wrote: Jim Hargrave wrote: http://www.gotdotnet.com/workspaces/workspace.aspx?id=ad7acff7-ab1e-4bcb-99c0-57ac5a3a9742 You really shoud try and get out more: http://www.pycon.org/dc2005/talks/keynote regards

Re: compound strip() string problem

2005-04-08 Thread Sidharth Kuruvila
The time module has a function called 'strftime' which can retyrn the time in the the format you want to. So you really don't need to parse the string returned by asctime the way you are doing. On Apr 8, 2005 6:01 PM, Dylan Wilson <[EMAIL PROTECTED]> wrote: > Hi, > I'm new to python and i have a

Re: Multiple inheritance: Interface problem workaround, please comment this

2005-04-08 Thread Michele Simionato
Axel: > So, if there are ready class-modules, and I want to use them for > multiple inheritance, I've to rewrite the init's of classes in the > module! Or you use a metaclass that rewrites the __init___ method for you. This is a start (warning: written in 5 minutes and not tested more than you s

compound strip() string problem

2005-04-08 Thread Dylan Wilson
Hi, I'm new to python and i have a string problem. My problem is this -- >>>import time >>>time = time.asctime() >>>time 'Fri Apr 08 22:14:14 2005' >>>ti = time[0:13] >>>me = time[14:16] >>>time = ti + me >>>time 'Fri Apr 08 22

Matplotlib question-- Numeric or numarray?

2005-04-08 Thread Matt Feinstein
I'm working my way through the matplotlib documentation & there's a point that's ambiguous-- the pdf file (dated Mar. 1, 2005) warns of dire consequences if I use the 'wrong' array package-- e.g., put numarray in the .matlabrc file if the compile-time package is Numeric. But there's only one curren

Re: decorating functions with generic signatures (not for the faint of heart)

2005-04-08 Thread Michele Simionato
Yes, this is essentially the same idea. You compile the codestring to bytecode, whereas I just evalue the codestring to a lambda function. We are essentially implementing a runtime macro by hand. I wonder if there is any alternative approach to get the same result, without manipulation of the sourc

Re: decorating functions with generic signatures (not for the faint of heart)

2005-04-08 Thread Thomas Heller
"Michele Simionato" <[EMAIL PROTECTED]> writes: > I have realized today that defining decorators for functions > with generic signatures is pretty non-trivial. I've not completely read your post ;-), but I assume you're trying to do something that I've also done some time ago. Maybe the following

Re: Thoughts on some stdlib modules

2005-04-08 Thread Nick Efford
vegetax <[EMAIL PROTECTED]> wrote: > And those thoughts comes to mind again, if python is such a great language > why does the stdlib is so bloated with duplication,bad bad library > design,clumsy to use modules,etc. > I mean is this normal? i dont think so.I havent seen such a messy stdlib in >

Re: decorating functions with generic signatures (not for the faint of heart)

2005-04-08 Thread Michele Simionato
I said it was very little tested! ;) This should work better: # def _signature_gen(varnames, n_default_args, n_args, rm_defaults=False): n_non_default_args = n_args - n_default_args non_default_names = varnames[:n_non_default_args] default_names = varnames[n_non_default_args:n_args]

Re: Best editor?

2005-04-08 Thread [EMAIL PROTECTED]
Howdy, I'm sold on out Leo, http://leo.sf.net, pure Python amazingly easy to learn and powerful. Based on outlining, it provides a powerful and flexible way to manage content. Lots of built in Python code awareness. Extensible with plugins, a very active community is making "I wish my editor cou

Re: curious problem with large numbers

2005-04-08 Thread Sion Arrowsmith
Michael Spencer <[EMAIL PROTECTED]> wrote: >Terry Reedy wrote: >> "Chris Fonnesbeck" <[EMAIL PROTECTED]> wrote >>>However, on Windows (have tried on Mac, Linux) I get the following >>>behaviour: >>inf = 1e1 >>inf >>>1.0 >> On my Windows machine with 2.2.1, I get exactly what you expec

Re: Problem with access to shared memory(W2K) SOLVED

2005-04-08 Thread Claudio Grondi
I have got a solution to my problem from Thomas Heller by email. The problem was solved by using .from_address() instead of causing trouble cast() - here the solution as a generalized example of code for reading access to shared memory area with given 'appropriateName': from ctypes import * FILE_

Re: __builtins__ wreidness

2005-04-08 Thread Laszlo Zsolt Nagy
__builtins__ (plural form) is a CPython implementation detail. if you want to access the __builtin__ module, import it as usual: import __builtin__ f = __builtin__.open(...) if you're interested in CPython implementation details, study the CPython source code. Ok, I agree. I was an idio

decorating functions with generic signatures (not for the faint of heart)

2005-04-08 Thread Michele Simionato
I have realized today that defining decorators for functions with generic signatures is pretty non-trivial. Consider for instance this typical code: # def traced_function(f): def newf(*args, **kw): print "calling %s with args %s, %s" % (f.__name__, args, kw) return f(*args, *

Re: 'Address already in use' when using socket

2005-04-08 Thread J Berends
Peter Hansen wrote: Bearish wrote: I get 'Address already in use' errors when using sockets. Generally one can fix this using: sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) where "sock" is the server socket in question. Do this prior to attempting to bind to the port. -Peter I agree

args attribute of Exception objects

2005-04-08 Thread Sébastien de Menten
Hi, When I need to make sense of a python exception, I often need to parse the string exception in order to retrieve the data. Example: try: print foo except NameError, e: print e.args symbol = e.args[0][17:-16] ==> ("NameError: name 'foo' is not defined", ) or try: (4).foo except Nam

Re: __builtins__ wreidness

2005-04-08 Thread Fredrik Lundh
Laszlo Zsolt Nagy wrote: > Given this module "test.py": > > print type(__builtins__) > > I ran into a wreid thing. > > Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32 > Type "help", "copyright", "credits" or "license" for more information. > >>> __builtins__ > > >>>

Thoughts on some stdlib modules

2005-04-08 Thread vegetax
I was messing around in google looking for the available python form validation modules when i found this: http://www.jorendorff.com/articles/python/path/, and i realized that is very similar to my python fileutils module,which encapsulate,path operations,file operations,etc. And those thoughts co

Re: doubt regarding Conversion of date into timestamp

2005-04-08 Thread Max M
praba kar wrote: Dear All, I am new to Python I want to know how to change a time into timestamp Is there any specific reason for not using datetime instead of time ? -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science -- http://mail.python.org/mailman/listinfo/python-list

Re: curious problem with large numbers

2005-04-08 Thread Dan Bishop
Chris Fonnesbeck wrote: > I have been developing a python module for Markov chain Monte Carlo > estimation, in which I frequently compare variable values with a very > large number, that I arbitrarily define as: > > inf = 1e1 Don't forget that you can write your own Infinity. (Warning: Buggy

changing from python2.3 to python2.4

2005-04-08 Thread Uwe Mayer
I've written a little application which uses the bang-line #!/usr/bin/python to call the interpreter. As python 2.4 comes distributed with other distroes this breaks my application as its modules are installed in /usr/local/lib/python2.3/site-packages/... and python2.4 does not look there. How d

doubt regarding Conversion of date into timestamp

2005-04-08 Thread praba kar
Dear All, I am new to Python I want to know how to change a time into timestamp eg "Fri, 8 Apr 2005 09:22:14 +0900" like format date I want to change as a timestamp. I have used below code to get timestamp import time time.strptime(v,'%a, %d %b %Y %X +0900') function. This function wil

Re: Grouping code by indentation - feature or ******?

2005-04-08 Thread Tim Tyler
I, Tim Tyler <[EMAIL PROTECTED]> wrote or quoted: > What do you guys think about Python's grouping of code via > indentation? Some relevant resources: http://c2.com/cgi/wiki?PythonWhiteSpaceDiscussion http://c2.com/cgi/wiki?IndentationEqualsGrouping http://c2.com/cgi/wiki?SyntacticallySignifica

__builtins__ wreidness

2005-04-08 Thread Laszlo Zsolt Nagy
Given this module "test.py": print type(__builtins__) I ran into a wreid thing. Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> __builtins__ >>> type(__builtins__) >>> import test >>> What

Problems On Path

2005-04-08 Thread andrea . gavana
Hello NG, yesterday I installed Python 2.4.1 (together with all the site-packages I need for it, including Pythonwin, wxPython, py2exe, etc...), but then I found that for some of my py2exe generated application there were some problems. So, I came back and I re-installed Python 2.3.4 as befo

Re: logging as root using python script

2005-04-08 Thread Paul Casteels
Raghul wrote: Hi Is it possible to login as a root in linux using python script? What I need is when I execute a script it should login as root and execute my command and logout from root to my existing account. IS is possible? Thanx in advance. Hi, You can compile the small .c program and setu

Re: Problems extracting attachment from email

2005-04-08 Thread Max M
foten wrote: The problem I'm having is when I'm trying to extract the attachement using f=open(Filename, "wb") f.write(msg.get_payload(decode=1)) f.close() Not the whole message is decoded and stored! When only trying f.write(msg.get_payload()) I see that the last 25

Re: Problems extracting attachment from email

2005-04-08 Thread foten
Lee Harr <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > On 2005-04-07, foten <[EMAIL PROTECTED]> wrote: > > The problem I'm having is when I'm trying to extract the > > attachement using > > f=open(Filename, "wb") > > f.write(msg.get_payload(decode=1)) > >

<    1   2