help req installing python 2.6

2010-04-28 Thread sanam singh
hi, i am am facing problem in installing python 2.6 on ubuntu 9.04. When i sudo make i get following error : Failed to find the necessary bits to build these modules: _bsddb _curses_curses_panel _sqlite3 bsddb185 bz2 dbm

Re: pyjamas 0.7 released

2010-04-28 Thread Wolfgang Strobl
lkcl : >On Apr 28, 7:00 am, Wolfgang Strobl wrote: >> Two weeks ago, I played around with the trunk version, looking for an >> working drag&drop example. I didn't find anything, but noticed some >> unfinished code in a dnd subdirectory. Are you aware of the fact that >> many of the examples just

Re: assigning multi-line strings to variables

2010-04-28 Thread Steven D'Aprano
On Thu, 29 Apr 2010 02:16:46 +0100, MRAB wrote: > Steven D'Aprano wrote: >> On Thu, 29 Apr 2010 06:17:42 +1000, Lie Ryan wrote: >> Consider that the concatenation language feature probably is there because it's useful (e.g. it preserves indentation and allows per line comments). >>

Issues while building pyfsevents in python 3.1

2010-04-28 Thread mathan kumar
I m trying port pyfsevents coded in python2.6 to python3.1. But i m getting following errors while building that though i havent changed anything in these lines. Any idea why? " pyfsevents.c:22: error: expected specifier-qualifier-list before ‘CFFileDescriptorRef’ pyfsevents.c:30: error: expected

Re: building python 3 -- _dbm necessary bits

2010-04-28 Thread James Mills
On Thu, Apr 29, 2010 at 1:12 PM, Mark Olbert wrote: > I'm getting an error message about make not being able to find the necessary > bits to build modules related to _dbm. Yet I have > libgdbm installed installed on my system. Suggestions on how to fix this? You need the development C headers fo

Re: ooolib, reading writing a spread sheet and keep formatting

2010-04-28 Thread Kushal Kumaran
On Thu, Apr 29, 2010 at 5:46 AM, News123 wrote: > Hi, > > I'm making first attempts to modify a few cells of an openoffice > spreadsheet. > Try the xlrd and xlwt modules, and the documentation at http://www.python-excel.org/ > -- regards, kushal -- http://mail.python.org/mailman/listinfo/pyt

building python 3 -- _dbm necessary bits

2010-04-28 Thread Mark Olbert
I'm getting an error message about make not being able to find the necessary bits to build modules related to _dbm. Yet I have libgdbm installed installed on my system. Suggestions on how to fix this? - Mark -- http://mail.python.org/mailman/listinfo/python-list

Re: assigning multi-line strings to variables

2010-04-28 Thread MRAB
Steven D'Aprano wrote: On Thu, 29 Apr 2010 06:17:42 +1000, Lie Ryan wrote: Consider that the concatenation language feature probably is there because it's useful (e.g. it preserves indentation and allows per line comments). No, the implicit concatenation is there because Python didn't always h

ooolib, reading writing a spread sheet and keep formatting

2010-04-28 Thread News123
Hi, I'm making first attempts to modify a few cells of an openoffice spreadsheet. I thought I'll start with ooolib as it seems rather simple. ( linux / open office 3.1 / ooolib-python-0.0.16 ) My first test was just to open a spread sheet import ooolib doc = ooolib.Calc() doc.load("doc1.ods")

Re: assigning multi-line strings to variables

2010-04-28 Thread Ben Finney
Lie Ryan writes: > Python have triple-quoted string when you want to include large amount > of text; there is no need to split the string up manually or even > scriptically. You can even have multi-line string literals that have correct indentation in the code, but strip that indentation at runt

Re: CGI python 3 write RAW BINARY

2010-04-28 Thread Antoine Pitrou
Le Wed, 28 Apr 2010 23:54:07 +0200, Dodo a écrit : > Help! this is driving me crazy lol > I want to print raw binary data to display an image file BUT > python3 outputs b'' instead of so the > browser can't read the image!! > > f = open("/some/path/%s" % x, 'rb') > print(f.read()) print

Re: function name

2010-04-28 Thread Steven D'Aprano
On Wed, 28 Apr 2010 21:03:36 +0200, Peter Otten wrote: > Richard Lamboj wrote: > >> is there any way to get the name from the actual called function, so >> that the function knows its own name? > import sys def my_name(): > ... return sys._getframe(1).f_code.co_name Be aware thou

Re: assigning multi-line strings to variables

2010-04-28 Thread Steven D'Aprano
On Thu, 29 Apr 2010 06:17:42 +1000, Lie Ryan wrote: >> Consider that the concatenation language feature probably is there >> because it's useful (e.g. it preserves indentation and allows per line >> comments). > > No, the implicit concatenation is there because Python didn't always > have triple

Re: CGI python 3 write RAW BINARY

2010-04-28 Thread Gary Herron
Dodo wrote: Help! this is driving me crazy lol I want to print raw binary data to display an image file BUT python3 outputs b'' instead of so the browser can't read the image!! f = open("/some/path/%s" % x, 'rb') print(f.read()) any idea? Dorian Huh??? In what universe does print

CGI python 3 write RAW BINARY

2010-04-28 Thread Dodo
Help! this is driving me crazy lol I want to print raw binary data to display an image file BUT python3 outputs b'' instead of so the browser can't read the image!! f = open("/some/path/%s" % x, 'rb') print(f.read()) any idea? Dorian -- http://mail.python.org/mailman/listinfo/python-l

modifying open office spreadsheet (with OO installed)

