Re: Making programs work together.

2005-08-16 Thread Peter Otten
[EMAIL PROTECTED] wrote: > Example: I'm driving a car in a game and I hit an oil slick so instead > of me having to lift off the throttle button on the keyboard, I want to > make a program to disengage the throttle as long as I'm on that oil > slick. Does that clear anything up? Yes. Here's how

Embedding Python in C, undefined symbol: PyExc_FloatingPointError

2005-08-16 Thread Simon Newton
Hi, I've just starting out embedding Python in C and get the following error when I try and import a module that in turn imports the math module. ImportError: /usr/lib/python2.4/lib-dynload/math.so: undefined symbol: PyExc_FloatingPointError The module is as follows: # begin script.py import ma

Re: Making programs work together.

2005-08-16 Thread ChuckDubya
Example: I'm driving a car in a game and I hit an oil slick so instead of me having to lift off the throttle button on the keyboard, I want to make a program to disengage the throttle as long as I'm on that oil slick. Does that clear anything up? -- http://mail.python.org/mailman/listinfo/python

Re: keeping a ref to a non-member function in a class

2005-08-16 Thread Peter Otten
Gregory Bond wrote: > Thanks Peter, that's a big help. You're welcome. > I can solve my problem now, but I'm chasing this further in the name of > education, because it seems there is some deep magic happening here that > I don't understand. Python resorts to deep magic only when it's inevitabl

Re: Making programs work together.

2005-08-16 Thread Bengt Richter
On 16 Aug 2005 22:30:51 -0700, [EMAIL PROTECTED] wrote: >I'm looking to make what's basically a macro for a computer game. But >I want this "macro" to take information from the game itself, so it's >not really a macro. > >How do I access the data from my game to use in a program? > How do I acces

Making programs work together.

2005-08-16 Thread ChuckDubya
I'm looking to make what's basically a macro for a computer game. But I want this "macro" to take information from the game itself, so it's not really a macro. How do I access the data from my game to use in a program? -- http://mail.python.org/mailman/listinfo/python-list

Re: base64.encode and decode not correct

2005-08-16 Thread Damir Hakimov
Damir b wrote: >Hi *! > >I found a strange bug in base64.encode and decode, when I try to encode >- decode a file 1728512 bytes lenth. >Is somebody meet with this? I don't attach the file because it big, but >can send to private. > >Which solution for transfer file (binary data) via string-only

Re: How to obtain GMT offset?

2005-08-16 Thread Erik Max Francis
Bengt Richter wrote: > > time.timezone gives you the timezone offset in minutes. > > ITYM seconds? I sure did. But at least minutes is a more entertaining answer. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis

Re: get the return code when piping something to a python script?

2005-08-16 Thread Jeff Schwab
mhenry1384 wrote: > On WinXP, I am doing this > > nant.exe | python MyFilter.py > > This command always returns 0 (success) because MyFilter.py always > succeeds. ... > How do I set the return code from MyFilter.py based on the return of > nant.exe? Is this possible? I have googled around for

Sep 9 is the last day for reduced rates for OOPSLA 2005

2005-08-16 Thread Gail E. Harris
OOPSLA 2005 is being held in San Diego, Oct 16 to 20. Invited speakers include: Robert Hass, Martin Fowler, Gerald Jay Sussman Grady Booch, Jimmy Wales, Mary Beth Rosson, David P. Reed The conference features 29 research papers, 58 tutorials by leaders in their fields, 23 Workshops,

Re: open links in a html page

2005-08-16 Thread Mike Meyer
"Ajar" <[EMAIL PROTECTED]> writes: > Hi, > > Using urllib2,ClinetForm and ClinetCookie modules I have logged into my > ISPs web site and managed to fetch the first page. Now, on this page > there is this link: > > Service > Records > > I need to click this link from python code. How do I do it? ch

Re: Library vs Framework

2005-08-16 Thread Peter Decker
On 8/16/05, Mike Meyer <[EMAIL PROTECTED]> wrote: > Well, they may have created a library class that does the job for > them. Figuring out which is which seemed to be the point of this > thread. I guess my summary of the thread was that a library is built to do one thing, while a framework is bui

Re: Library vs Framework

