Re: wxPython : getting started

2005-12-05 Thread Magnus Lycka
Peter Milliken wrote: > Personally I "bounced" when I attempted to learn wxPython - I found it much > easier to learn and use Tkinter combined with Pmw. It's my impression that Pmw isn't really maintained. AFAIK, the last release (as well as the last CVS commit) is more than two years old. -- htt

Re: Need help on designing a project

2005-12-07 Thread Magnus Lycka
Mardy wrote: > This works, but my problem is that SQL connections (MySQL or sqlite) don't > get closed when the script execution finishes, and at the next execution > of a CGI they may lock the database (this is especially true with sqlite, > but even mysql on Windows gave me these problems). You

Re: ElementTree - Why not part of the core?

2005-12-08 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > ElementTree on the other hand provides incredibly easy access to XML > elements and works in a more Pythonic way. Why has the API not been > included in the Python core? I'd really like to see that too. Sure, it's fairly trivial to install it, but each different package

Re: ElementTree - Why not part of the core?

2005-12-08 Thread Magnus Lycka
Fredrik Lundh wrote: > but seriously, given how easy it is to build things with distutils, I don't > think your > configuration folks would have much trouble adding support for "anything that > has > a setup file, and is reasonably self-contained" to their build scripts. True. It's one more thin

Re: ElementTree - Why not part of the core?

2005-12-09 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > >> ElementTree on the other hand provides incredibly easy access to XML > >> elements and works in a more Pythonic way. Why has the API not been > >> included in the Python core? > > Magnus> I'd really like to see that too. Sure, it's fairly trivial to >

Re: efficient 'tail' implementation

2005-12-09 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > hi > > I have a file which is very large eg over 200Mb , and i am going to use > python to code a "tail" > command to get the last few lines of the file. What is a good algorithm > for this type of task in python for very big files? > Initially, i thought of reading eve

Re: How to find the type ...

2005-12-09 Thread Magnus Lycka
Lad wrote: > Hello > How can I find out in Python whether the operand is integer or a > character and change from char to int ? I'm not sure what you mean by "character" in a Python context. A string? "i = int(i)" will make sure both 5 and "5" are used as 5, and "five" will be rejected with a Val

Re: UML to Python/Java code generation

2005-06-20 Thread Magnus Lycka
James wrote: > The brain may be fine for generating Python from UML but it is MANY > MANY orders of magnitude harder to generate UML from code with just > your brain than using a tool (usually zero effort and error free) no > matter how good you are at Python. I've really only used Rational Rose,

Re: strxfrm works with unicode string ?

2005-06-21 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > Gruëzi, Gerald ;-) > > Well, ok, but I don't understand why I should first convert a pure > unicode string into a byte string. > The encoding ( here, latin-1) seems an arbitrary choice. Yes. The correct choice would be 'cp1252', not 'latin-1', since that's what your loc

Re: ISO authoritative Python ref

2005-06-21 Thread Magnus Lycka
bill wrote: >>I have to learn Python in a hurry. > > My apologies. I found what I needed. I don't understand it how > I missed it in my first round of searching. I don't know what you found, but I think you would appreciate Martelli's "Python in a Nutshell". For the really, really terse versi

Re: Loop until condition is true

2005-06-21 Thread Magnus Lycka
Remi Villatel wrote: > while True: > some(code) > if final_condition is True: > break > # > # > > What I don't find so "nice" is to have to build an infinite loop only to > break it. This is a common Python idiom. I think you will get used to it. > Is there a better recipe?

Re: OO approach to decision sequence?

2005-06-21 Thread Magnus Lycka
Chinook wrote: > I understand what you are saying. The point I'm messing up my head with > though, is when the entity (tree node in my case or variable record content > deconstructing in the aspect example I noted) is not an instance of a class > already - it is obtained from an external source

Re: Loop until condition is true

2005-06-21 Thread Magnus Lycka
Benji York wrote: > If by "economy" you mean "optimization", then I would suggest that the > difference would be unnoticeable. If there is a measurable performance gain in skipping the runtime test in "while True", then this is a compiler issue, not a language issue. I don't know anything about t

