Re: Question regarding __new__

2007-03-23 Thread Gabriel Genellina
En Thu, 22 Mar 2007 13:19:52 -0300, Frank Benkstein <[EMAIL PROTECTED]> escribió: > Yet [1] says: "[...] some rules for __new__: [...] If you return an > object of a different class, its __init__ method will be called." That was true at that time (2.2 initial), but not now. See http://www.pyt

Re: Problem with time

2007-03-23 Thread ian
"Steve Holden" <[EMAIL PROTECTED]> a écrit dans le message de news: [EMAIL PROTECTED] > import time > import datetime > > dbtd = > h, m, s = time.localtime()[3:6] > timenow = s + (60 * (m + 60 * h)) Look like ok, thanks all :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Idiom for running compiled python scripts?

2007-03-23 Thread Gerard Flanagan
On Mar 23, 8:30 am, Mark <[EMAIL PROTECTED]> wrote: > > Of course I am not deleting the sources. In fact, I am also talking > about python scripts being called from shell scripts. There's a nice recipe in Python Cookbook (Martelli et al.) for this. It involves zipping your .pyc files and adding a

Re: How to receive a FILE* from Python under MinGW?

2007-03-23 Thread Gabriel Genellina
En Fri, 23 Mar 2007 01:47:22 -0300, John Pye <[EMAIL PROTECTED]> escribió: > On Mar 23, 3:33 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: >> import msvcrt >> fh = msvcrt.get_osfhandle(f.fileno()) > .. >> example.filetest(fh) >> f.close() > > Cool, that looks great, Gabriel. > > But is ther

Re: python on window

2007-03-23 Thread Gabriel Genellina
En Fri, 23 Mar 2007 04:25:52 -0300, sandeep patil <[EMAIL PROTECTED]> escribió: > i have install python on window xp os. > C:/program files/python > > i have done print program it working but .py can't working > help me to how i will execute this file this file where i will save > it. > path

Re: Making a non-root daemon process

2007-03-23 Thread Leo Kislov
On Mar 22, 11:19 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > Howdy all, > > For making a Python program calve off an independent daemon process of > itself, I found Carl J. Schroeder's recipe in the ASPN Python Cookbook. > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731> > > This is

Re: how can I invoke a Java code?

2007-03-23 Thread Laurent Pointal
momobear a écrit : > A friend of my write a Java program, and I want use it in my python > program as a module. I searched the topic in Google and find maybe the > better way is use GCJ to compile it. Is there any other way for me? > the simple and speediness choice the better. thanks. See my lin

Re: python on window

2007-03-23 Thread jwelby
On Mar 23, 7:25 am, "sandeep patil" <[EMAIL PROTECTED]> wrote: > i have install python on window xp os. > C:/program files/python > > i have done print program it working but .py can't working > help me to how i will execute this file this file where i will save > it. > path execution how . > te

Re: python on window

2007-03-23 Thread jwelby
That should have been: "You should be able edit your PYTHONPATH variable (should you need to)..." Gabiel is right, it's not usually required. -- http://mail.python.org/mailman/listinfo/python-list

Re: Making a non-root daemon process

2007-03-23 Thread Ben Finney
"Leo Kislov" <[EMAIL PROTECTED]> writes: > On Mar 22, 11:19 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > > The problem I'm having is that 'os.setsid()' fails with 'OSError: > > [Errno 1] Operation not permitted' unless I run the program as the > > root user. This isn't a program that I want necessa

Re: how can I invoke a Java code?

2007-03-23 Thread Jarek Zgoda
momobear napisał(a): > A friend of my write a Java program, and I want use it in my python > program as a module. I searched the topic in Google and find maybe the > better way is use GCJ to compile it. Is there any other way for me? > the simple and speediness choice the better. thanks. If the s

$1 download the newest pda software

2007-03-23 Thread downloadpda
Want access to 15000+ all the new pda applications? just $1 register for one account to download/buy applications in this site. http://handpedia.vicp.cc/ this is one-time email, thank your reading. -- http://mail.python.org/mailman/listinfo/python-list

Create new processes over telnet in XP

2007-03-23 Thread Godzilla
Hello, How do you create/spawn new processes in XP over telnet using python? I.e. I would like to create a new process and have it running in the background... when I terminate the telnet connection, I would what the spawned processes to keep running until I shut it off... I got the os.popen meth

Re: Need help to learn Python

