Re: Modifying Class Object

2010-02-11 Thread Alf P. Steinbach
* I V: On Thu, 11 Feb 2010 07:37:35 +0100, Alf P. Steinbach wrote: * Steven D'Aprano: s = [1] t = s # Binds the name t to the object bound to the name s. t[0] = 2 # Changes the object bound to the name t print(s) # Checks the object via the original name. Notice that your ver

Re: I've built Python, but can't figure out how to package it for windows

2010-02-11 Thread Tim Golden
On 11/02/2010 05:24, Mark Jones wrote: [... problems building from tools/msi ...] I sympathise. I went through similar hoops last year, merely to be able to do it. I think I'm right in saying that very few people are bothered enough to package their own MSI on windows because the (probably very f

Re: Executing Commands From Windows Service

2010-02-11 Thread Tim Golden
On 10/02/2010 22:55, T wrote: Great suggestions once again - I did verify that it was at least running the plink.exe binary when under LocalSystem by having the service run "plink.exe> C:\plinkoutput.txt" - this worked fine. And, as I mentioned, it's now working just fine when running under a r

Re: ANN: obfuscate

2010-02-11 Thread Christian Heimes
Gregory Ewing wrote: > Actually I gather it had a lot to do with the fact that > the Germans made some blunders in the way they used the > Enigma that seriously compromised its security. There > was reportedly a branch of the German forces that used > their Enigmas differently, avoiding those mista

how to improve this cycle (extracting data from structured array)?

2010-02-11 Thread Alexzive
Hello guys, I am just wondering if there is a quick way to improve this algorithm [N is a structured array which hold info about the nodes n of a finite element mesh, and n is about 300.000). I need to extract info from N and put it in to a 3*n matrix NN which I reshape then with numpy. I think to

Re: how to improve this cycle (extracting data from structured array)?

2010-02-11 Thread Tim Chase
Alexzive wrote: I am just wondering if there is a quick way to improve this algorithm [N is a structured array which hold info about the nodes n of a finite element mesh, and n is about 300.000). I need to extract info from N and put it in to a 3*n matrix NN which I reshape then with numpy. I thi

Bizarre arithmetic results

2010-02-11 Thread Terrence Cole
Can someone explain to me what python is doing here? Python 3.1.1 (r311:74480, Feb 3 2010, 13:36:47) [GCC 4.3.4] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> -0.1 ** 0.1 -0.7943282347242815 >>> a = -0.1; b = 0.1 >>> a ** b (0.7554510437117542+0.24546092364

Re: Re: sqlite3 bug?

2010-02-11 Thread wayne . dads . bell
Thank you It just highlights that when your tired things can easily be missed and maybe you should leave things until the morning to view things with fresh eyes =) -- http://mail.python.org/mailman/listinfo/python-list

Re: Modifying Class Object

2010-02-11 Thread Arnaud Delobelle
"Alf P. Steinbach" writes: [...] > That's bullshit. [...] > not any that you know about. [...] > yet another ad hominem attack [...] > It also reflects rather badly on you. [...] > - Alf Alf, The above was extracted from the last post from you but I could have picked almost any of your recent e

Re: ANN: obfuscate

2010-02-11 Thread Gregory Ewing
Daniel Fetchinson wrote: It also turned out that everybody mostly writes his/her own obfuscation routine. Hey, it gives you the additional advantage of obfuscation by obscurity! -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: obfuscate

2010-02-11 Thread Paul Rubin
Gregory Ewing writes: > Actually I gather it had a lot to do with the fact that the Germans > made some blunders in the way they used the Enigma that seriously > compromised its security. There was reportedly a branch of the German > forces that used their Enigmas differently, avoiding those mista

Unicode strings

2010-02-11 Thread aabelyakov
Excellent! But what about the unicode -- http://mail.python.org/mailman/listinfo/python-list

Re: Bizarre arithmetic results

2010-02-11 Thread Andre Engels
On Thu, Feb 11, 2010 at 1:44 AM, Terrence Cole wrote: > Can someone explain to me what python is doing here? > > Python 3.1.1 (r311:74480, Feb  3 2010, 13:36:47) > [GCC 4.3.4] on linux2 > Type "help", "copyright", "credits" or "license" for more information. -0.1 ** 0.1 > -0.7943282347242815

Re: Bizarre arithmetic results

