Re: Memory problem

2006-08-14 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Yi Xing wrote: > Is there a way that I can define a two-dimensional array in > array.array()? Thanks. If you need more than one dimension you really should take a look at `numarray` or `numpy`. What are you going to do with the data once it's loaded into memory? Ciao,

ANN: byteplay - a bytecode assembler/disassembler

2006-08-14 Thread spam . noam
Hello, I would like to present a module that I have wrote, called byteplay. It's a Python bytecode assembler/disassembler, which means that you can take Python code object, disassemble them into equivalent objects which are easy to play with, play with them, and then assemble a new, modified, code

Re: python-dev Summary for 2006-07-16 through 2006-07-31

2006-08-14 Thread david_wahler
I'll be out of the office until approximately August 20th. If you have any questions, please email [EMAIL PROTECTED] -- David Wahler -- http://mail.python.org/mailman/listinfo/python-list

Re: LDTP 0.5.0 released !!!

2006-08-14 Thread david_wahler
I'll be out of the office until approximately August 20th. If you have any questions, please email [EMAIL PROTECTED] -- David Wahler -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Crunchy version 0.7 is here!

2006-08-14 Thread david_wahler
I'll be out of the office until approximately August 20th. If you have any questions, please email [EMAIL PROTECTED] -- David Wahler -- http://mail.python.org/mailman/listinfo/python-list

Re: RELEASED: scgi 1.11

2006-08-14 Thread david_wahler
I'll be out of the office until approximately August 20th. If you have any questions, please email [EMAIL PROTECTED] -- David Wahler -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: byteplay - a bytecode assembler/disassembler

2006-08-14 Thread david_wahler
I'll be out of the office until approximately August 20th. If you have any questions, please email [EMAIL PROTECTED] -- David Wahler -- http://mail.python.org/mailman/listinfo/python-list

Re: python-dev Summary for 2006-07-01 through 2006-07-15

2006-08-14 Thread david_wahler
I'll be out of the office until approximately August 20th. If you have any questions, please email [EMAIL PROTECTED] -- David Wahler -- http://mail.python.org/mailman/listinfo/python-list

Re: yet another noob question

2006-08-14 Thread starGaming
Jason Nordwick wrote: > *mouth agape* > > Wow. That really sucks. I make extensive use of reduce. It seems to run more > than twice as fast as a for loop. > > >>> t = Timer('bino.reduceadd(bino.bits)', 'import bino') > >>> s = Timer('bino.loopadd(bino.bits)', 'import bino') > >>> t.timeit(10) > 1

python-dev Summary for 2006-07-16 through 2006-07-31