2005-08-16 Thread Mike Meyer
Peter Decker <[EMAIL PROTECTED]> writes: > I've written several apps that need to update a database, and each one > had to do the same things: connect, grab data, create controls to > display/edit that data, validate any changes and then stuff the edited > data back into the database. I started pl

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope'or 'module' better?)

2005-08-16 Thread Bengt Richter
On Tue, 16 Aug 2005 19:24:04 -0400, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > >"Bengt Richter" <[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] >> IOW, "...open the box and find the i'th item /in/ the box..." is not >> really >> finding the i'th item _itself_ "/in/" the box. It is f

Re: How can I exclude a word by using re?

2005-08-16 Thread could ildg
Thanks for all of you~ I made it. Pyparsing is really nice. On 16 Aug 2005 11:33:48 -0700, Paul McGuire <[EMAIL PROTECTED]> wrote: > I just reviewed what the re "\s" signifies: whitespace. This is easy, > pyparsing ignores all intervening whitespace by default. So mp3Entry > simplfies to: > > m

Re: keeping a ref to a non-member function in a class

2005-08-16 Thread Gregory Bond
Peter Otten wrote: > > You are on the right track with staticmethod, but you have to apply it to > fn: > > ... fn = staticmethod(foo) Thanks Peter, that's a big help. I can solve my problem now, but I'm chasing this further in the name of education, because it seems there is some deep ma

Re: __del__ pattern?

2005-08-16 Thread Michael Hudson
[EMAIL PROTECTED] writes: > Chris Curvey wrote: >> I need to ensure that there is only one instance of my python class on >> my machine at a given time. (Not within an interpreter -- that would >> just be a singleton -- but on the machine.) These instances are >> created and destroyed, but there

Re: List copying idiom was Re: [Python-Dev] implementation of copy standard lib

2005-08-16 Thread John Machin
Tom Anderson wrote: > > When you say [:], do you mean that you copy lists like this: > > l = someList() > m = [] > m[:] = l > > ? Why not m = L[:] instead of m = []; m[:] = L ??? > > That's what i've been doing. The other day, i realised that i could just > do: > > l = someList() > m = list

FW: List copying idiom was Re: [Python-Dev] implementation of copystandard lib

2005-08-16 Thread Delaney, Timothy (Tim)
Tom Anderson wrote: > When you say [:], do you mean that you copy lists like this: > > l = someList() > m = [] > m[:] = l Forwarded to python-list, where it belongs. The idiom is actually: a = [1, 2, 3] b = a[:] Tim Delaney -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows message pump problems

2005-08-16 Thread Neil Hodgson
Cantankerous Old Git: > Problem 1: > If I have another thread call DestroyWindow after a delay, it gets an > error "permission denied". I really can't see why. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/wind

List copying idiom was Re: [Python-Dev] implementation of copy standard lib

2005-08-16 Thread Tom Anderson
On Tue, 16 Aug 2005, Ron Adam wrote: > Simon Brunning wrote: > >> On 8/14/05, Martijn Brouwer <[EMAIL PROTECTED]> wrote: >> >>> I can imagine that *a lot* of libs/scripts use the copy library, >> >> I think that copy is very rarely used. I don't think I've ever imported it. > > I use copy.deepco

Urgent: Embedding Python problems - advice sought

2005-08-16 Thread adsheehan
Hi, I am embedding Python into a multi-threaded C++ application running on Solaris and need urgent clarification on the embedding architecture and its correct usage (as I am experience weird behaviors). Can anyone clarify: - if Python correctly supports multiple sub-interpreters (Py_NewInterp

Re: __del__ pattern?

2005-08-16 Thread BranoZ
[EMAIL PROTECTED] wrote: > For a reasonably portable solution, leave the lock file open. > On most systems, you cannot delete an open file,.. On most UNIXes, you can delete an open file. Even flock-ed. This is BTW also an hack around flock. 1. Process A opens file /var/tmp/test1, and flocks descri

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope'or 'module' better?)

2005-08-16 Thread Terry Reedy
"Bengt Richter" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > IOW, "...open the box and find the i'th item /in/ the box..." is not > really > finding the i'th item _itself_ "/in/" the box. It is finding one end of a > string > tied to some point /in/ the box, but the actual item

Re: stopping a python windows service

2005-08-16 Thread Do Re Mi chel La Si Do
Hi ! Use SC.exe (windows-XP) (with popen ?) For help :sc /? You can, also, try : qprocess /? tasklist /? taskkill /? etc. @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: GUI tookit for science and education

2005-08-16 Thread Mateusz Łoskot
Markus Rosenstihl napisał(a): >>> It doesn't have much math built in. For functions you have to >>> plot points. >> >> >> If you want to plot stuff, the gnuplot-py module is very easy >> to use. http://sourceforge.net/projects/gnuplot-py/ >> [...] > > matplotlib is also ver good possibility >

Re: __del__ pattern?

2005-08-16 Thread bryanjugglercryptographer
Chris Curvey wrote: > I need to ensure that there is only one instance of my python class on > my machine at a given time. (Not within an interpreter -- that would > just be a singleton -- but on the machine.) These instances are > created and destroyed, but there can be only one at a time. > > S

Re: stopping a python windows service

2005-08-16 Thread Grig Gheorghiu
Here are 2 recipes from the online Python Cookbook. I've used this one very successfully: . This one seems simpler: Grig -- http://mail.python.org/mailman/listinfo/pyt

Re: stopping a python windows service

2005-08-16 Thread Benjamin Niemann
DK wrote: > i was able to successfully create a windows service using py2exe. it > polls a website periodically and logs it to a file. this is done using > a function that does an infinite loop with periodic "sleeps". > > my question is... > > what's the best way to stop this service gracefully?

Re: random seed

2005-08-16 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Thanks. I guess I will use the system time and pass it as seed > explicitly. My goal is to replicate the random numbers that I generate > to ensure repeatabilty in the regression test suite that I am trying > to write. In that case you should just pick a single seed yo

Re: Help!

2005-08-16 Thread dimitri pater
Hi, the MS-DOS Prompt is actually the Python shell: >>> Now type: >>> print "Hello Ert" and it returns: Hello Ert Your first Python program! Do yourself a favour and google for "python tutorials" good luck, dimitri On 8/17/05, Ert Ert <[EMAIL PROTECTED]> wrote: When ever i try  to open python it op

stopping a python windows service

2005-08-16 Thread DK
i was able to successfully create a windows service using py2exe. it polls a website periodically and logs it to a file. this is done using a function that does an infinite loop with periodic "sleeps". my question is... what's the best way to stop this service gracefully? when try to stop it fro

Help!

2005-08-16 Thread Ert Ert
When ever i try  to open python it opens as a MS-DOS Prompt I do not know what else to do i need your help so if you could please help. Oh and this is the second time i emailed you so please do not send me back an automated message thank you. -- ___

Re: random seed

2005-08-16 Thread vivek7006
Thanks. I guess I will use the system time and pass it as seed explicitly. My goal is to replicate the random numbers that I generate to ensure repeatabilty in the regression test suite that I am trying to write. -- http://mail.python.org/mailman/listinfo/python-list

Read from stdouton Popen on WinXP?

2005-08-16 Thread mhenry1384
I am trying to run a program and filter the output on Windows XP. Since I want to filter the output, I'd like to read it a line at a time and only print the lines I care about. p = subprocess.Popen(["doxygen.exe", r"Doxyfile.cfg"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) while 1: line

Re: __del__ pattern?

2005-08-16 Thread Peter Hansen
Dan wrote: > someSocket.bind(('localhost', somePort)) means accept only connections > from the local machine. Almost: accept only attempts to connect *to* localhost, from the local machine. Attempting to connect -- even locally -- using one of the IP addresses bound to an external interface wil

Re: String functions deprication

2005-08-16 Thread Paul Watson
Sorry, the previous post was based on Python 2.1. That is probably not of much interest. How about 2.4.1? Python 2.4.1 (#1, Jul 19 2005, 14:16:43) [GCC 4.0.0 20050519 (Red Hat 4.0.0-8)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import string >>> dir

Re: class-call a function in a function -problem

2005-08-16 Thread Bengt Richter
On Tue, 16 Aug 2005 18:46:30 +0200, "wierus" <[EMAIL PROTECTED]> wrote: >Hello, i have a problem. I write my first class in python so i'm not a >experience user. I want to call a function in another function, i tried to >do it in many ways, but i always failed:( >I supposed it's sth very simple b

FW: python oldie, SWIG newbie needs help

2005-08-16 Thread Sells, Fred
-Original Message- From: Sells, Fred Sent: Tuesday, August 16, 2005 5:09 PM To: python-list@python.org Subject: python oldie, SWIG newbie needs help I've been trying all day to get a simple SWIG generated interface to a simple (but ugly) piece of c++ code provided to us by the gov't.

Re: 'import copy' too slow?, was Re: [Python-Dev] implementation of copy standard lib

2005-08-16 Thread Peter Otten
[Martijn Brouwer] > Importing copy takes 5-10 times more time that > import os, string and re together! If your measurement isn't flawed, try again after replacing the following import in copy.py try: from org.python.core import PyStringMap except ImportError: PyStringMap = None with jus

Re: String functions deprication

2005-08-16 Thread Paul Watson
steve morin wrote: > http://www.python.org/doc/2.4.1/lib/node110.html > > These methods are being deprecated. What are they being replaced > with? Does anyone know? > > Steve It might be helpful to compare the following lists. Python 2.1 (#1, May 23 2003, 11:43:56) [C] on aix4 Type "copyright

'import copy' too slow?, was Re: [Python-Dev] implementation of copy standard lib

2005-08-16 Thread Peter Otten
[Martijn Brouwer] > Importing copy takes 5-10 times more time that > import os, string and re together! Are you sure you aren't seeing the effects of caching? My little ad hoc test (which fails on the os module) doesn't confirm your numbers: $ python2.4 -m timeit -n1 -r1 -s"import sys; assert 're

Re: random seed

2005-08-16 Thread tiissa
[EMAIL PROTECTED] wrote: > By default, randomm module uses the timestamp to generate the seed > value. Is it possible to know what that seed value is? From a (very) quick glance at the doc [1], I'm not sure you can get it. But if you want to reuse it later (for a deterministic behaviour), you

Re: How to obtain GMT offset?

2005-08-16 Thread Bengt Richter
On Mon, 15 Aug 2005 20:57:16 -0700, Erik Max Francis <[EMAIL PROTECTED]> wrote: >new pip wrote: > >> I'm using Windows os. If the current system date time is '28 Jun 2001 >> 14:17:15 +0700', how can I obtain the value '+0700' using python? > >time.timezone gives you the timezone offset in minutes.

Re: class-call a function in a function -problem

2005-08-16 Thread Elmo Mäntynen
On Tue, 16 Aug 2005 18:45:51 +0200, wierus wrote: > Hello, i have a problem. I write my first class in python so i'm not a > experience user. I want to call a function in another function, i tried to > do it in many ways, but i always failed:( > I supposed it's sth very simple but i can't figu

Re: How to obtain GMT offset?

2005-08-16 Thread Bengt Richter
On Mon, 15 Aug 2005 20:57:16 -0700, Erik Max Francis <[EMAIL PROTECTED]> wrote: >new pip wrote: > >> I'm using Windows os. If the current system date time is '28 Jun 2001 >> 14:17:15 +0700', how can I obtain the value '+0700' using python? > >time.timezone gives you the timezone offset in minutes.

Re: GUI tookit for science and education

2005-08-16 Thread Markus Rosenstihl
>> It doesn't have much math built in. For functions you have to >> plot points. > > If you want to plot stuff, the gnuplot-py module is very easy > to use. http://sourceforge.net/projects/gnuplot-py/ > > The one feature that I'd really like to add is the ability to > plot a python function obj

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope' or 'module' better?)

2005-08-16 Thread Ron Adam
Antoon Pardon wrote: > I disagree here. The problem with "global", at least how it is > implemented in python, is that you only have access to module > scope and not to intermediate scopes. > > I also think there is another possibility. Use a symbol to mark > the previous scope. e.g. x would be t

Re: get the return code when piping something to a python script?

2005-08-16 Thread Paul Watson
mhenry1384 wrote: > On WinXP, I am doing this > > nant.exe | python MyFilter.py > > This command always returns 0 (success) because MyFilter.py always > succeeds. > > MyFilter.py looks like this > > while 1: > line = sys.stdin.readline() > if not line: > break > ... > sy

Re: Reading portions of a wave file

2005-08-16 Thread Bengt Richter
On Tue, 16 Aug 2005 02:33:36 GMT, Nadie <[EMAIL PROTECTED]> wrote: >Greeting list readers, > >I noticed that the wave read object has an *implementation dependent* >setpos(pos) method. When reading audio files, it is useful to be able >to set the position to a specific sample. While setpos(pos

Re: [Python-Dev] implementation of copy standard lib

2005-08-16 Thread Ron Adam
Simon Brunning wrote: > On 8/14/05, Martijn Brouwer <[EMAIL PROTECTED]> wrote: > >>After profiling a small python script I found that approximately 50% of >>the runtime of my script was consumed by one line: "import copy". >>Another 15% was the startup of the interpreter, but that is OK for an >>

Re: get the return code when piping something to a python script?

2005-08-16 Thread mhenry1384
>Didn't help you much.. Thanks, actually even hints that it's not possible helps. So I won't keep driving myself crazy figuring out how to do it. :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: get the return code when piping something to a python script?

2005-08-16 Thread BranoZ
mhenry1384 wrote: > On WinXP, I am doing this > > nant.exe | python MyFilter.py > > How do I set the return code from MyFilter.py based on the return of > nant.exe? Is this possible? I don't know how it is on WinXP, but in UNIX you IMHO cannot easily get the retcode of the peer _if_ the pipe was

Re: How can I exclude a word by using re?

2005-08-16 Thread Paul McGuire
I just reviewed what the re "\s" signifies: whitespace. This is easy, pyparsing ignores all intervening whitespace by default. So mp3Entry simplfies to: mp3entry = valign + number.setResultsName("number"­­­) + tdEnd + \ tdStart + aStart + \ SkipTo(tdEnd).setResultsName("­

random seed

2005-08-16 Thread vivek7006
By default, randomm module uses the timestamp to generate the seed value. Is it possible to know what that seed value is? import random random.random() # How do I print the current value of the seed? Thanks Vivek -- http://mail.python.org/mailman/listinfo/python-list

Re: How to obtain GMT offset?

2005-08-16 Thread Mark Thalman
According to it is in seconds. -- Mark On Aug 16, 2005, at 9:35 AM, Peter Hansen wrote: > Erik Max Francis wrote: > >> time.timezone gives you the timezone offset in minutes. >> > > Dang, that means I'm twelve days in the past! > >

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope' or 'module' better?)

2005-08-16 Thread Bengt Richter
On Sat, 06 Aug 2005 20:56:13 GMT, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >On Sat, 06 Aug 2005 21:16:13 +0200, Paolino <[EMAIL PROTECTED]> >declaimed the following in comp.lang.python: > > >> The point is not to understand obvious technical things, but having a >> coherent programming framew

Re: Library vs Framework (was Dr. Dobb's Python-URL!)

2005-08-16 Thread Magnus Lycka
Terry Hancock wrote: > Zope recently started going through some massive changes to make > it more like a toolkit (which is the term I use instead of library here). > Even if there must be a framework, a thin framework with good tools > tends to be better than a complex framework, even if they can,

Windows message pump problems

2005-08-16 Thread Cantankerous Old Git
I am trying to write a program that I hope to get working as a command-line app to start with, and then eventually use a windows service wrapper to call it as a service. Its purpose is to attach to an already running (not ours) service using an API DLL, where it will do houskeeping and monitori

get the return code when piping something to a python script?

2005-08-16 Thread mhenry1384
On WinXP, I am doing this nant.exe | python MyFilter.py This command always returns 0 (success) because MyFilter.py always succeeds. MyFilter.py looks like this while 1: line = sys.stdin.readline() if not line: break ... sys.stdout.write(line) sys.stdout.flush() How

Re: class-call a function in a function -problem

2005-08-16 Thread Steven Bethard
Larry Bates wrote: > def __init__(self, x=1, y=2) [snip] > self.x=x > self.y=y > self.a=0 > return > > def l(self): [snip] > self.a=self.x+self.y > print "In ludzik.l a=',self.a > return > > def ala(self): [snip] > self.l

Re: GUI tookit for science and education

2005-08-16 Thread Mateusz Łoskot
Thank you all for valuable responses. I think I will stick to Tk and Tkinter. Cheers -- Mateusz Łoskot, mateusz (at) loskot (dot) net Registered Linux User #220771 -- http://mail.python.org/mailman/listinfo/python-list

Re: class-call a function in a function -problem

2005-08-16 Thread Steven Bethard
wierus wrote: > class ludzik: > x=1 > y=2 > l=0 > def l(self): > ludzik.l=ludzik.x+ludzik.y > print ludzik.l > > def ala(self): > print ludzik.x > print ludzik.y > ludzik.l() Methods defined in a class expect an instance of that class as the first argument. When you write: l

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope' or 'module' better?)

2005-08-16 Thread Bengt Richter
On 5 Aug 2005 21:22:41 -0700, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >I'm not saying 'modulescope' and 'module' are the only alternatives or >even >the best anyone can come up with. > >'global' has the connotation of being visible *EVERYWHERE* >where in Python it is just visible in one mod

Re: __del__ pattern?

2005-08-16 Thread bryanjugglercryptographer
Tom Anderson wrote: > On Mon, 15 Aug 2005, Chris Curvey wrote: > > > Is there a better pattern to follow than using a __del__ method? I just > > need to be absolutely, positively sure of two things: > > An old hack i've seen before is to create a server socket - ie, make a > socket and bind it to

Re: [Python-Dev] implementation of copy standard lib

2005-08-16 Thread Benji York
Simon Brunning wrote: > I think that copy is very rarely used. I don't think I've ever imported it. > > Or is it just me? I rarely use copy, and almost always regret it when I do. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Library vs Framework (was Dr. Dobb's Python-URL!)

2005-08-16 Thread Paolino
Rocco Moretti wrote: > Cameron Laird wrote: > >> Andy Smith rails against "frameworks": >> >> http://an9.org/devdev/why_frameworks_suck?sxip-homesite=&checked=1 > > > Slapdash Summary: Libraries good, frameworks bad - they are a > straightjackets and limit sharing. > > Which

String functions deprication

2005-08-16 Thread Dan
> http://www.python.org/doc/2.4.1/lib/node110.html > > These methods are being deprecated. What are they being replaced > with? They're being made methods of the string class itself. For example: >>> s = 'any old string' >>> string.split(s, ' ') # Old way ['any', 'old', 'string'] >>>

Re: class-call a function in a function -problem

2005-08-16 Thread Larry Bates
Try something like: class ludzik: # # Define an __init__ method that gets called when # you instantiate the class. Notice also that I've # allowed you to set x, and y parameters if you like. # If you don't pass them they default to 1 and 2 as # in your example. #

RE: looping list problem

2005-08-16 Thread Jon Bowlas
Many thanks for your help, worked a treat Jon -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Otten Sent: 16 August 2005 17:25 To: python-list@python.org Subject: RE: looping list problem Jon Bowlas wrote: > Incidentally I'm doing this in zope. M

Re: String functions deprication

2005-08-16 Thread Tim Peters
[steve morin] > http://www.python.org/doc/2.4.1/lib/node110.html > > These methods are being deprecated. What are they being replaced > with? Does anyone know? As it says at the top of that page, The following list of functions are also defined as methods of string and Unicode objects;

Re: MainThread blocks all others

2005-08-16 Thread Nodir Gulyamov
Thank you very much to all. I found out solution. I created separate thread from GUI and everything is working correct. Best Regards, /Gelios -- http://mail.python.org/mailman/listinfo/python-list

String functions deprication

2005-08-16 Thread steve morin
http://www.python.org/doc/2.4.1/lib/node110.html These methods are being deprecated. What are they being replaced with? Does anyone know? Steve -- http://mail.python.org/mailman/listinfo/python-list

class-call a function in a function -problem

2005-08-16 Thread wierus
Hello, i have a problem. I write my first class in python so i'm not a experience user. I want to call a function in another function, i tried to do it in many ways, but i always failed:( I supposed it's sth very simple but i can't figure what it is: == class lud

class-call a function in a function -problem

2005-08-16 Thread wierus
Hello, i have a problem. I write my first class in python so i'm not a experience user. I want to call a function in another function, i tried to do it in many ways, but i always failed:( I supposed it's sth very simple but i can't figure what it is: == class ludzik

Re: Wheel-reinvention with Python

2005-08-16 Thread Ed Leafe
On Tuesday 16 August 2005 05:48, Magnus Lycka wrote: > The fact that his excellent, more or less daily postings are so badly > needed does indicate a problem, either with the design of the toolkit, > or with the docs. I'm not sure which. I htink that there is such an overwhelming amount of stuff

RE: looping list problem

2005-08-16 Thread Peter Otten
Jon Bowlas wrote: > Incidentally I'm doing this in zope. Many posters (including me) in this newsgroup don't do zope, so your best option is to ask on a zope-related mailing list. > I was hoping that this would loop through the elements in the list > returned by the hiddens function comparing th

Re: base64.encode and decode not correct

2005-08-16 Thread bryanjugglercryptographer
Damir Hakimov wrote: > I found a strange bug in base64.encode and decode, when I try to encode > - decode a file 1728512 bytes lenth. > Is somebody meet with this? I don't attach the file because it big, but > can send to private. I agree the file is too big, but can you show a small Python prog

Re: Library vs Framework (was Dr. Dobb's Python-URL!)

2005-08-16 Thread Peter Decker
On 8/16/05, Terry Hancock <[EMAIL PROTECTED]> wrote: > Where a framework shines is when you don't really want to program > it much at all -- you just need a tweak here and there beyond what > it already does. Gimp plugins are a great example of that. I'd put it slightly differently. Where a fram

Re: [Python-Dev] implementation of copy standard lib

2005-08-16 Thread Michael Hoffman
Simon Brunning wrote: > I think that copy is very rarely used. I don't think I've ever imported it. > > Or is it just me? It's just you. I use copy.deepcopy() fairly often. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: help with mysql cursor.execute()

2005-08-16 Thread William Gill
Dennis Lee Bieber wrote: > On Sun, 14 Aug 2005 19:28:04 GMT, William Gill <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > >>I have been trying to pass parameters as indicated in the api. >>when I use: >> >> sql= 'select * from %s where cusid = %s ' % name,recID) >> Cur

libdnet and python (scapy)

2005-08-16 Thread codecraig
I am interested in using libdnet with Python, how can I go about "installing" it on windows? http://libdnet.sourceforge.net/ Ultimately, I would like to get Scapy (http://www.secdev.org/projects/scapy/) running on windows...currently it is a *nix app written in Python, so I think I should be able

Re: Creating a graphical interface on top of SSH. How?

2005-08-16 Thread Jp Calderone
On 16 Aug 2005 07:10:25 -0700, "John F." <[EMAIL PROTECTED]> wrote: >I want to write a client app in Python using wxWindows that connects to >my FreeBSD server via SSH (using my machine account credentials) and >runs a python or shell script when requested (by clicking a button for >instance). > >C

RE: looping list problem

2005-08-16 Thread Jon Bowlas
Ok, so I've adapted my script calling it a hiddens() function and included it inside my get_tree_html function which creates my navigation: pub = context.get_publication() obj = context.aq_inner fpath = context.getPhysicalPath() def hiddens(): attobject = context.get_attobject() navstring

extending: new type instance

2005-08-16 Thread BranoZ
I'm writing my own (list-like) type in C. It is implementing a Sequence Protocol. In 'sq_slice' method I would like to return a new instance of my class/type. How do I create (and initialize) an instance of a given PyTypeObject MyType ? I have tried to provide (PyObject *)&MyType as 'class' argum

Re: Library vs Framework (was Dr. Dobb's Python-URL!)

2005-08-16 Thread Terry Hancock
On Tuesday 16 August 2005 08:46 am, Rocco Moretti wrote: > But I'm not sure if library vs. framework a fair comparison - the two > are doing different things. With a framework, you're not really writing > your own program, you're customizing someone else's. Sort of a vastly > more flexible versi

open links in a html page

2005-08-16 Thread Ajar
Hi, Using urllib2,ClinetForm and ClinetCookie modules I have logged into my ISPs web site and managed to fetch the first page. Now, on this page there is this link: Service Records I need to click this link from python code. How do I do it? check(4) is the following javascript function: ---

Re: [Python-Dev] implementation of copy standard lib

2005-08-16 Thread Simon Brunning
On 8/14/05, Martijn Brouwer <[EMAIL PROTECTED]> wrote: > After profiling a small python script I found that approximately 50% of > the runtime of my script was consumed by one line: "import copy". > Another 15% was the startup of the interpreter, but that is OK for an > interpreted language. The co

Re: Library vs Framework (was Dr. Dobb's Python-URL!)

2005-08-16 Thread Rocco Moretti
Simon Brunning wrote: > On 8/15/05, Terry Hancock <[EMAIL PROTECTED]> wrote: > >>On Monday 15 August 2005 09:54 am, Simon Brunning wrote: >> >>>If you call its code, it's a library. If it calls yours, it's a framework. >> >>Such concision deserves applause. ;-) > > > Thank you. ;-) > > As other

Creating a graphical interface on top of SSH. How?

2005-08-16 Thread John F.
I want to write a client app in Python using wxWindows that connects to my FreeBSD server via SSH (using my machine account credentials) and runs a python or shell script when requested (by clicking a button for instance). Can someone give me some advice on how to create a "graphical shell" per se

A (unpythonic) pythonable mixin recipe.

2005-08-16 Thread Paolino
I had always been negative on the boldeness of python on insisting that unbound methods should have been applied only to its im_class instances. Anyway this time I mixed in rightly, so I post this for comments. ## looking for a discovery .Start # class _Mixin(object): def

RE: looping list problem

2005-08-16 Thread Peter Otten
Jon Bowlas wrote: > Ok so I changed it to this: > > attobject = context.get_attobject() > navstring = context.get_uclattribute(attobject, 'ucl_navhide') > hiddennavelements = navstring.split(' ') > for hiddennavelement in hiddennavelements: > yield hiddennavelements > > But I get the followi

Re: looping list problem

2005-08-16 Thread Peter Hansen
Jon Bowlas wrote: > Ok so I changed it to this: > > attobject = context.get_attobject() > navstring = context.get_uclattribute(attobject, 'ucl_navhide') > hiddennavelements = navstring.split(' ') > for hiddennavelement in hiddennavelements: > yield hiddennavelements > > But I get the followi

Re: How to obtain GMT offset?

2005-08-16 Thread Peter Hansen
Erik Max Francis wrote: > time.timezone gives you the timezone offset in minutes. Dang, that means I'm twelve days in the past! >>> import time >>> time.timezone 18000 >>> 18000/60 300 (So that would be hours? ;-) ) >>> 18000/60/24 12 Wait up guys! -Peter -- http://mail.python.org/mailman

Re: looping list problem

2005-08-16 Thread Fredrik Lundh
Jon Bowlas wrote: > Ok so I changed it to this: > > attobject = context.get_attobject() > navstring = context.get_uclattribute(attobject, 'ucl_navhide') > hiddennavelements = navstring.split(' ') > for hiddennavelement in hiddennavelements: >yield hiddennavelements > > But I get the following

Re: looping list problem

2005-08-16 Thread Paul McGuire
Well, you are returning prematurely from a for loop, so that is why you are only getting the first value. Its just like: for i in range(100): return i It doesn't matter how big the range is you are iterating over, you'll return on the first element and that's it. If what you want is the

Re: Replacement for keyword 'global' good idea? (e.g. 'modulescope' or 'module' better?)

2005-08-16 Thread Peter Hansen
Antoon Pardon wrote: > Why has one made a difference in search policy for finding a > variable based on whether the variable is rebound or not > in the first place. Do you really not understand the reason, or do you simply disagree with it? It's a choice with rational thought behind it. Whether

Re: __del__ pattern?

2005-08-16 Thread Dan
> What does "default" mean, and is that definition in conflict with what I > said? The docs say it means INADDR_ANY. someSocket.bind(('', somePort)) means accept connections from any machine. (We use INADDR_ANY instead of '' in C.) someSocket.bind(('localhost', somePort)) means accept only conne

Re: How can I exclude a word by using re?

2005-08-16 Thread Paul McGuire
Oof! That should be: mp3entry = valign + number.setResultsName("number"­­) + tdEnd + \ tdStart + SkipTo(aStart) + aStart + \ SkipTo(tdEnd).setResultsName("n­ame") + tdEnd -- http://mail.python.org/mailman/listinfo/python-list

RE: looping list problem

2005-08-16 Thread Jon Bowlas
Ok so I changed it to this: attobject = context.get_attobject() navstring = context.get_uclattribute(attobject, 'ucl_navhide') hiddennavelements = navstring.split(' ') for hiddennavelement in hiddennavelements: yield hiddennavelements But I get the following error- Line 5: Yield statements a

  1   2   >