Re: Loop until condition is true

2005-06-21 Thread Magnus Lycka
Konstantin Veretennicov wrote: > On 6/21/05, Magnus Lycka <[EMAIL PROTECTED]> wrote: > >>I don't know anything about the Python compiler internals, >>but it doesn't seem very hard to identify simple literals following >>while and if, and to skip the ru

Re: Loop until condition is true

2005-06-22 Thread Magnus Lycka
Remi Villatel wrote: > Erm... You totally missed the point. I wrote it this way because, first, > it's perfectly valid Python code and, second and most important, it's > also a valid english sentence. Remi, I think you have failed to understand what Fredrik was telling you. I can understand that

Re: Database recommendations for Windows app

2005-06-22 Thread Magnus Lycka
Will McGugan wrote: > Hi, > > I'd like to write a windows app that accesses a locally stored database. > There are a number of tables, the largest of which has 455,905 records. > > Can anyone recommend a database that runs on Windows, is fast / > efficient and can be shipped without restriction

Re: Database recommendations for Windows app

2005-06-22 Thread Magnus Lycka
Thomas Bartkus wrote: > If you are writing strictly for the MS Windows platform >And > If the database is running single user with a "locally stored database" on a > Windows workstation. >Then > The MS Access file based (.mdb) system is hard to argue with. I disagree. What does .mdb/jet wi

Re: Database recommendations for Windows app

2005-06-22 Thread Magnus Lycka
Gregory Piñero wrote: > I always figured a problem with using MySQL was distribution. Would > you have to tell your users to install MySQL and then to leave the > service running? I've never found an easy way to embed MySQL into a > python app, and even if you could, would you then have to pay fo

Re: Database recommendations for Windows app

2005-06-23 Thread Magnus Lycka
Cameron Laird wrote: > OK, I'm with you part of the way. Typical "Access" developers > are *always* involved with DLL hell, right? You're surely not > saying that Python worsens that frustration, are you? I think Dan was commenting on flaws in Microsoft's products, not in Python. As I understan

Re: create a pdf file

2005-06-23 Thread Magnus Lycka
Alberto Vera wrote: > Hello: > > I found a script that convert a file to PDF format , but it was made in PHP > > Do you know any script using Python? What do you mean by "convert a file to PDF format"? The solution obviously depends on what the file you start with looks like. If you want to crea

Re: Database recommendations for Windows app

2005-06-23 Thread Magnus Lycka
Thomas Bartkus wrote: > "Magnus Lycka" <[EMAIL PROTECTED]> wrote in message > > The O.P. wanted a database for his > > Python app, and Thomas Bartkus suggested Access. > > Not exactly! Sorty, I meant Jet or whatever the backend is called these days. >

Re: Database recommendations for Windows app

2005-06-30 Thread Magnus Lycka
Thomas Bartkus wrote: > I was thinking of Win32com which I expect lets you put a wrapper around ADO > and work the ADO (or any other ActiveX) object model from within Python. Sure, but since others have made wrappers around ADO for Python before, you'd either reivent the wheel or or use e.g. http

Re: Boss wants me to program

2005-06-30 Thread Magnus Lycka
I think Python works on fairly antique hardware, whatever OS you use (as long as the OS works ok). You can get a DOS version of Python 2.2 at http://www.caddit.net/ , but I don't have any good suggestions for a UI then. This might work after some tweaking: http://www.effbot.org/zone/console-index.h

Re: Add methods to string objects.

2005-06-30 Thread Magnus Lycka
Negroup wrote: > Hi all. > I'm writing a simple Python module containing functions to process > strings in various ways. Actually it works importing the module that > contains the function I'm interested in, and calling > my_module.my_function('mystring'). > > I was just asking if it is possible t

Re: a pickle's pickle

2005-08-02 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > class TrainingMatrix: > matrix = [] > estimator = {} > wordInfo = {} > contextInfo = {} > totalWordsProcessed = 0 > numWords = 0 > numContexts = 0 > matrixWords = 0 Is there some confusion between the scope of the class object and the sco

Re: time.clock() or time.time()

2005-08-02 Thread Magnus Lycka
Shane Hathaway wrote: > time.time() measures real time, while time.clock() measures the time the > CPU dedicates to your program. I suppose that varies with the platform... "help(time.clock)" says: Help on built-in function clock: clock(...) clock() -> floating point number Return t

Re: time.clock() or time.time()

2005-08-05 Thread Magnus Lycka
Shane Hathaway wrote: > However, isn't this thoroughly un-Pythonic? No wonder people have to > ask. Only if they've never read K&R, and I thought that was compulsory! ;^) There are a few python libraries, such as time and math, that are basically just thin wrappers around standard C libraries.

Re: The ONLY thing that prevents me from using Python

2005-08-05 Thread Magnus Lycka
Martin P. Hellwig wrote: > Kevin wrote: > > > Well, for some strange reason I have never found that to be a problem. If you develop software for an external customer, and they have an existing web site run by some ISP that you have no control over, this might well be a problem. Even if the cust

Re: python for microcontrollers

2005-08-10 Thread Magnus Lycka
Peter Hansen wrote: > (Not trying to argue, just understand, because it looks like you're > conflating Forth programs with Forth implementations, or perhaps I'm > even more ignorant than noted above and am missing a key point. :-) It's decades since I coded Forth, but I suspect that Forth compil

Re: What are modules really for?

2005-08-11 Thread Magnus Lycka
N.Davis wrote: > Functions existing in a module? Surely if "everything is an object" (OK > thats Java-talk but supposedly Python will eventually follow this too) int too? ;) Actaully, I think Python and Java are fairly much on equal footing here, with Java possibly being slightly behind rather

Re: What are modules really for?

2005-08-12 Thread Magnus Lycka
bruno modulix wrote: > Magnus Lycka wrote: > >>N.Davis wrote: >> >> >>>Functions existing in a module? Surely if "everything is an object" >>>(OK thats Java-talk but supposedly Python will eventually follow this >>>too) >> >

Re: What are modules really for?

2005-08-12 Thread Magnus Lycka
Terry Reedy wrote: > However, everything is an instance of a class or type. Except whitespace, comments, operators and statements! (Did I miss anything?) You can obviously argue whether a "variable" (or name if you like) is an object, or just refers to an object, but then we're getting philosophi

Re: What is Python?!

2005-08-12 Thread Magnus Lycka
Evil Bastard wrote: > I guess a language could be called a 'scripting language' if: > - the source code can be executed directly, and/or > - source need not be converted to a separate file in a >non-human-readable format before it can be executed, and/or > - a change to the source file aut

Re: len(sys.argv) in (3,4)

2005-08-12 Thread Magnus Lycka
Daniel Schüle wrote: > I just tried the same code at home and it worked fine > it has to do with windows .. some settings or whatever > (python 2.4.1 installed on both) > > maybe someone have experienced the same problem > and had more luck in solving the puzzle First of all: "Windows" is a whole

