Since v2.5, SQLite is included in the Standard Library. You can get docs at
the Python website, or in the handy chm that comes with the Windows
distribution.
Cheers
On Sunday 31 January 2010, Samuel de Champlain wrote:
> My project is relatively light and postgresql or mysql might be overkill
There are two obvious "gotchas". One is binary extensions. If you are using
modules that are not "pure Python", you will have to find *nux versions for
your target.
The other problem is impossible to solve in general, but most of the time,
it's less trouble than the first problem. Python is
Using freeze or another tool of its ilk is only going to make you an
executable for that platform. If you want an executable for a different
platform, you need to set up a native Python environment with all the
dependencies installed where Python can find them, and then use that platform's
to
Here's a (more or less) useful example. It generates the "nth triangular
series" (my term), n=2 is the triangular numbers, n=3 the tetrahedral numbers
(n has a correspondence to dimension). Each series is the sum of the elements
of the previous one. They are also the columns of Pascal's Tria
I'm using Debian. Used to be etch, but I did a double dist-upgrade recently.
So, whatever the current testing release is. My shell is zsh, but bash should
work the same.
PYTHONPATH should have worked. CLASSPATH is for Java.
Here's the documentation link you want:
http://docs.python.org/i
This actually isn't so hard with classes (not instances of the class). Just
use setattr(). The first parameter of the function will be the instance,
called "self" by convention. This should work with both old and new style
There's stuff in the new module for adding stuff to instances, but I
Sorry, should have included a concrete example. Although, as the others have
said, I'm not sure how it helps with what you (seem) to want to do.
0 % cat bar.py
def the_answer(self):
return 42
0 % cat foo.py
import bar
class A:
pass
setattr(A, '__call__', bar.the_answer)
a=A()
print a(
There are many ways. The simplest is to export the file to CSV and load that,
but you'll only get one worksheet, and it's a big hassle to update the Excel
file that way. You can save the spreadsheet as an ODF file, which is a fully
documented XML format that Python can read and write easily,
It sounds like maybe you could use Enthought Python, which is a bundle of most
of the popular numerical libraries by the scipy sponsors. Not free, however,
there's a trial version.
http://enthought.com/products/epd.php
The problem of bundling stuff is a real thorny one and has been beaten to
The preferred and most graceful way is to use neither, as others have pointed
out. However, you can't return an exit code that way, and it sometimes isn't
feasible to structure your code to allow it. I prefer SystemExit, because it
doesn't require adding something to the namespace (the sys mo
It sounds to me like you need to set a nonzero linewidth. The default is to
not fill in the space between points. Check out the documentation at
http://matplotlib.sourceforge.net/contents.html. It's a lot to wade through,
but worth it when you learn how to unlock the power of the software.
You might also consider pexpect.
http://pexpect.sourceforge.net/
It's designed for interactive console applications like ftp.
For popen() style access, the recommended approach is the subprocess module.
You should be able to find an example in the docs to fit your application.
http://docs.pyth
SWIG supports opaque pointers that you can pass into and out of Python without
any problems.
Working with SWIG isn't that bad for basic stuff, although it can get
complicated if you need to have it interpret exotica like references,
structures, or such for Python. Having a good C++ background
You can always substitute Iteration for Recursion by making the stack an
explicit part of your code. As an example, imagine you are traversing this
directory tree:
birds
birds/owls
birds/owls/snowy
birds/owls/barn
birds/owls/great-horned
birds/eagles
birds/eagles/golden
birds/eagles/bald
birds/e
You should look into Numpy or ScientificPython.
http://numpy.scipy.org
http://dirac.cnrs-orleans.fr/plone/software/scientificpython
Also, the main Python Wiki has a page devoted to numeric/scientific topics:
http://wiki.python.org/moin/NumericAndScientific
Cheers
On Monday 16 February 2009 12:3
There's a recipe in the Python Cookbook that addresses this:
http://code.activestate.com/recipes/65203/
There are probably others floating around, too.
Cheers
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Sunday 01 March 2009 12:04, Wayne Watson wrote:
> Ok, how do I do what's mentioned in Subject?
There's an inverse to the strftime() function, strptime(), also in the time
module, that will do this.
Cheers
___
Tutor maillist - Tutor@python.org
htt
Use time.strptime() to parse them into seconds since the start of epoch, and
then an ordinary numeric subtraction will work.
Cheers
On Monday 02 March 2009 19:45, Judith Flores wrote:
> Hello,
>
>I can't seem to figure out the syntax to calculate the difference in
> minutes between two time
There is a not-free GUI builder, wxDesigner, that isn't too bad (except for
costing money). http://www.roebling.de
The GLADE GUI builder for Gtk is very nice, however.
http://www.pygtk.org/
For windows:
http://gladewin32.sourceforge.net/
Cheers
___
Make your own. You can have empty containers in glade that you fill in at
runtime, or you could create the interface in glade, perhaps a couple of
ComboBoxes. I would leave an empty container and create a reusable widget
descended from gtk.HBox that implements validation or anything else that
This is a super book for beginners who are new to GUI programming. Tkinter is
easy to use, and comes included with Python. Serious programmers will
probably want something faster, better looking, and with nicer features, but
they can be tricky to figure out and install. I still prefer Tkinte
widget), includes
a set of standard data validators, etc.
Cheers
On Tuesday 17 March 2009 16:27, Alan Gauld wrote:
> "Chris Fuller" wrote
> > This book does not cover the Tix widget set, which was originally
> > created for
> > Tcl/Tk and later included wi
With respect to grid and pack, all siblings must use the same manager. Do
otherwise and your application will hang. Children/parents may use different
managers. I don't believe there are any restrictions on place, as it doesn't
do any negotiation.
Cheers
_
You should iterate over the keys of the dictionary:
for k in a.keys():
because if you iterate over the full dictionary, your items are the values,
not the keys. Otherwise your code looks correct, and I don't think its
terribly bad form. You could do something interesting with sets:
sa = set(a.k
Oops! The dictionary iterates over keys, not values as I stated (and
demonstrated by your working code). Consequently, the example I gave could
be more succinctly expressed by:
sa = set(a)
sb = set(b)
Sorry for the error.
Cheers
___
Tutor maillist -
There's a section in the Python docs just on this topic:
http://docs.python.org/extending/index.html
There's probably also some stuff in the wiki, although I'm not familiar with
anything specific: http://wiki.python.org/moin/
The SWIG documentation is extensive, and while not the user-friendl
You should look up "numerical methods" or similar. There are ways of
rearranging your calculations to minimize the loss of precision. You could
also try a numerical/scientific library like GMP (for integers or rational
numbers). I don't know of any (Python) library for extended precision
fl
His problem was composing four functions, each with a small error. The first
two applications work well enough, but there is a about a percent error in
the third composition. The big source of error is f(x+h)-f(x). Subtracting
two floating point numbers that are nearly equal is a known source
Most teachers use spreadsheets for this. Is there a reason you'd like to use
Python? A spreadsheet would be easier to create and less error prone.
If you don't have a copy of Microsoft Orifice handy, you can use Gnumeric or
Open Office.
Cheers
On Wednesday 22 April 2009 10:54, John Jenkinson
On Friday 05 June 2009 06:18, Norman Khine wrote:
> Hello,
> What is the way to group each value so that I get a list, from a string
> like:
>
> dir = '/expert/forum/expert/expert'
> list = ['/expert', '/forum', '/expert', '/expert']
>
> I've tried:
> >>> dir = '/expert/forum'
> >>> dir.split('/')
On Saturday 13 June 2009 04:44, Eddie wrote:
> Hi guys,
>
> What would you regard as the best free Python editor to use on Windows
> for a new guy? Searching Google i see that there is quite a few out
> there and is "VIM" the best one to go with?
>
> Regards
> Eddie
I've tried a lot of editors, an
Use os.path.walk or similar to build the file before you call setup().
Cheers
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Friday 19 June 2009 17:23, Robert Lummis wrote:
> Could you recommend a module or methods I should use to manage an
> encrypted text file? I want to store passwords and associated contact
> information in a file and feel confident that if the file is stolen
> the information couldn't be read.
U
On Friday 03 July 2009 15:37, Emile van Sebille wrote:
> On 7/3/2009 1:21 PM Kent Johnson said...
>
> > On Fri, Jul 3, 2009 at 3:49 PM, Dinesh B
> >
> > Vadhia wrote:
> >> d = [0, 8, 4, 4, 4, 7, 2, 5, 1, 1, 5, 11, 11, 1, 6, 3, 5, 6, 11, 1]
> >>
> >> and we want:
> >>
> >> [0, 8, 12, 16, 20, 27, 29,
The only things that matter are the arguments and the result. It sounds to me
like a good case use for SWIG (http:://www.swig.org). You can do really
complicated stuff with swig, and it takes a correspondingly steep learning
curve to achieve, but doing simple stuff is really simple. It sounds
On Sunday 12 July 2009 11:09, Rick Pasotto wrote:
> I've got a script that I wrote several years ago and have been happily
> using daily. Suddenly when I try to run it I get a segmentation fault.
>
> I'm running debian testing so probably some recent update caused the
> breakage. How can I find out
On Tuesday 28 July 2009 10:45, shawn bright wrote:
> Hey all,
>
> I have an app that runs in a GUI written in pygtk. It spawns several
> threads, and runs all the time.
> It is mission critical that we can never have two instances of this
> running at once.
>
> So, my question is, how can i write s
On Tuesday 04 August 2009 12:43, Megan Land wrote:
> Hi,
>
> I'm working on a python script to automate a program we run at work. The
> program is run from one command. The only problem is that it asks you to
> hit enter to continue after it runs. Is there a way I can do this?
>
> If at all poss
On Friday 07 August 2009 21:31, Mark Young wrote:
> Hi, I was reading a tutorial, and it mentioned the "import this" easter
> egg. I was curious, and looked up the contents of the module, and dscovered
> that it had attributes c, d, i, and s. I was wondering if anyone had any
> clue what these attr
Something else to note: you can find any module's location by looking it up in
the dictionary sys.modules. For instance:
Python 2.4.4 (#2, Oct 22 2008, 19:52:44)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>
There are a few projects attempting something like this, but it is not easy to
get a language like Python running on the minimalist resources found in a
microcontroller. Google "python microcontroller" (without the quotes).. you
could also try the plural form to see if that brings up other hits
It might also be a good application for numpy (http://www.numpy.org/)
Cheers
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
It's trying to launch GhostScript, and failing. The broken pipe is a clue
that its trying to communicate with external software. Most likely, you
don't have ghostscript installed. Google Ghostscript and you should find
instructions for installing on windows (I'm fairly sure there is a port).
Like I said, you need to find out what's going wrong with GhostScript. Also,
converting image formats is something PIL does internally, without requiring
a (large) external package like GhostScript, which is an interpreter for a
different language (PostScript), which your eps files are coded i
The version of GTK for windows I like to use is at
http://gladewin32.sourceforge.net/, but it is rather out of date. It's main
advantage is everything is bundled up in a nice installer. You can also get
it from the main site at ftp://ftp.gtk.org/pub/gtk, but you have to grab
several files an
on differences:
The downloads include binaries, so there have to be distinct files for Linux
and Windoze. If you download the same versions, there shouldn't be any
noticeable differences, with one big exception: multithreading and PyGTK
don't mix well on Windows. Your application might run
Start with the main site. There are links to wikis/mailing lists/etc there.
http://www.riverbankcomputing.co.uk/software/pyqt/
Also, you might be interested in the fully-free alternate, PySide, sponsored
by Nokia:
http://www.pyside.org/
Cheers
On Wednesday 28 October 2009 11:17, Christopher S
My approach has been to store it as an array and then build the integer as
needed. This code requires Python 2.5 or later.
def bits2int(l):
return sum([2**i if j else 0 for i,j in enumerate(l)])
To convert the other way:
def int2bits(m, n):
return [int(bool(m&(1<>= inc
return i
flo
Something to keep in mind is that the audio output of your computer and the
system speaker are independent. Sometimes the BELL character (ACSII 0x07)
will sound the system speaker, spending on your OS, drivers, etc.
The winsound docs say it's the speaker, which is connected to the motherboard
The most concise way to do this is to transpose the list (convert a axb array
to bxa), then complare the elements that are pairs of one value each of the
original lists.
You have two lists, a and b. Put these into a list and you have a 2x6
2d "array".
>>> [a,b]
[[4, 3, 2, 6, 7, 9], [8, 6, 3, 3
I didn't think of that. But for an arbitrary 2D list, you need the asterisk
syntax.
On Tuesday 25 December 2007 19:00, you wrote:
> Chris Fuller wrote:
> >>>> zip(*[a,b])
> >
> > [(4, 8), (3, 6), (2, 3), (6, 3), (7, 2), (9, 7)]
>
th.
On Wednesday 26 December 2007 08:51, you wrote:
> Chris Fuller wrote:
> > I didn't think of that. But for an arbitrary 2D list, you need the
> > asterisk syntax.
>
> I don't know what you mean by "an arbitrary 2D list". You need the *
> synta
On Wednesday 26 December 2007 10:03, Alan Gauld wrote:
> I thought I was following this but now I'm not sure.
>
> Do you mean that if I have a list L that contains an arbitrary
>
> number of sublists that I can call zip using:
> >>> zip(*L)
>
> rather than
>
> >>> zip(L[0],L[1],, L[n])
>
> If s
On Thursday 27 December 2007 08:29, [EMAIL PROTECTED] wrote:
>
> e = Elevator()
> e.show_state()
>
> raw_input("\n\nPress the enter key to exit.")
>
Two observations:
This "module-level" code that does the testing will be run when the module is
imported. A more flexible approach would be to pla
You might find a dictionary useful. Each element in a dictionary is associated
with a "key", which can be a string.
objectlist = {}
o = eval("class1" + "()")
objectlist["object1"] = o
o.method("hello world")
Also, try to avoid using eval(), it usually makes troubleshooting and
maintenance hard
TUGZip (www.tugzip.com) is another free (as in speech) alternative. It has a
distinct interface from 7-zip that some may prefer.
Cheers
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Friday 28 December 2007 09:31, Tim Michelsen wrote:
> Hello,
> I have a mbox file locally on my notebook.
>
> I would like to send this file to my IMAP account using python.
>
> Does anyone know a module or tutorial which does this?
>
> I tried
> * IMAPClient 0.3 - http://pypi.python.org/pypi/IM
first thing.. you are duplicating a lot of effort inside your loops. getting
rid of that will speed things up:
dict = {}
for record in list:
rid = record[0]
if rid in dict:
dict[ rid ].append( record )
else:
dict[ rid ] = [record]
The other thing I see isn't a speed p
Is there a reason you are building from scratch? There are binaries for
win32, and most linux distributions.
You will need the development packages for libpng, zlib, and freetype, and
others, depending on the GUI backends you want to use. These can be
configured in the setup.cfg file. See
On Monday 31 December 2007 06:19, goldgod a wrote:
> hello all,
> Please find the attached file. I want to sort the content
> of this file based on the "bytes" in descending order. How can i do
> it, any pointers to it.
This is a classic case for the use of regular expressions. A powe
On Monday 31 December 2007 10:36, Chris Fuller wrote:
> lin = re.findall('\s*([^\s]+)\s+([^\s]+)\s+(\d+)( [kM])?bytes', s)
This is incorrect. The first version of the script I wrote split the file
into records by calling split('bytes'). I erroneously assumed I would obta
This is a good case for recursion. My solution is in two steps. A
straightforward application of recursion (I was casting about semi-randomly)
yields a attractive tree structure:
root
a b
c d e c de
f f f f ff
g h
he and
mod_python. You can use it the same way as PHP. This might not be suitable
for what you need to do, but if you could do it this way, it would probably
be faster.
Cheers
Chris Fuller
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Wednesday 06 February 2008 09:23, Damian Archer wrote:
> When I am running a script in cmd the script runs but the cmd windows
> closes immediately after the script has finished.
>
> Is there anyway I can freeze the cmd window until a user actually closers
> it??
There are numerous ways to do t
On Wednesday 13 February 2008 18:49, Arun Srinivasan wrote:
> I'm trying to learn Python, and I decided to try kata 2 from the
> CodeKate website. It's basically just a challenge to implement a binary
> search in different ways.
>
> I wrote an implementation that works, but I'm confused as to why.
There's a post on this list from me, with example code, from a couple of weeks
ago that solves this:
http://mail.python.org/pipermail/tutor/2008-February/060025.html
Cheers
On Thursday 21 February 2008 11:15, brindly sujith wrote:
> hi
>
> i m developing a application using tkinter
>
> i want
You probably want to start with PySerial:
http://pyserial.sourceforge.net/
But, the details really depend on the application.. what are you talking to at
the other end? Do you need a general terminal program?
You can probably find xmodem and zmodem libraries, but if you control both
ends, roll
On Friday 29 February 2008 06:28, Dick Moores wrote:
> I keep missing a certain weekly program on my local NPR station. My
> idea is to record it using software I have, Easy Hi-Q Recorder. I can
> set it to start recording when the program starts, 8pm, but I need to
> have the program playing on my
On Friday 29 February 2008 18:25, Tiger12506 wrote:
> time.sleep is not exactly accurate, so I would suggest that you use this
> method, short 5 minutes or so and then do a sleep(10) or so in a loop to
> get closer to the time.
Another advantage to shorter sleeps is it reduces the latency of anyth
I left out the daily increment. there should be a event_time += 86400 end of
the inner loop.
while True:
while time()http://mail.python.org/mailman/listinfo/tutor
On Friday 29 February 2008 12:24, Dick Moores wrote:
> http://www.kuow.org/real.ram .
Try this to start, then turn into a service with FireDaemon,
http://www.firedaemon.com/. You'll need to fill in the quit() function, and
the particulars for your media player.
from time import mktime, strft
On Friday 29 February 2008 16:30, Trey Keown wrote:
> Hey all,
> Been away for a while. So, I'm in the process of making a program for
> encrypting and decrypting strings of text. And I was wondering how it
> would be possible to perhaps keep keys in a .pyc file, and keep them
> from being isolat
Almost. And better than my original idea. You could have a hierarchical sort
function:
def hiersort(a,b):
if a.attr1 != b.attr1:
return cmp(a.attr1, b.attr1)
else:
if a.attr2 != b.attr2:
return cmp(a.attr2, b.attr2)
else:
return cmp(a.attr3, b.att3)
l
How I would improve this:
compile the regular expression. This is more efficient.
self.digit_extractor = re.compile('(\d+)')
then, use the findall method:
self.allNumbers = self.digit_extractor.findall(self.aString)
which will even work with multiline strings, but doesn't convert to integers.
The basic approach I use in these sorts of problems is to generate the
choices, remove them from a list as they are asked, and then stop when this
list is empty.
If you don't need the list of questions afterwards, this will work:
from random import choice
questions = [ [i,j] for i in range(1
SIGKILL is not trappable. You probably want SIGTERM. Furthermore, this
signal will be sent to the process, not some thread or class instance within
a process.
Maybe you need some other mechanism? Is the signal going to be from the same
python process? If so, just call it directly. Otherwis
I read your post again, and it looks as though you might want to use the
atexit module. Another idea would be to trap the SIGTERM signal and to keep
a registry of instances, and then to invoke a cleanup method of each
instance.
Another important note: trapping signals will have no effect if yo
On Sunday 16 March 2008 08:03, Guba wrote:
> Hello!
>
> I like the idea of retaining my original questions by creating a proxy
> list, but I wasn't able to understand (find) the proxy list:
>
> Chris Fuller wrote:
> > from random import choice
> >
> > quest
Oops, I based those examples on my initial solution, not the preferred one
that preserved the questions. Here is some better code. They only use the
shuffle method, and I've elaborated a bit on the basic solution, to
illustrate some ideas for improvement.
Some things you might try as an exer
You should try some of the Python tutorials out there. There's a difference
between tuples and lists, and the parameter list passed to the string
formatting operator must be a tuple. String formatting will also solve your
second problem.
Also, the library reference is your friend. I particu
Unless you have a specific reason for choosing postgresql (an excellent
database, just not the easiest), such as having an existing
installation, desiring networked access, or nice features such as type
safety, you might want to consider SQLite instead. Also, if you stick to
the DB-API spec, yo
There are at least a couple of python interfaces to postgresql, but psycopg
follows the DB-API spec. You shouldn't have to use the postgresql engine
directly.
http://www.initd.org/pub/software/psycopg/
The cool bit is that the examples you see that follow DB-API will apply to
postgresql, exce
On Wednesday 19 March 2008 18:52, Dinesh B Vadhia wrote:
> Say because of performance, you might want to re-write/convert Python code
> to C++. What is the best way (or best practice) to do this wrt the tools
> available?
>
> Dinesh
You also might want to use some profiling tools, or skip that st
What about Alt keys? I was thinking terminal control voodoo. But I don't
know any. man 5 termcap might be a start, though.
Cheers
On Sunday 23 March 2008 06:58, Kent Johnson wrote:
> Nathan McBride wrote:
> > I've used pexpect for a few projects and love it. Basically pexpect
> > lets you sp
What about Alt keys? I was thinking terminal control voodoo. But I don't
know any. man 5 termcap might be a start, though.
Cheers
On Sunday 23 March 2008 06:58, Kent Johnson wrote:
> Nathan McBride wrote:
> > I've used pexpect for a few projects and love it. Basically pexpect
> > lets you s
On Wednesday 26 March 2008 09:11, Tom Tucker wrote:
> Hello all. I'm looking for a builtin Python library capable of providing
> similar output to what the unix df command provides. Obviously, I'm trying
> to avoid a system call if possible. I'm looking for the following fields
> at a mimimum, to
The email and mailbox modules might help you out. Multiple email messages
will probably parse as an mbox format mailbox.
http://docs.python.org/lib/module-email.html
http://docs.python.org/lib/module-mailbox.html
Cheers
On Friday 28 March 2008 03:14, linuxian iandsd wrote:
> good morning ever
On Saturday 19 April 2008 10:45, Wayne Watson wrote:
> I have a Python program that runs 24/7, but is activated around dusk and
> de-activated from its task around dawn. My clock drifts about 4 sec/day.
> Is there some function that will fetch the correct time from the
> internet and reset the cloc
I just checked my laptop (XP Pro), and you can set the time server (or use the
default), but it only updates once a week. So your computer's time could be
off by thirty seconds by the time of the next synchronization. It might be
enough, but you also need to be aware so you aren't confused int
I expect if you take that route, you would have to compile the Python
interpreter with debugging enabled, and then run that with gdb. A better
idea might be to recompile your library to produce debugging output at
strategic locations, and then output it to the console or a socket to some
logg
On Wednesday 28 May 2008 20:32, bob gailer wrote:
> Robert William Hanks wrote:
> > Need ti find out whem a number o this form i**3+j**3+1 is acube.
> > tryed a simple brute force code but, why this not work?
> >
> > def iscube(n):
> > cubed_root = n**(1/3.0)
> > if round(cubed_root)**3 =
On Monday 09 June 2008 14:13, Alan Gauld wrote:
> You need to find an API that lets you work at the X windows
> protocol level. I don;t know of one but will be surprised if
> there isn't such a beast around somewhere!
This made me think of Tcl's send() function. This web page has some links
that
On the subject of controlling interactive programs and Tcl, one can hardly
forget expect.. now add Python and you probably have what you want:
http://www.noah.org/wiki/Pexpect
Cheers
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailm
You can also subclass the dictionary type so that this happens transparently.
You could do something similar with lists.
class Container(dict):
def __setitem__(self, key, value):
dict.__setitem__(self, key, value)
if hasattr(value, 'setParent'):
if callable(value.setPare
You could try creating a list of strings, and then using a ''.join(list) to
concatenate, but you are probably going to be best off using the cStringIO
module (http://docs.python.org/lib/module-cStringIO.html). Try timing all
three and see how they compare when joining lots of strings. The leng
On Thursday 10 July 2008 09:09, George Flaherty wrote:
> Hello,
>
> I am trying to port over some old code from Ruby into Python. In my old
> ruby code I had a UnitTest class that created a bunch of test methods (i.e.
> def test_MyTestFunction) dynamically through the ruby method
> define_method(h
On Friday 25 July 2008 09:04, Rick Pasotto wrote:
> I have a script that works fine on my linux machine but bombs out when
> run under windows using the exact same data files. The script downloads
> a file then unzips it and then scans the resulting file for certain
> records. Under Windows it gets
On Monday 28 July 2008 10:56, Karthik wrote:
> Hi,
>
>
>
> I am new to Python programming, I was trying to work out a few problems in
> order to grasp the knowledge gained after going through the basic chapters
> on Python programming. I got stuck with a memory error.
>
>
>
> Following is what I di
There's no need to keep any lists. The sum can be done on the fly, which is
perhaps a bit slower, but takes a constant amount of ram. Even storing every
other element (or every third, which is what he's trying to do: the elements
that are even numbers, not every other element.. See his exampl
The original post was a little ambiguous: "I need to find the sum of all
numbers at even positions in the Fibonacci series upto 2 million."
But the project euler page
(http://projecteuler.net/index.php?section=problems&id=2) is clear: "Find the
sum of all the even-valued terms in the sequence
1 - 100 of 156 matches
Mail list logo