2007-03-23 Thread Benjamin Hell
Hi! PythonBiter wrote: > I'm very new in this Group as well Python language. I want to learn > Python. So could you please advice me, and guide me how can i become > master in Python ! If you are new to programming in general, too, the "Non-Programmer's Tutorial for Python" is a good start: http

Re: Making GIF image twice the size - in memory

2007-03-23 Thread Michele Petrazzo
Miki wrote: > Hello All, > Heelo, > I get an image from a web page (via urlopen), and like to make it > twice the size. <-cut-> > However I don't get a valid GIF image. > Your code work well here! Why you said that the string are invalid? --code: test_image_double.py from urllib import ur

"finally" for unit test

2007-03-23 Thread killkolor
hi! I have a unittest framework that tests a single function that in turn works with files (takes input and outputs in the same file, no return values). In the unittest class I assign a member with all the names of my testfiles and a testdirectory. The tests call the function (which opens and writ

Re: Idiom for running compiled python scripts?

2007-03-23 Thread Steven D'Aprano
On Fri, 23 Mar 2007 07:30:58 +, Mark wrote: > On Fri, 23 Mar 2007 14:03:12 +1100, Steven D'Aprano wrote: >> Since you've done these tests already, perhaps you can tell us what gain >> you actually got? > > About the same as you, ~20 msecs for my small script samples. Well, I think that prett

Re: "finally" for unit test

2007-03-23 Thread Steven D'Aprano
On Fri, 23 Mar 2007 04:18:59 -0700, killkolor wrote: > The problem now is that after each testrun I have to copy "fresh" files > into the testdirectory, since of course the function already run on all > the files and made the changes. So I implemented a buffering in the > unittest functions: buffe

Re: Been a while...

2007-03-23 Thread Paul Boddie
On 22 Mar, 16:34, John Salerno <[EMAIL PROTECTED]> wrote: > Hi guys. It's been a while since I've used Python, so I got a little > rusty, but I really want to start using it again, just out of habit and > for fun. Can anyone suggest a book or a website with little projects I > could work on to keep

Re: Create new processes over telnet in XP

2007-03-23 Thread rishi pathak
You could use pexpect module. Open a telnet session Then run the script in nohup mode It's assumed that the binary is available over there On 23 Mar 2007 03:47:14 -0700, Godzilla <[EMAIL PROTECTED]> wrote: Hello, How do you create/spawn new processes in XP over telnet using python? I.e. I woul

Re: "finally" for unit test

2007-03-23 Thread Peter Otten
killkolor wrote: > I have a unittest framework that tests a single function that in turn > works with files (takes input and outputs in the same file, no return > values). > In the unittest class I assign a member with all the names of my > testfiles and a testdirectory. The tests call the functio

Re: Help controlling CDROM from python

2007-03-23 Thread R. Bernstein
If you want an OS neutral way one may be able to use pycdio from the Cheese shop. It requires libcdio to be installed and that sometimes the case if you have a free media player (like vlc or xine, or mplayer) installed. I don't really use it all that often so I can't vouch for how good it is. (Al

Re: "finally" for unit test

2007-03-23 Thread Duncan Booth
"killkolor" <[EMAIL PROTECTED]> wrote: > I have a unittest framework that tests a single function that in turn > works with files (takes input and outputs in the same file, no return > values). I would want to split that function into two: a) one which does the processing, but not working with a

Re: Idiom for running compiled python scripts?

2007-03-23 Thread mark
On Fri, 23 Mar 2007 22:24:07 +1100, Steven D'Aprano wrote: > if not os.path.exists(compiledname) or \ os.stat(compiledname)[MT] < > os.stat(scriptname)[MT]: > # compiled file doesn't exist, or is too old Surely the validity check done by Python is more sophisticated than this? Does

Cleanly exiting multi thread application on SIGINT

2007-03-23 Thread jrpfinch
Is the following the most elegant way to exit a multi-threaded application on a Ctrl-C? I am a complete beginner and would have thought there was some way of doing it without having to use while 1: pass, but have yet to find a way. N.B. exit() is a method for cleanly exiting the thread using a qu

Re: On Java's Interface (the meaning of interface in computer programing)

2007-03-23 Thread Lew
Sherm Pendley wrote: > Lew <[EMAIL PROTECTED]> writes: > >> Jim Burton wrote: >>> Or you could stop feeding the trolls. >> Does not apply. The OP was not being trollish > > You obviously don't know Xah. He's been doing this for years, cross- > posting to various language groups trying to start an

Re: How to receive a FILE* from Python under MinGW?

2007-03-23 Thread John Pye
On Mar 23, 7:48 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > And replace all places where a Python file goes into a C extension, with > exportable_file(f) What about calling mscvrt_get_osfhandle from inside the SWIG wrapper? I tried this but it seemed that the function was not exported t

Re: "finally" for unit test

2007-03-23 Thread killkolor
I went with the TestCase.setUp() function. Thanks a lot! -- http://mail.python.org/mailman/listinfo/python-list

Re: Need help to learn Python

2007-03-23 Thread Graeme Glass
Online Docs, and Core Python Programming fits the bill! (http:// starship.python.net/crew/wesc/cpp/) -- http://mail.python.org/mailman/listinfo/python-list

Catching an unknown error

2007-03-23 Thread Harlin Seritt
Using the code below: ---BEGIN CODE--- value = raw_input("Type a divisor: ") try: value = int(value) print "42 / %d = %d" % (value, 42/value) except ValueError: print "I can't convert the value to an integer" except ZeroDivisionError: print "Your value should not be zero" ex

Re: Need help to learn Python

2007-03-23 Thread kyosohma
On Mar 23, 12:03 am, "PythonBiter" <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I'm very new in this Group as well Python language. I want to learn > Python. So could you please advice me, and guide me how can i become > master in Python ! > > Thanks, > Partha If you need books for a beginner in

Re: Catching an unknown error

2007-03-23 Thread kyosohma
On Mar 23, 8:16 am, "Harlin Seritt" <[EMAIL PROTECTED]> wrote: > Using the code below: > > ---BEGIN CODE--- > > value = raw_input("Type a divisor: ") > try: >value = int(value) >print "42 / %d = %d" % (value, 42/value) > except ValueError: > print "I can't convert the value to an in

Re: Catching an unknown error

2007-03-23 Thread Fredrik Lundh
Harlin Seritt wrote: > In the last 'except' block, how can I print out the particular error > name even though one is not specifically named? the sys.exc_info() function returns information about the current exception. see: http://effbot.org/pyref/sys.exc_info -- http://mail.python.or

Re: Catching an unknown error

2007-03-23 Thread kyosohma
On Mar 23, 8:29 am, [EMAIL PROTECTED] wrote: > On Mar 23, 8:16 am, "Harlin Seritt" <[EMAIL PROTECTED]> wrote: > > > > > Using the code below: > > > ---BEGIN CODE--- > > > value = raw_input("Type a divisor: ") > > try: > >value = int(value) > >print "42 / %d = %d" % (value, 42/value) > > exc

Re: Catching an unknown error

2007-03-23 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Make the last 'except' block like this: > > Except Exception, e: > print e while that's good enough for the given example, it's not good enough for the general case (in contemporary Python, exceptions don't have to inherit from the Exception class). -- http://m

Re: Cleanly exiting multi thread application on SIGINT

2007-03-23 Thread Fredrik Lundh
"jrpfinch" wrote: > Is the following the most elegant way to exit a multi-threaded > application on a Ctrl-C? I am a complete beginner and would have > thought there was some way of doing it without having to use while 1: > pass, but have yet to find a way. > def main: >wt = workerThread() >

Re: Catching an unknown error

2007-03-23 Thread kyosohma
On Mar 23, 8:16 am, "Harlin Seritt" <[EMAIL PROTECTED]> wrote: > Using the code below: > > ---BEGIN CODE--- > > value = raw_input("Type a divisor: ") > try: >value = int(value) >print "42 / %d = %d" % (value, 42/value) > except ValueError: > print "I can't convert the value to an in

Re: Need help to learn Python

2007-03-23 Thread Tina I
PythonBiter wrote: > Hi everyone, > > I'm very new in this Group as well Python language. I want to learn > Python. So could you please advice me, and guide me how can i become > master in Python ! > > > Thanks, > Partha > Lots of great resources for beginners: http://wiki.python.org/moin/Begi

Re: Idiom for running compiled python scripts?

2007-03-23 Thread Steven D'Aprano
On Fri, 23 Mar 2007 12:22:44 +, mark wrote: > On Fri, 23 Mar 2007 22:24:07 +1100, Steven D'Aprano wrote: >> if not os.path.exists(compiledname) or \ os.stat(compiledname)[MT] < >> os.stat(scriptname)[MT]: >> # compiled file doesn't exist, or is too old > > Surely the validity

Re: Catching an unknown error

2007-03-23 Thread Harlin Seritt
On Mar 23, 9:42 am, [EMAIL PROTECTED] wrote: > On Mar 23, 8:16 am, "Harlin Seritt" <[EMAIL PROTECTED]> wrote: > > > > > Using the code below: > > > ---BEGIN CODE--- > > > value = raw_input("Type a divisor: ") > > try: > >value = int(value) > >print "42 / %d = %d" % (value, 42/value) > > exc

Re: Create new processes over telnet in XP

2007-03-23 Thread Rob Wolfe
Godzilla wrote: > Hello, > > How do you create/spawn new processes in XP over telnet using python? > I.e. I would like to create a new process and have it running in the > background... when I terminate the telnet connection, I would what the > spawned processes to keep running until I shut it off

Re: "finally" for unit test

2007-03-23 Thread skip
gabriel> Is there something like a finally for unittest functions? TestCase instances have setUp() and tearDown() methods: http://docs.python.org/dev/lib/testcase-objects.html Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: Catching an unknown error

2007-03-23 Thread skip
Harlin> value = raw_input("Type a divisor: ") Harlin> try: Harlin>value = int(value) Harlin>print "42 / %d = %d" % (value, 42/value) Harlin> except ValueError: Harlin> print "I can't convert the value to an integer" Harlin> except ZeroDivisionError: Harl

Re: Cleanly exiting multi thread application on SIGINT

2007-03-23 Thread skip
Jon> Is the following the most elegant way to exit a multi-threaded Jon> application on a Ctrl-C? I am a complete beginner and would have Jon> thought there was some way of doing it without having to use while Jon> 1: pass, but have yet to find a way. I thought there was some sor

Re: Wikipedia and a little piece of Python History

2007-03-23 Thread Jorgen Grahn
On 21 Mar 2007 12:18:50 -0700, Paddy <[EMAIL PROTECTED]> wrote: > I just had a link to Tim peters first post on doctest: > http://groups.google.com/group/comp.lang.python/msg/1c57cfb7b3772763 > removed from http://en.wikipedia.org/wiki/Doctest as it doesn't fit > their guidelines for external links

Exception passing

2007-03-23 Thread Thomas Dybdahl Ahle
Hi, I have a function, which looks like the following: connecting = False def func (): global connecting connecting = True try: # Do lot of network stuff except Exception, e: connecting = False raise e This works quite good, but it is a hell to debug. Instea

Re: Exception passing

2007-03-23 Thread kyosohma
On Mar 23, 9:29 am, Thomas Dybdahl Ahle <[EMAIL PROTECTED]> wrote: > Hi, I have a function, which looks like the following: > > connecting = False > def func (): > global connecting > connecting = True > try: ># Do lot of network stuff > except Exception, e: > connec

Re: Exception passing

2007-03-23 Thread Alex Martelli
Thomas Dybdahl Ahle <[EMAIL PROTECTED]> wrote: > Hi, I have a function, which looks like the following: > > connecting = False > def func (): > global connecting > connecting = True > try: ># Do lot of network stuff > except Exception, e: > connecting = False >

Re: Create new processes over telnet in XP

2007-03-23 Thread Jorgen Grahn
On 23 Mar 2007 03:47:14 -0700, Godzilla <[EMAIL PROTECTED]> wrote: > Hello, > > How do you create/spawn new processes in XP over telnet using python? > I.e. I would like to create a new process and have it running in the > background... Ssh -- or even rsh -- are better choices than telnet for thes

Re: Idiom for running compiled python scripts?

2007-03-23 Thread Alex Martelli
Mark <[EMAIL PROTECTED]> wrote: ... > so I could just do a "python_compile_and_run myscript.py" and it would > do what I want, i.e. run myscript.pyc if available and valid, generate > and run it if necessary. You can use python -c 'import myscript; myscript.main()' and variations thereon. A

Re: "finally" for unit test

2007-03-23 Thread Jorgen Grahn
On 23 Mar 2007 12:19:15 GMT, Duncan Booth <[EMAIL PROTECTED]> wrote: > "killkolor" <[EMAIL PROTECTED]> wrote: > >> I have a unittest framework that tests a single function that in turn >> works with files (takes input and outputs in the same file, no return >> values). > > I would want to split tha

Re: Exception passing

2007-03-23 Thread Thomas Dybdahl Ahle
Den Fri, 23 Mar 2007 07:38:47 -0700 skrev Alex Martelli: > Thomas Dybdahl Ahle <[EMAIL PROTECTED]> wrote: >> This works quite good, but it is a hell to debug. Instead of getting a >> log message to the line which originally raised the exception. > As you see, the traceback is "maintained" when y

Re: Mocking OpenOffice in python?

2007-03-23 Thread Gerrit Muller
Méta-MCI schreef: > Hi! > > > Under windows, I drive OOo, from Python, via COM/OLE-automation. > > It's run OK, but some bugs, in the OOo-COM-Python, had stop my > devloppements... > > However, this way is usable (only on Win, ok?) > Do you have some (small) example program of using OOo from

Re: why brackets & commas in func calls can't be ommited? (maybe it could be PEP?)

2007-03-23 Thread Jorgen Grahn
On Thu, 22 Mar 2007 14:20:42 -0400, Steve Holden <[EMAIL PROTECTED]> wrote: ... > I'm in danger of getting short-tempered on c.l.py for the first time in > a long time. If you think that five arguments is an excessive number for > a function then you live in a world of toy programs. Or at least

Re: "finally" for unit test

2007-03-23 Thread Duncan Booth
Jorgen Grahn <[EMAIL PROTECTED]> wrote: > On 23 Mar 2007 12:19:15 GMT, Duncan Booth > <[EMAIL PROTECTED]> wrote: >> "killkolor" <[EMAIL PROTECTED]> wrote: >> >>> I have a unittest framework that tests a single function that in >>> turn works with files (takes input and outputs in the same file, n

How to list current line in pdb?

2007-03-23 Thread Chris Lasher
Hi all, Using the pdb shell, after repeatedly entering 'l' (lowercase 'L'), how do I jump back to listing the current line again if I don't remember exactly what line my current line is? Do I just have to list an early line in the code and repeatedly list from there until I see the '->' indicating

Re: fine grain logging cotrol

2007-03-23 Thread Eric S. Johansson
Peter Otten wrote: > Eric S. Johansson wrote: > > [in private mail -- please don't, Eric] sorry. my preference is for private mail. it's my way of trying to be kind to others by reducing list clutter. > I don't understand. The logging package detects the function name without > user intervent

Re: How to list current line in pdb?

2007-03-23 Thread Duncan Booth
"Chris Lasher" <[EMAIL PROTECTED]> wrote: > Using the pdb shell, after repeatedly entering 'l' (lowercase 'L'), > how do I jump back to listing the current line again if I don't > remember exactly what line my current line is? Do I just have to list > an early line in the code and repeatedly list

Re: GCC 4.1.2 installer for Python distutils compilation

2007-03-23 Thread David Rushby
On Mar 18, 6:22 pm, Giovanni Bajo <[EMAIL PROTECTED]> wrote: > On 18/03/2007 13.24, DavidRushbywrote: > > > Even though I have access to MSVC 7.1, so I don't really need MinGW > > myself, [...] > > But remember that GCC 4.1.2 is almost 4 years newer than MSVC 7.1, and > I found it to produce more o

Re: Wikipedia and a little piece of Python History

2007-03-23 Thread Paul Rubin
Jorgen Grahn <[EMAIL PROTECTED]> writes: > Wikipedia should have some guideline for referencing Usenet postings, > somewhere ... It has one (WP:RS). The guideline is don't do it. The problem is that these guidelines arise out of disputes, i.e. maybe someone tried to use a Usenet post to prove so

Re: Been a while...

2007-03-23 Thread Erik Johnson
"James Stroud" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hawk this list and try to pick off easy answers before anyone else. > That's what I do. The pressure is to be right, because if you're not, > you hear about it in a hurry. That is actually an excellent suggestion.

Multi-line strings with formatting

2007-03-23 Thread [EMAIL PROTECTED]
When constructing a particularly long and complicated command to be sent to the shell, I usually do something like this, to make the command as easy as possible to follow: commands.getoutput( 'mycommand -S %d -T %d ' % (s_switch, t_switch) + '-f1 %s -f2 %s ' % (filename1, filenam

Re: Multi-line strings with formatting

2007-03-23 Thread Carsten Haese
On Fri, 2007-03-23 at 09:54 -0700, [EMAIL PROTECTED] wrote: > When constructing a particularly long and complicated command to be > sent to the shell, I usually do something like this, to make the > command as easy as possible to follow: > > commands.getoutput( > 'mycommand -S %d -T %d ' % (s_

detect suprocess interaction

2007-03-23 Thread Robin Becker
I'm using subprocess to carry out svn commands (probably should use the svn api package, but that's a dependency too far). Anyhow my code looks like from subprocess import Popen, PIPE p = Popen((svn,'ls',u),stdout=PIPE,stderr=PIPE) i = p.wait() and this sort of thing works well under most circum

Compiler-AST-Walk-Visitor: Any Examples or Documentation?

2007-03-23 Thread Efrat Regev
Hello, I'm trying to write something that will translate Python code to pseudo-code (for teaching purposes). Googling around indicated that the compiler module is pertinent, especially creating a visitor to walk the generated AST: http://docs.python.org/lib/module-compiler.html

Re: fine grain logging cotrol

2007-03-23 Thread Peter Otten
Eric S. Johansson wrote: > Peter Otten wrote: >> Eric S. Johansson wrote: >> >> [in private mail -- please don't, Eric] > > sorry. my preference is for private mail. it's my way of trying to be > kind to others by reducing list clutter. It is not list clutter in my book; it gives others the c

exit to interpreter?

2007-03-23 Thread belinda thom
Hi, I'm writing a function that polls the user for keyboard input, looping until it has determined that the user has entered a valid string of characters, in which case it returns that string so it can be processed up the call stack. My problem is this. I'd also like it to handle a special

Re: How to list current line in pdb?

2007-03-23 Thread Chris Lasher
On Mar 23, 11:56 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > "Chris Lasher" <[EMAIL PROTECTED]> wrote: > > Using the pdb shell, after repeatedly entering 'l' (lowercase 'L'), > > how do I jump back to listing the current line again if I don't > > remember exactly what line my current line is? Do

Re: "finally" for unit test

2007-03-23 Thread 7stud
On Mar 23, 5:18 am, "killkolor" <[EMAIL PROTECTED]> wrote: > I have .. a single function that .. > works with files (takes input and outputs in the same file, no return > values). That function could cause problems. If your function reads in the whole file, modifies the data, and then overwrites

Re: exit to interpreter?

2007-03-23 Thread kyosohma
On Mar 23, 12:52 pm, belinda thom <[EMAIL PROTECTED]> wrote: > Hi, > > I'm writing a function that polls the user for keyboard input, > looping until it has determined that the user has entered a valid > string of characters, in which case it returns that string so it can > be processed up the call

Re: exit to interpreter?

2007-03-23 Thread belinda thom
On Mar 23, 2007, at 11:04 AM, [EMAIL PROTECTED] wrote: > On Mar 23, 12:52 pm, belinda thom <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I'm writing a function that polls the user for keyboard input, >> looping until it has determined that the user has entered a valid >> string of characters, in which

Re: On Java's Interface (the meaning of interface in computer programing)

2007-03-23 Thread John W. Kennedy
Lew wrote: > But if Xah were being trollish, why didn't they jump on my response and > call me names? I'm not sure he's a proper troll. Unfortunately, he seems to be the kind of person who thinks that reading "Java for Dummies" makes one a self-sufficient expert on Java and philosopher of progr

Re: Multi-line strings with formatting

2007-03-23 Thread Steve Holden
Carsten Haese wrote: > On Fri, 2007-03-23 at 09:54 -0700, [EMAIL PROTECTED] wrote: >> When constructing a particularly long and complicated command to be >> sent to the shell, I usually do something like this, to make the >> command as easy as possible to follow: >> >> commands.getoutput( >> 'm

Re: #!/usr/bin/env python > 2.4?

2007-03-23 Thread Jon Ribbens
In article <[EMAIL PROTECTED]>, Gabriel Genellina wrote: > Uh... I never thought it was an implied formula there - that F0 had to > come from 1.5 = 15 = 0xF. > I think it should be stated much more clearly. I'm not sure what you're saying. You are correct that the documentation is rather vague.

Re: Still the __new__ hell ...

2007-03-23 Thread Paulo da Silva
Gabriel Genellina escreveu: > En Wed, 21 Mar 2007 07:51:32 -0300, Bruno Desthuilliers > <[EMAIL PROTECTED]> escribió: > >> Paulo da Silva a écrit : >>> As a relatively inexperient >>> in python, how could I know that a 'string' is an instance of >>> basestring? >> >> By reading this newsgroup ?-)

Join strings - very simple Q.

2007-03-23 Thread Paulo da Silva
Hi! I was told in this NG that string is obsolet. I should use str methods. So, how do I join a list of strings delimited by a given char, let's say ','? Old way: l=['a','b','c'] jl=string.join(l,',') New way? Thanks Paulo -- http://mail.python.org/mailman/listinfo/python-list

Re: Join strings - very simple Q.

2007-03-23 Thread Paul Rudin
Paulo da Silva <[EMAIL PROTECTED]> writes: > Hi! > > I was told in this NG that string is obsolet. I should use > str methods. > > So, how do I join a list of strings delimited by a given > char, let's say ','? > > Old way: > > l=['a','b','c'] > jl=string.join(l,',') > > New way? Dunno if it's th

Re: Join strings - very simple Q.

2007-03-23 Thread Mike Kent
On Mar 23, 2:37 pm, Paulo da Silva <[EMAIL PROTECTED]> wrote: > Hi! > > I was told in this NG that string is obsolet. I should use > str methods. > > So, how do I join a list of strings delimited by a given > char, let's say ','? > > Old way: > > l=['a','b','c'] > jl=string.join(l,',') > > New way?

Re: Join strings - very simple Q.

2007-03-23 Thread Paul Rudin
Paul Rudin <[EMAIL PROTECTED]> writes: > Paulo da Silva <[EMAIL PROTECTED]> writes: > >> Hi! >> >> I was told in this NG that string is obsolet. I should use >> str methods. >> >> So, how do I join a list of strings delimited by a given >> char, let's say ','? >> >> Old way: >> >> l=['a','b','c']

Re: Join strings - very simple Q.

2007-03-23 Thread Daniel Nogradi
> > I was told in this NG that string is obsolet. I should use > > str methods. > > > > So, how do I join a list of strings delimited by a given > > char, let's say ','? > > > > Old way: > > > > l=['a','b','c'] > > jl=string.join(l,',') > > > > New way? > > Dunno if it's the "new way", but you can

Re: How to receive a FILE* from Python under MinGW?

2007-03-23 Thread Gabriel Genellina
En Fri, 23 Mar 2007 10:07:30 -0300, John Pye <[EMAIL PROTECTED]> escribió: > On Mar 23, 7:48 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: >> >> And replace all places where a Python file goes into a C extension, with >> exportable_file(f) > > What about calling mscvrt_get_osfhandle from in

ECCOMAS Thematic Conference VipIMAGE 2007 - Last Call for Papers

2007-03-23 Thread [EMAIL PROTECTED]
- (Apologies for cross-posting) International ECCOMAS Thematic Conference VipIMAGE 2007 - I ECCOMAS THEMATIC CONFERENCE ON COMPUTATIONAL VISION AND MEDICAL I

Re: Join strings - very simple Q.

2007-03-23 Thread Paulo da Silva
Mike Kent escreveu: ... > New way: > l=['a','b','c'] > jl=','.join(l) > I thank you all. Almost there ... I tried "".join(l,',') but no success ... :-( Paulo -- http://mail.python.org/mailman/listinfo/python-list

Re: How to receive a FILE* from Python under MinGW?

2007-03-23 Thread Gabriel Genellina
En Fri, 23 Mar 2007 16:34:22 -0300, Gabriel Genellina <[EMAIL PROTECTED]> escribió: >> What about calling mscvrt_get_osfhandle from inside the SWIG wrapper? >> I tried this but it seemed that the function was not exported to the >> DLL. > > The idea is to separate both worlds - _get_osfhandle mu

Re: exit to interpreter?

2007-03-23 Thread Mel Wilson
belinda thom wrote: > On Mar 23, 2007, at 11:04 AM, [EMAIL PROTECTED] wrote: > >> On Mar 23, 12:52 pm, belinda thom <[EMAIL PROTECTED]> wrote: >>> Hi, >>> >>> I'm writing a function that polls the user for keyboard input, >>> looping until it has determined that the user has entered a valid >>> st

Re: exit to interpreter?

2007-03-23 Thread kyosohma
On Mar 23, 1:20 pm, belinda thom <[EMAIL PROTECTED]> wrote: > On Mar 23, 2007, at 11:04 AM, [EMAIL PROTECTED] wrote: > > > > > On Mar 23, 12:52 pm, belinda thom <[EMAIL PROTECTED]> wrote: > >> Hi, > > >> I'm writing a function that polls the user for keyboard input, > >> looping until it has determ

Using Python to start SNMP service on remote XP hosts...

2007-03-23 Thread KDawg44
Hi, I am very new to Python and really just began studying and using it. I read that it was relatively easy to interact with Windows machines with Python and I am desperately looking for something to replace VBScript (not a big fan). I am currently deploying a Gentoo Linux SNMP server running Cac

Re: Join strings - very simple Q.

2007-03-23 Thread John Machin
On Mar 24, 5:37 am, Paulo da Silva <[EMAIL PROTECTED]> wrote: > Hi! > > I was told in this NG that string is obsolet. I should use > str methods. > > So, how do I join a list of strings delimited by a given > char, let's say ','? > > Old way: > > l=['a','b','c'] > jl=string.join(l,',') > > New way?

Re: Using Python to start SNMP service on remote XP hosts...

2007-03-23 Thread kyosohma
On Mar 23, 2:51 pm, "KDawg44" <[EMAIL PROTECTED]> wrote: > Hi, > > I am very new to Python and really just began studying and using it. > I read that it was relatively easy to interact with Windows machines > with Python and I am desperately looking for something to replace > VBScript (not a big fa

Re: Create new processes over telnet in XP

2007-03-23 Thread Laurent Pointal
Jorgen Grahn wrote: > On 23 Mar 2007 03:47:14 -0700, Godzilla <[EMAIL PROTECTED]> wrote: >> Hello, >> >> How do you create/spawn new processes in XP over telnet using python? >> I.e. I would like to create a new process and have it running in the >> background... > > Ssh -- or even rsh -- are bet

Python object overhead?

2007-03-23 Thread Matt Garman
I'm trying to use Python to work with large pipe ('|') delimited data files. The files range in size from 25 MB to 200 MB. Since each line corresponds to a record, what I'm trying to do is create an object from each record. However, it seems that doing this causes the memory overhead to go up tw

ANN: wxPython 2.8.3.0

2007-03-23 Thread Robin Dunn
Announcing -- The 2.8.3.0 release of wxPython is now available for download at http://wxpython.org/download.php. This release includes a number of bug fixes and also some new enhancements, including updates to the XRCed tool and the new InspectionTool. Source code is available, as well a

Re: Python object overhead?

2007-03-23 Thread Mark Nenadov
On Fri, 23 Mar 2007 15:11:35 -0600, Matt Garman wrote: > > Is this "just the way it is" or am I overlooking something obvious? > Matt, If you iterate over even the smallest object instantiation a large amount of times, it will be costly compared to a simple list append. I don't think you ca

Re: Create new processes over telnet in XP

2007-03-23 Thread Shane Geiger
This reminds me of something I once wanted to do: How can I install Python in a totally non-gui way on Windows (without the use of VNC)? I think I was telnetted into a computer (or something like that) and I was unable to run the usual Python installer because it uses a GUI. Laurent Poin

Re: Python object overhead?

2007-03-23 Thread Jack Diederich
On Fri, Mar 23, 2007 at 03:11:35PM -0600, Matt Garman wrote: > I'm trying to use Python to work with large pipe ('|') delimited data > files. The files range in size from 25 MB to 200 MB. > > Since each line corresponds to a record, what I'm trying to do is > create an object from each record. H

Re: Python object overhead?

2007-03-23 Thread Gabriel Genellina
En Fri, 23 Mar 2007 18:27:25 -0300, Mark Nenadov <[EMAIL PROTECTED]> escribió: > I'd suggest doing the following instead of that while loop: > > for line in open(sys.argv[1]).xreadlines(): Poor xreadlines method had a short life: it was born on Python 2.1 and got deprecated on 2.3 :( A file i

Re: Python object overhead?

2007-03-23 Thread Gabriel Genellina
En Fri, 23 Mar 2007 18:11:35 -0300, Matt Garman <[EMAIL PROTECTED]> escribió: > Example 2: read lines into objects: > # begin readobjects.py > import sys, time > class FileRecord: > def __init__(self, line): > self.line = line > records = list() > file = open(sys.argv[1]) > while Tru

On text processing

2007-03-23 Thread Daniel Nogradi
Hi list, I'm in a process of rewriting a bash/awk/sed script -- that grew to big -- in python. I can rewrite it in a simple line-by-line way but that results in ugly python code and I'm sure there is a simple pythonic way. The bash script processed text files of the form: ###

Re: On Java's Interface (the meaning of interface in computer programing)

2007-03-23 Thread Sherm Pendley
Lew <[EMAIL PROTECTED]> writes: > But if Xah were being trollish, why didn't they jump on my response > and call me names? Xah never replies to the threads he starts. At least, I've never known him to do so. > I still think that analysis of the original post is a useful exercise > to learn Java.

Re: fine grain logging cotrol

2007-03-23 Thread Eric S. Johansson
Peter Otten wrote: > Eric S. Johansson wrote: > > Here is yet another revision of my example then: it's making more and more sense although I don't quite follow 'property' quite yet. But I see that get_logger is invoked prior to the __logger.info call. I was looking at how to implement one of

  1   2   >