Re: Python and Db

2008-04-21 Thread Magnus Lycka
> <[EMAIL PROTECTED]> escribió: > >> I would like to use sqlite, But I also wanted a tutorial with the >> basis of the sql and etc, I never dealed with dbs before For practicing SQL on-line, I'd suggest sqlzoo.net. -- http://mail.python.org/mailman/listinfo/python-list

Re: unit testing

2007-10-10 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > I maintain old code... code written a long time ago, before unittest > was popular. Getting unittest to work on that is difficult at best. Writing unit tests for lots of old code is not the most funny thing you can imagine... For situations like that, it might be much b

Re: python 2.5 and 3gb switch

2007-10-02 Thread Magnus Lycka
neil wrote: > I see python is not really there for 64 bit yet but most of the people I think you mean "Windows is not really there for 64 bit yet". Python works well on real 64 bit operating system. Blender does too I presume. -- http://mail.python.org/mailman/listinfo/python-list

Re: A question on python performance.

2007-09-28 Thread Magnus Lycka
Joe Goldthwaite wrote: > I didn't know about the getattr function. I tried to search for that > type of function but not knowing how to word the search request, > I couldn't find it. You should really read through chapter 2 (Built-in Objects) of the library reference. All that stuff is core Pytho

Re: Something in the function tutorial confused me.

2007-08-09 Thread Magnus Lycka
Lee Fleming wrote: > Hello, > I have a simple question. Say you have the following function: > > def f(x, y = []): ... > But this, the code that "fixes" the list accumulation confounds me: > def f(x, y=None): > if y is None: y = [] ... > In other words, what's going on here? How is it that

Re: Python end of file marker similar to perl's __END__

2007-08-02 Thread Magnus Lycka
Neil Cerutti wrote: > On 2007-08-01, Cameron Laird <[EMAIL PROTECTED]> wrote: . >> I want to re-emphasize the "triple-quote it" tip mentioned >> earlier in this thread. I think the original questioner >> will find this quite satisfying, if I understand his situ- >> ation at all. >> >> *I* ce

Re: Python end of file marker similar to perl's __END__

2007-08-01 Thread Magnus Lycka
beginner wrote: > Hi All, > > This is just a very simple question about a python trick. > > In perl, I can write __END__ in a file and the perl interpreter will > ignore everything below that line. This is very handy when testing my > program. Does python have something similar? raise SystemExit

Re: Where do they tech Python officialy ?

2007-08-01 Thread Magnus Lycka
On July 23, NicolasG wrote: > I want to be a professional python programmer... > unfortunately sometimes to work as a programmer is really hard in this > world, every employee requires professional experience and you can't > really start as a beginner.. On July 24, NicolasG wrote: > Python is

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-18 Thread Magnus Lycka
Alex Martelli wrote: > PL/1 is basically gone, but its legacy of "take what you need and leave > the rest" is unfortunately alive in other languages that are blind to > the enormous advantages of simplicity and uniformity. Reminds me of RUP... No wonder Ivar Jacobson gave up and started all over.

Re: Python not giving free memory back to the os get's me in real problems ...

2007-04-26 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > Our (python-)macro uses massively nested loops which are unfortunately > necessary. These loops perform complex calculations in this commercial > tool. To give you a quick overview how long this macros runs: > > The outer loop takes 5-7 hours for one cycle. Each cycle cr

Re: Fast and capable XML parser?

2007-04-20 Thread Magnus Lycka
Larry Bates wrote: > I don't know if it meets ALL of your requirements but this might > help: > > http://www.reportlab.org/pyrxp.html AFAIK, there is no XML Schema support in PyRXP. This is really bad enough. GPL is not an option for us, and a commercial licence is less good than e.g. MIT or LGP

Fast and capable XML parser?

2007-04-20 Thread Magnus Lycka
I'm looking for some library to parse XML code much faster than the libs built into Python 2.4 (I'm stuck with 2.4 for quite a while) and I also need XML Schema validation, and would appreciate support for e.g. XPath and XInclude. I also want an API which is more Pythonic than e.g. a thin wrapper o

Re: Future Python Gui?