2006-08-14 Thread steven . bethard
python-dev Summary for 2006-07-16 through 2006-07-31 .. contents:: [The HTML version of this Summary is available at http://www.python.org/dev/summary/2006-07-16_2006-07-31] = Announcements = --- Pyth

Re: yet another noob question

2006-08-14 Thread Stargaming
Jason Nordwick wrote: > > [EMAIL PROTECTED] wrote: > >> Jason Nordwick: >> >>> Stargaming wrote: >>> Also note that reduce will be removed in Python 3000. >>> >>> What will replace it? >> >> >> Nothing, I presume. You will have to write a function to find another >> way to solve problems. >

python-dev Summary for 2006-07-01 through 2006-07-15

2006-08-14 Thread steven . bethard
python-dev Summary for 2006-07-01 through 2006-07-15 .. contents:: [The HTML version of this Summary is available at http://www.python.org/dev/summary/2006-07-01_2006-07-15] = Announcements = --- Pyth

Re: Mega Newbie Questions: Probably FAQs

2006-08-14 Thread Zeph
Zeph wrote: >> 3) Can someone recommend a good framework that will enable me to keep >> things well sorted out, and easy to maintain as my apps grow? (I'm >> considering MVC, but have no idea how to apply it until I've gone >> beyond "Hello World"). Yu-Xi Lim wrote: > Framework for what kind o

Re: How to fill a form

2006-08-14 Thread Yu-Xi Lim
Sulsa wrote: > but i don't know how to post these data if i knew there there would > be no topic. http://docs.python.org/lib/module-urllib.html You want to look at urlopen and urlencode. But if you mean you don't know what fields and data to use, then you need a HTML reference, not a Python one

Re: modifying __new__ of list subclass

2006-08-14 Thread Steven Bethard
Ken Schutte wrote: > I want an int-derived class that is initilized to one greater than what > it's constructor is given: > > class myint(int): > def __new__(cls, intIn): > newint = int(intIn+1) > return int.__new__(cls, newint) Or simply: class myint(int): def __new__(cls, int_i

Re: How to fill a form

2006-08-14 Thread Tom Brown
On Monday 14 August 2006 20:43, Sulsa wrote: > On Tue, 15 Aug 2006 03:37:02 - > > Grant Edwards <[EMAIL PROTECTED]> wrote: > > On 2006-08-15, Sulsa <[EMAIL PROTECTED]> wrote: > > > I want to fill only one smiple form so i would like not to use > > > any non standard libraries. > > > > Then just

Re: Mega Newbie Questions: Probably FAQs

2006-08-14 Thread Yu-Xi Lim
Zeph wrote: > 1b) Are these executable completely free from the need of the average > user needing to install Python. Basically, I want to write and sell > "compiled" apps. OSX and Linux installations nearly always come with Python pre-installed (usually because they are required by other syste

Re: Mega Newbie Questions: Probably FAQs

2006-08-14 Thread AlbaClause
Zeph wrote: > ajaksu wrote: > I do intend to start small and build up, but I want to front load my > learning curve, usually makes the other side of the curve more productive. Did you ever play on teeter-totters when you were a kid? I think that's what they're called. Those board like things

Re: How to fill a form

2006-08-14 Thread Sulsa
On Tue, 15 Aug 2006 03:37:02 - Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2006-08-15, Sulsa <[EMAIL PROTECTED]> wrote: > > > I want to fill only one smiple form so i would like not to use > > any non standard libraries. > > Then just send the HTTP "POST" request containing the fields > an

Re: How to fill a form

2006-08-14 Thread Steve Holden
Sulsa wrote: > On Tue, 15 Aug 2006 03:22:40 +0100 > Steve Holden <[EMAIL PROTECTED]> wrote: > > >>I'd recommend you take a look at mechanize, see >> >> http://wwwsearch.sourceforge.net/mechanize/ >> >>and specifically at ClientForm, see >> >> http://wwwsearch.sourceforge.net/ClientForm/ >> >>

Re: How to fill a form

2006-08-14 Thread Grant Edwards
On 2006-08-15, Sulsa <[EMAIL PROTECTED]> wrote: > I want to fill only one smiple form so i would like not to use > any non standard libraries. Then just send the HTTP "POST" request containing the fields and data you want to submit. -- Grant Edwards grante Yow! LB

Re: How to fill a form

2006-08-14 Thread Sulsa
On Tue, 15 Aug 2006 03:22:40 +0100 Steve Holden <[EMAIL PROTECTED]> wrote: > I'd recommend you take a look at mechanize, see > >http://wwwsearch.sourceforge.net/mechanize/ > > and specifically at ClientForm, see > >http://wwwsearch.sourceforge.net/ClientForm/ > > These make it easy to

Redirecting output (Cherif YAYA)

2006-08-14 Thread Chef YA
Hi,I'm writing a script and I need to use a tierce console application.I'd like to be able to redirect this application output to a wxPython frame. I know that wxPython can redirect standard output automatically  to a default frame. However, I'd rather like to direct the output to a frame I have co

Re: Mega Newbie Questions: Probably FAQs

2006-08-14 Thread Zeph
ajaksu wrote: > Zeph wrote: And I'd research a bit about decompiling those executables, > might be easier (or harder, in my case) than you thought :) Are you saying that generally python code is insecure? It hadn't occurred to me, but I want to play in a fairly competitive field, and I'd hate t

Re: How to fill a form

2006-08-14 Thread Steve Holden
Sulsa wrote: > I need to fill form from web site, the code for this form looks like > this: > > > > class="post" /> > class="post" /> > > value="" /> > value="Login" /> > > > > I can of course connect to a web site and download the form, i do it > like this: > > import urllib2 > www =

Python class objects as plugins?

2006-08-14 Thread sleem
Hi. I'm hacking up an irc bot in python using Joel Rosdahl's irclib. I want to be able to add plugins to my bot, without having to restart it. In specific, I would have a directory called "plugins". Into this, I would place scripts that the bot could load as plugins, whenever I give it the instru

Re: Mega Newbie Questions: Probably FAQs

2006-08-14 Thread Zeph
ajaksu wrote: > Hoping this helps more than confuses, Thanks, these were the sort of answers I was looking for. I've programmed in Basic, AppleScript, Pascal and Usertalk (Userland Frontier), I've got a sense for development, it's just been a very, very long time ago. I do intend to start smal

How to fill a form

2006-08-14 Thread Sulsa
I need to fill form from web site, the code for this form looks like this: I can of course connect to a web site and download the form, i do it like this: import urllib2 www = urllib2.urlopen("http://www.site.com/login.php";) form_data= stronka.read() or using httplib: import httplib

Re: recommended general-purpose string template packages?

2006-08-14 Thread Dan Sommers
On 13 Aug 2006 19:48:55 -0700, "John Machin" <[EMAIL PROTECTED]> wrote: > In general, I'm mainly interested in a template engine for dynamic web > pages but would like a general purpose one to avoid learning yet > another package for generating e-mail messages, form letters, source > code, whateve

Crunchy version 0.7 is here!

2006-08-14 Thread jwoolard
Version 0.7 of Crunchy has been released. It is available on Sourceforge (http://sourceforge.net/project/showfiles.php?group_id=169458) Crunchy, the Interactive Python Tutorial Maker, is an application that transforms an ordinary html-based Python tutorial into an interactive session within a web

Re: Finding if Python Is Running In Console (python.exe) or Window (pythonw.exe)

2006-08-14 Thread [EMAIL PROTECTED]
Chaos wrote: > Does anyone know how to find where python is running from. I cant find > the answer to this anywahere on google or the docs. I know its there > because Ive seen ti done before. Thanks. Hopefully It is still there. In module "sys" as "executable". Juergen -- http://mail.python.o

modifying __new__ of list subclass

2006-08-14 Thread Ken Schutte
Hi, I'm been trying to create some custom classes derived from some of python's built-in types, like int and list, etc. I've run into some trouble, which I could explain with a couple simple examples. Lets say I want an int-derived class that is initilized to one greater than what it's const

Re: hide python code !

2006-08-14 Thread Gerhard Fiedler
On 2006-08-14 20:48:45, Damjan wrote: > I think you increase your chances of Microsoft not even being in the same > room with your software 100-fold if you release it under.. say GPL. ... and have the money to run a law suit? Patents, licenses etc are only as strong as the money that backs them,

Re: looking for a simple way to load a program from another python program..

2006-08-14 Thread [EMAIL PROTECTED]
Gabriel Genellina wrote: > At Sunday 13/8/2006 16:51, [EMAIL PROTECTED] wrote: > > > I was looking for a simple way to load a simple python program from > >another python program. > > > >I tried > > > >os.system(cabel) > > > >The file name is cabel.py a csound instrument editor.. > > > >NameEr

Re: hide python code !

2006-08-14 Thread Damjan
> Imagine if you were the single-person developer of a small application > that did something quite innovative, and charged a small fee for your > product. Now imagine you were practically forced to make your algorithm > obvious - a couple of months later, Microsoft bring out a freeware > version a

Finding if Python Is Running In Console (python.exe) or Window (pythonw.exe)

2006-08-14 Thread Chaos
Does anyone know how to find where python is running from. I cant find the answer to this anywahere on google or the docs. I know its there because Ive seen ti done before. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Memory problem

2006-08-14 Thread John Machin
Martin v. Löwis wrote: > John Machin wrote: > > Incredible. That's only 34 MB. What is the size of your paging file? > > What memory guzzlers were you running at the same time? What was the > > Task Manager "Performance" pane showing while your test was running? > > What version of Python? > > He

Re: yet another noob question

2006-08-14 Thread AlbaClause
mike_wilson1333 wrote: > I would like to generate every unique combination of numbers 1-5 in a 5 > digit number and follow each combo with a newline. So i'm looking at > generating combinations such as: (12345) , (12235), (4) and so on. > What would be the best way to do this? So, basically i

Re: help parsing this

2006-08-14 Thread Paul McGuire
"a" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > mx.DateTime.RangeError at /podcasts > Failed to parse "31 Apr 2006 20:19:00 -0400": day out of range: 31 > Python /usr/lib/python2.4/site-packages/mx/DateTime/Parser.py in > DateTimeFromString, line 608 > > how to parse this date > t

Re: OT: p-gal website

2006-08-14 Thread John Bokma
Gabriel Genellina <[EMAIL PROTECTED]> wrote: > At Monday 14/8/2006 18:45, John Bokma wrote: > >> > Even Firefox developers will tell you to avoid this. Develop for >> > standards compliant browsers (including Firefox) by testing against >> > the standards. Neither your HTML or CSS pass validation

Re: Memory problem

2006-08-14 Thread John Machin
Yi Xing wrote: > Thanks! I just found that that I have no problem with > x=[[10.0]*2560*2560]*500, but x=range(1*2560*2560*30) doesn't work. > range(1*2560*2560*30) is creating a list of 196M *unique* ints. Assuming 32-bit ints and pointers: that's 4 bytes each for the value, 4 for the type pointe

Re: Compiling wxPython app for Windows; Single EXE

2006-08-14 Thread Philippe Martin
Vincent Delporte wrote: > Hi > > I browsed the archives, but since some messages date back a bit, I > wanted to make sure that > > - py2exe is still the best tool in town to compile Python scripts to > run on a Windows host that doesn't have Python installed, including > wxWidgets/wxPython > >

Re: Memory problem

2006-08-14 Thread Martin v. Löwis
Yi Xing wrote: > Thanks! I just found that that I have no problem with > x=[[10.0]*2560*2560]*500, but x=range(1*2560*2560*30) doesn't work. That's no surprise. In the first case, try x[0][0] = 20.0 print x[1][0] You have the very same (identical) list of 2560*2560 values in x 500 times. To cre

Re: Memory problem

2006-08-14 Thread Martin v. Löwis
John Machin wrote: > Incredible. That's only 34 MB. What is the size of your paging file? > What memory guzzlers were you running at the same time? What was the > Task Manager "Performance" pane showing while your test was running? > What version of Python? He didn't say Windows (so far). AFAICT,

Re: Compiling wxPython app for Windows; Single EXE

2006-08-14 Thread Vincent Delporte
On 14 Aug 2006 09:39:02 -0700, "ajaksu" <[EMAIL PROTECTED]> wrote: >I'm using PyInstaller (http://pyinstaller.hpcf.upr.edu/) precisely to >"compile" a wxPython-based program. So I'm curious about what makes >py2exe "the best tool...", because I'm about to miss that due to my >ignorance. I didn't k

Re: Memory problem

2006-08-14 Thread John Machin
Yi Xing wrote: > On a related question: how do I initialize a list or an array with a > pre-specified number of elements, something like > int p[100] in C? I can do append() for 100 times but this looks silly... > > Thanks. > > Yi Xing In the case of an array, you may wish to consider the fromfil

Re: help parsing this

2006-08-14 Thread Steve Holden
a wrote: > mx.DateTime.RangeError at /podcasts > Failed to parse "31 Apr 2006 20:19:00 -0400": day out of range: 31 > Python/usr/lib/python2.4/site-packages/mx/DateTime/Parser.py in > DateTimeFromString, line 608 > > how to parse this date > thanks > """ 30 days hath September APRIL, June

Re: Memory problem

2006-08-14 Thread Yi Xing
Is there a way that I can define a two-dimensional array in array.array()? Thanks. On Aug 14, 2006, at 2:28 PM, John Machin wrote: > Yi Xing wrote: >> I tried the following code: >> > i=0 > n=2600*2600*30 > a=array.array("f") > while (i<=n): >> .. i=i+1 >> .. a.append(floa

Re: Memory problem

2006-08-14 Thread Yi Xing
Thanks! I just found that that I have no problem with x=[[10.0]*2560*2560]*500, but x=range(1*2560*2560*30) doesn't work. -Yi On Aug 14, 2006, at 3:08 PM, Larry Bates wrote: > Yi Xing wrote: >> On a related question: how do I initialize a list or an array with a >> pre-specified number of elemen

Re: Basic Boost.Python Question

2006-08-14 Thread Neil Hodgson
Hoop: > I am starting on an application that will developed in VS2005, probably > using C++/CLI. I haven't heard any reports of Boost.Python code being compatible with C++/CLI so you may need to add an adaptation layer. To run inside .NET, I'd choose IronPython. Neil -- http://mail.py

Re: Basic Boost.Python Question

2006-08-14 Thread Pierre Barbier de Reuille
Hoop wrote: > Hi, > > I have been working in getting Boost.Python running on my PC, seems to > work now. > I have what I believe is somewhat of basic question here. > I am starting on an application that will developed in VS2005, probably > using C++/CLI. > I want to be able to exchange data in b

Re: Memory problem

2006-08-14 Thread Larry Bates
Yi Xing wrote: > On a related question: how do I initialize a list or an array with a > pre-specified number of elements, something like > int p[100] in C? I can do append() for 100 times but this looks silly... > > Thanks. > > Yi Xing > Unlike other languages this is seldom done in Python. I t

Re: OT: p-gal website

2006-08-14 Thread Gabriel Genellina
At Monday 14/8/2006 18:45, John Bokma wrote: > Even Firefox developers will tell you to avoid this. Develop for > standards compliant browsers (including Firefox) by testing against > the standards. Neither your HTML or CSS pass validation, both due to > minor, easy-to-fix issues. If you actual

Re: Best IDE for Python

2006-08-14 Thread Tryker
Gotta love PyScripter. Light, easy to use, free. http://mmm-experts.com/Products.aspx?ProductID=4 [EMAIL PROTECTED] wrote: > Hi All, What do you find the best IDE for creating web applications in > Python is? Preferably FOS IDE. > > Cheers -- http://mail.python.org/mailman/listinfo/python-list

Re: Best IDE for Python

2006-08-14 Thread [EMAIL PROTECTED]
Yu-Xi Lim wrote: > Eclipse+PyDev has the advantage over emacs when it comes to big > projects, IMO. It has features like refactoring, better project > management, code coverage Emacs and vim both have good integration of BicycleRepairMan for python refactoring. I don't know what better project ma

Re: TypeError: 'module' object is not callable (newby question)

2006-08-14 Thread John Machin
Charles Russell wrote: > Marc 'BlackJack' Rintsch wrote: > > > > > Don't call your file `glob.py` because then you import this module and not > > the `glob` module from the standard library. > > > > Ciao, > > Marc 'BlackJack' Rintsch > > Yes, thanks. Renaming to myglob.py solved the problem.

Re: why the method get() of python Queue is hang on there?

2006-08-14 Thread Gabriel Genellina
At Monday 14/8/2006 12:35, zxo102 wrote: Thanks for your guys. I got it. I thought Queue can be used anywhere in the code and the second b.get() would return a "None". You can use a list as a generic queue, with append (== push) and pop(0) Gabriel Genellina Softlab SRL

Re: TypeError: 'module' object is not callable (newby question)

2006-08-14 Thread Charles Russell
Charles Russell wrote: But why does the > conflict not occur when the code is run interactively from the python > prompt? Because, I now realize, I had not yet created glob.py when I tried that. -- http://mail.python.org/mailman/listinfo/python-list

Re: sending mailing list with smtplib

2006-08-14 Thread Gabriel Genellina
At Monday 14/8/2006 10:22, 3KWA wrote: # ... but the actual message sending in a loop to send one email each (didn't work) Specify "didn't work" at least... see http://www.catb.org/~esr/faqs/smart-questions.html Gabriel Genellina Softlab SRL ___

Re: OT: p-gal website

2006-08-14 Thread John Bokma
"ajaksu" <[EMAIL PROTECTED]> wrote: > Don't :) > Even Firefox developers will tell you to avoid this. Develop for > standards compliant browsers (including Firefox) by testing against > the standards. Neither your HTML or CSS pass validation, both due to > minor, easy-to-fix issues. If you actual

Re: selecting base class from user input

2006-08-14 Thread danielx
Jackson wrote: > Maric Michaud wrote the following on 2006-08-14 01:26: > > In [28]: class Animal(object) : > >: _types = {} > >: > >: > > > > In [29]: class Worker(object) : > >: def work(self) : print 'hard' > >: > >: > > > [snip] > > What

Re: looking for a simple way to load a program from another python program..

2006-08-14 Thread Gabriel Genellina
At Sunday 13/8/2006 16:51, [EMAIL PROTECTED] wrote: I was looking for a simple way to load a simple python program from another python program. I tried os.system(cabel) The file name is cabel.py a csound instrument editor.. NameError: global name 'cabel' is not defined Have you tried o

Re: Mega Newbie Questions: Probably FAQs

2006-08-14 Thread ajaksu
Zeph wrote: > 1) I want to write high-level apps that are db connected, networkable > and cross-platform: Linux, Mac OSX, Windows. I know there are apps that > can convert to Linux or Windows as stand-alone executables, is there > also one that will permit me to convert to MacOSX? Yes, py2app (http

Re: Newbie Python SQL

2006-08-14 Thread Gabriel Genellina
At Monday 14/8/2006 16:54, len wrote: Could someone recommend a tutoral, book, white paper, etc. I am trying to write a python program which takes a CSV file and through SQL insert update my SQL files. The SQL files contain a parent file with multiply child and grandchildren plus various files

Re: Memory problem

2006-08-14 Thread John Machin
Yi Xing wrote: > I tried the following code: > > >>> i=0 > >>> n=2600*2600*30 > >>> a=array.array("f") > >>> while (i<=n): > .. i=i+1 > .. a.append(float(i)) Not a good idea. The array has to be resized, which may mean that a realloc won't work because of fragmentation, you're out of luck

Re: TypeError: 'module' object is not callable (newby question)

2006-08-14 Thread Charles Russell
John Machin wrote: > > Contemplate the following: > > C:\junk>type glob.py > if __name__ == "__main__": > print "*** Being run as a script ..." > import glob > print "glob was imported from", glob.__file__ > print "glob.glob is", type(glob.glob) > print "glob.glob was importe

Re: selecting base class from user input

2006-08-14 Thread danielx
Jackson wrote: > Thanks for the reply. > > danielx wrote the following on 2006-08-13 19:49: > > Is your declaration of ABC supposed to have some_super as one of the > > base classes? Your constructor has some_super as a parameter. What is > > this supposed to mean in light of the declaration for AB

Re: TypeError: 'module' object is not callable (newby question)

2006-08-14 Thread Charles Russell
Marc 'BlackJack' Rintsch wrote: > > Don't call your file `glob.py` because then you import this module and not > the `glob` module from the standard library. > > Ciao, > Marc 'BlackJack' Rintsch Yes, thanks. Renaming to myglob.py solved the problem. But why does the conflict not occur w

Re: Mega Newbie Questions: Probably FAQs

2006-08-14 Thread AlbaClause
Zeph wrote: > 4) There are a lot of books and tutorials out there, but they are of the > proof-of-concept type. Specifically, a tutorial might teach me Hello > World, but not really care about the framework, because it's a very > simple item, and the point is simply to get me coding. I'd like t

Re: Memory problem

2006-08-14 Thread Thomas Nelson
Yi Xing wrote: > On a related question: how do I initialize a list or an array with a > pre-specified number of elements, something like > int p[100] in C? I can do append() for 100 times but this looks silly... > > Thanks. > > Yi Xing Use [0]*100 for a list. THN -- http://mail.python.org/ma

Re: Memory problem

2006-08-14 Thread Simon Forman
Yi Xing wrote: > On a related question: how do I initialize a list or an array with a > pre-specified number of elements, something like > int p[100] in C? I can do append() for 100 times but this looks silly... > > Thanks. > > Yi Xing You seldom need to do that in python, but it's easy enough:

OT: p-gal website

2006-08-14 Thread ajaksu
Sorry for the OT post... Paolo Pantaleo wrote: > 14 Aug 2006 10:16:37 -0700, ajaksu <[EMAIL PROTECTED]>: > > The homepage (http://paolopan.freehostia.com/p-gal/ ) looks weird in my > > SeaMonkey 1.0.4, contents appear below GoogleAds instead of at the > > right. > > Well... I designed the site fo

Re: Memory problem

2006-08-14 Thread Yi Xing
On a related question: how do I initialize a list or an array with a pre-specified number of elements, something like int p[100] in C? I can do append() for 100 times but this looks silly... Thanks. Yi Xing -- http://mail.python.org/mailman/listinfo/python-list

Basic Boost.Python Question

2006-08-14 Thread Hoop
Hi, I have been working in getting Boost.Python running on my PC, seems to work now. I have what I believe is somewhat of basic question here. I am starting on an application that will developed in VS2005, probably using C++/CLI. I want to be able to exchange data in between Python and C++. The u

Re: Memory problem

2006-08-14 Thread Larry Bates
Yi Xing wrote: > Hi, > > I need to read a large amount of data into a list. So I am trying to see > if I'll have any memory problem. When I do > x=range(2700*2700*3) I got the following message: > > Traceback (most recent call last): > File "", line 1, in ? > MemoryError > > Any way to get a

Memory problem

2006-08-14 Thread Yi Xing
I tried the following code: >>> i=0 >>> n=2600*2600*30 >>> a=array.array("f") >>> while (i<=n): .. i=i+1 .. a.append(float(i)) .. Traceback (most recent call last): File "", line 3, in ? MemoryError to see the size of the array at the time of memory error: >>>len(a) 8539248. I use Wind

Newbie Python SQL

2006-08-14 Thread len
Hi all Could someone recommend a tutoral, book, white paper, etc. I am trying to write a python program which takes a CSV file and through SQL insert update my SQL files. The SQL files contain a parent file with multiply child and grandchildren plus various files for doing validation. I am usin

Re: Memory problem

2006-08-14 Thread Tim Chase
> I need to read a large amount of data into a list. So I am trying to > see if I'll have any memory problem. When I do > x=range(2700*2700*3) I got the following message: > > Traceback (most recent call last): > File "", line 1, in ? > MemoryError > > Any way to get around this problem? I

Re: Which KDE IDE for Python?

2006-08-14 Thread gregarican
SPE looks good. I've used Komodo for about a year or so but am considering giving SPE a try. All of the malware/spyware/adware that was attempting to load on my system when I visited the SPE website wasn't so good, however :-/ crystalattice wrote: > Bart Ogryczak wrote: > > Hi, > > Rigth now I'm u

Re: Memory problem

2006-08-14 Thread John Machin
[EMAIL PROTECTED] wrote: > If you know that you need floats only, then you can use a typed array > (an array.array) instead of an untyped array (a Python list): > > import array > a = array.array("f") > Clarification: typecode 'f' stores a Python float (64-bits, equivalent to a C double) as a 32

Mega Newbie Questions: Probably FAQs

2006-08-14 Thread Zeph
I'm pretty well of a mind to pick up Python. I like it because it seems to have a fair degree of functionality and is accessible to someone without a PhD in computer sciences. This is my second day of investigation, and I'm astounded by the huge ecosystem that surrounds it. I have a number of q

Re: Memory problem

2006-08-14 Thread John Machin
Yi Xing wrote: > Hi, > > I need to read a large amount of data into a list. So I am trying to > see if I'll have any memory problem. When I do > x=range(2700*2700*3) I got the following message: > > Traceback (most recent call last): > File "", line 1, in ? > MemoryError > > Any way to get ar

Re: outputting a command to the terminal?

2006-08-14 Thread John Salerno
Simon Forman wrote: > Neat trick: man -k Ah, so much command line magic to learn! Maybe I should just go back to Windowsor maybe not. ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: Memory problem

2006-08-14 Thread bearophileHUGS
Yi Xing wrote: > I need to read a large amount of data into a list. So I am trying to > see if I'll have any memory problem. When I do > x=range(2700*2700*3) I got the following message: > Traceback (most recent call last): > File "", line 1, in ? > MemoryError > Any way to get around this pr

Re: yet another noob question

2006-08-14 Thread Jason Nordwick
*mouth agape* Wow. That really sucks. I make extensive use of reduce. It seems to run more than twice as fast as a for loop. >>> t = Timer('bino.reduceadd(bino.bits)', 'import bino') >>> s = Timer('bino.loopadd(bino.bits)', 'import bino') >>> t.timeit(10) 1.2373670396656564 >>> s.timeit(10) 2.64

Re: outputting a command to the terminal?

2006-08-14 Thread Simon Forman
John Salerno wrote: > Simon Forman wrote: > > > It's simple, short, and to-the-point. The equivalent python script > > would be much longer, for no appreciable gain. I write most of my tiny > > little helper scripts in python, but in this case, bash is the clear > > winnar. (And on *nix. man pag

Re: TypeError: 'module' object is not callable (newby question)

2006-08-14 Thread John Machin
Charles Russell wrote: > Why does this work from the python prompt, but fail from a script? > How does one make it work from a script? > > #! /usr/bin/python > import glob > # following line works from python prompt; why not in script? > files=glob.glob('*.py') > print files > > Traceback (most rec

Re: outputting a command to the terminal?

2006-08-14 Thread John Salerno
Simon Forman wrote: > It's simple, short, and to-the-point. The equivalent python script > would be much longer, for no appreciable gain. I write most of my tiny > little helper scripts in python, but in this case, bash is the clear > winnar. (And on *nix. man pages are your best friend. Plus y

tkinter, livewires: slow moving on Canvas

2006-08-14 Thread Pavel Kosina
Hi, I have two similar programs- one in Livewires and one in Tkinter. Just moving the player on a canvas. Why is that one in Tkinter so slow? What did I miss? Livewires is based on Tkinter, so it should be the same. I looked at the code of Livewires, tried something, but no success. Mayb

Re: Which KDE IDE for Python?

2006-08-14 Thread Jarek Zgoda
Diez B. Roggisch napisał(a): >>As a side note, Eric3 has no KDE integration because it's pure PyQt >>application. > > Not fully true. While it certainly doesn't aim to be a fully integrated ide, > it has some kde-support. Which you can disable using the --nokde argument, > btw. > > It will then

Re: Best IDE for Python

2006-08-14 Thread Satya
[EMAIL PROTECTED] wrote: > Hi All, What do you find the best IDE for creating web applications in > Python is? Preferably FOS IDE. WingIDE appears to be the best, especially if you are an Emacs user and are used to its niceties. It is however, not free. PyScripter is pretty good too -- light wei

Re: TypeError: 'module' object is not callable (newby question)

2006-08-14 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Charles Russell wrote: > Why does this work from the python prompt, but fail from a script? > How does one make it work from a script? > > #! /usr/bin/python > import glob > # following line works from python prompt; why not in script? > files=glob.glob('*.py') > print fil

Memory problem

2006-08-14 Thread Yi Xing
Hi, I need to read a large amount of data into a list. So I am trying to see if I'll have any memory problem. When I do x=range(2700*2700*3) I got the following message: Traceback (most recent call last): File "", line 1, in ? MemoryError Any way to get around this problem? I have a mac

Re: outputting a command to the terminal?

2006-08-14 Thread Simon Forman
John Salerno wrote: > Yu-Xi Lim wrote: > > > I assume you're using a Debian-based distro with aptitude as the front > > end. In which case, all dpkg operations should be logged in > > /var/log/dpkg.log > > Yes, I'm using Ubuntu. But I checked this log file and I'm a bit > confused. It has a lot of

Re: yet another noob question

2006-08-14 Thread bearophileHUGS
Jason Nordwick: > Stargaming wrote: > > Also note that reduce will be removed in Python 3000. > What will replace it? Nothing, I presume. You will have to write a function to find another way to solve problems. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: TypeError: 'module' object is not callable (newby question)

2006-08-14 Thread faulkner
works for me. do you do anything in your script besides that? Charles Russell wrote: > Why does this work from the python prompt, but fail from a script? > How does one make it work from a script? > > #! /usr/bin/python > import glob > # following line works from python prompt; why not in script?

Re: Boost Build Warning

2006-08-14 Thread Roman Yakovenko
On 14 Aug 2006 10:29:08 -0700, Hoop <[EMAIL PROTECTED]> wrote: > Hi, > I am trying to run the Hello World example in Boost.Python from the > Building Hello World documentation. I believe that I have everything > set up right but I get these three warnings, > > warning: no toolsets are configured. >

Re: p-gal: photo gallery generator with templating support

2006-08-14 Thread Paolo Pantaleo
14 Aug 2006 10:16:37 -0700, ajaksu <[EMAIL PROTECTED]>: > Paolo Pantaleo wrote: > > www.sf.net/projects/ppgal > > Ciao Paolo! > > The homepage (http://paolopan.freehostia.com/p-gal/ ) looks weird in my > SeaMonkey 1.0.4, contents appear below GoogleAds instead of at the > right. Well... I designe

Re: selecting base class from user input

2006-08-14 Thread Jackson
John Machin wrote the following on 2006-08-14 01:45: > Here are a couple of thoughts that *might* help: > > (1) mix-in i.e. a class can have multiple base classes: > > class AntWorker(Animal, Worker): > > (2) you can create classes on the fly using the 3-argument form of the > built-in type() fu

Re: yet another noob question

2006-08-14 Thread Jason Nordwick
Stargaming wrote: > > Also note that reduce will be removed in Python 3000. What will replace it? -j -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >