Debugging python in emacs isn't working.

2009-11-09 Thread menomnon
Hi, Emacs 22.3, python 2.6.4 Put the following into my .emacs: (setq pdb-path 'c:\\python26\\lib\\pdb.py gud-pdb-command-name (symbol-name pdb-path)) (defadvice pdb (before gud-query-cmdline activate) Provide a better default command line when called interactively. (interactive

Re: String prefix question

2009-11-09 Thread Ben Finney
Alan Harris-Reid a...@baselinedata.co.uk writes: From what I can gather from the documentation the b prefix represents a bytes literal Yes. In Python 3 there are two types with similar-looking literal syntax: ‘str’ and ‘bytes’. The types are mutually incompatible (though they can be explicitly

Re: pythonw.exe under Windows-7 (Won't run for one admin user)

2009-11-09 Thread SD_V897
Dennis Lee Bieber wrote: On Fri, 06 Nov 2009 21:19:44 GMT, SD_V897 sd_v...@nosuchmail.com declaimed the following in gmane.comp.python.general: AppPath=C:\Program Files\Utilities\Python Scripting v2.62\pythonw.exe That's an interesting path... Did the install path for Python (from

Re: Help with OS X installation

2009-11-09 Thread stephen_b
Thanks all. That did it. -- http://mail.python.org/mailman/listinfo/python-list

Choosing GUI Module for Python

2009-11-09 Thread Antony
Hi all I just wanted to know which module is best for developing designing interface in python . i have come across some modules which are listed here . please tell your suggestions and comments to choose best one 1. PyGTK 2. PyQT 3. PySide 4. wxPython 5 . TKinter Also i need to know is

Re: Cancelling a python thread (revisited...)

2009-11-09 Thread John Nagle
Antoine Pitrou wrote: John Nagle nagle at animats.com writes: I'd argue against general thread cancellation. Inter-thread signals, though, have safety problems no worse than the first-thread only signals we have now. You're allowed to raise an exception in a signal handler, which is

Re: Choosing GUI Module for Python

2009-11-09 Thread r
On Nov 8, 10:49 pm, Antony anthonir...@gmail.com wrote: Hi all    I just wanted to know which module is best for developing designing interface in python . i have come across some modules which are listed here . please tell your suggestions and comments to choose best one  1. PyGTK  2. PyQT

Re: Indentation problems

2009-11-09 Thread r
On Nov 8, 1:48 pm, Tim Chase python.l...@tim.thechases.com wrote: I am having problems with indentation some times. When I hit the enter key after if statements or while statemt there are times when the indentation is too much and other times too little. Check for omitted brackets, braces

Re: Choosing GUI Module for Python

2009-11-09 Thread Antony
On Nov 9, 11:49 am, r rt8...@gmail.com wrote: On Nov 8, 10:49 pm, Antony anthonir...@gmail.com wrote: Hi all    I just wanted to know which module is best for developing designing interface in python . i have come across some modules which are listed here . please tell your suggestions

how to close not response win32 IE com interface

2009-11-09 Thread elca
hello, these day im making some script that use win32 IE com interface. one of problem is , my internet line is very slow, so sometimes my IE.navigate(http://www.example.com;) not response timely. it looks hang and open status, not complete status. so my IE.navigate function is not correctly

Re: installing library on MAC OS X 10.5.8

2009-11-09 Thread Diez B. Roggisch
Xbiton schrieb: Hi, I'm new to mac and I'm having a lot of problems installing library on mac ox x 10.5.8. I want to install PyXML and although the install procedure - just done like described on the web page of PyXML - That's a 5-years-old XML package. Don't use it. Your python2.5 already

Re: Query about doing fortran-esque repeat formatting

2009-11-09 Thread Glenn Hutchings
Rob Briggs rdbriggs at mun.ca writes: Is there a way to do a repeat formatting command like in Fortran? Rather that doing this: print %s %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f % (parmName[i], tmp[i][1], tmp[i][2], tmp[i][4], tmp[i][6], tmp[i][7], tmp[i][8], tmp[i][9]) There

Re: how to remove the same words in the paragraph

2009-11-09 Thread Tim Chase
I think simple regex may come handy, p=re.compile(r'(.+) .*\1')#note the space s=p.search(python and i love python) s.groups() (' python',) But that matches for only one double word.Someone else could light up here to extract all the double words.Then they can be removed from the

Re: username/password dialog prompt

2009-11-09 Thread Dan Winsor
On Nov 6, 4:40 pm, Cousin Stanley cousinstan...@gmail.com wrote: My Tkinter is very rusty but perhaps you could do it something like this :  http://pastebin.com/m5e49da19 I forgot how to get rid of the empty root window that appears, sorry.   root.withdraw()   # should do it Thanks to

Re: Cancelling a python thread (revisited...)

2009-11-09 Thread Antoine Pitrou
Le Sun, 08 Nov 2009 21:04:06 -0800, John Nagle a écrit : Antoine Pitrou wrote: John Nagle nagle at animats.com writes: I'd argue against general thread cancellation. Inter-thread signals, though, have safety problems no worse than the first-thread only signals we have now. You're

Re: Query about doing fortran-esque repeat formatting

2009-11-09 Thread Jean-Michel Pichavant
Glenn Hutchings wrote: Rob Briggs rdbriggs at mun.ca writes: Is there a way to do a repeat formatting command like in Fortran? Rather that doing this: print %s %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f % (parmName[i], tmp[i][1], tmp[i][2], tmp[i][4], tmp[i][6], tmp[i][7],

OT: regular expression matching multiple occurrences of one group

2009-11-09 Thread pinkisntwell
How can I make a regular expression that will match every occurrence of a group and return each occurrence as a group match? For example, for a string -c-c-c-c-c, how can I make a regex which will return a group match for each occurrence of -c? --

Re: Choosing GUI Module for Python

2009-11-09 Thread sstein...@gmail.com
On Nov 9, 2009, at 3:59 AM, Antony wrote: You may want to offer a little more info, like what exactly you are looking to do with such GUI. are your needs for a VW, Corvette, or Mercedes? etc, etc. All these kits have pros and cons, some better for this some for that, yadda yadda I would

Re: sort values from dictionary of dictionaries python 2.4

2009-11-09 Thread Peter Otten
J Wolfe wrote: I would like to sort this dictionary by the values of the inner dictionary ‘ob’ key. Python's built-in dictionary is unsorted by design. mydict = {’WILW1′: {’fx’: ‘8.1′, ‘obtime’: ‘2009-11-07 06:45:00′, ‘ob’: ‘6.9′}, ‘GRRW1′: {’fx’: ‘12.8′, ‘obtime’: ‘2009-11-07 04:15:00′,

CGI vs mod_python

2009-11-09 Thread Victor Subervi
Hi; I've been told by a server farm that they're having trouble getting my scripts to work because they're written with cgi calls as opposed to mod_python. Is there a basis for their complaint? These pages serve fine on another server. TIA, Victor --

Re: CGI vs mod_python

2009-11-09 Thread sstein...@gmail.com
On Nov 9, 2009, at 9:32 AM, Victor Subervi wrote: Hi; I've been told by a server farm that they're having trouble getting my scripts to work because they're written with cgi calls as opposed to mod_python. Is there a basis for their complaint? These pages serve fine on another server.

Re: Query about doing fortran-esque repeat formatting

2009-11-09 Thread Rob Briggs
Thanks to the chaps who answered, I knew there would be an efficient answer to this. regards, Rob On Mon, 2009-11-09 at 13:31 +0100, Jean-Michel Pichavant wrote: Glenn Hutchings wrote: Rob Briggs rdbriggs at mun.ca writes: Is there a way to do a repeat formatting command

Re: Choosing GUI Module for Python

2009-11-09 Thread Kevin Walzer
On 11/8/09 11:49 PM, Antony wrote: Hi all I just wanted to know which module is best for developing designing interface in python . i have come across some modules which are listed here . please tell your suggestions and comments to choose best one 1. PyGTK 2. PyQT 3. PySide 4.

Re: CGI vs mod_python

2009-11-09 Thread Victor Subervi
Yes, obviously. But if CGI is enabled, it should work anyway, should it not? V On Mon, Nov 9, 2009 at 9:46 AM, sstein...@gmail.com sstein...@gmail.comwrote: On Nov 9, 2009, at 9:32 AM, Victor Subervi wrote: Hi; I've been told by a server farm that they're having trouble getting my

Re: CGI vs mod_python

2009-11-09 Thread sstein...@gmail.com
On Nov 9, 2009, at 10:18 AM, Victor Subervi wrote: Yes, obviously. But if CGI is enabled, it should work anyway, should it not? Depends on what CGI is enabled means. Usually, web servers are not set to just handle cgi scripts from anywhere, but only from specific file system locations.

[PYTHON] How to set the range for x-axis

2009-11-09 Thread Moses
Hi Everyone, I have written a script in python to plot a graph. However, the range for the x-axis starts from 0.5 to 1.0. However, I would like to start from 0 to 1. Any pointer to this shall be appreciated. Thanks, Moses -- http://mail.python.org/mailman/listinfo/python-list

Re: [PYTHON] How to set the range for x-axis

2009-11-09 Thread Chris Rebert
On Mon, Nov 9, 2009 at 7:45 AM, Moses jam...@gmail.com wrote: I have written a script in python to plot a graph. However, the range for the x-axis starts from 0.5 to 1.0. However, I would like to start from 0 to 1. Any pointer to this shall be appreciated. Some /very/ basic information such as

Re: OT: regular expression matching multiple occurrences of one group

2009-11-09 Thread Diez B. Roggisch
pinkisntwell schrieb: How can I make a regular expression that will match every occurrence of a group and return each occurrence as a group match? For example, for a string -c-c-c-c-c, how can I make a regex which will return a group match for each occurrence of -c? Why is this flagged OT?

Re: CGI vs mod_python

2009-11-09 Thread Victor Subervi
Uuuuh. Thanks! V On Mon, Nov 9, 2009 at 10:45 AM, sstein...@gmail.com sstein...@gmail.comwrote: On Nov 9, 2009, at 10:41 AM, Victor Subervi wrote: On Mon, Nov 9, 2009 at 10:29 AM, sstein...@gmail.com sstein...@gmail.comwrote: On Nov 9, 2009, at 10:18 AM, Victor Subervi wrote: Yes,

Re: OT: regular expression matching multiple occurrences of one group

2009-11-09 Thread Jon Clements
On Nov 9, 1:53 pm, pinkisntwell pinkisntw...@gmail.com wrote: How can I make a regular expression that will match every occurrence of a group and return each occurrence as a group match? For example, for a string -c-c-c-c-c, how can I make a regex which will return a group match for each

Req. comments on first version ch 2 progr. intro (using Python 3.x in Windows)

2009-11-09 Thread Alf P. Steinbach
Chapter 2 Basic Concepts is about 0.666 completed and 30 pages so far. It's now Python 3.x, and reworked with lots of graphical examples and more explanatory text, plus limited in scope to Basic Concepts (which I previously just had as a first ch 2 section -- but there's rather a lot of

Re: [PYTHON] How to set the range for x-axis

2009-11-09 Thread Moses
Hi Chris, I am using python 2.6 and am using scipy and pylab. See the code below. Cheers. from scipy import * from pylab import * x1 = [0.5,0.6,0.7,0.8,0.9,1.0] x2 = [0,1,2,3,4,5,6,7,8,9,10] plot(x1,y01,linewidth=5.0) show() Thanks. . On Mon, Nov 9, 2009 at 5:49 PM, Chris Rebert

Re: [PYTHON] How to set the range for x-axis

2009-11-09 Thread Moses
Hi Chris, The code is from scipy import * from pylab import * x = [0.5,0.6,0.7,0.8,0.9,1.0] y = [2,6,8,10,10,10] plot(x,y,linewidth=5.0) show() and not from scipy import * from pylab import * x1 = [0.5,0.6,0.7,0.8,0.9,1.0] x2 = [0,1,2,3,4,5,6,7,8,9,10] plot(x1,y01,linewidth=5.0) show()

Re: String prefix question

2009-11-09 Thread Gerard Flanagan
Alan Harris-Reid wrote: In the Python.org 3.1 documentation (section 20.4.6), there is a simple “Hello World” WSGI application which includes the following method... def hello_world_app(environ, start_response): status = b'200 OK' # HTTP Status headers = [(b'Content-type', b'text/plain;

Re: Req. comments on first version ch 2 progr. intro (using Python 3.x in Windows)

2009-11-09 Thread Jon Clements
On Nov 9, 4:10 pm, Alf P. Steinbach al...@start.no wrote: Chapter 2 Basic Concepts is about 0.666 completed and 30 pages so far. It's now Python 3.x, and reworked with lots of graphical examples and more explanatory text, plus limited in scope to Basic Concepts (which I previously just had as

Re: OT: regular expression matching multiple occurrences of one group

2009-11-09 Thread sln
On Mon, 9 Nov 2009 05:53:00 -0800 (PST), pinkisntwell pinkisntw...@gmail.com wrote: How can I make a regular expression that will match every occurrence of a group and return each occurrence as a group match? For example, for a string -c-c-c-c-c, how can I make a regex which will return a group

Re: OT: regular expression matching multiple occurrences of one group

2009-11-09 Thread J�rgen Exner
pinkisntwell pinkisntw...@gmail.com wrote: How can I make a regular expression that will match every occurrence of a group and return each occurrence as a group match? For example, for a string -c-c-c-c-c, how can I make a regex which will return a group match for each occurrence of -c? Where is

Re: Req. comments on first version ch 2 progr. intro (using Python 3.x in Windows)

2009-11-09 Thread Alf P. Steinbach
* Jon Clements: On Nov 9, 4:10 pm, Alf P. Steinbach al...@start.no wrote: Chapter 2 Basic Concepts is about 0.666 completed and 30 pages so far. It's now Python 3.x, and reworked with lots of graphical examples and more explanatory text, plus limited in scope to Basic Concepts (which I

Re: Req. comments on first version ch 2 progr. intro (using Python 3.x in Windows)

2009-11-09 Thread sstein...@gmail.com
On Nov 9, 2009, at 11:54 AM, Jon Clements wrote: On Nov 9, 4:10 pm, Alf P. Steinbach al...@start.no wrote: First, because as opposed to ch 1 there is quite a bit of code here, and since I'm a Python newbie I may be using non-idiomatic constructs, Welp, there goes my last excuse. I'm off

Re: Re: String prefix question

2009-11-09 Thread Alan Harris-Reid
Gerard Flanagan wrote: div class=moz-text-flowedAlan Harris-Reid wrote: In the Python.org 3.1 documentation (section 20.4.6), there is a simple “Hello World” WSGI application which includes the following method... def hello_world_app(environ, start_response): status ='200 OK' # HTTP Status

Re: Serious Privileges Problem: Please Help

2009-11-09 Thread Victor Subervi
Did you give up on me? V On Sun, Nov 8, 2009 at 12:40 PM, Victor Subervi victorsube...@gmail.comwrote: [r...@13gems angrynates.com]# chcon -R -h unconfined_u:object_r:httpd_sys_content_t global_solutions/* Then I surfed to http://209.216.9.56/global_solutions/index.py [r...@13gems

Re: Req. comments on first version ch 2 progr. intro (using Python 3.x in Windows)

2009-11-09 Thread Alf P. Steinbach
* sstein...@gmail.com: On Nov 9, 2009, at 11:54 AM, Jon Clements wrote: On Nov 9, 4:10 pm, Alf P. Steinbach al...@start.no wrote: First, because as opposed to ch 1 there is quite a bit of code here, and since I'm a Python newbie I may be using non-idiomatic constructs, Welp, there goes my

Re: Serious Privileges Problem: Please Help

2009-11-09 Thread Simon Forman
On Mon, Nov 9, 2009 at 12:44 PM, Victor Subervi victorsube...@gmail.com wrote: Did you give up on me? V Please don't top-post. -- http://mail.python.org/mailman/listinfo/python-list

Re: Serious Privileges Problem: Please Help

2009-11-09 Thread Rami Chowdhury
On Mon, 09 Nov 2009 09:44:24 -0800, Victor Subervi victorsube...@gmail.com wrote: Did you give up on me? V On Sun, Nov 8, 2009 at 12:40 PM, Victor Subervi victorsube...@gmail.comwrote: [r...@13gems angrynates.com]# chcon -R -h unconfined_u:object_r:httpd_sys_content_t global_solutions/*

Re: Tax Calculator--Tkinter

2009-11-09 Thread Marcus Gnaß
Someone Something wrote: from Tkinter import *; Try to avoid this. Better import Tkinter. And don't forget to import Tkconstants too! rate=Frame(root) income=Frame(root) result=Frame(root) Why do you use three frames? You only need one. And you can make your class TaxCalc inherit from

Re: Serious Privileges Problem: Please Help

2009-11-09 Thread Victor Subervi
Of course. Let me start with some updates to httpd.conf, which didn't help anyway: VirtualHost *:80 ServerAdmin m...@creative.vi DocumentRoot /var/www/html/angrynates.com ServerName angrynates.com Options +ExecCGI -IncludesNoExec Directory /var/www/html/angrynates.com/global_solutions Options

Re: Choosing GUI Module for Python

2009-11-09 Thread r
On Nov 9, 3:59 am, Antony anthonir...@gmail.com wrote: I would like to know about that pros and cons only ... I'll reiterate what i have said and others have said. WE NEED MORE INFO TO PROPERLY GUIDE YOU!!! Survey: What GUI is right for you? 1. What is your level of GUI programming? (0 1 2 3 4

Re: Req. comments on first version ch 2 progr. intro (using Python 3.x in Windows)

2009-11-09 Thread Jon Clements
On Nov 9, 5:22 pm, Alf P. Steinbach al...@start.no wrote: * Jon Clements: On Nov 9, 4:10 pm, Alf P. Steinbach al...@start.no wrote: Chapter 2 Basic Concepts is about 0.666 completed and 30 pages so far. It's now Python 3.x, and reworked with lots of graphical examples and more

Re: Serious Privileges Problem: Please Help

2009-11-09 Thread Rami Chowdhury
On Mon, 09 Nov 2009 10:36:31 -0800, Victor Subervi victorsube...@gmail.com wrote: Of course. Let me start with some updates to httpd.conf, which didn't help anyway: VirtualHost *:80 ServerAdmin m...@creative.vi DocumentRoot /var/www/html/angrynates.com ServerName angrynates.com Options

questions regarding stack size use for multi-threaded python programs

2009-11-09 Thread Eyal Gordon
Hi, background: we are using python 2.4.3 on CentOS 5.3 with many threads - and our shell's default stack size limit is set to 10240KB (i.e. ~10MB). we noticed that python's Threading module appears to create threads with this value as their stack size (we ran a sample program that creates 10

Re: Re: String prefix question

2009-11-09 Thread Alan Harris-Reid
Benjamin Kaplan wrote: On Sun, Nov 8, 2009 at 9:38 PM, Alan Harris-Reid a...@baselinedata.co.uk wrote: In the Python.org 3.1 documentation (section 20.4.6), there is a simple Hello World WSGI application which includes the following method... def hello_world_app(environ, start_response):

Re: Serious Privileges Problem: Please Help

2009-11-09 Thread Victor Subervi
On Mon, Nov 9, 2009 at 1:53 PM, Rami Chowdhury rami.chowdh...@gmail.comwrote: On Mon, 09 Nov 2009 10:36:31 -0800, Victor Subervi victorsube...@gmail.com wrote: Of course. Let me start with some updates to httpd.conf, which didn't help anyway: VirtualHost *:80 ServerAdmin

Re: Serious Privileges Problem: Please Help

2009-11-09 Thread Rami Chowdhury
On Mon, 09 Nov 2009 11:24:33 -0800, Victor Subervi victorsube...@gmail.com wrote: On Mon, Nov 9, 2009 at 1:53 PM, Rami Chowdhury rami.chowdh...@gmail.comwrote: On Mon, 09 Nov 2009 10:36:31 -0800, Victor Subervi victorsube...@gmail.com wrote: Of course. Let me start with some updates to

Re: Choosing GUI Module for Python

2009-11-09 Thread Simon Hibbs
Having tried most of the options out there, personaly I've settled on two. I use Tkinter for ver simple GUIs such as single dialog boxes or results displays. The advantage of it being built-in to Python outweighs it's limitations. For anything more complex, I go for PyQT every time. QTDesigner

Re: [PYTHON] How to set the range for x-axis

2009-11-09 Thread David Robinow
On Mon, Nov 9, 2009 at 11:46 AM, Moses jam...@gmail.com wrote: Hi Chris, The code is from scipy import * from pylab import * x = [0.5,0.6,0.7,0.8,0.9,1.0] y = [2,6,8,10,10,10] plot(x,y,linewidth=5.0) show() and not from scipy import * from pylab import * x1 =

Re: [PYTHON] How to set the range for x-axis

2009-11-09 Thread Robert Kern
On 2009-11-09 10:43 AM, Moses wrote: Hi Chris, I am using python 2.6 and am using scipy and pylab. See the code below. You will want to ask matplotlib questions on the matplotlib mailing list: https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Robert Kern I have come to

Re: Serious Privileges Problem: Please Help

2009-11-09 Thread Victor Subervi
On Mon, Nov 9, 2009 at 2:30 PM, Victor Subervi victorsube...@gmail.comwrote: On Mon, Nov 9, 2009 at 2:27 PM, Rami Chowdhury rami.chowdh...@gmail.comwrote: On Mon, 09 Nov 2009 11:24:33 -0800, Victor Subervi victorsube...@gmail.com wrote: On Mon, Nov 9, 2009 at 1:53 PM, Rami Chowdhury

Re: How to set the range for x-axis

2009-11-09 Thread Martin
On Nov 9, 8:45 pm, Robert Kern robert.k...@gmail.com wrote: On 2009-11-09 10:43 AM, Moses wrote: Hi Chris, I am using python 2.6 and am using scipy and pylab. See the code below. You will want to ask matplotlib questions on the matplotlib mailing list:

Re: IDLE python shell freezes after running show() of matplotlib

2009-11-09 Thread Michael
On Oct 28, 11:09 pm, Chris Colbert sccolb...@gmail.com wrote: This is a threading issue that is very common when using gui toolkits with the interactive interpreter. You're better off just using ipython, which already has builtin support for matplotlib when you start it via ipython -pylab

Re: Can't Find Module

2009-11-09 Thread Rhodri James
On Sat, 07 Nov 2009 16:59:29 -, Victor Subervi victorsube...@gmail.com wrote: ImportError: No module named template [snip] I can import this just fine from the python command prompt. So, what gives? Is template.py in your current directory when you run the script from the command

NEWB problem with urllib2

2009-11-09 Thread Penn
I just installed PyDev into Eclipse using the 'update' method and did the standard installation. I allowed it to Auto Configure itself and ran a Hello World module to make sure I was in the ballpark. I got an starting module up and have run Hello World but now am stuck on getting urlopen to

Re: PiCloud Beta Release

2009-11-09 Thread Ken Elkabany
On Thu, Nov 5, 2009 at 3:19 PM, Jacob Shaw shawjac...@gmail.com wrote: On Nov 1, 5:13 pm, Ken Elkabany k...@elkabany.com wrote: Hello, PiCloud has just released a Python library, cloud, which allows you to easily offload the execution of a function to a cluster of servers running on Amazon

Socket programming with NetCom serial-to-ethernet module

2009-11-09 Thread Ryan Swindle
Hi, This is my first Python-list post; I hope it's going to the right place. Here's my problem: I've read many tutorials on socket programming, but I can't seem to piece them together for my particular case. I have 3 serial ports, each of which individually connects to a port on a NetCom box,

Re: Indentation problems

2009-11-09 Thread Rhodri James
I'm going to make a whole bunch of wild guesses here, since you don't give us a lot to go on. Wild Guess #1: you're using IDLE. On Sun, 08 Nov 2009 19:01:37 -, Ray Holt mrhol...@sbcglobal.net wrote: I am having problems with indentation some times. When I hit the enter key after if

Re: is None or == None ?

2009-11-09 Thread Rhodri James
On Sun, 08 Nov 2009 19:45:31 -, Terry Reedy tjre...@udel.edu wrote: I believe the use of tagged pointers has been considered and so far rejected by the CPython developers. And no one else that I know of has developed a fork for that. It would seem more feasible with 64 bit pointers

Is it possible to get the Physical memory address of a variable in python?

2009-11-09 Thread Ognjen Bezanov
Hello all, Say I have a python variable: a = hello Is it possible for me to get the physical address of that variable (i.e. where it is in RAM)? I know that id(a) will give me it's memory address, but the address given does not seem to correlate with the physical memory. Is this even

Re: Is it possible to get the Physical memory address of a variable in python?

2009-11-09 Thread Benjamin Kaplan
On Mon, Nov 9, 2009 at 7:47 PM, Ognjen Bezanov ogn...@mailshack.com wrote: Hello all, Say I have a python variable: a = hello Is it possible for me to get the physical address of that variable (i.e. where it is in RAM)? I know that id(a) will give me it's memory address, but the address

Re: NEWB problem with urllib2

2009-11-09 Thread Simon Forman
On Mon, Nov 9, 2009 at 6:29 PM, Penn powderd...@gmail.com wrote: I just installed PyDev into Eclipse using the 'update' method and did the standard installation.  I allowed it to Auto Configure itself and ran a Hello World module to make sure I was in the ballpark. I got an starting module up

Re: Is it possible to get the Physical memory address of a variable in python?

2009-11-09 Thread MRAB
Ognjen Bezanov wrote: Hello all, Say I have a python variable: a = hello Is it possible for me to get the physical address of that variable (i.e. where it is in RAM)? I know that id(a) will give me it's memory address, but the address given does not seem to correlate with the physical

Re: on Namespaces

2009-11-09 Thread Rhodri James
On Sun, 08 Nov 2009 21:20:23 -, webtourist webtour...@gmail.com wrote: New bie Question: in Zen of Python - what exactly does the last one mean ? - Namespaces are one honking great idea -- let's do more of those! I mean why the emphasis ? Is it like saying put modules into packages in

Re: NEWB problem with urllib2

2009-11-09 Thread Penn
Thanks Simon! You are right.. I also believe it is something with Eclipse. I've been working since... the module below runs.. but Eclipse is still showing an error when I reference urlopen with a little red X... saying it is an undefined variable in the IDE.. but not giving me an runtime

Re: Debugging python in emacs isn't working.

2009-11-09 Thread menomnon
On Nov 8, 6:36 pm, menomnon p...@well.com wrote: Hi, Emacs 22.3, python 2.6.4 Put the following into my .emacs: (setq pdb-path 'c:\\python26\\lib\\pdb.py       gud-pdb-command-name (symbol-name pdb-path)) (defadvice pdb (before gud-query-cmdline activate)   Provide a better default

Re: Is it possible to get the Physical memory address of a variable in python?

2009-11-09 Thread Dave Angel
Benjamin Kaplan wrote: On Mon, Nov 9, 2009 at 7:47 PM, Ognjen Bezanov ogn...@mailshack.com wrote: Hello all, Say I have a python variable: a = hello Is it possible for me to get the physical address of that variable (i.e. where it is in RAM)? I know that id(a) will give me it's memory

Re: Is it possible to get the Physical memory address of a variable in python?

2009-11-09 Thread Carl Banks
On Nov 9, 4:47 pm, Ognjen Bezanov ogn...@mailshack.com wrote: Hello all, Say I have a python variable: a = hello Is it possible for me to get the physical address of that variable (i.e. where it is in RAM)? I know that id(a) will give me it's memory address, but the address given does

how to create a pip package

2009-11-09 Thread Phlip
Py hont: I have a single file that I need my crew to pip install. When I Google for how to create a pip package I don't hit anything. Of course that info is out there; I can't seem to pick up the trail of breadcrumbs to it. While I'm looking, could someone push the link in here? Purely for

Re: sort values from dictionary of dictionaries python 2.4

2009-11-09 Thread Steven D'Aprano
On Mon, 09 Nov 2009 06:02:09 -0800, J Wolfe wrote: Hi, I would like to sort this dictionary by the values of the inner dictionary ‘ob’ key. You can't sort dictionaries in Python, because they are unordered hash tables. Giving up the ability to store items in order is one of the things

Re: Most efficient way to pre-grow a list?

2009-11-09 Thread Gabriel Genellina
En Sun, 08 Nov 2009 10:08:35 -0300, gil_johnson gil_john...@earthlink.net escribió: On Nov 6, 8:46 pm, gil_johnson gil_john...@earthlink.net wrote: The problem I was solving was this: I wanted an array of 32-bit integers to be used as a bit array, and I wanted it initialized with all bits set,

Re: on Namespaces

2009-11-09 Thread Steven D'Aprano
On Sun, 08 Nov 2009 13:20:23 -0800, webtourist wrote: New bie Question: in Zen of Python - what exactly does the last one mean ? - Namespaces are one honking great idea -- let's do more of those! I mean why the emphasis ? Is it like saying put modules into packages in other programming

Re: how to create a pip package

2009-11-09 Thread Gabriel Genellina
En Tue, 10 Nov 2009 00:48:26 -0300, Phlip phlip2...@gmail.com escribió: I have a single file that I need my crew to pip install. When I Google for how to create a pip package I don't hit anything. Of course that info is out there; I can't seem to pick up the trail of breadcrumbs to it. See

Re: OT: regular expression matching multiple occurrences of one group

2009-11-09 Thread Gabriel Genellina
En Mon, 09 Nov 2009 12:59:53 -0300, Jon Clements jon...@googlemail.com escribió: On Nov 9, 1:53 pm, pinkisntwell pinkisntw...@gmail.com wrote: How can I make a regular expression that will match every occurrence of a group and return each occurrence as a group match? For example, for a

[issue6508] expose setresuid

2009-11-09 Thread Gregory P. Smith
Gregory P. Smith g...@krypto.org added the comment: Attaching an updated patch that includes unittests. I also changed the set functions to take input as long's instead of int's as that is more likely to fit within a uid_t and forced the return values on the get's to fit within a long and

[issue7293] test_msvc9compiler test_reg_class failure on new Windows box

2009-11-09 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: As you now have access to freshly-installed systems: can you propose such a key? -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7293

[issue7293] test_msvc9compiler test_reg_class failure on new Windows box

2009-11-09 Thread David Bolen
David Bolen db3l@gmail.com added the comment: Well, I can at least start by comparing XP and Win7 immediately post-installation. Any suggestions on guidelines to what can be chosen? Does it have to be a DWORD, or a 0/1 value, or under HKCU for a specific reason? --

[issue5792] Enable short float repr() on Solaris/x86

2009-11-09 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: There are some related comments in issue #7281. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5792 ___

[issue7281] copysign() with NaN arguments on OpenSolaris

2009-11-09 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Yes, I don't think Python 2.6 had a deliberate workaround. I suspect that it's just that one version of Python happened to use something like 0.0/0.0 to generate NaN, while another used some equivalent of strtod(nan, ...). I also remember

[issue7281] copysign() with NaN arguments on OpenSolaris

2009-11-09 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Just to confirm the above: In 2.6, PyFloat_FromString in Objects/floatobject.c ends up using the system strtod to parse nan and -nan (except that if the system strtod fails to recognise nan for some reason then it returns the result of 0.0 *

[issue5792] Enable short float repr() on Solaris/x86

2009-11-09 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: I can confirm that short float repr() is active and all float tests are passed on this combination: Ubuntu64bit - KVM - OpenSolaris32bit/Python3.2/gcc -- nosy: +skrah ___ Python tracker

[issue5792] Enable short float repr() on Solaris/x86

2009-11-09 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Stefan Krah mentions in the issue 7281 discussion that suncc supports the C99 fenv functions. I'm not sure how to use these to set the x87 precision, though. (Setting the rounding mode is straightforward.) --

[issue7276] UnboundLocalError scoping problem with nested functions

2009-11-09 Thread Ole Laursen
Ole Laursen o...@iola.dk added the comment: OK, sorry, I was under the impression that the global binding was still available (I can't find anything to the contrary here http://docs.python.org/reference/simple_stmts.html#assignment-statements ) but it's obviously using a static definition of

[issue5792] Enable short float repr() on Solaris/x86

2009-11-09 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I see two alternatives: (1) Use fesetenv. I don't know what the appropriate value to pass would be though, or even whether solaris lets you use fesetenv to control the x87 precision. It seems that its primary purpose is to set flags and

[issue5792] Enable short float repr() on Solaris/x86

2009-11-09 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Looking at: http://docs.sun.com/app/docs/doc/816-5172/fesetenv-3m it seems that fesetenv isn't what we want here. It 'only installs the state of the floating-point status flags represented through its argument'. --

[issue5792] Enable short float repr() on Solaris/x86

2009-11-09 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Stefan, is it possible that suncc already accepts the assembler syntax used in Python/pymath.h (py3k or trunk) for the functions _Py_get_387controlword and _Py_set_387controlword? -- ___ Python

[issue7282] RLocks leak references when used in raw threads

2009-11-09 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: An updated patch with test. -- Added file: http://bugs.python.org/file15298/rlock_leak2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7282

[issue5792] Enable short float repr() on Solaris/x86

2009-11-09 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- assignee: - mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5792 ___ ___

[issue7242] Forking in a thread raises RuntimeError

2009-11-09 Thread Zsolt Cserna
Zsolt Cserna zsolt.cse...@morganstanley.com added the comment: Additional info: I've tested it on solaris 10 / sparc 32-bit, and my test script runs fine on that. Based on my test it seems that this bug does not affect solaris 10. -- ___ Python

[issue5792] Enable short float repr() on Solaris/x86

2009-11-09 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: The inline asm compiles, but I don't know how good the GNU inline asm support is with suncc in general. I'm not a heavy user of suncc, I just use it for testing. That said, perhaps fesetprec works, too:

[issue5792] Enable short float repr() on Solaris/x86

2009-11-09 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Excellent! From a bit of searching, it looks as though this assembler syntax works on icc as well, which is very good news. Thanks for finding fesetprec as well. It's a shame this isn't standard C. Oh well; maybe for C201X. I think I'd

[issue5792] Enable short float repr() on Solaris/x86

2009-11-09 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: fesetprec and fegetprec are at least semi-standard, it seems. They're recommended in the C99 rationale (see page 121 of http://www.open-std.org/jtc1/sc22/wg14/www/C99RationaleV5.10.pdf ). -- ___

[issue5792] Enable short float repr() on Solaris/x86

2009-11-09 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: If gcc and suncc are present, ./configure chooses gcc and everything is fine. If only suncc is present, it's detected as cc. These tests should be possible: ste...@opensolaris:~/svn/py3k$ cc -V cc: Sun C 5.9 SunOS_i386 Patch 124868-07

[issue5792] Enable short float repr() on Solaris/x86

2009-11-09 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Thanks. uname looks like the way to go, then. Is your copy of OpenSolaris running in 32-bit mode or 64-bit mode? Does the mode make a difference to the output of uname, or is uname -p always i386, regardless of the mode? I think the

  1   2   >