2007-04-20 Thread Magnus Lycka
Jarek Zgoda wrote: > I am not a hacker, just a software developer, but I'd have no problems > in either installing PyGTK on Ubuntu box (sudo apt-get install > python-gtk2, but it's installed by default anyway) or on Windows XP > machine (double click on installer icon). "Simple user" is not an idio

Re: Random passwords generation (Python vs Perl) =)

2007-02-01 Thread Magnus Lycka
NoName wrote: > Perl: > @char=("A".."Z","a".."z",0..9); > do{print join("",@char[map{rand @char}(1..8)])}while(<>); If you generate passwords like that to normal computer users, you'll end up with a lot of "my password doesn't work" tickets. You should skip the symbols that are easy to mistake for

Re: OODB vs RDBMS

2006-11-29 Thread Magnus Lycka
Thomas Guettler wrote: > Hi, > > most of the time I use ZODB/Durus to store my data. > > I like it, but I know that it has some weaknesses: > - only accesible from python > - I need to code your indexes for fast searching yourself. There are other features of relational database systems that I

Re: Is python for me?

2006-11-17 Thread Magnus Lycka
I think Python is for you. lennart wrote: > Can you define 'large'? Is that large in code, or large in database? I > don't know which database is supported. If its a external db, like > MySql, the query is performed through the software of MySql, am I > right? If I'm correct, the 'slowness' comes

Re: Py3K idea: why not drop the colon?

2006-11-16 Thread Magnus Lycka
John Salerno wrote: > personally, i don't mind the colon and see no need to lose it, but if we > are talking in the realm of aesthetics, it actually seems like it would > be cleaner if it weren't there...sure, at first everyone who is used to > it might feel like something is missing, or the lin

Re: Python component model

2006-11-13 Thread Magnus Lycka
sturlamolden wrote: > There is a whole generation of computer users out there scared stiff of > using the keyboard. Soon, computers will not have a keyboard at all. > The trend is perhaps more pronounced among managers not writing code > themselves, but "taking decisions" about which tools to use.

Re: Is there a commas-in-between idiom?

2006-11-09 Thread Magnus Lycka
Ernesto García García wrote: > list = [1,2,3,4,5,6] Just a nit-pick: It's considered an anti-idiom to hide builtins just as list by using it as a name for a variable. >>> list=[1,2,3,4,5] >>> tuple = (1,2,3,4,5) >>> if list == list(tuple): print "equal" ... Traceback (most recent call last):

Re: is mod_python borked?

2006-11-03 Thread Magnus Lycka
walterbyrd wrote: > *sigh* maybe I'll just use php until the web-hosters catch up, if they > ever do. The first general availability release of Apache 2.0 (2.0.35) appeared in April 2002. There are many ISPs. Perhaps you should limit yourself to those who lag behind less than four years? I can und

Re: Python in sci/tech applications

2006-11-03 Thread Magnus Lycka
robert wrote: > When one follows .. > http://docs.python.org/inst/tweak-flags.html#SECTION000622000 > http://www.zope.org/Members/als/tips/win32_mingw_modules > > ..this seems only to cover the immediate python dll issues. What happens > with the C runtime libraries? You'll bind 2 di

Re: Event driven server that wastes CPU when threaded doesn't

2006-11-02 Thread Magnus Lycka
Snor wrote: > I'm attempting to create a lobby & game server for a multiplayer game, > and have hit a problem early on with the server design. I am stuck > between using a threaded server, and using an event driven server. I've > been told time and time again that I should use an event driven serve

Re: ANN: wxPython 2.7.1.3

2006-11-02 Thread Magnus Lycka
robert wrote: > John Salerno wrote: >> You want Python 2.3 for Windows? > > yes. > (I know no other big libs which already stops support of py2.3-win) The general policy for Python is to support version 2.n-1 when 2.n is the current version, but not older versions than that. There was recently a

Re: python GUIs comparison (want)

2006-10-27 Thread Magnus Lycka
David Boddie wrote: > You're forgetting that Qt isn't just a widget toolkit. I suspect that the non-GUI parts are (just like in Wx) C++ stuff which is more or less equivalent with things that are either Python builtins or parts of Python's standard library. Besides, getting those proprietary depen

Re: Python 2.5 ; Effbot console ; thank ; pb release.