2010-04-28 Thread News123
Hi, I wanted to know who can recommend a good module/library, that allows to modify an Open Office spreadsheet. One can assume, that Open Office is installed on the host. Is PyUNO_bridge ( http://wiki.services.openoffice.org/wiki/PyUNO_bridge ) the way to go or is there something better / fa

modifying openoffice/xls spreadsheet (without OO /Excel installed)

2010-04-28 Thread News123
Hi, Similiar to me previous question I wanted to know who can recommend a good module/library, that allows to modify an Open Office spreadsheet. If it helps I can also convert to .xls format prior to running my script. However in this case I'd like to work on hosts, which don't have open office

Re: replacing words in HTML file

2010-04-28 Thread Cameron Simpson
On 28Apr2010 22:03, Daniel Fetchinson wrote: | > Any idea how I can replace words in a html file? Meaning only the | > content will get replace while the html tags, javascript, & css are | > remain untouch. | | I'm not sure what you tried and what you haven't but as a first trial | you might want

Re: convert n-byte string into integer

2010-04-28 Thread Maligree
On Apr 28, 11:03 pm, MRAB wrote: > Maligree wrote: > > Hello there. > > > Since this is one of those problems that may have some painfully > > simple solution that will make me feel like a fool, I'll start of with > > this: it's _very_ late (.. yeah, it's not). > > > To the point. > > > Data retur

Re: replacing words in HTML file

2010-04-28 Thread luap...@gmail.com
On Apr 28, 8:02 am, james_027 wrote: > hi, > > Any idea how I can replace words in a html file? Meaning only the > content will get replace while the html tags, javascript, & css are > remain untouch. > > THanks, > James You might try cleaning the HTML with uTidy (http:// utidylib.berlios.de/) to

Re: convert n-byte string into integer

2010-04-28 Thread MRAB
Maligree wrote: Hello there. Since this is one of those problems that may have some painfully simple solution that will make me feel like a fool, I'll start of with this: it's _very_ late (.. yeah, it's not). To the point. Data returned by socket.recvfrom is a string. Obviously one that most o

convert n-byte string into integer

2010-04-28 Thread Maligree
Hello there. Since this is one of those problems that may have some painfully simple solution that will make me feel like a fool, I'll start of with this: it's _very_ late (.. yeah, it's not). To the point. Data returned by socket.recvfrom is a string. Obviously one that most of the time will co

Re: pyjamas 0.7 released

2010-04-28 Thread lkcl
On Apr 28, 7:00 am, Wolfgang Strobl wrote: > lkcl : > > > > > > >On Apr 25, 9:37 pm, Wolfgang Strobl wrote: > >> Daniel Fetchinson : > > >> >> for fits and giggles, to show what's possible in only 400 > >> >> lines of python, here is a game of asteroids, written by joe rumsey. > >> >> yes, it run

Re: assigning multi-line strings to variables

2010-04-28 Thread Lie Ryan
On 04/29/10 04:16, Alf P. Steinbach wrote: > On 28.04.2010 18:54, * Lie Ryan: >> On 04/28/10 15:34, Alf P. Steinbach wrote: > > Yes, that's been mentioned umpteen times in this thread, including the > *very first* quoted sentence above. > > It's IMHO sort of needless to repeat that after quoting

Re: function name

2010-04-28 Thread Terry Reedy
On 4/28/2010 3:20 PM, Alf P. Steinbach wrote: * Richard Lamboj: is there any way to get the name from the actual called function, so that the function knows its own name? There was an earlier thread about this not very long ago. General consensus, as I recall, to replace function with an obj

Re: replacing words in HTML file

2010-04-28 Thread Daniel Fetchinson
> Any idea how I can replace words in a html file? Meaning only the > content will get replace while the html tags, javascript, & css are > remain untouch. I'm not sure what you tried and what you haven't but as a first trial you might want to f = open( 'new.html', 'w' ) f.write( open( 'index.h

Re: NumPy and vectorize

2010-04-28 Thread Robert Kern
On 4/28/10 1:48 PM, Carl Johan Rehn wrote: I'm having problem with the return values of NumPy's vectorize function. When I pass an array of strings in the following simple example, vectorize truncates the strings in the returned list. Any clues of what to do? You will want to report numpy bugs

Re: function name

2010-04-28 Thread Tim Chase
On 04/28/2010 01:50 PM, Emile van Sebille wrote: On 4/28/2010 11:44 AM Richard Lamboj said... is there any way to get the name from the actual called function, so that the function knows its own name? >>> def test():pass ... >>> dir(test) ['__call__', '__class__', '__closure__', '__code_

Re: function name

2010-04-28 Thread Alf P. Steinbach
* Richard Lamboj: is there any way to get the name from the actual called function, so that the function knows its own name? There was an earlier thread about this not very long ago. General consensus, as I recall, to replace function with an object of a class (possibly with __call__ method

Re: function name

2010-04-28 Thread Brendan Abel
On Apr 28, 11:44 am, Richard Lamboj wrote: > Hello, > > is there any way to get the name from the actual called function, so that the > function knows its own name? > > Kind Regards, > > Richi If you want to get the function name from within the function itself, check out the inspect module. http

Re: function name

2010-04-28 Thread Sridhar Ratnakumar
On 2010-04-28, at 11:50 AM, Emile van Sebille wrote: > On 4/28/2010 11:44 AM Richard Lamboj said... >> >> Hello, >> >> is there any way to get the name from the actual called function, so that the >> function knows its own name? >> >> Kind Regards, >> >> Richi > ActivePython 2.6.1.1 (ActiveSt

Re: function name

2010-04-28 Thread Peter Otten
Richard Lamboj wrote: > is there any way to get the name from the actual called function, so that > the function knows its own name? >>> import sys >>> def my_name(): ... return sys._getframe(1).f_code.co_name ... >>> def rumpelstilzchen(): ... print u"Ach, wie gut dass niemand weiß, dass

Re: function name

2010-04-28 Thread Emile van Sebille
On 4/28/2010 11:44 AM Richard Lamboj said... Hello, is there any way to get the name from the actual called function, so that the function knows its own name? Kind Regards, Richi ActivePython 2.6.1.1 (ActiveState Software Inc.) based on Python 2.6.1 (r261:67515, Dec 5 2008, 13:58:38) [MSC v

NumPy and vectorize

2010-04-28 Thread Carl Johan Rehn
I'm having problem with the return values of NumPy's vectorize function. When I pass an array of strings in the following simple example, vectorize truncates the strings in the returned list. Any clues of what to do? Yours, Carl import numpy as np def __f(x): return x f = vectorize(__f) s

function name

2010-04-28 Thread Richard Lamboj
Hello, is there any way to get the name from the actual called function, so that the function knows its own name? Kind Regards, Richi -- http://mail.python.org/mailman/listinfo/python-list

Re: assigning multi-line strings to variables

2010-04-28 Thread Alf P. Steinbach
On 28.04.2010 18:54, * Lie Ryan: On 04/28/10 15:34, Alf P. Steinbach wrote: On 28.04.2010 07:11, * Sagar K: Use triple quote: d = """ this is a sample text which does not mean anything""" "goldtech" wrote in message news:4e25733e-eafa-477b-a84d-a64d139f7...@u34g2000yqu.googlegroups.com... On

long int OverflowException

2010-04-28 Thread Peyman Askari
I am seriously stumped by this one problem I essentially have two functions like so def a():  try:   b()  except:   print sys.exc_info()[0]   print sys.exc_info()[1]   print sys.exc_info()[2]   def b():  print x.__class__.__name__  return x the print statement in b() says it is an int, but the

Re: assigning multi-line strings to variables

2010-04-28 Thread Lie Ryan
On 04/28/10 15:34, Alf P. Steinbach wrote: > On 28.04.2010 07:11, * Sagar K: >> Use triple quote: >> d = """ this is >> a sample text >> which does >> not mean >> anything""" >> >> "goldtech" wrote in message >> news:4e25733e-eafa-477b-a84d-a64d139f7...@u34g2000yqu.googlegroups.com... >> On Apr 27

Re: wxPython problem: Can't assign size of plot.PlotCanvas

2010-04-28 Thread Kaipo ch...@taiwan
Thanks a lot. I'll check the wx list. CM 提到: On Apr 28, 9:13 am, "Kaipo ch...@taiwan" wrote: I wrought something like client = plot.PlotCanvas(childFrame2, 2,pos=(300,400),size=(100,200), name=text1) But the plotcanvas kept filling all the childFrame. Is there a way to Really adjust the size o

Re: os x compile, install?

2010-04-28 Thread Benjamin Kaplan
On Wed, Apr 28, 2010 at 4:35 AM, Rob wrote: > On Apr 28, 2:09 pm, Rob wrote: >> Hi, >> >> Python on my system is behaving badly, so I want to create a new >> install from source code.  I have OS X 10.6.2, I downloaded the source >> code (Python-2.6.5.tar.bz2) and did the usual, ./configure, make,

Re: wxPython problem: Can't assign size of plot.PlotCanvas

2010-04-28 Thread CM
On Apr 28, 9:13 am, "Kaipo ch...@taiwan" wrote: > I wrought something like > client = plot.PlotCanvas(childFrame2, 2,pos=(300,400),size=(100,200), > name=text1) > But the plotcanvas kept filling all the childFrame. > Is there a way to Really adjust the size of ploscanvas? > Thanks in advance for y

Re: assigning multi-line strings to variables

2010-04-28 Thread cjw
On 27-Apr-10 22:31 PM, Brendan Abel wrote: On Apr 27, 7:20 pm, goldtech wrote: Hi, This is undoubtedly a newbie question. How doI assign variables multiline strings? If I try this i get what's cited below. Thanks. d="d d" d Traceback (most recent call last): File "", line 1, i

Re: Advice requested on class design

2010-04-28 Thread Walter Wefft
Alan Ristow wrote: I would like to have three classes, ClassA, ClassB, and ClassC, that are essentially the same, the only difference being that each class has a different range of valid values for its properties. Thus, the obvious solution is to create a base class, then subclass from that a

Re: Advice requested on class design

2010-04-28 Thread Jean-Michel Pichavant
- "Alan Ristow" wrote: > Hi all, > > I am relatively new to Python, though not to programming in general, and > using Python 2.6. I have a design problem that I cannot quite decide how to > handle and I am hoping for some advice. > > I would like to have three classes, ClassA, ClassB,

wxPython problem: Can't assign size of plot.PlotCanvas

2010-04-28 Thread Kaipo ch...@taiwan
I wrought something like client = plot.PlotCanvas(childFrame2, 2,pos=(300,400),size=(100,200), name=text1) But the plotcanvas kept filling all the childFrame. Is there a way to Really adjust the size of ploscanvas? Thanks in advance for your help. The problematic code is below: class FrameWithABu

replacing words in HTML file

2010-04-28 Thread james_027
hi, Any idea how I can replace words in a html file? Meaning only the content will get replace while the html tags, javascript, & css are remain untouch. THanks, James -- http://mail.python.org/mailman/listinfo/python-list

Re: Download Visual Studio Express 2008 now

2010-04-28 Thread TerryP
On Apr 27, 11:09 pm, "Martin v. Loewis" wrote: > > I'm curious to know exactly the differences between the c/c++ compilers > > you get with various versions of VS and those you get with the (command > > line only) Windows SDK (formerly called the platform SDK). > > > The windows sdk is a free down

Re: How to check what is holding reference to object

2010-04-28 Thread Christian Heimes
Almar Klein wrote: Ah, it does exist! I wish I knew that two months ago, it would've saved me some precious time ;) The trick works only for objects that are tracked by CPython's garbage collector. Simple and non-containerish objects like str, int, unicode and some other types aren't tracked

Re: Python 2.X vs. 3.X - level of acceptance?

2010-04-28 Thread TerryP
For the most part keeping new code compatible with both Python 2.6 and 3.1 isn't a challenge, the most noticeable issue is with string data. The obvious downside is if the code has to run on an interp that doesn't understand the modern 'except ClassName as varname:' thing. -- http://mail.python.or

Advice requested on class design

2010-04-28 Thread Alan Ristow
Hi all, I am relatively new to Python, though not to programming in general, and using Python 2.6. I have a design problem that I cannot quite decide how to handle and I am hoping for some advice. I would like to have three classes, ClassA, ClassB, and ClassC, that are essentially the same, the o

Re: How to check what is holding reference to object

2010-04-28 Thread Almar Klein
On 27 April 2010 23:08, Chris Rebert wrote: > On Tue, Apr 27, 2010 at 1:45 PM, Michal M > wrote: > > I've just found out that one of objects is not destroyed when it > > should be. This means that something was holding reference to this > > object or part of it (i.e. method). Is there any way to

RE: Need help in python plug-in development

2010-04-28 Thread Andreas Tawn
> Hi, I am new to python. I am using python 2.6. I have gone through the > basic python and now I am trying to develop some plugin for maya 2009 > through python. So, for that I would need helping hand. You'll probably have more luck with pymel specific stuff at http://www.tech-artists.org/ Chee

Re: Need help in python plug-in development

2010-04-28 Thread Krister Svanlund
On Wed, Apr 28, 2010 at 12:21 PM, Suraj Sakhare wrote: > Hi, I am new to python. I am using python 2.6. I have gone through the > basic python and now I am trying to develop some plugin for maya 2009 > through python. So, for that I would need helping hand. You would have to ask questions for tha

Need help in python plug-in development

2010-04-28 Thread Suraj Sakhare
Hi, I am new to python. I am using python 2.6. I have gone through the basic python and now I am trying to develop some plugin for maya 2009 through python. So, for that I would need helping hand. -- http://mail.python.org/mailman/listinfo/python-list

winreg - access mask

2010-04-28 Thread Richard Lamboj
Hello, if i want to read, write a key and set a value, does i only need to set KEY_WRITE, or does i need to set KEY_READ, KEY_WRITE and KEY_SET_VALUE? This questions is related to the OpenKey Function. http://docs.python.org/py3k/library/winreg.html <- The other Access modes are missing in th

Re: Remembering the context

2010-04-28 Thread Chris Rebert
On Wed, Apr 28, 2010 at 1:31 AM, GZ wrote: > I am looking at the following code: > > def fn(): > >    def inner(x): >         return tbl[x] > >    tbl={1:'A', 2:'B'} >    f1 = inner   # I want to make a frozen copy of the values of tbl > in f1 >    tbl={1:'C', 2:'D'} >    f2 = inner >   return (f1

Re: os x compile, install?

2010-04-28 Thread Rob
On Apr 28, 2:09 pm, Rob wrote: > Hi, > > Python on my system is behaving badly, so I want to create a new > install from source code.  I have OS X 10.6.2, I downloaded the source > code (Python-2.6.5.tar.bz2) and did the usual, ./configure, make, sudo > make install.  Build went fine.  But on inst

Remembering the context

2010-04-28 Thread GZ
Hi All, I am looking at the following code: def fn(): def inner(x): return tbl[x] tbl={1:'A', 2:'B'} f1 = inner # I want to make a frozen copy of the values of tbl in f1 tbl={1:'C', 2:'D'} f2 = inner return (f1,f2) f1,f2 = fn() f1(1) # output C f2(1) # output

[no subject]

2010-04-28 Thread mannu jha
Dear all, I have a file like: 1 ALA Helix Sheet Helix Coil 2 ALA Coil Coil Coil Sheet 3 ALA Helix Sheet Coil Turn now what I want is that write a python program in which I will put the condition that in each line whatever secondary structure is coming more than or equal to two times it should

Re: How to use a class property to store function variables?

2010-04-28 Thread Bruno Desthuilliers
GZ a écrit : (snip) Ah, this totally works. The key is to use the staticmethod function. staticmethod is not a function, it's a class. Another question: I am not sure how staticmethod works internally. And the python doc does not seem to say. What does it do? It's easy to figure this out on

Re: How to use a class property to store function variables?

2010-04-28 Thread GZ
On Apr 28, 1:20 am, Chris Rebert wrote: > On Tue, Apr 27, 2010 at 11:02 PM, GZ wrote: > > On Apr 27, 9:20 pm, alex23 wrote: > >> GZ wrote: > >> > I do not think it will help me. I am not trying to define a function > >> > fn() in the class, but rather I want to make it a "function reference" >

Re: How to check what is holding reference to object

2010-04-28 Thread Michal M
On Apr 28, 12:02 am, Chris Rebert wrote: > On Tue, Apr 27, 2010 at 2:58 PM, Chris Rebert wrote: > > On Tue, Apr 27, 2010 at 2:42 PM, Michal M > > wrote: > >> On 27 Kwi, 23:21, Duncan Booth wrote: > >>> Michal M wrote: > >>> > I've just found out that one of objects is not destroyed when it >

Re: pyjamas 0.7 released

2010-04-28 Thread Wolfgang Strobl
lkcl : >On Apr 25, 9:37 pm, Wolfgang Strobl wrote: >> Daniel Fetchinson : >> >> >> for fits and giggles, to show what's possible in only 400 >> >> lines of python, here is a game of asteroids, written by joe rumsey. >> >> yes, it runs underpyjamas-desktop too. >> >> >>    http://pyjs.org/examples

Re: Ignoring XML Namespaces with cElementTree

2010-04-28 Thread Stefan Behnel
dmtr, 28.04.2010 03:42: Is there any way to configure cElementTree to ignore the XML root namespace? Default cElementTree (Python 2.6.4) appears to add the XML root namespace URI to _every_ single tag. Certainly not in the serialised XML. Are you referring to the qualified names it uses? St