Re: Library vs Framework (was Dr. Dobb's Python-URL!)

2005-08-15 Thread Magnus Lycka
Simon Brunning wrote: > On 8/15/05, Rocco Moretti <[EMAIL PROTECTED]> wrote: > >>Which lead me to the question - what's the difference between a library >>and a framework? > > > If you call its code, it's a library. If it calls yours, it's a framework. Erh, it's not quite that simple. I don't k

Re: SOAP and XMLRPC

2005-08-15 Thread Magnus Lycka
dcrespo wrote: > Hi to all... > Someone knows if is there possible to have a Python SOAP or XMLRPC > server that works with VB? I would like you to include the examples > clients and server programs. If you can write an XML-RPC client in VB, it will work with XML-RPC servers written in any languag

Re: SOAP and XMLRPC

2005-08-16 Thread Magnus Lycka
phil hunt wrote: > I thought it was the whole point of XMLRPC that the server can be > written in one language and the client in another. Yes. > Am I wrong? No. That's what I said. The OP wanted to write a VB client, and I don't think this is the forum for questions about that. I can understand

Re: Wheel-reinvention with Python

2005-08-16 Thread Magnus Lycka
David E. Konerding DSD staff wrote: > Actually, the real problem with the wxWidgets documentation is that it > doesn't tell you > *how* to do things. It does only a barely adequate job as an API reference, > but what it lacks is > an extensive howto. I waste too much of my time dinking around d

Re: How to obtain GMT offset?

2005-08-16 Thread Magnus Lycka
new pip wrote: > I'm using Windows os. If the current system date time is '28 Jun 2001 > 14:17:15 +0700', how can I obtain the value '+0700' using python? > > Thank you If you ignore the time and datetime modules, you can always split the string on whitespace and grab the last part: >>> ts='28

Re: Library vs Framework (was Dr. Dobb's Python-URL!)

2005-08-16 Thread Magnus Lycka
Terry Hancock wrote: > Zope recently started going through some massive changes to make > it more like a toolkit (which is the term I use instead of library here). > Even if there must be a framework, a thin framework with good tools > tends to be better than a complex framework, even if they can,

Re: Making programs work together.

2005-08-17 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > I'm looking to make what's basically a macro for a computer game. But > I want this "macro" to take information from the game itself, so it's > not really a macro. That's exactly a macro as the term is used in e.g. MS Office macros written in VBA etc. Do you have access

Re: random seed

2005-08-17 Thread Magnus Lycka
Robert Kern wrote: > random.seed(1234567890) > > is traditional and works just fine. > > Other favorites: > > 3141592653589793 > 2718281828459045 Nothing beats 42! (That was just an exclamation mark in the end, no factorial intended.) 371 is another nice number, since it's its own revers

Re: up to date books?

2005-08-18 Thread Magnus Lycka
John Salerno wrote: > hi all. are there any recommendations for an intro book to python that > is up-to-date for the latest version? It depends on what kind of books you like, and of course on your previous experience. I think "Python: Visual QuickStart Guide" by Chris Fehily is a rather nice be

Re: up to date books?

2005-08-19 Thread Magnus Lycka
John Salerno wrote: > These all seem to be focused on Java though. I think C# is close enough to Java when it comes to the issues discussed here, that you can read the texts and more or less think C# when you read Java... > gene tani wrote: > >> Start here: >> >> http://naeblis.cx/rtomayko/2004/1

Re: up to date books?

2005-08-19 Thread Magnus Lycka
John Salerno wrote: > Just one more quick question: I'm basically learning programming for > fun, and I'm concentrating on C# right now. Python seems interesting, > but I was wondering if I should even bother. Would it supplement C# in > any way, or can C# do everything Python can? Python is an

Re: determine variable type

2005-08-19 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > trying to determine a variable type, specifically that a variable is an > integer. > > i tried using type(var) but that only seemed to produce a response in the > command line. You mean that if you do "type(var)" at the Python prompt, it gives you a reply, but if you

Re: Some questions

2005-08-19 Thread Magnus Lycka
Thomas Ganss wrote: > My blind guess would have been that Tkinter was *not* the GUI of choice > for *J*ython. With Jython you'd probably use Swing or SWT. It's certainly less coding to get something working in Jython/Swing than with Java/Swing, but I suspect that there is a cost in runtime perfor

Re: can I delete one of *.py *.pyc *.pyo in /usr/lib/python2.3 ?

2005-08-22 Thread Magnus Lycka
Miernik wrote: > I noticed that all those files come in three "flavours": > *.py *.pyc *.pyo > > Is it possible that only one "flavour" of these files is needed, and I can > delete the remaining two, any my Python installation will still work? If you remove all *.pyc and *.pyo, they will be regen

Re: Sandboxes

2005-08-22 Thread Magnus Lycka
42 wrote: > Fair enough. I'm more or less ready to 'give up' on this fantasy of > python in a sandbox. I'll either use something else, or just accept the > risk. :) But is the scripting language interpreter the right place to put this? After all, any most languages would allow you to write somet

Re: Reg Python Byte code

2005-08-22 Thread Magnus Lycka
praba kar wrote: > Python 2.3 creates byte code with *.pyc > extention. But Python 2.4 creates bytes code with > *.pyo. Is there any difference between *.pyc > and *.pyo?. Since way back, ordinary Python bytecode uses .pyc, and optimized Python bytecode (python -O) uses .pyc. This has noth

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > Hi, I'm working on a project were a need to be able to upload firmware > to a microcontroller based Ethernet device. But because of the memory > constraints the controller can only handle packages of 300 bytes each > time. So therefore the firmware file must be sent in ch

Re: sending binary files to a 16 micro controller.

2005-08-22 Thread Magnus Lycka
Magnus Lycka wrote: > header_template = 'Chunk %05i, %03i bytes' BTW, if the header is binary, you probably want to have a look at the struct module. http://docs.python.org/lib/module-struct.html -- http://mail.python.org/mailman/listinfo/python-list

Re: while c = f.read(1)

2005-08-22 Thread Magnus Lycka
Antoon Pardon wrote: >>Python doesn't guess. There are a range of values that will be treated, >>in a Boolean context (how perlish) as equivalent to False. > > Yes it does. No it doesn't! > Python has no way to know what would be the most > usefull Boolean interpretation of these values in a p

Re: while c = f.read(1)

2005-08-23 Thread Magnus Lycka
Antoon Pardon wrote: > Following a well defined specification is not contradictory > to guessing. It may just mean that the guess was formalized > into the specification. If you want the behaviour of Python to change, you should write a PEP. It always felt natural to me to interpret empty as false

Re: Eve from Adams' Ribs

2005-08-23 Thread Magnus Lycka
Godwin wrote: > I think its possible with python as it is called a dynamic > language. Certainly, but what's really the point with these classes? If they are completely generated from tables, they won't have different behaviour anyway, just a different chunk of attributes to fetch, save and update

Re: while c = f.read(1)

2005-08-23 Thread Magnus Lycka
Antoon Pardon wrote: > Such a PEP would have no chance of being accepted, since > it would break to much existing code. What's the point of this thread then? > But how can you do this when somewhere else '' is used as > an indication for an EOF. If that's your problem, I guess that's what you sh

Re: The ONLY thing that prevents me from using Python

2005-08-24 Thread Magnus Lycka
Andreas Kostyrka wrote: > I cannot comment on linode as I'm not a customer. The info on the website > seems ok. But the prices are somehow laughable: I'm currently paying > EUR39 for a dedicated host (with at least 200GB traffic, I'd had to look it > up > 60GB "storage", 256MB RAM and a 2.4GHz P4

Re: while c = f.read(1)

2005-08-24 Thread Magnus Lycka
Antoon Pardon wrote: > I think he did, because both expression are not equivallent > unless some implicite constraints make them so. Values where > both expressions differ are: > > start1=67, stop1=9, start2=10, stop2=29 Ouch! That didn't occur to me. How sloppy to just assume that time periods

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-29 Thread Magnus Lycka
Robert Kern wrote: > If I may digress for a bit, my advisor is currently working on a project > that is processing seafloor depth datasets starting from a few decades > ago. A lot of this data was orginally to be processed using FORTRAN > software, so in the idiom of much FORTRAN software from thos

Problem with select.poll and popen2

2005-08-30 Thread Magnus Lycka
I'm trying to read standard out in a process started with popen2 in a non-blocking way. (Other good ways of doing this than the one I tried are appreciated.) I've tried to dumb down my code to see what happens, and socket.poll seems to behave very strangely. I've tried to use the .poll method for

Re: micro-python - is it possible?

2005-08-30 Thread Magnus Lycka
Evil Bastard wrote: > Hi, > > Has anyone done any serious work on producing a subset of python's > language definition that would suit it to a tiny microcontroller > environment? Isn't pypy meant to support different backends with different requirements and constraints using the same basic langua

Re: Problem with select.poll and popen2

2005-08-30 Thread Magnus Lycka
Magnus Lycka wrote: > I'm trying to read standard out in a process started with popen2 > in a non-blocking way. (Other good ways of doing this than the > one I tried are appreciated.) I'm starting to get on top of this. First of all, I was confused by POLLIN and POLLOUT, sinc

Re: Automatic language translation

2005-09-02 Thread Magnus Lycka
Jon wrote: > Does python have a module that will translate between different spoken > languages? My python program displays all of its messages in English > currently and my boss wants it to default to Korean now. > > Any ideas how to go about doing this? "import gettext" is a start... See http:

Re: Well, Python is hard to learn...

2005-09-02 Thread Magnus Lycka
wen wrote: > due to the work reason, i have to learn python since last month. i have > spent 1 week on learning python tutorial and felt good. but i still don't > understand most part of sourcecode of PYMOL(http://pymol.sourceforge.net/) > as before. Maybe you (or someone else) is making a mistake

Re: Possible improvement to slice opperations.

2005-09-05 Thread Magnus Lycka
Ron Adam wrote: > Slicing is one of the best features of Python in my opinion, but > when you try to use negative index's and or negative step increments > it can be tricky and lead to unexpected results. Hm... Just as with positive indexes, you just need to understand the concept properly. > Thi

Re: round function problem

2005-09-06 Thread Magnus Lycka
mg wrote: > The problem is simple. The function 'round' allow to obtain the value > with the specified number of digits after the ",". Then, when the > variable 'freq' is printed, there is no problem; but when freq is set in > the table and the table printed, all the digits are come back. > > I

Re: Possible improvement to slice opperations.

2005-09-06 Thread Magnus Lycka
Ron Adam wrote: > Ok, lets see... This shows the problem with using the gap indexing model. > > L = range(10) > > [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ] # elements > 0 1 2 3 4 5 6 7 8 9 10 # index's > > L[3::1] -> [3, 4, 5, 6, 7, 8, 9] 3rd index to end... ok > L[3

Re: How to protect Python source from modification

2005-09-13 Thread Magnus Lycka
Frank Millman wrote: > Hi all > > I am writing a multi-user accounting/business system. Good! > The client program contains all the authentication and business logic. Not good. You lose...if it's *only* in the client. Of course, there is no such thing as a safe system, and you need a pragmatic

Re: Launching Python programs from Linux shell script

2005-09-13 Thread Magnus Lycka
Ernesto wrote: > Thanks! How do you add Python in Linux to the path? This works out of the box in most modern Linux distributions. If you're open to suggestions, I'd suggest that you have a look at Ubuntu. It's a user friendly Linux distribution with rather close ties to the Python community.

Re: Why do Pythoneers reinvent the wheel?

2005-09-14 Thread Magnus Lycka
Claudio Grondi wrote: > To name a simplest example: > What should I do to find a piece of code taking an > integer and giving a string with binary form of a > number? How to put some available pieces of code > together if the binary form is needed and the integer > is provided as a string holding i

Re: How to protect Python source from modification

2005-09-14 Thread Magnus Lycka
Frank Millman wrote: > I have seen Twisted mentioned many times in this ng, but I have no idea > what it actually does. Can someone tell me in simple terms what > advantage it might give me over a multi-threaded socket server program. More control. Less resource usage. Twisted also provides a very

Re: PyGTK or wXPython?

2005-09-14 Thread Magnus Lycka
Rod W wrote: > I'm just starting out on Python but my primary goal is to provide > applications with some user interface (GUI). > > Can someone point me to a good comparison of whether I should use > wxPython (with wxGlade I assume) or PyGTK (with Glade I assume)? What OS(es) do yo need to supp

Re: round() wrong in Python 2.4?

2005-09-14 Thread Magnus Lycka
Nils Grimsmo wrote: > (Is this due to the different GCC used?) Yes, but there are probably other nasty values with the other CGG. Basically, what the code does, for a positive number, is to calculate floor(0.0225*1000.0+0.5)/1000.0. As others have said: Don't trust this. If you use Python 2.4, yo

Re: What XML lib to use?

2005-09-14 Thread Magnus Lycka
Fredrik Lundh wrote: > since there are no *sane* reasons to use SAX or DOM in Python, that's mainly > a job security issue... I can see two reasons (sane or not): - You're familiar with those APIs and use them in e.g. C++. - You don't want to rely on third party libraries unless you must. In

Re: MySQLdb UPDATE does nothing

2005-09-16 Thread Magnus Lycka
Steve Horsley wrote: > Or, as I found out yesterday, cursor.execute('commit') afterwards. The correct way to do it is to close the cursor object, and then do "db.commit()". Don't rely on a cursor object to work across transaction boundries! See e.g. www.thinkware.se/epc2004db/epc04_mly_db.pdf and

Re: Free seminar on domain-specific modeling

2005-09-21 Thread Magnus Lycka
Martijn Iseger wrote: > Before slashing down in ignorance - educate yourself on > www.dsmforum.org. After that: feel free to comment. I will make you look > a lot more intelligent Peter Hansen. Talk about throwing stones in glass houses! -- http://mail.python.org/mailman/listinfo/python-list

Re: OO in Python? ^^

2005-12-13 Thread Magnus Lycka
Welcome to Python Matthias. I hope you will enjoy it! Matthias Kaeppler wrote: > Another thing which is really bugging me about this whole dynamically > typing thing is that it seems very error prone to me: > > foo = "some string!" > > # ... > > if (something_fubar): >fo = "another string"

Re: I want a Python Puppy !

2005-12-13 Thread Magnus Lycka
Claudio Grondi wrote: > I have just discovered the existance of Puppy Linux which is a complete > operating system with a suite of GUI apps, only about 50 - 60M booting > directly off the CDROM ( http://www.puppylinux.org ). > > This approach appears to me very Pythonic, so it were a nice thin

Re: sql using characters like é and ã

2005-12-13 Thread Magnus Lycka
Diez B. Roggisch wrote: > "Select * from table where name like '%s%%'" % > "José".decode("latin-1").encode("utf-8") Ouch! Please use parameter passing instead of building full SQL statements with embedded parameter values. You're opening up for SQL injection attacks if you allow user provided inpu

Re: OO in Python? ^^

2005-12-14 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > Magnus Lycka wrote: > >>The static typing means that you either have to make several >>implementations of many algorithms, or you need to work with >>those convoluted templates that were added to the language as >>an afterthought. > &

Re: OO in Python? ^^

2005-12-14 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > Magnus Lycka wrote: > >>I don't really know Haskell, so I can't really compare it >>to Python. A smarter compiler can certainly infer types from >>the code and assemble several implementations of an >>algorithm, but unless I

Re: const objects (was Re: Death to tuples!)

2005-12-14 Thread Magnus Lycka
Gabriel Zachmann wrote: > > I was wondering why python doesn't contain a way to make things "const"? > > If it were possible to "declare" variables at the time they are bound to > objects that they should not allow modification of the object, then we > would have a concept _orthogonal_ to data

Re: OO in Python? ^^

2005-12-14 Thread Magnus Lycka
Christopher Subich wrote: > Doesn't work; duck typing is emphatically not subclass-typing. For this > system to still work and be as general as Python is now (without having > to make all variables 'object's), we'd need true interface checking. > That is, we'd have to be able to say: > > imple

Re: Newbie: executing a system command from my Python app

2005-12-14 Thread Magnus Lycka
Dan M wrote: > Have done so. Thanks for pointing out the shutils module! I keep finding > more and more excellent modules available. Do we have a Python equivalent > to Perl's CPAN? See http://www.python.org/pypi -- http://mail.python.org/mailman/listinfo/python-list

Re: I want a Python Puppy !

2005-12-14 Thread Magnus Lycka
Paul Rubin wrote: > Are you seriously saying that whatever distro came out most recently > (and therefore have the latest Python version) gets to be your > favorite? You're going to have to change favorites practically every > week. Python is very high on the agenda for the Ubuntu project, and *t

Re: I want a Python Puppy !

2005-12-14 Thread Magnus Lycka
Claudio Grondi wrote: > I have some trouble to understand how Python works > on it because it is not organized as on Windows (e.g. there is no [Lib] > directory under the [Python2.4] one) I guess it's at /usr/lib/python2.4 It's Windows which is odd by the way... Linux is organized in a way whic

Re: Still Loving Python

2005-12-14 Thread Magnus Lycka
Peter Maas wrote: > If you design a moderately complex UI a designer will be faster. It's > not the speed of typing vs. dragging that matters. You see the result > instantly and don't have to start your program, look, type code, start > again and so on. A GUI builder is more pleasant to work with,

Re: Visual Python, really "Visual"?

2005-12-14 Thread Magnus Lycka
Tolga wrote: > After a very rapid entrance into the Python, I have immediately looked > for a good IDE. Komodo and Wing IDE look very good and I think they are > enough. But now, I am searching for a Pyhton environment which should > look like Delphi / Kylix, Borland's C++ builder or Allegro Common

Dr. Dobb's Python-URL! - weekly Python news and links (Jan 18)

2006-01-17 Thread Magnus Lycka
QOTW: "*what* the value is is defined by the operations that the object supports (via its type). *how* the value is represented inside the object is completely irrelevant; a Python implementation may use electric charges in small capacitors, piles of rocks, diapers,or an endless supply of small

Re: Newcomer question wrt variable scope/namespaces

2006-01-18 Thread Magnus Lycka
Florian Daniel Otel wrote: > Do I understand it correctly > that actually the rule has to be refined as pertaining to the (so > called) "immutable" types (like e.g. integers, tuples/strings) > whereas lists and dictionaries are "mutable" types and the said > scoping rule does not apply ? No! The

Dr. Dobb's Python-URL! - weekly Python news and links (Jan 18)

2006-01-18 Thread Magnus Lycka
QOTW: "*what* the value is is defined by the operations that the object supports (via its type). *how* the value is represented inside the object is completely irrelevant; a Python implementation may use electric charges in small capacitors, piles of rocks, diapers,or an endless supply of small

Re: New Python.org website?

2006-01-19 Thread Magnus Lycka
Steve Holden wrote: > The trepidation was accounted for solely by a concern that Python would > become involved in any kind of religious controversy, or that someone of > extreme views might claim that Python was associated with, or against, a > particular religious belief. I'm sure there are a

Re: PyCon Vs. Europython

2006-01-19 Thread Magnus Lycka
Simon Burton wrote: > My employer has given me the choice to go to either Pycon or Europython > this year, > and I need some help deciding which would be more useful (for me, my > company, and python itself). > > I am mainly interested in scientific/engineering applications of > python; As far as

Re: Multiple modules with database access + general app design?

2006-01-19 Thread Magnus Lycka
Robin Haswell wrote: > Can anyone give me advice on making this all a bit more transparent? I > guess I really would like a method to bring all these files in to the same > scope to make everything seem to be all one application, even though > everything is broken up in to different files. This is

Re: Decimal vs float

2006-01-19 Thread Magnus Lycka
Fredrik Lundh wrote: str(1.1) > > '1.1' > repr(1.1) > > '1.1001' To add to the confusion: >>> str(1.1001) '1.1' >>> repr(1.1001) '1.1001' Floating point numbers are not precise. Decimals are, so they require precise information when th

Re: New Python.org website ?

2006-01-19 Thread Magnus Lycka
Roel Schroeven wrote: > - The header is too empty. Maybe "The Official Python Programming > Language Website" should be there instead of under it. (I also think > that title should be shorter, maybe something simply like "The Python > Programming Language" I also think that grey header area is

Re: Can a simple a==b 'hang' in and endless loop?

2006-01-20 Thread Magnus Lycka
Claudio Grondi wrote: > You seem here to try to give a definition of the term 'value' for > Python. If I understand it right, the definition of the term can't be > generally given for many reasons. It depends at least on type and in > advanced usage it can be arbitrary defined or changed. > That

Re: Being unjust

2006-01-20 Thread Magnus Lycka
Fredrik Lundh wrote: > if you can find one that's relatively stable, simple enough to enable > beginners to > do simple things with just a little python code, can do simple stuff without > needing > a full-blown DB, and can run as an ordinary CGI if necessary, I'm definitely > +1. > > (hmm. ma

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: 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

<    1   2   3   4   5   >