2006-10-27 Thread Magnus Lycka
Méta-MCI wrote: > Hi! (***sorry for my approximative english***) That's ok. Quite amusing to read that you were repaired. > A few months ago, I needed a console, under Windows. > After several research, I selected the console of EffBot. > > Thank you very much, Fredrik Lundh, for this small

Re: Restricting import file lookup for pyd, dll, ...

2006-10-27 Thread Magnus Lycka
Bernard Lebel wrote: > Hi, > > That's because I'm using Python through another application, via the > pywin32 extensions. When that other application starts, it performs > several thousands of file requests (we're talking 4,500, roughly) in > the Python installation, locations where there are Pyth

Re: print dos format file into unix format

2006-10-27 Thread Magnus Lycka
Tim Roberts wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >> Suppose I have a dos format text file. The following python code will >> print ^M at the end. I'm wondering how to print it in unix format. >> >> fh = open(options.filename) >> for line in fh.readlines() >> print line, > > Are

Re: Book about database application development?

2006-10-19 Thread Magnus Lycka
Wolfgang Keller wrote: > does anyone know of a good book that about development of database > applications? Scott Ambler's "Agile Database Techniques" Regardless of whether you'll actually use a full MVC framework or not, I suggest that you write model classes that are fully decoupled from the U

Re: Ok. This IS homework ...

2006-10-19 Thread Magnus Lycka
Frederic Rentsch wrote: > Once upon a time programmers did things like this: > > BEGIN > | > -->|<- > | | | > | catch input| >

Re: How to write Smart Python programs?

2006-10-18 Thread Magnus Lycka
Raj wrote: > Hi, > > We just executed a project with Python using TG. The feedback was to > use more python like programming rather than C style code executed in > Python. The feedback is from a Python purist and for some reasons we > cannot solicity his help. > > So we'd like to do is to scrub t

Re: Where is Python in the scheme of things?

2006-10-12 Thread Magnus Lycka
Bruno Desthuilliers wrote: > gord wrote: >> As a complete novice in the study of Python, I am asking myself where this >> language is superior or better suited than others. For example, all I see in >> the tutorials are lots of examples of list processing, arithmetic >> calculations - all in a D

Re: What value should be passed to make a function use the default argument value?

2006-10-12 Thread Magnus Lycka
Antoon Pardon wrote: > Well maybe he didn't intend that, but how is the reader of the > documentation to know that? The reader can only go by how > things are documented. If those are not entirely consistent > with the intend of the programmer, that is not the readers > fault. I don't think I ever

Re: Python to use a non open source bug tracker?

2006-10-09 Thread Magnus Lycka
Fredrik Lundh wrote: > you're not on the infrastructure list, I hear. I tried to figure out where that list is, so I could have a look at the archives, but I didn't find it in the (for me) obvious places. Could someone please provide a link to the archives for this mailing list, or aren't there

Re: Where is Python in the scheme of things?

2006-10-09 Thread Magnus Lycka
gord wrote: > As a complete novice in the study of Python, I am asking myself where this > language is superior or better suited than others. For example, all I see in > the tutorials are lots of examples of list processing, arithmetic > calculations - all in a DOS-like environment. Python runs

Re: Leave the putdowns in the Perl community, the Python world does not need them

2006-09-29 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > Steve makes a good point. Fredrik is one of the most important > contributors of Python code, tools, etc and as far as I am concerned, > that is so important that it gives him the right to be cranky from tiem > to time. Since February last year I've had the opportunity t

Re: Talking to marketing people about Python

2006-09-29 Thread Magnus Lycka
Roy Smith wrote: > I'm working on a product which for a long time has had a Perl binding for > our remote access API. A while ago, I wrote a Python binding on my own, > chatted it up a bit internally, and recently had a (large) customer enquire > about getting access to it. > > I asked for per

Re: A critique of cgi.escape

2006-09-29 Thread Magnus Lycka
Jon Ribbens wrote: > In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: >> maybe you haven't done software long enough to understand that >> software works better if you use it the way it was intended to be >> used, but that's no excuse for being stupid. > > So what's your excuse? If you don't

Re: a different question: can you earn a living with *just* python?

2006-09-29 Thread Magnus Lycka
John Salerno wrote: > It's a nice thought that a person can earn a living programming with > Python, which is fun enough to use just for its own sake. But for > someone like me (i.e. no programming experience) it's always a little > disheartening to see that most (if not all) job descriptions th

Re: does anybody earn a living programming in python?

2006-09-28 Thread Magnus Lycka
Stuart Bishop wrote: > My personal experience is that there is a shortage of good Python > programmers. In Melbourne, Australia for example there is a continual need > for about 2 more - one Python shop there just hires clueful developers and > makes their first task 'learn Python'. We generally ha

Re: Replace single character at given position

2006-09-27 Thread Magnus Lycka
Larry Bates wrote: >> How do I replace a single character in a string at a given position? You can't. Strings can't be mutated in Python how ever hard you try. The string type is immutable. (Of course, I suspect you can write a horrible C extension that would help you cheat. Yuk!) You need to cre

Re: I need some tips to begin a simple project

2006-09-27 Thread Magnus Lycka
dutche wrote: > Hi, I'm new in Python and I'm learning with "Learning Python" oreilly's > book which is very good written and explanatory. You're not saying how new you are to programming (particularly GUI programming) in general. Python itself is probably not the tricky part here. > And I can us

Re: does anybody earn a living programming in python?

2006-09-27 Thread Magnus Lycka
walterbyrd wrote: > If so, I doubt there are many. Depends on what you compare with. I'm pretty sure there are thousands of people working as Python programmers, and many more using it as a smaller tool in their work. Of course this is small compared to Java or C++. In the US, it seems a lot of

Re: Python programs always open source?

2006-09-22 Thread Magnus Lycka
Ben Finney wrote: > Leif K-Brooks <[EMAIL PROTECTED]> writes: > Ben Finney wrote: > So long as you're not distributing some or all of Python itself, > or a derivative work, the license for Python has no legal effect > on what license you choose for your own work. > >> I was reply

Re: When is it a pointer (aka reference) - when is it a copy?

2006-09-19 Thread Magnus Lycka
Fredrik Lundh wrote: > this article > > http://effbot.org/zone/python-objects.htm > > may be useful for those who haven't already seen it. I don't know how many times I've referred to, or paraphrased, that article. Shouldn't it be incorporated into the standard tutorial? I think it's very he

Re: question about including something like sqlite in python

2006-09-14 Thread Magnus Lycka
John Salerno wrote: > I was just thinking, since Python 3.0 is supposed to clean up a lot of > the unnecessary or redundant features of Python and make other things > more streamlined, does it seem to anyone that including SQLite goes > against this goal? Not to me. I don't see the redundancy.

Re: best small database?

2006-09-14 Thread Magnus Lycka
David Isaac wrote: > I have no experience with database applications. > This database will likely hold only a few hundred items, > including both textfiles and binary files. > > I would like a pure Python solution to the extent reasonable. > > Suggestions? You haven't provided enough requirement

Re: Is it just me, or is Sqlite3 goofy?

2006-09-14 Thread Magnus Lycka
Paul Boddie wrote: > Well, if the client is free not to bother signalling anything about > erroneous value types, one has to wonder why there's so much of a > specification. If you read it, I think you'll notice that the committee has managed to produce a lot of text without spending too much ink

Re: Is it just me, or is Sqlite3 goofy?

2006-09-13 Thread Magnus Lycka
Paul Boddie wrote: > To be fair, that text originates in section 12.3, referring to input > parameters to procedures. Meanwhile, the following text (subclause > 13.8, "") appears to be more pertinent: > > "If the data type of the target identified by the i-th is > an exact numeric type, then the

Re: Is it just me, or is Sqlite3 goofy?

2006-09-13 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > What was Richard Hipp's justification for slandering the > writers of the SQL Language Specification? First of all, if you read the text you quoted and understand English, you should be able to see that the author of the text is clearly expressing an opinion, not stating

Re: Is it just me, or is Sqlite3 goofy?

2006-09-13 Thread Magnus Lycka
First of all, anyone with extensive experience in database systems understand that validating and cleaning input is an unavoidable task. Static typing can help identify some of the problems, but far from all, and there is often data processing done before the data enters the database, so it's ofte

Re: [ANN] RuPy 2007 - Python & Ruby Conference

2006-09-11 Thread Magnus Lycka
Jakub Piotr Nowak wrote: > RuPy 2007 > Python & Ruby Conference > > Poznan, Poland > April 7-8, 2007 Are you aware of the EuroPython Conference which will take place in Vilnius three months later? -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it just me, or is Sqlite3 goofy?

2006-09-11 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > I think an explanation of how Sqlite3 differs from SQL and > a better set of examples is still warranted. In general, Python standard library modules that are wrappers for third party libraries are very thinly documented, and they should probably remain that way, because

Is it just me, or is Sqlite3 goofy?

2006-09-08 Thread Magnus Lycka
While I can understand your frustration, I think it is important to think about the tone in our postings here. Hydrocephalus is one of the most common birth defects, and it's not terribly unlikely that someone who reads this has a family member or someone else in his proximity who suffers from this

Re: Permission Denied

2006-08-23 Thread Magnus Lycka
Jorge Godoy wrote: > ;-) And think about security as well. I.e. put '.' in the end of your PATH, never in the beginning! -- http://mail.python.org/mailman/listinfo/python-list

