Re: Python3.0 has more duplication in source code than Python2.5

2009-02-08 Thread Henry Read
I don't think code duplication rate has strong relationship towards code quality. On Sun, Feb 8, 2009 at 9:12 AM, Terry wrote: > On 2月8日, 上午8时51分, Terry wrote: > > On 2月8日, 上午12时20分, Benjamin Peterson wrote: > > > > > Terry gmail.com> writes: > > > > > > On 2月7日, 下午7时10分, "Diez B. Roggisch"

Internal Server error

2009-02-08 Thread zaheer . agadi
HI I am getting an internal server error while trying get response from a server following is my code def getDetails(self,username,password): urllib = urllib2.Request idurl="https://some.server.com/"; port=8181 conn = httplib.HTTPSConnection("some.server.com/",8181); conn.d

Re: MacPython 2.5 IDLE font size

2009-02-08 Thread Brian Blais
Hello, On Sat, Feb 7, 2009 at 4:03 PM, wrote: Hi, Is there a way to adjust the default font size in IDLE, in MacPython 2.5? The default now is too tiny. I have to use this version of MacPython. As far as I searched, I can't find how I do this. It is indeed a bug that the options menu doesn't

Re: Internal Server error

2009-02-08 Thread Diez B. Roggisch
zaheer.ag...@gmail.com schrieb: HI I am getting an internal server error while trying get response from a server following is my code def getDetails(self,username,password): urllib = urllib2.Request idurl="https://some.server.com/"; port=8181 conn = httplib.HTTPSConnection("s

Re: BaseHTTPRequestHandler freezes while writing to self.wfile after installing Python 3.0

2009-02-08 Thread mail
On Feb 7, 3:55 pm, m...@joaomoreno.com wrote: > Hey guys, > > I'm starting to lose my head with this one. > > I have a class that extends BaseHTTPRequestHandler. It works fine on > Python 2.5. And yesterday I was curious and decided to install Python > 3.0 on my Mac (I followed this tutorial, to be

Re: Internal Server error

2009-02-08 Thread zaheer . agadi
On Feb 8, 4:09 pm, "Diez B. Roggisch" wrote: > zaheer.ag...@gmail.com schrieb: > > > > > HI > > I am getting an internal server error while trying get response from a > > server following is my code > > >    def getDetails(self,username,password): > >     urllib = urllib2.Request > >     idurl="ht

Re: TkInter: Problem with propagation of resize events through geometry manager hierarchy?

2009-02-08 Thread James Stroud
Randy Smith wrote: The cropping and scrolling works fine. But when I try to add responding to resize events, I get into trouble. Specifically: * When I naively change the size of the image shown to be borderwidth less than the size indicated in the configure event, the size of the image sho

Re: simple web app, where to start

2009-02-08 Thread James Matthews
I use Django for all simple apps and it works great! On Sat, Feb 7, 2009 at 6:16 AM, Vincent Davis wrote: > I have a simple script that takes a few input values and returns a csv file > and a few stats. If I wanted to host this on the web how would I. I have no > idea where to begin. If someone c

Re: Path question

2009-02-08 Thread Geert Vancompernolle
Diez B. Roggisch wrote: Geert Vancompernolle schrieb: Hi, I have the following path construction: ./src/__init__.py /main.py /modules/__init__.py /application.py /ui/__init__.py /mainwindow/__init__.py /mainwindow.py Now I want to call the meth

Re: Process crash with no reason

2009-02-08 Thread gil . shinar
On Jan 28, 7:37 pm, Philip Semanchuk wrote: > On Jan 28, 2009, at 12:12 PM, gil.shi...@gmail.com wrote: > > > On Jan 27, 5:59 pm, Philip Semanchuk wrote: > >> On Jan 27, 2009, at 10:34 AM, gil.shi...@gmail.com wrote: > >>> On Jan 27, 2:10 pm, Tim Golden wrote: > Then how are you interacting

The fastest way to convert a long list of date

2009-02-08 Thread loredana . pier
If I want to convert a single date format I can do: import datetime, dateutil.parser d = dateutil.parser.parse('2008-09-26) print d.strftime('%A %d, %b %y' ) but if I want convert a long list of time how can do it in the fastest way? for example: from ['2008-09-26’, '2008-09-28’, '2008-09-29’,...

Re: len()

2009-02-08 Thread Pat
Gabriel Genellina wrote: En Wed, 04 Feb 2009 12:38:04 -0200, Pat escribió: Andreas Waldenburger wrote: On Sat, 31 Jan 2009 13:27:02 -0500 Pat wrote: Tobiah wrote: Just out of curiosity, why was len() made to be it's own function? I often find myself typing things like my_list.len before I

Re: len()

2009-02-08 Thread Pat
Terry Reedy wrote: Pat wrote: Andreas Waldenburger wrote: On Sat, 31 Jan 2009 13:27:02 -0500 Pat wrote: Tobiah wrote: Just out of curiosity, why was len() made to be it's own function? I often find myself typing things like my_list.len before I catch myself. Thanks, Toby I'm surprised t

Re: The fastest way to convert a long list of date

2009-02-08 Thread Chris Rebert
On Sun, Feb 8, 2009 at 4:46 AM, wrote: > If I want to convert a single date format I can do: > > import datetime, dateutil.parser > d = dateutil.parser.parse('2008-09-26) > print d.strftime('%A %d, %b %y' ) > > but if I want convert a long list of time how can do it in the fastest > way? > for ex

Re: Changing return of type(obj)

2009-02-08 Thread Pekka Klärck
2009/2/6 Ken Elkabany : > > I am attempting to fully-simulate an 'int' object with a custom object type. > It is part of a library I am creating for python futures and promises. Is > there anyway such that type(my_object) can return ? If it's enough to change how the type looks like you can simply

Re: "Weird" Indentation? (Or: is there a for...else construct?)

2009-02-08 Thread Tim Rowe
2009/2/7 andrew cooke : > > there's a justification for this awful mess here - > http://mail.python.org/pipermail/python-3000/2006-March/000104.html > > i didn't know about this, and even after reading steven's broken (i > assume) example, managed to get it backwards. What's awful about it? Except

How to copy an instance without its cStringIO.StringO item ?

2009-02-08 Thread Barak, Ron
Hi, I need to copy an instance of a class, where one of the items in the original is a cStringIO.StringO object. I do not need the cStringIO.StringO in the target object. The target instance is to be pickled. Googling made me devise the following plan: do a deepcopy from the original to the tar

Re: simple web app, where to start

2009-02-08 Thread Brian Blais
On Feb 7, 2009, at 21:39 , Vincent Davis wrote: Thanks http://www.cherrypy.org/ looks like a good and simple option. it is a nice option, but I prefer www.webpy.org over cherrypy. It's a bit easier, and there is less magic. I've done really simple scripts, to semi-complex web apps with

Re: The fastest way to convert a long list of date

2009-02-08 Thread Peter Otten
loredana.p...@gmail.com wrote: > If I want to convert a single date format I can do: > > import datetime, dateutil.parser > d = dateutil.parser.parse('2008-09-26) > print d.strftime('%A %d, %b %y' ) > > but if I want convert a long list of time how can do it in the fastest > way? > for example:

Re: How to copy an instance without its cStringIO.StringO item ?

2009-02-08 Thread Christian Heimes
Barak, Ron schrieb: > Hi, > > I need to copy an instance of a class, where one of the items in the original > is a cStringIO.StringO object. > I do not need the cStringIO.StringO in the target object. > The target instance is to be pickled. > > Googling made me devise the following plan: do a de

easy_install

2009-02-08 Thread hall . jeff
For the life of me I can not figure out how to get easy_install to work. The syntax displayed on the web page does not appear to work properly. easy_install c:\MySQL_python-1.2.2-py2.4-win32.egg Is there a simpler way to install a python egg? Or am I missing something with easy_install? -- http:/

ANN: eric 4.3.0 released

2009-02-08 Thread Detlev Offenbach
Hi, this is to inform all of you about the immediate availability of the long awaited 4.3.0 release. It includes enhancements in nearly every area. Please see for yourself by downloading it from http://eric-ide.python-projects.org/index.html eric4 is a Python (and Ruby) IDE written using PyQt4

Re: receive and react to MIDI input

2009-02-08 Thread elsjaako
On Jan 29, 8:33 pm, elsjaako wrote: > Hi all. I want to write an application that reads midi notes and then > does something (specifically, play sound files, but that doesn't > really matter for this question). I'm on windows. > > Bart de Waal I got it working, quickly packed it up, and posted it

Re: easy_install

2009-02-08 Thread Diez B. Roggisch
hall.j...@gmail.com wrote: > For the life of me I can not figure out how to get easy_install to > work. The syntax displayed on the web page does not appear to work > properly. > > easy_install c:\MySQL_python-1.2.2-py2.4-win32.egg It usually works for me - so what does "not appear to work prope

Re: Internal Server error

2009-02-08 Thread Diez B. Roggisch
zaheer.ag...@gmail.com wrote: > On Feb 8, 4:09 pm, "Diez B. Roggisch" wrote: >> zaheer.ag...@gmail.com schrieb: >> >> >> >> > HI >> > I am getting an internal server error while trying get response from a >> > server following is my code >> >> > def getDetails(self,username,password): >> > urllib

Dynamically updating sections of webpage

2009-02-08 Thread David Shi
I want to dynamically update sections of webpage, something like a div or table or frame.   Where can I find best examples/demos for this?  Preferably with a generic loader.   I would also like to find a best book on this.  It needs to be concise, well explained and can be applied universally.  

Re: TkInter: Problem with propagation of resize events through geometry manager hierarchy?

2009-02-08 Thread curiouserrandy
On Feb 8, 6:27 am, James Stroud wrote: > I can't test your code because I don't have the test image and for some > reason it does not recognize a tiff of my own. But, just glancing at > your code, it looks like a quick-fix would be to set self.zoom to a > sentinel at the end of refresh() and retu

Re: easy_install

2009-02-08 Thread hall . jeff
On Feb 8, 9:27 am, "Diez B. Roggisch" wrote: > hall.j...@gmail.com wrote: > > For the life of me I can not figure out how to get easy_install to > > work. The syntax displayed on the web page does not appear to work > > properly. > > > easy_install c:\MySQL_python-1.2.2-py2.4-win32.egg > > It usua

Re: Process crash with no reason

2009-02-08 Thread Stephen Hansen
> Thanks a lot and sorry for the late response. My main suspect is the > CherryPy. > I'm still investigating it. You're asking for advice but not listening to what people are saying here -- why is CherryPy on the top of your list? What version of CherryPy is it? 1 or 2? If its 2, then its pure p

Re: easy_install

2009-02-08 Thread Duncan Booth
hall.j...@gmail.com wrote: > http://peak.telecommunity.com/DevCenter/EasyInstall#downloading-and-ins > talling-a-package > > seems to imply that after installation I can goto a command prompt and > type > > easy_install c:\MySQL_python-1.2.2-py2.4-win32.egg > > I tried doing this in the python

Quetion about flags of socket.recv(bufsize, [flags])

2009-02-08 Thread Ken
I want to receive 4 bytes from a connected socket, I code like this: data = sock.recv(4) There is a problem with above code. The recv method will not block until it get all 4 bytes. So I use the second param of recv method like this data = sock.recv(4, socket.MSG_WAITALL) This works fine on lin

Re: Quetion about flags of socket.recv(bufsize, [flags])

2009-02-08 Thread Steve Holden
Ken wrote: > I want to receive 4 bytes from a connected socket, I code like this: > > data = sock.recv(4) > > There is a problem with above code. The recv method will not block until > it get all 4 bytes. So I use the second param of recv method like this > > data = sock.recv(4, socket.MSG_WAITA

How to copy an instance without its cStringIO.StringO item ?

2009-02-08 Thread Barak, Ron
Hi John, Maybe you encountered the below issue in your Python programming, and you may offer advise ? I need to copy an instance of a class, where one of the items in the original is a cStringIO.StringO object. I do not need the cStringIO.StringO in the target object. The target instance is to

Re: The fastest way to convert a long list of date

2009-02-08 Thread loredana . pier
First of all: Thanks for your reply My use case is the following: I perform a query to DB and the result of query is this; >>> print rows {‘Label’: {'2009:01:30': 9, '2009:01:28': 13, '2009:01:29': 19, '2009:01:26': 1, '2009:01:27': 3, '2009:01:20': 86, '2009:01:22': 3, '2009:01:23': 12, '2009:02:

Re: ElementTree and clone element toot

2009-02-08 Thread Aahz
In article <4986bfd7$0$9385$ba4ac...@news.orange.fr>, m.banaouas wrote: > >Working with the ElementTree module, I looked for clone element >function but not found such tool: Have you tried using copy.deepcopy()? -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ We

Re: len()

2009-02-08 Thread Andreas Waldenburger
On Sun, 08 Feb 2009 07:54:13 -0500 Pat wrote: > Terry Reedy wrote: > > Pat wrote: > >> Andreas Waldenburger wrote: > >>> On Sat, 31 Jan 2009 13:27:02 -0500 Pat wrote: > >>> > Tobiah wrote: > > Just out of curiosity, why was len() made to > > be it's own function? I often find mysel

Re: len()

2009-02-08 Thread Steve Holden
Andreas Waldenburger wrote: > On Sun, 08 Feb 2009 07:54:13 -0500 Pat wrote: > >> Terry Reedy wrote: >>> Pat wrote: Andreas Waldenburger wrote: > On Sat, 31 Jan 2009 13:27:02 -0500 Pat wrote: > >> Tobiah wrote: >>> Just out of curiosity, why was len() made to >>> be it's

Best 3d graphics kit for CAD program???

2009-02-08 Thread rantingrick
I want to build a 3D CAD visualization program with Python. Now before you say this is not possible with Python here me out :) I know OpenGL is probably my best bet BUT i want something a little higher level than that. I am not ready for OpenGL yet. I would like a kit that is just above OpenGL an

Re: easy_install

2009-02-08 Thread Colin J. Williams
Diez B. Roggisch wrote: hall.j...@gmail.com wrote: For the life of me I can not figure out how to get easy_install to work. The syntax displayed on the web page does not appear to work properly. easy_install c:\MySQL_python-1.2.2-py2.4-win32.egg It usually works for me - so what does "not ap

Re: easy_install

2009-02-08 Thread Benjamin Kaplan
On Sun, Feb 8, 2009 at 12:18 PM, Colin J. Williams wrote: > Diez B. Roggisch wrote: > >> hall.j...@gmail.com wrote: >> >> For the life of me I can not figure out how to get easy_install to >>> work. The syntax displayed on the web page does not appear to work >>> properly. >>> >>> easy_install c

Re: Best 3d graphics kit for CAD program???

2009-02-08 Thread Gary Herron
rantingrick wrote: I want to build a 3D CAD visualization program with Python. Now before you say this is not possible with Python here me out :) I know OpenGL is probably my best bet BUT i want something a little higher level than that. I am not ready for OpenGL yet. I would like a kit th

Re: easy_install

2009-02-08 Thread Stephen Hansen
> I updated my easy_install, used the scripts directory, dropped the "c:\" and > it gave the response below for me: That's kinda apples to oranges to what the OP's problem is. The OP appears to be trying to install an egg he downloaded previously. You're instructing easy_install (by dropping the

Re: sortable table in python 3.0

2009-02-08 Thread Martin v. Löwis
Peter Pei wrote: > In one of my program, I used something called MultiColumnList, which is > one of the sortable table widgets done in python. However 3.0 sort is > different. I googled and found couple of other implementations, but all > in python 3.0 -. > > Does anyone know any solution in 3.0?

Python Module: nift

2009-02-08 Thread J
What are your thoughts on this module I created? ''' A Python Module created by a High School Student. Includes rev(), reet(), and leet(). Import nift Function: nift.rev() Description:Reverses a string Usage: nift.rev('string')

Re: easy_install

2009-02-08 Thread Martin v. Löwis
> That's kinda apples to oranges to what the OP's problem is. > > The OP appears to be trying to install an egg he downloaded > previously. I think he actually didn't - if you read his messages, nowhere he said that he actually downloaded the file, and that it actually exists in the root director

Re: Lists implemented as integer-hashed Dictionaries?

2009-02-08 Thread Gabriel Genellina
En Sat, 07 Feb 2009 01:18:37 -0200, er escribió: Somebody much more intelligent than I said today that someone told him that Python lists are just dictionaries with lists hashed by integers. In addition to all other responses you received, I'd add that lists and dictionaries share the same

Re: Lists implemented as integer-hashed Dictionaries?

2009-02-08 Thread Gabriel Genellina
En Sat, 07 Feb 2009 01:18:37 -0200, er escribió: Somebody much more intelligent than I said today that someone told him that Python lists are just dictionaries with lists hashed by integers. In addition to all other responses you received, I'd add that lists and dictionaries share the same

Re: easy_install

2009-02-08 Thread Martin v. Löwis
> http://peak.telecommunity.com/DevCenter/EasyInstall#downloading-and-installing-a-package > > seems to imply that after installation I can goto a command prompt and > type > > easy_install c:\MySQL_python-1.2.2-py2.4-win32.egg These instructions must have misled you. This command only works if

Re: Python Module: nift

2009-02-08 Thread Chris Rebert
On Sun, Feb 8, 2009 at 10:42 AM, J wrote: > What are your thoughts on this module I created? * You should probably use individual docstrings for each function rather than one giant module docstring * Don't use 'list' as a variable name; it shadows the name of the builtin list type * You can use t

Re: MacPython 2.5 IDLE font size

2009-02-08 Thread Scott David Daniels
choha...@gmail.com wrote: Hi, Is there a way to adjust the default font size in IDLE, in MacPython 2.5? The default now is too tiny. I have to use this version of MacPython. As far as I searched, I can't find how I do this. Thanks. If you can read what you have at all, try to go toHelp (on the

Re: How to copy an instance without its cStringIO.StringO item ?

2009-02-08 Thread Gabriel Genellina
En Sun, 08 Feb 2009 14:17:34 -0200, Barak, Ron escribió: I need to copy an instance of a class, where one of the items in the original is a cStringIO.StringO object. I do not need the cStringIO.StringO in the target object. The target instance is to be pickled. [...] for_pickle_

Re: Lists implemented as integer-hashed Dictionaries?

2009-02-08 Thread Christian Heimes
er schrieb: > Somebody much more intelligent than I said today that someone told him that > Python lists are just dictionaries with lists hashed by integers. Since he > said that someone else told him this, I piped up and said that I thought > that wasn't true. I looked at the source code for lis

Re: Lists implemented as integer-hashed Dictionaries?

2009-02-08 Thread Christian Heimes
Stephen Hansen schrieb: > Now, I believe Python sets *are* for all intents and purposes > dictionaries, but I think that's just because its the easiest and most > efficient way to implement their uniqueness properties; they took the > very-well-tuned dictionary implementation and cut out the stuff

Re: Python Module: nift

2009-02-08 Thread bearophileHUGS
More suggestions for a real-world Python programmer: - There's code duplication, the original poster may express reet as a composition of the other functions. - A Python string/list/array can be inverted with [::-1] - I suggest to convert the examples of the main doscstring into doctests. - The mai

Re: "Weird" Indentation? (Or: is there a for...else construct?)

2009-02-08 Thread birdsong
On Feb 7, 6:34 am, Andreas Waldenburger wrote: > On Sun, 08 Feb 2009 01:28:00 +1100 Steven D'Aprano > > wrote: > > Andreas Waldenburger wrote: > > > > It seems that there is a for...else construct. Replacing the inner > > > if with pass seems to confirm this. The else clause is still > > > execut

Re: Path question

2009-02-08 Thread Gabriel Genellina
En Sun, 08 Feb 2009 10:07:40 -0200, Geert Vancompernolle escribió: Diez B. Roggisch wrote: Geert Vancompernolle schrieb: Hi, I have the following path construction: ./src/__init__.py /main.py /modules/__init__.py /application.py /ui/__init__.py /mainwindow/_

Re: py2exe and distutils

2009-02-08 Thread Gabriel Genellina
En Sat, 07 Feb 2009 18:39:19 -0200, Thomas Heller escribió: Maxim Demenko schrieb: Hi, i have installed Python 2.5.4 on WinXP, setuptools-0.6c9 and py2exe 0.6.9 Now i can't list installed modules, here is the stacktrace: [...] Any suggestion, how to fix this issue? Thomas Heller schr

Extracting bytecode out of frozen programs

2009-02-08 Thread David Kraeutmann
Hello, I need to extract the modules/packages out of a frozen script. It was compiled using Python 2.2.3 and the standard freeze.py. I managed to get a shell after execution using PYTHONINSPECT=y and find the start of a module/package using a hex editor (I got the sta, but these modules don't seem

Re: Python Module: nift

2009-02-08 Thread Gabriel Genellina
En Sun, 08 Feb 2009 17:59:41 -0200, escribió: More suggestions for a real-world Python programmer: - There's code duplication, the original poster may express reet as a composition of the other functions. - A Python string/list/array can be inverted with [::-1] - I suggest to convert the exampl

Re: Python Module: nift

2009-02-08 Thread Paul McGuire
On Feb 8, 12:42 pm, J wrote: > What are your thoughts on this module I created? > Here are a few steps to illustrate some good basic Python idioms worth learning: Step 1: Replace many-branched if-elif with dict While translating characters in a string is a special case that usually warrants usin

Re: programming by evolution?

2009-02-08 Thread blue indigo
On Fri, 06 Feb 2009 14:32:21 +0100, Pascal Costanza wrote: > Xah Lee wrote: >> Pascal Constanza is a Common Lisp fanatic. > > It's Costanza, not Constanza. > > > Thank you, > Pascal +---+ .:\:\:/:/:. | PLEASE DO NOT |:.:

Re: How to copy an instance without its cStringIO.StringO item ?

2009-02-08 Thread John Machin
On Feb 9, 1:01 am, Christian Heimes wrote: > Barak, Ron schrieb: > > > Hi, > > > I need to copy an instance of a class, where one of the items in the > > original is a cStringIO.StringO object. > > I do not need the cStringIO.StringO in the target object. > > The target instance is to be pickled.

Re: Python3.0 has more duplication in source code than Python2.5

2009-02-08 Thread Gabriel Genellina
On Sun, Feb 8, 2009 at 9:12 AM, Terry wrote: I have made the same analysis to some commercial source code, the dup60 rate is quite often significantly larger than 15%. En Sun, 08 Feb 2009 07:10:12 -0200, Henry Read escribió: I don't think code duplication rate has strong relationship to

Re: Extracting bytecode out of frozen programs

2009-02-08 Thread Martin v. Löwis
> Is there a way of extracting them so they are importable in a python shell? Try imp.get_frozen_object. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Module: nift

2009-02-08 Thread bearophileHUGS
Paul McGuire: > LEET_LETTERS = dict( zip("eEaAiItTsSoObB", "33441177550088") ) > def leet(s): >     return ''.join( LEET_LETTERS.get(c,c) for c in s ) This may be better: from string import maketrans def leet(txt): leet_chars = maketrans("eEaAiItTsSoObB", "33441177550088") return txt.tra

Re: Python Module: nift

2009-02-08 Thread Chris Rebert
On Sun, Feb 8, 2009 at 12:57 PM, Paul McGuire wrote: > On Feb 8, 12:42 pm, J wrote: >> What are your thoughts on this module I created? >> > Here are a few steps to illustrate some good basic Python idioms worth > learning: > > Step 1: Replace many-branched if-elif with dict > > While translating

Re: Python Module: nift

2009-02-08 Thread bearophileHUGS
Gabriel Genellina: > bearophile: > > - Generally I suggest to learn to code in the small, using as little > > code as possible. > > I completely agree with all the above suggestions, except this last one.   > Ok, I think I know what you mean, but a beginner might understand this   > completely wron

Re: Extracting bytecode out of frozen programs

2009-02-08 Thread Gabriel Genellina
En Sun, 08 Feb 2009 18:38:22 -0200, David Kraeutmann escribió: Hello, I need to extract the modules/packages out of a frozen script. It was compiled using Python 2.2.3 and the standard freeze.py. I managed to get a shell after execution using PYTHONINSPECT=y and find the start of a module/pac

Re: Newbie SWMixer / numpy help - AssertionError

2009-02-08 Thread Peter Chant
Robert Kern wrote: > >snd = swmixer.Sound(data=tone_data) > > Well, sort of. You probably need to scale your data and convert it to > int16 format. It's currently in floating point format. Done and working, thanks. As "file" was not needed for file="test.wav" I assumed the data prefix for

Re: Extracting bytecode out of frozen programs

2009-02-08 Thread Gabriel Genellina
En Sun, 08 Feb 2009 19:19:12 -0200, Martin v. Löwis escribió: Is there a way of extracting them so they are importable in a python shell? Try imp.get_frozen_object. Ouch... this looks better than using ctypes. get_frozen_object exists at least since 1.5.2, but has never been documented

Python on TV-centric platforms

2009-02-08 Thread Vitaliy Yermolenko
Hi, Thanks for thoughts. As I can see considering Yahoo Widgets (based on HTML/JavaScript/Flash), XML, AJAX and JavaScript (i. e. web components) on Figure 1 of http://www.intelconsumerelectronics.com/Consumer-Electronics-3.0/Widget-Channel-Overview.aspx, it seems, like Pyjamas is more close for

Re: Python Module: nift

2009-02-08 Thread J
Thanks for your answers, especially Chris Rebert and Paul McGuire's. I have a question: How far does Python go in the Game Development field? (Using Python only, no extensions) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Module: nift

2009-02-08 Thread Chris Rebert
On Sun, Feb 8, 2009 at 2:45 PM, J wrote: > Thanks for your answers, especially Chris Rebert and Paul McGuire's. I > have a question: > How far does Python go in the Game Development field? (Using Python > only, no extensions) You pretty much need to integrate with some C(++) libraries in order to

Re: TkInter: Problem with propagation of resize events through geometry manager hierarchy?

2009-02-08 Thread James Stroud
curiouserra...@gmail.com wrote: Thanks! I hadn't known about the "return 'break'" technique. But I don't follow your sentinel suggestion; how would that sentinel ever get reset? Presumably you would set it from some kind of input. Basically, if you don't need to zoom, you wouldn't bother sca

Re: Extracting bytecode out of frozen programs

2009-02-08 Thread Martin v. Löwis
> get_frozen_object exists at least since 1.5.2, but has never been > documented, and the source code says it's obsolete. Should be documented > now? Any alternative? get_frozen_object has been marked obsolete in 1997. Whether it can be un-deprecated should be discussed on python-dev; I can't gues

Re: Flattening lists

2009-02-08 Thread Rhamphoryncus
On Feb 7, 3:07 pm, wrote: > On Sat, 7 Feb 2009 12:50:22 -0800 (PST) > Rhamphoryncus wrote: > > Can you explain this in a little more detail? > > In the application, there is one main numpy array of type "O". > Each element of the array corresponds to one cell in a grid. The user > may enter a Pyt

RE: Ordered dict by default

2009-02-08 Thread Delaney, Timothy (Tim)
bearophileh...@lycos.com wrote: > I have missed another example: It may be possible to create a sorting > routine that's not stable but is faster than the current stable > timsort (for example in C++ STL you have both sorting routines, and > the unstable one is a variant of introsort that is faste

Re: Scanning a file character by character

2009-02-08 Thread Spacebar265
On Feb 7, 2:17 am, Jorgen Grahn wrote: > On Wed, 4 Feb 2009 22:48:13 -0800 (PST), Spacebar265 > wrote: > > Hi. Does anyone know how to scan a filecharacterbycharacterand > > have eachcharacterso I can put it into a variable. I am attempting > > to make a chatbot and need this to read the saved i

Re: Best 3d graphics kit for CAD program???

2009-02-08 Thread nick
Gary Your email client is set to HTML mode and looks terrible for those of us who prefer plain view. It also appears your client is not properly sending your message in text/plain encoding. -- http://mail.python.org/mailman/listinfo/python-list

Importing a file (not a module).

2009-02-08 Thread Luis Zarrabeitia
Is there any way to "import" a .py file that is not on sys.path? I'd like to 'import' a file that resides somewhere on my filesystem without having to add it's directory to sys.path. At first, I thought that something like my_module = __import__("path/to/file") would work, but I was mistaken.

Re: Python Module: nift

2009-02-08 Thread Paul McGuire
On Feb 8, 3:28 pm, Chris Rebert wrote: > This I disagree with as being unnecessarily clever; the dict literal > is just fine as-is and the zip() makes it less clear. However, I would > definitely rewrite the dict to use less lines, which, after removing > the capital dupes (as I mentioned in my po

Re: [2.5.1] Comparing dates?

2009-02-08 Thread Gabriel Genellina
En Wed, 04 Feb 2009 14:11:07 -0200, Gilles Ganault escribió: On Mon, 2 Feb 2009 22:00:53 +0100, Martin wrote: as suggested, the DBA should seriously think about defining the correct type of the column here, for intermediate use and getting stuff to work you could use a view and define some

Re: Scanning a file character by character

2009-02-08 Thread Steve Holden
Spacebar265 wrote: > On Feb 7, 2:17 am, Jorgen Grahn wrote: >> On Wed, 4 Feb 2009 22:48:13 -0800 (PST), Spacebar265 >> wrote: >>> Hi. Does anyone know how to scan a filecharacterbycharacterand >>> have eachcharacterso I can put it into a variable. I am attempting >>> to make a chatbot and need t

Re: Importing a file (not a module).

2009-02-08 Thread Steve Holden
Luis Zarrabeitia wrote: > Is there any way to "import" a .py file that is not on sys.path? > I'd like to 'import' a file that resides somewhere on my filesystem without > having to add it's directory to sys.path. At first, I thought that something > like > > my_module = __import__("path/to/file"

Simple question - stock market simulation

2009-02-08 Thread cptn.spoon
I'm trying to create an incredibly simple stock market simulator to be used in a childrens classroom and I'm wondering whether someone can point me in the right direction. I basically want to be able to have a stock struct as follows: StockName = "Test" StockPriceList = (12,13,12,10,10,8,10) Stoc

Re: Simple question - stock market simulation

2009-02-08 Thread Paul Rubin
"cptn.spoon" writes: > I'm not asking for tips on the program itself, I just can't figure out > how to get the data structures in place. Would I use Classes or would > I use dictionaries? Am I completely off the mark with this? Typically you would use a class for the multi-fielded data structure;

Re: Simple question - stock market simulation

2009-02-08 Thread cptn.spoon
On Feb 9, 3:58 pm, Paul Rubin wrote: > "cptn.spoon" writes: > > I'm not asking for tips on the program itself, I just can't figure out > > how to get the data structures in place. Would I use Classes or would > > I use dictionaries? Am I completely off the mark with

Re: Best 3d graphics kit for CAD program???

2009-02-08 Thread Gary Herron
n...@stinemates.org wrote: > Gary > > Your email client is set to HTML mode and looks terrible for those of us > who prefer plain view. It also appears your client is not properly > sending your message in text/plain encoding. > > > -- > http://mail.python.org/mailman/listinfo/python-list > Un

Re: Simple question - stock market simulation

2009-02-08 Thread Paul Rubin
"cptn.spoon" writes: > def __init__(self, stockname, stockpricelist[], stockrisk, > stockqty): ... You would say just stockpricelist rather than stockpricelist[], but other than that your class def looks good. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Module: nift

2009-02-08 Thread Terry Reedy
J wrote: What are your thoughts on this module I created? ''' A Python Module created by a High School Student. Includes rev(), reet(), and leet(). Gutsy of you to post this. Setup: * Save to Python Directory\Lib\ as nift.py Add-in modules and package

Re: Lists implemented as integer-hashed Dictionaries?

2009-02-08 Thread Terry Reedy
Christian Heimes wrote: Sets are basically dicts without values. For CPython true, but abstractly, dicts are sets with values, and mappings are often viewed as sets of key,value pairs. -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple question - stock market simulation

2009-02-08 Thread Terry Reedy
cptn.spoon wrote: On Feb 9, 3:58 pm, Paul Rubin wrote: "cptn.spoon" writes: I'm not asking for tips on the program itself, I just can't figure out how to get the data structures in place. Would I use Classes or would I use dictionaries? Am I completely off the ma

Re: self-aware list of objects able to sense constituent member alterations?

2009-02-08 Thread John O'Hagan
On Fri, 6 Feb 2009, greyw...@gmail.com wrote: > On Jan 28, 4:37 am, John O'Hagan wrote: > > On Tue, 27 Jan 2009, Reckoner wrote: > > > I'm not sure this is possible, but I would like to have > > > a list of  objects > > > > > > A=[a,b,c,d,...,z] > > > > > > where,  in the midst of a lot of process

GAE open()

2009-02-08 Thread alex goretoy
Hello, How to open binary file for writing into datastore. I'm trying to loop over listdir output of images directory, How to do this without using self.request.POST.get.file.read(), or rather how to loop this task in app engine file(os.curdir+"somefile").read() UnicodeDecodeError: 'ascii' code

Python binaries with VC++ 8.0?

2009-02-08 Thread Greg Ewing
Is there anywhere I can download a set of Python binaries, of any version, that have been built with Visual C++ 8.0? I'm trying to hook Python up to Sketchup 7 on Windows, and I think I'm having problems because Sketchup is linked with msvcr80.dll. -- Greg -- http://mail.python.org/mailman/listi

How to debug deadlock?

2009-02-08 Thread Victor Lin
Hi, I am developing a multi-threading application, I encounter a deadlock. I use Visual C++ Express 2008 to trace the program. Once the deadlock occurs, I just pause the program and trace. I found that when deadlock occurs, there will be two threads called python from my C++ extension. All of them

adodb has no attribute connect

2009-02-08 Thread Rahul
Hello all, I have to access data from database using adodb so I did Import adodb Conn=adodb.NewADOConnection("odbc") Upto this it works properly but when I say Conn.Connect("","","") It gives error as [Attributrerror]: Object Nonetype has no attribute Connect. I have Red Hat Enterprise Linux

Re: Python binaries with VC++ 8.0?

2009-02-08 Thread Carl Banks
On Feb 8, 10:51 pm, Greg Ewing wrote: > Is there anywhere I can download a set of Python > binaries, of any version, that have been built > with Visual C++ 8.0? > > I'm trying to hook Python up to Sketchup 7 on > Windows, and I think I'm having problems because > Sketchup is linked with msvcr80.dl

Re: ElementTree and clone element toot

2009-02-08 Thread Stefan Behnel
Aahz wrote: > In article <4986bfd7$0$9385$ba4ac...@news.orange.fr>, > m.banaouas wrote: >> Working with the ElementTree module, I looked for clone element >> function but not found such tool: > > Have you tried using copy.deepcopy()? While being the most obvious solution, calling deepcopy() on a

Re: Python Module: nift

2009-02-08 Thread Steven D'Aprano
On Sun, 08 Feb 2009 13:34:50 -0800, bearophileHUGS wrote: > Gabriel Genellina: >> bearophile: >> > - Generally I suggest to learn to code in the small, using as little >> > code as possible. >> >> I completely agree with all the above suggestions, except this last >> one. Ok, I think I know what y

  1   2   >