2010-02-11 Thread Mark Dickinson
On Feb 11, 12:44 am, Terrence Cole wrote: > Can someone explain to me what python is doing here? > >>> -0.1 ** 0.1 > -0.7943282347242815 Here you're computing -(0.1 ** 0.1). The exponentiation operator binds more strongly than the negation operator. > >>> a = -0.1; b = 0.1 > >>> a ** b > (0.75

Re: Bizarre arithmetic results

2010-02-11 Thread Peter Otten
Terrence Cole wrote: > Can someone explain to me what python is doing here? > > Python 3.1.1 (r311:74480, Feb 3 2010, 13:36:47) > [GCC 4.3.4] on linux2 > Type "help", "copyright", "credits" or "license" for more information. -0.1 ** 0.1 > -0.7943282347242815 a = -0.1; b = 0.1 a **

Re: Bizarre arithmetic results

2010-02-11 Thread Shashwat Anand
Do you really believe that -0.1 ** 0.1 is a valid computational problem ? Can you raise a negative number to a fractional power ? Output on my console (python 2.6) >>> -.1 ** .1 -0.79432823472428149 >>> a,b = -.1,.1 >>> a**b Traceback (most recent call last): File "", line 1, in ValueError: neg

Re: Bizarre arithmetic results

2010-02-11 Thread Christian Heimes
Terrence Cole wrote: -0.1 ** 0.1 > -0.7943282347242815 a = -0.1; b = 0.1 a ** b > (0.7554510437117542+0.2454609236416552j) -abs(a ** b) > -0.7943282347242815 > > Why does the literal version return the signed magnitude and the > variable version return a complex? The binary po

Re: Bizarre arithmetic results

2010-02-11 Thread Shashwat Anand
Just realized my flaw >>> .1**.1 0.79432823472428149 >>> (-.1)**(.1) Traceback (most recent call last): File "", line 1, in ValueError: negative number cannot be raised to a fractional power - a ** b = - (a ** b) and not (-a) ** b, Thats why -.1**.1 giving you -0.79432823472428149 since .1 **

Re: Bizarre arithmetic results

2010-02-11 Thread Jussi Piitulainen
Terrence Cole writes: > Can someone explain to me what python is doing here? > > Python 3.1.1 (r311:74480, Feb 3 2010, 13:36:47) > [GCC 4.3.4] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> -0.1 ** 0.1 > -0.7943282347242815 > >>> a = -0.1; b = 0.1 > >>>

Re: Bizarre arithmetic results