Re: Project organisation

2006-07-19 Thread Magnus Lycka
rony steelandt wrote: > Imagine I have x projects and they all use util.py > > What would be the best way to organise this > > 1. > c --\project1\*.py > | > |-\project2\*.py > | > --\globals\util.py > > This organisation has the problem that if I have to modify something to > util.py tha

Re: running python from a memory stick?

2006-07-13 Thread Magnus Lycka
John Salerno wrote: > Is there a way to 'install' and use Python on a memory stick, just as > you would on any computer? I use Windows, and I know the installation > does things with the registry, so probably I couldn't use the executable > file to install it. But is it possible to do it some ot

Re: How to display name of elements in list?

2006-07-12 Thread Magnus Lycka
>> My list called "elten" looks like that: >> >> [Tensor: id = 1, intensity = 2976.52 >> xx = -1447.32, xy = 52.458, xz = -594.186 >> yy = -1090.54, yz = -0.0158068, zz = -4043. >> , Tensor: id = 26, intensity = 2896.9 >> ... >> , Tensor: id = 5, intensity = 2920.5 >> xx = -1534.53, xy = 23.

Re: Specifing arguments type for a function

2006-07-04 Thread Magnus Lycka
Paolo Pantaleo wrote: > I have a function > > def f(the_arg): > ... > > and I want to state that the_arg must be only of a certain type > (actually a list). Is there a way to do that? You can state that in your documentation. You're very likely to get a reasonable runtime error from this when y

Re: About classes and OOP in Python

2006-04-12 Thread Magnus Lycka
Michele Simionato wrote: > Roy Smith wrote: > >> That being said, you can indeed have private data in Python. Just prefix >> your variable names with two underscores (i.e. __foo), and they effectively >> become private. Yes, you can bypass this if you really want to, but then >> again, you can b

Re: Py+SQLite or other (big output) ?

2006-04-11 Thread Magnus Lycka
DurumDara wrote: > I want to process many data with python, and want to store in database. ... > So I want to use one database file - but I want to protect it. > How to do it with SQLite ? > I see that solutions: > - 1. I use transactions. > - 2. I create full copy of database after every bigger tr

Re: Looking for a language/framework

2006-04-11 Thread Magnus Lycka
Gregor Horvath wrote: > Scott David Daniels schrieb: > >> Using a relational DBMS is most definitely _not_ premature optimization. >> A relational system provides a way to store data so that it is later > > I did not mean that using a relational DBMS is premature optimization > but not using a OR

Re: How to search HUGE XML with DOM?

2006-04-07 Thread Magnus Lycka
Ivan Vinogradov wrote: > I have not much clue about databases, except that they exist, somewhat > complex, and often use proprietary formats for efficiency. Prorietary storage format, but a standardized API... > So any points on whether RDBM-based setup > would be better would be greatly appreci

Re: does python could support sequence of short or int?

2006-03-30 Thread Magnus Lycka
momobear wrote: > but what about buffer is not be declared in python program, it comes > from a C function. and what about I want to treat a string as a short > list? Python is a high level language with much stronger typing than C. If you want a list of integers, use a list of integers. Strings a

Re: Set Windows Environment Variable

2006-03-30 Thread Magnus Lycka
Duncan Booth wrote: > Fuzzyman wrote: >> In the ``win32api`` package there is a ``GetEnvironmentVariable`` >> function, but no ``SetEnvironmentVariable``. Any options ? > > No, your only option is to find a solution which doesn't involve changing > another process's environment. Surely there mus

Re: does python could support sequence of short or int?

2006-03-30 Thread Magnus Lycka
momobear wrote: > hi, is there a way to let python operate on sequence of int or short? If you want to work with arrays of numbers, you might want to look at NumArray etc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Debugger / IDE ??

2006-03-30 Thread Magnus Lycka
Don Taylor wrote: > Is there a free or low-cost version of Delphi for Windows available > anywhere? Sure. If my memory serves me correctly, I have several CDs from various computer magazines with previous versions of Delphi at home. I don't know if such offers have been around recently, but you

Re: Looking for a language/framework

2006-03-30 Thread Magnus Lycka
Steve Juranich wrote: > [EMAIL PROTECTED] wrote: > >> As far as hosting, I also know >> where Zope/Plone hosting from 7.95 a month - although the host doesn't >> list it on their ads, they do use and host it. > > Which host would this be? I'm currently exploring some options for getting > a Zope

Re: What's the best way to learn perl for a python programmer?

2006-03-28 Thread Magnus Lycka
vj wrote: > I've been given a project which requires writing scripts that need to > be run on over 3000 servers. Only about 15% of them have python > installed on them. While all/most of them will have perl. > > I'll try and do as much as possible in pexpect but am sure I'll have do > some signifi

Re: Suggestion for Web App

2006-03-28 Thread Magnus Lycka
Harlin Seritt wrote: > I want to make a recommendation to a group of internal customers where > I work concerning a Python web framework. They are seeking to build a > portal that can handle around 5000 total users but probably no more > than 100-200 simultaneous users. This is supposed to serve m

Re: New development windows, IronPython or PythonWin

2006-03-28 Thread Magnus Lycka
Dan wrote: > Just starting to do some windows Client / Server programming. Which > would you recommend? I need to create a server to fire events and > communicate with clients over a lan. Thanks There are plenty of Python solutions for this, most of them work with Windows, but aren't locked to it.

Re: multiple assignment

2006-03-24 Thread Magnus Lycka
Anand wrote: > Suppose i have a big list and i want to take tke the first one and rest > of the list like car/cdr in lisp. > is there any easy way to do this in python? It seems like overkill to me to make the syntax more complex just to avoid writing a one-line function. def first_rest(seq): ret

Re: datetime iso8601 string input

2006-03-23 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > Why not > > dt = datetime.datetime(*time.strptime(s, "%Y-%m-%dT%H:%M:%S")[0:6]) > > ? Maybe due to neglection of the 7th commandment? Most of the other commandments can be ignored while coding Python, but the 7th certainly applies here. http://www.lysator.liu.se/c

Re: Python compiler

2006-03-21 Thread Magnus Lycka
Rc wrote: > But ,my question is when I start Python it is a Dos Window > that opened.I think it is not possible on a XP computer? The Windows NT family, including XP, is not based on MS DOS. It still has a text more interface, and it is much better than DOS ever was. You can start that by clicking

Re: Importing an output from another function

2006-03-20 Thread Magnus Lycka
Byte wrote: > Now what do I do if Func1() has multiple outputs and Func2() requires > them all to give its own output, as follows: > > import random > > def Func1(): > choice = ('A', 'B', 'C') > output = random.choice(choice) > output2 = random.choice(choice) > return output >

Re: Is there no end to Python?

2006-03-20 Thread Magnus Lycka
John Salerno wrote: > But isn't Python sort of known for the opposite, i.e. 'one simple way', > or something to that effect? If we compare it with the "opposite" language--Perl, and think of these languages as natural languages, rather than programming languages, Perl's inventor Larry Wall, felt

Re: Need design advice. What's my best approach for storing this data?

2006-03-20 Thread Magnus Lycka
Mudcat wrote: > I am trying to build a tool that analyzes stock data. Therefore I am > going to download and store quite a vast amount of it. Just for a > general number - assuming there are about 7000 listed stocks on the two > major markets plus some extras, 255 tradying days a year for 20 years,

Re: python debugging question

2006-03-16 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > I am a python newbie. I have writen some 500 lines of code. There are 4 > classes and in all 5 files. > > Now, I am trying to run the program. I am getting wrong values for the > simulation results. If you first write 500 lines of code, and *then* try to run it, it seem

Re: list/classmethod problems

2006-03-15 Thread Magnus Lycka
ahart wrote: > I thank you all for your help and suggestions. I wasn't aware that > default values were considered class (static) values. That seems a > little odd to me, but as long as I know that's the case, I'll be fine. It's all very simple and regular: Things in the class scope is shared betw

Re: A better RE?

2006-03-10 Thread Magnus Lycka
Fredrik Lundh wrote: > Magnus Lycka wrote: > r"(\d\d[A-Z]{3}\d\d) (\d\d[A-Z]{3}\d\d) (?=[1234567])(1?2?3?4?5?6?7?)" > Thanks a lot. (I knew about {3} of course, I was in a hurry when I posted since I was close to missing my train...) -- http://mail.python.org/mailman/listinfo/python-list

Re: A better RE?

2006-03-10 Thread Magnus Lycka
Schüle Daniel wrote: > >>> txt = "21MAR06 31APR06 1236" > > >>> m = '(?:JAN|FEB|MAR|APR|MAI|JUN|JUL|AUG|SEP|OCT|NOV|DEZ)' > # non capturing group (:?) > > >>> p = re.compile(r"(\d\d%s\d\d) (\d\d%s\d\d) > (?=[1234567])(1?2?3?4?5?6?7?)" % (m,m)) > > >>> p.match(txt).group(1) > '21MAR06' > >

Re: is there any overheard with try/except statements?

2006-03-10 Thread Magnus Lycka
John Salerno wrote: > One of the things I learned with C# is that it's always better to handle > any errors that might occur within the codes itself (i.e. using if > statements, etc. to catch potential out of range indexing) rather than > use too many try/catch statements, because there is some

Re: is there any overheard with try/except statements?

2006-03-10 Thread Magnus Lycka
John Salerno wrote: > Thanks guys! I had a feeling exceptions were nothing like in C languages > (i.e. a pain to deal with). :) Since when does C have exceptions? (You're not confusing C with C++ or C#?) -- http://mail.python.org/mailman/listinfo/python-list

Re: String functions: what's the difference?

2006-03-09 Thread Magnus Lycka
Harro de Jong wrote: > Thanks for the pointer. I was using time.time(), which I now see isn't > very accurate on Windows. time.clock() is more accurate on Windows (and much less so on Linux, where it also measures something completely different.) -- http://mail.python.org/mailman/listinfo/python

A better RE?

2006-03-09 Thread Magnus Lycka
I want an re that matches strings like "21MAR06 31APR06 1236", where the last part is day numbers (1-7), i.e it can contain the numbers 1-7, in order, only one of each, and at least one digit. I want it as three groups. I was thinking of r"(\d\d[A-Z]\d\d) (\d\d[A-Z]\d\d) (1?2?3?4?5?6?7?)" but tha

Re: Python Evangelism

2006-03-09 Thread Magnus Lycka
rtilley wrote: > Steve Holden wrote: > >> Doug Bromley wrote: >> >>> I can see Ruby overtaking Python if we don't ALL do something about it. > > > I think it's the name. Python. Let's change it to something nicer. Think > about it... if you found a Ruby, you'd pick it up and put it in your > p

Re: New python.org website

2006-03-09 Thread Magnus Lycka
Nicola Musatti wrote: > The obviously perfect logo would be Kaa's face: > http://disney.go.com/vault/archives/villains/kaa/kaa.html The Soviet version is better, and I think most of the Maugli movies are made before 1973, which means that they aren't copyrighted outside the former Soviet Union. (D

Alternative style sheets - Re: New python.org website

2006-03-09 Thread Magnus Lycka
Phoe6 wrote: > beta.python.org evolved very nice and noticed today the new python.org > website going live. There is a change in the look n feel, wherein it > looks "more official" and maximum possible information about python is > now directly accessible from the home page itself. Kudoes to the

Re: ODBC module and strange date reference <...>

2006-03-08 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > I'm all for using for the latest version of Python. I'm just now > learning about Python classes, and it seems like there were some > significant changes at 2.2. I don't remember exactly what appeared when, but nothing you learn with 2.1 will stop working in 2.2 (I think

Re: Learning different languages

2006-03-08 Thread Magnus Lycka
Rich wrote: > Anyway, my question is: what experience you people have with working > with different languages at the same time? I typically use Python, C++ and SQL. When there's been lots of Python and little C++, I tend to forget to terminate C++ statements with semicolon... Otherwise I seem to k

Re: Python advocacy in scientific computation

2006-03-07 Thread Magnus Lycka
Terry Reedy wrote: > I believe it is Guido's current view, perhaps Google's collective view, and > a general *nix view that such increases can just as well come thru parallel > processes. I believe one can run separate Python processes on separate > cores just as well as one can run separate pr

Re: Incorrect Decimal-Float behaviour in comparison tests

2006-03-06 Thread Magnus Lycka
Sergei Organov wrote: > Well, without reading the manuals I'd expect this to raise an exception > instead of yielding of meaningless and confusing result, consider: Without reading the manuals, you can only expect that Python will be "compatible" with the ideas you have of things based on previous

Re: Python advocacy in scientific computation

2006-03-06 Thread Magnus Lycka
Dennis Lee Bieber wrote: > I did look at Ruby once... It looked to me like the worst aspects of > PERL grafted onto the worst parts of old Python. Don't forget that there are portions of Smalltalk syntax (blocks) added in as well. I guess it could be seen as Perl-NG. Both the name 'Ruby' and

Re: re-posting: web.py, incomplete

2006-03-03 Thread Magnus Lycka
Dennis Lee Bieber wrote: > On 3 Mar 2006 04:01:44 -0800, "_wolf" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > >>it does look like it, no? No, it looks the other way around: You have buffered output, and parts of your stdout never gets flushed. -u is not a problem, it's

Re: white space in expressions and argument lists

2006-03-03 Thread Magnus Lycka
Sybren Stuvel wrote: > Scott David Daniels enlightened us with: > >>One reason is such code changes too much on code edits, which makes >>code differences hard to read. > > Good point. I'll keep it in mind :) Think particularly about using version management systems and applying patches coming f

Re: ODBC module and strange date reference <...>

2006-03-03 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > Been using the ODBC module for Python 2.1 It might well become a problem that you are stuck with a five year old Python version. Python 2.1 is no longer a supported Python version. Support for 2.2 will probably end soon. Are you using an old version of ESRI software, o

Re: ODBC module and strange date reference <...>

2006-03-03 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > Incidentally, I have just ordered: > > * Learning Python > * Python Cookbook > * Python Pocket Reference > > Are there any other books y'all would recommend as essential Python > references and/or books for becoming fluent in Python? Both Beazley's "Python Essential Re

Re: Best python module for Oracle, but portable to other RDBMSes

2006-03-03 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > # Print new list > print recordList > > [872L, 'ACTIVE', , >>>00EA1428>, None, '1.0.0.0', None, None, None] Read the Python library manual chapter 2. Read all of it, it's all very useful information, but take a particular look at str() and repr(). All Python object

Re: re-posting: web.py, incomplete

2006-03-03 Thread Magnus Lycka
_wolf wrote: > then the output is :: > > Hello, oops! > Hello, oops! > <20 lines omitted/> > Hello, oops! > Hel Are you running Python unbuffered? I.e. python -u -- http://mail.python.org/mailman/listinfo/python-list

Re: Best python module for Oracle, but portable to other RDBMSes

2006-03-02 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > The other thing I didn't do a good job of explaining is that I want to > have a layer of abstraction between the underlying RDBMS and the > business logic. It's the business logic I want to use Python for, so > that would stay roughly the same between RDBMS changes, if we

Re: Best python module for Oracle, but portable to other RDBMSes

2006-03-02 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > This is from a database I didn't design and can't change. The problem > is that the ODBC module suffixes an "L" to any integer returned that > was defined as data type number(p). For example, an integer stored as: > 56 will be returned as 56L. Numbers that were specifie

  1   2   3   4   5   >