2010-02-11 Thread Tim Chase
Terrence Cole wrote: Can someone explain to me what python is doing here? Python 3.1.1 (r311:74480, Feb 3 2010, 13:36:47) [GCC 4.3.4] on linux2 Type "help", "copyright", "credits" or "license" for more information. -0.1 ** 0.1 -0.7943282347242815 a = -0.1; b = 0.1 a ** b (0.75545104371175

Re: Bizarre arithmetic results

2010-02-11 Thread Daniel Fetchinson
On 2/11/10, Terrence Cole wrote: > Can someone explain to me what python is doing here? > > Python 3.1.1 (r311:74480, Feb 3 2010, 13:36:47) > [GCC 4.3.4] on linux2 > Type "help", "copyright", "credits" or "license" for more information. -0.1 ** 0.1 > -0.7943282347242815 a = -0.1; b = 0.

Re: Executing Commands From Windows Service

2010-02-11 Thread Martin P. Hellwig
On 02/07/10 19:02, T wrote: I have a script, which runs as a Windows service under the LocalSystem account, that I wish to have execute some commands. Specifically, the program will call plink.exe to create a reverse SSH tunnel. Right now I'm using subprocess.Popen to do so. When I run it inte

Re: SimpleXMLRPCServer and client address

2010-02-11 Thread Jean-Michel Pichavant
Stephen Hansen wrote: On Wed, Feb 10, 2010 at 5:36 PM, Jean-Michel Pichavant mailto:jeanmic...@sequans.com>> wrote: I don't know exactly what you are trying to do, but if your server requires informations from the client, it would be better to ask explicitly the client for those inf

exception in Tkinter on Ubtunu...

2010-02-11 Thread Lumbee
...hey guys, I posted this over on the Ubuntu forums with no luck. I'm running Ubuntu 9.10 and python 2.5. In Idle when I type in a function I get this error... >>> Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python2.5/lib-tk/Tkinter.py", line 1417, in __call_

Re: Your beloved python features

2010-02-11 Thread jhermann
$ python -c "import this" -- http://mail.python.org/mailman/listinfo/python-list

Re: Bizarre arithmetic results

2010-02-11 Thread Duncan Booth
Tim Chase wrote: > But perhaps Py3 changes evaluation, returning an complex number. Yes, the change is documented at http://docs.python.org/3.1/reference/expressions.html#the-power-operator If it is in any of the "What's new in Python x.xx" documents or in a PEP somewhere I haven't spotted it

base32hex support in python?

2010-02-11 Thread Vishal Shetye
Hi, One of the modules that I am currently working on requires base32hex encoding as defined by RFC 4648, section 7. I checked base64 module which has base32encode/decode functionality but not with extended hex alphabet. Is there a module, currently available, that provides this? As far as I see

Re: how to improve this cycle (extracting data from structured array)?

2010-02-11 Thread Alexzive
On Feb 11, 1:08 pm, Tim Chase wrote: > Alexzive wrote: > > I am just wondering if there is a quick way to improve this algorithm > > [N is a structured array which hold info about the nodes n of a finite > > element mesh, and n is about 300.000). I need to extract info from N > > and put it in to

Re: Bizarre arithmetic results

2010-02-11 Thread Mark Dickinson
On Feb 11, 1:38 pm, Duncan Booth wrote: > Tim Chase wrote: > > But perhaps Py3 changes evaluation, returning an complex number. > > Yes, the change is documented > athttp://docs.python.org/3.1/reference/expressions.html#the-power-operator > > If it is in any of the "What's new in Python x.xx" do

python crash on windows but not on linux

2010-02-11 Thread hjebbers
To all, I am running an EDI translator, and doing stress tests. When processing a test with a (relatively) big EDI file(s) on windowsXP I get a crash: 'sorry for the inconvenience' etc (so no clues about what is causing the problem) This happens with python 2.4, 2.5, 2.6 It does not happen i

Re: method names nounVerb or verbNoun

2010-02-11 Thread cjw
On 05-Feb-10 14:53 PM, Wanderer wrote: Which is the more accepted way to compose method names nounVerb or verbNoun? For example voltageGet or getVoltage? getVoltage sounds more normal, but voltageGet is more like voltage.Get. I seem to mix them and I should probably pick one way and stick with i

Re: Bizarre arithmetic results

2010-02-11 Thread Robert Kern
On 2010-02-11 06:31 AM, Shashwat Anand wrote: Do you really believe that -0.1 ** 0.1 is a valid computational problem ? Can you raise a negative number to a fractional power ? Output on my console (python 2.6) >>> -.1 ** .1 -0.79432823472428149 >>> a,b = -.1,.1 >>> a**b Traceback (most recent

Re: Modifying Class Object

2010-02-11 Thread Steve Holden
Alf P. Steinbach wrote: > * Steve Holden: [...] >> In this particular part of the thread I am attempting, unsuccessfully, >> to convince you that a change in *your* behavior would lead to less >> hostility directed towards the way you present your ideas. >> >> You apparently feel it is quite accept

Re: Modifying Class Object

2010-02-11 Thread Steve Holden
Alf P. Steinbach wrote: > * Steven D'Aprano: [...] >> accusing them of lying for having an opinion that differs from yours, > > That is untrue. > Well, that says it all really. regards Steve -- Steve Holden +1 571 484 6266 +1 800 494 3119 PyCon is coming! Atlanta, Feb 2010 http://

Any way to turn off exception handling? (debugging)

2010-02-11 Thread mk
Hello everyone, I'm getting an exception (on socket) handled in a program I'm trying to debug. I have trouble locating where exactly that happens. In such situation turning exception handling off could be useful, bc unhandled exception stack trace is precisely what I'm trying to obtain. Any

Re: method names nounVerb or verbNoun

2010-02-11 Thread Martin P. Hellwig
On 02/05/10 19:53, Wanderer wrote: Which is the more accepted way to compose method names nounVerb or verbNoun? For example voltageGet or getVoltage? getVoltage sounds more normal, but voltageGet is more like voltage.Get. I seem to mix them and I should probably pick one way and stick with it.

Re: Bizarre arithmetic results

2010-02-11 Thread Jussi Piitulainen
Robert Kern writes: > On 2010-02-11 06:31 AM, Shashwat Anand wrote: > > There is a little issue here that '>>> -.1 ** .1' should give you > > error message. That is it. > > No, fractional powers of negative numbers are perfectly valid > mathematically. The result is a complex number. In Python 3 (

Re: Any way to turn off exception handling? (debugging)

2010-02-11 Thread Steve Holden
mk wrote: > Hello everyone, > > I'm getting an exception (on socket) handled in a program I'm trying to > debug. I have trouble locating where exactly that happens. > > In such situation turning exception handling off could be useful, bc > unhandled exception stack trace is precisely what I'm try

Re: Need debugging knowhow for my creeping Unicodephobia

2010-02-11 Thread mk
kj wrote: I have read a *ton* of stuff on Unicode. It doesn't even seem all that hard. Or so I think. Then I start writing code, and WHAM: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 0: ordinal not in range(128) (There, see? My Unicodephobia just went up a notch.)

Re: Dreaming of new generation IDE

2010-02-11 Thread Bruno Desthuilliers
catonano a écrit : (snip) Today, I tried to understand the twisted.web.client code and I found 3 methods I couldn't find by who were called. I asked on the mailing list and they suggested me where they were called and that the tool for such thing is "grep". So, you grep, you get a list of files

Re: Terminating threaded programs

2010-02-11 Thread Aahz
In article , mk wrote: > >I have a problem with a threaded program: it frequently hangs on sys.exit. > >The problem is that my program uses threads which in turn use paramiko >library, which itself is threaded. > >I try to gracefully close the threads (below), but it doesn't always >work, if pa

Re: Any way to turn off exception handling? (debugging)

2010-02-11 Thread mk
Steve Holden wrote: I'm getting an exception (on socket) handled in a program I'm trying to debug. I have trouble locating where exactly that happens. If the exception is currently being trapped by a handler in your code It's not my code. you could just insert a "raise" statement at the st

Re: Any way to turn off exception handling? (debugging)

2010-02-11 Thread Simon Brunning
On 11 February 2010 16:17, mk wrote: > I'm getting an exception (on socket) handled in a program I'm trying to > debug. I have trouble locating where exactly that happens. > > In such situation turning exception handling off could be useful, bc > unhandled exception stack trace is precisely what I

Re: Any way to turn off exception handling? (debugging)

2010-02-11 Thread mk
Simon Brunning wrote: Not as far as I know. Besides, the chances are that if you were to be able to turn off exception handling altogether your code wouldn't make it as far as the code you are interested in anyway. Sure, but I could deal with that, jerry-rigging the code as exceptions go by, f

Re: Dreaming of new generation IDE

2010-02-11 Thread Francis Carr
> I can't believe the code editing situation today is in a such sorry > state. I can't believe an old coder is feeling so sorry for himself. > Today, I tried to understand the twisted.web.client code and I found 3 > methods I couldn't find by who were called. > > I asked on the mailing list and t

Re: Need debugging knowhow for my creeping Unicodephobia

2010-02-11 Thread kj
In mk writes: >To make matters more complicated, str.encode() internally DECODES from >string into unicode: > >>> nu >'\xc4\x84' > >>> > >>> type(nu) > > >>> nu.encode() >Traceback (most recent call last): > File "", line 1, in >UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in

Re: Any way to turn off exception handling? (debugging)

2010-02-11 Thread Stephen Hansen
On Thu, Feb 11, 2010 at 9:32 AM, mk wrote: > Simon Brunning wrote: > >> Not as far as I know. Besides, the chances are that if you were to be >> able to turn off exception handling altogether your code wouldn't make >> it as far as the code you are interested in anyway. >> > > Sure, but I could d

Re: Need debugging knowhow for my creeping Unicodephobia

2010-02-11 Thread MRAB
mk wrote: kj wrote: I have read a *ton* of stuff on Unicode. It doesn't even seem all that hard. Or so I think. Then I start writing code, and WHAM: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 0: ordinal not in range(128) (There, see? My Unicodephobia just went u

Re: ANN: obfuscate

2010-02-11 Thread MRAB
Christian Heimes wrote: Gregory Ewing wrote: Actually I gather it had a lot to do with the fact that the Germans made some blunders in the way they used the Enigma that seriously compromised its security. There was reportedly a branch of the German forces that used their Enigmas differently, avo

Re: Any way to turn off exception handling? (debugging)

2010-02-11 Thread mk
the uncommon, the exceptional, case. If one could somehow turn off exceptions, you can't even do a for loop: every for loop would become infinite-- exceptions are how Python signals the end of an iterator. Think about that, *every* for loop in Python suddenly breaks. Ouch. Sure I can,

Re: ANN: obfuscate

2010-02-11 Thread Matthew Barnett
Paul Rubin wrote: Gregory Ewing writes: Actually I gather it had a lot to do with the fact that the Germans made some blunders in the way they used the Enigma that seriously compromised its security. There was reportedly a branch of the German forces that used their Enigmas differently, avoidin

Re: ANN: obfuscate

2010-02-11 Thread MRAB
Paul Rubin wrote: Gregory Ewing writes: Actually I gather it had a lot to do with the fact that the Germans made some blunders in the way they used the Enigma that seriously compromised its security. There was reportedly a branch of the German forces that used their Enigmas differently, avoidin

Re: Any way to turn off exception handling? (debugging)

2010-02-11 Thread Paul Rubin
mk writes: >> Um... run your code in a debugger. > > ..except the code in question is multithreaded and pdb is no good for > that, and last time I checked, yappi was broken. Try winpdb.org. -- http://mail.python.org/mailman/listinfo/python-list

Re: Any way to turn off exception handling? (debugging)

2010-02-11 Thread mk
Stephen Hansen wrote: the uncommon, the exceptional, case. If one could somehow turn off exceptions, you can't even do a for loop: every for loop would become infinite-- exceptions are how Python signals the end of an iterator. Think about that, *every* for loop in Python suddenly breaks. Hm

Re: Any way to turn off exception handling? (debugging)

2010-02-11 Thread Peter Otten
mk wrote: > >> the uncommon, the exceptional, case. If one could somehow turn off >> exceptions, you can't even do a for loop: every for loop would become >> infinite-- exceptions are how Python signals the end of an iterator. >> Think about that, *every* for loop in Python suddenly breaks. > >

Re: Any way to turn off exception handling? (debugging)

2010-02-11 Thread Steve Holden
mk wrote: > Stephen Hansen wrote: >> the uncommon, the exceptional, case. If one could somehow turn off >> exceptions, you can't even do a for loop: every for loop would become >> infinite-- exceptions are how Python signals the end of an iterator. >> Think about that, *every* for loop in Python su

Re: ANN: obfuscate

2010-02-11 Thread Mark Lawrence
Christian Heimes wrote: Gregory Ewing wrote: Actually I gather it had a lot to do with the fact that the Germans made some blunders in the way they used the Enigma that seriously compromised its security. There was reportedly a branch of the German forces that used their Enigmas differently, avo

Re: Terminating threaded programs

2010-02-11 Thread sstein...@gmail.com
On Feb 11, 2010, at 11:43 AM, Aahz wrote: > In article , > mk wrote: >> >> I have a problem with a threaded program: it frequently hangs on sys.exit. >> >> The problem is that my program uses threads which in turn use paramiko >> library, which itself is threaded. >> >> I try to gracefully

Re: Any way to turn off exception handling? (debugging)

2010-02-11 Thread mk
Paul Rubin wrote: mk writes: Um... run your code in a debugger. ..except the code in question is multithreaded and pdb is no good for that, and last time I checked, yappi was broken. Try winpdb.org. This is a treasure! In minutes I've had this attached to remote process and debugging thre

python and http POST

2010-02-11 Thread galileo228
Hey All, Been teaching myself Python for a few weeks, and am trying to write a program that will go to a url, enter a string in one of the search fields, submit the search, and return the contents of the search result. I'm using httplib2. My two particular questions: 1) When I set my 'body' var

Re: Any way to turn off exception handling? (debugging)

2010-02-11 Thread mk
Peter Otten wrote: try: ... except socket.error: ... #untested import socket class SocketWrapper: def __getattr__(self, name): return getattr(socket, name) error = None import module_using_socket module_using_socket.socket = SocketWrapper() Very interesting solution.

Re: python crash on windows but not on linux

2010-02-11 Thread hjebbers
On Feb 11, 7:01 pm, Peter Otten <__pete...@web.de> wrote: > hjebbers wrote: > > On Feb 11, 5:45 pm, M3RT wrote: > >> The problem may be related to how you treat the EDI file or lets say > >> DATA. Also your coding style is important. Can you provide more info? > > > Yes, a whole lot more; but I do

Re: python crash on windows but not on linux

2010-02-11 Thread hjebbers
On Feb 11, 7:01 pm, Peter Otten <__pete...@web.de> wrote: > hjebbers wrote: > > On Feb 11, 5:45 pm, M3RT wrote: > >> The problem may be related to how you treat the EDI file or lets say > >> DATA. Also your coding style is important. Can you provide more info? > > > Yes, a whole lot more; but I do

MODULE FOR I, P FRAME

2010-02-11 Thread DANNY
Hello! I am currently developing a simple video player in python, and my problem is that i can't find a module which has a function that can determine if frame(image) is I or P coded (MPEG coding). I have been using PIL but I couldnt find anything that could help me with that problem. Thanks for

Re: python crash on windows but not on linux

2010-02-11 Thread Jerry Hill
On Thu, Feb 11, 2010 at 9:32 AM, hjebbers wrote: > To all, > I am running an EDI translator, and doing stress tests. > When processing a test with a (relatively) big EDI file(s) on > windowsXP  I get a crash: >    'sorry for the inconvenience' etc  (so no clues about what is > causing the problem)

Re: python crash on windows but not on linux

2010-02-11 Thread hjebbers
On Feb 11, 7:01 pm, Peter Otten <__pete...@web.de> wrote: > hjebbers wrote: > > On Feb 11, 5:45 pm, M3RT wrote: > >> The problem may be related to how you treat the EDI file or lets say > >> DATA. Also your coding style is important. Can you provide more info? > > > Yes, a whole lot more; but I do

PExpect Cross-Platform Alternative

2010-02-11 Thread Nathan Farrar
Hello Community, Recently I've been automating lots of network operations tasks via simple python scripts. Originally, I utilized paramiko but found that the module had issues working with cisco equipment. I switched to pexpect and things have worked wonderfully since (I've been running this scr

Re: Modifying Class Object

2010-02-11 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: * Steven D'Aprano: [...] accusing them of lying for having an opinion that differs from yours, That is untrue. Well, that says it all really. You seem to insinuate that I'm saying that Steven is lying, and/or that Steven is lying. From context an

Re: python and http POST

2010-02-11 Thread Ken Seehart
"Use tamperdata to view and modify HTTP/HTTPS headers and post parameters... " https://addons.mozilla.org/en-US/firefox/addon/966 Enjoy, Ken galileo228 wrote: Hey All, Been teaching myself Python for a few weeks, and am trying to write a program that will go to a url, enter a string in one o

Re: PExpect Cross-Platform Alternative

2010-02-11 Thread Steve Holden
Nathan Farrar wrote: > Hello Community, > > Recently I've been automating lots of network operations tasks via > simple python scripts. Originally, I utilized paramiko but found that > the module had issues working with cisco equipment. I switched to > pexpect and things have worked wonderfully

Re: Modifying Class Object

2010-02-11 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: * Steve Holden: [...] In this particular part of the thread I am attempting, unsuccessfully, to convince you that a change in *your* behavior would lead to less hostility directed towards the way you present your ideas. You apparently feel it is quite a

Re: Terminating threaded programs

2010-02-11 Thread mk
Stephen Hansen wrote: I use threads all the time (well, for certain types of workloads) and have never seen this. Are your threads daemon threads? The only time I've seen sys.exit() not close out my program is when I'm launching non-daemon threads on accident. The snag is that my program is

Re: Terminating threaded programs

2010-02-11 Thread mk
Aahz wrote: You can also use os._exit(). Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Terminating threaded programs

2010-02-11 Thread mk
Aahz wrote: You can also use os._exit(). Yes! It works cleanly! Thanks a million! OTOH, if I use sys.exit(), it's just hanging there. Regards, mk -- http://mail.python.org/mailman/listinfo/python-list

Re: Is a merge interval function available?

2010-02-11 Thread Jonathan Gardner
On Feb 10, 3:23 pm, Peng Yu wrote: > I'm wondering there is already a function in python library that can > merge intervals. For example, if I have the following intervals ('[' > and ']' means closed interval as > inhttp://en.wikipedia.org/wiki/Interval_(mathematics)#Excluding_the_end...) > > [1,

Re: Is a merge interval function available?

2010-02-11 Thread Alf P. Steinbach
* Jonathan Gardner: On Feb 10, 3:23 pm, Peng Yu wrote: I'm wondering there is already a function in python library that can merge intervals. For example, if I have the following intervals ('[' and ']' means closed interval as inhttp://en.wikipedia.org/wiki/Interval_(mathematics)#Excluding_the_

Re: Need debugging knowhow for my creeping Unicodephobia

2010-02-11 Thread mk
MRAB wrote: When working with Unicode in Python 2, you should use the 'unicode' type for text (Unicode strings) and limit the 'str' type to binary data (bytestrings, ie bytes) only. Well OK, always use u'something', that's simple -- but isn't str what I get from files and sockets and the like

calculating a string equation

2010-02-11 Thread Astan Chee
Hi, I have some variables in my script that looks like this: vars = {'var_a':'10','var_b':'4'} eqat = "(var_a/2.0) <= var_b" result = "(var_a+var_b)/7" What I'm trying to do is to plug in var_a and var_b's values from vars into eqat and see if eqat returns true or false as well as getting the va

Re: Need debugging knowhow for my creeping Unicodephobia

2010-02-11 Thread Robert Kern
On 2010-02-11 15:43 PM, mk wrote: MRAB wrote: Strictly speaking, only Unicode can be encoded. How so? Can't bytestrings containing characters of, say, koi8r encoding be encoded? I think he means that only unicode objects can be encoded using the .encode() method, as clarified by his next

Re: calculating a string equation

2010-02-11 Thread Arnaud Delobelle
Astan Chee writes: > Hi, > I have some variables in my script that looks like this: > vars = {'var_a':'10','var_b':'4'} > eqat = "(var_a/2.0) <= var_b" > result = "(var_a+var_b)/7" > What I'm trying to do is to plug in var_a and var_b's values from vars > into eqat and see if eqat returns true or

Re: Modifying Class Object

2010-02-11 Thread Terry Reedy
On 2/11/2010 1:37 AM, Alf P. Steinbach wrote: Consider just the assert( t is not s ) t = s Does this change anything at all in the computer's memory? By 'computer', do you mean 'anything that computes' (including humans) or specifically 'electronic computer'? But since it does have an eff

Re: Modifying Class Object

2010-02-11 Thread Alf P. Steinbach
* Terry Reedy: On 2/11/2010 1:37 AM, Alf P. Steinbach wrote: Consider just the assert( t is not s ) t = s Does this change anything at all in the computer's memory? By 'computer', do you mean 'anything that computes' (including humans) or specifically 'electronic computer'? In this contex

Re: Need debugging knowhow for my creeping Unicodephobia

2010-02-11 Thread Steve Holden
mk wrote: > MRAB wrote: > >> When working with Unicode in Python 2, you should use the 'unicode' type >> for text (Unicode strings) and limit the 'str' type to binary data >> (bytestrings, ie bytes) only. > > Well OK, always use u'something', that's simple -- but isn't str what I > get from files

Re: python crash on windows but not on linux

2010-02-11 Thread hjebbers
On Feb 11, 8:42 pm, Jerry Hill wrote: > On Thu, Feb 11, 2010 at 9:32 AM, hjebbers wrote: > > To all, > > I am running an EDI translator, and doing stress tests. > > When processing a test with a (relatively) big EDI file(s) on > > windowsXP  I get a crash: > >    'sorry for the inconvenience' etc

Re: python crash on windows but not on linux

2010-02-11 Thread hjebbers
On Feb 11, 8:42 pm, Jerry Hill wrote: > On Thu, Feb 11, 2010 at 9:32 AM, hjebbers wrote: > > To all, > > I am running an EDI translator, and doing stress tests. > > When processing a test with a (relatively) big EDI file(s) on > > windowsXP  I get a crash: > >    'sorry for the inconvenience' etc

Re: Bizarre arithmetic results

2010-02-11 Thread Terry Reedy
On 2/11/2010 11:23 AM, Jussi Piitulainen wrote: Robert Kern writes: On 2010-02-11 06:31 AM, Shashwat Anand wrote: There is a little issue here that '>>> -.1 ** .1' should give you error message. That is it. No, fractional powers of negative numbers are perfectly valid mathematically. The res

Re: python crash on windows but not on linux

2010-02-11 Thread Carl Banks
On Feb 11, 2:39 pm, hjebbers wrote: > On Feb 11, 8:42 pm, Jerry Hill wrote: > > > > > > > On Thu, Feb 11, 2010 at 9:32 AM, hjebbers wrote: > > > To all, > > > I am running an EDI translator, and doing stress tests. > > > When processing a test with a (relatively) big EDI file(s) on > > > windows

Re: python crash on windows but not on linux

2010-02-11 Thread Terry Reedy
On 2/11/2010 9:32 AM, hjebbers wrote: To all, I am running an EDI translator, and doing stress tests. When processing a test with a (relatively) big EDI file(s) on windowsXP I get a crash: 'sorry for the inconvenience' etc (so no clues about what is causing the problem) This happens with

Re: python crash on windows but not on linux

2010-02-11 Thread Emile van Sebille
On 2/11/2010 6:32 AM hjebbers said... To all, I am running an EDI translator, ... let's say bots :) and doing stress tests. When processing a test with a (relatively) big EDI file(s) on windowsXP I get a crash: 'sorry for the inconvenience' etc (so no clues about what is causing the p

Re: python and http POST

2010-02-11 Thread Terry Reedy
On 2/11/2010 2:11 PM, galileo228 wrote: Hey All, Been teaching myself Python for a few weeks, and am trying to write a program that will go to a url, enter a string in one of the search fields, submit the search, and return the contents of the search result. I'm using httplib2. My two particul

Re: Is a merge interval function available?

2010-02-11 Thread Peter
On Feb 12, 8:03 am, Jonathan Gardner wrote: > On Feb 10, 3:23 pm, Peng Yu wrote: > > > > > > > I'm wondering there is already a function in python library that can > > merge intervals. For example, if I have the following intervals ('[' > > and ']' means closed interval as > > inhttp://en.wikipe

Re: Need debugging knowhow for my creeping Unicodephobia

2010-02-11 Thread Terry Reedy
On 2/11/2010 4:43 PM, mk wrote: Neat, except that the process of porting most projects and external libraries to P3 seems to be, how should I put it, standing still? What is important are the libraries, so more new projects can start in 3.x. There is a slow trickly of 3.x support announcement

Re: MODULE FOR I, P FRAME

2010-02-11 Thread Rhodri James
On Thu, 11 Feb 2010 19:31:52 -, DANNY wrote: Hello! I am currently developing a simple video player in python, and my problem is that i can't find a module which has a function that can determine if frame(image) is I or P coded (MPEG coding). I have been using PIL but I couldnt find anythi

Please help with MemoryError

2010-02-11 Thread Jeremy
I have been using Python for several years now and have never run into memory errors… until now. My Python program now consumes over 2 GB of memory and then I get a MemoryError. I know I am reading lots of files into memory, but not 2GB worth. I thought I didn't have to worry about memory alloc

Re: Function attributes

2010-02-11 Thread Gabriel Genellina
En Thu, 11 Feb 2010 00:25:00 -0300, Terry Reedy escribió: On 2/10/2010 4:49 PM, Gabriel Genellina wrote: I've written a decorator for "injecting" a __function__ name into the function namespace, but I can't find it anywhere. I think I implemented it by adding a fake additional argument and rep

Re: Please help with MemoryError

2010-02-11 Thread Stephen Hansen
On Thu, Feb 11, 2010 at 3:39 PM, Jeremy wrote: > My Python program now consumes over 2 GB of memory and then I get a > MemoryError. I know I am reading lots of files into memory, but not > 2GB worth. I thought I didn't have to worry about memory allocation > in Python because of the garbage col

Re: Please help with MemoryError

2010-02-11 Thread Alf P. Steinbach
* Jeremy: I have been using Python for several years now and have never run into memory errors… until now. My Python program now consumes over 2 GB of memory and then I get a MemoryError. I know I am reading lots of files into memory, but not 2GB worth. I thought I didn't have to worry about

ANN: ActivePython 2.5.5.7 is now available

2010-02-11 Thread Sridhar Ratnakumar
I'm happy to announce that ActivePython 2.5.5.7 is now available for download from: http://www.activestate.com/activepython/ This is a minor release with several updates and fixes. Changes in 2.5.5.7 -- - Upgrade to Python 2.5.5 - Upgrade to Tcl/Tk 8.5.8 - Upgrade to PyWin32

Re: Please help with MemoryError

2010-02-11 Thread Jonathan Gardner
On Feb 11, 3:39 pm, Jeremy wrote: > I have been using Python for several years now and have never run into > memory errors… > > until now. > Yes, Python does a good job of making memory errors the least of your worries as a programmer. Maybe it's doing too good of a job... > My Python program no

Re: python crash on windows but not on linux

2010-02-11 Thread hjebbers
On Feb 11, 11:59 pm, Terry Reedy wrote: > On 2/11/2010 9:32 AM, hjebbers wrote: > > > > > To all, > > I am running an EDI translator, and doing stress tests. > > When processing a test with a (relatively) big EDI file(s) on > > windowsXP  I get a crash: > >      'sorry for the inconvenience' etc  

  1   2   >