circular import Module

2005-06-08 Thread [EMAIL PROTECTED]
Hello, I have two modules (file1.py and file2.py) Is that ok in python (without any weird implication) if my module import each other. I mean in module file1.py there exist command import file2 and in module file2.py there exist command import file1? This is not working in C#. pujo -- http://m

\r\n or \n notepad editor end line ???

2005-06-08 Thread [EMAIL PROTECTED]
Hello, I use windows notepad editor to write text. For example I write (in d:\myfile.txt): Helo World If I open it with python: FName = open(d:\myfile.txt,'r') h = FName.readlines() print h I get h : ['Helo\n', 'World'] I thought notepad use \r\n to to end the line. What's wrong with it

Re: \r\n or \n notepad editor end line ???

2005-06-08 Thread [EMAIL PROTECTED]
Hello thanks everyone, It means in windows we should use 'wb' to write and 'rb' to read ? Am I right? pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: different time tuple format

2005-06-08 Thread [EMAIL PROTECTED]
The names are at least platform specific, see below the names of the timezones on my Windows NT 4 box *** Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32 *** Type "help", "copyright", "credits" or "license" for more information. *** >>> import time *** >>> print time

running distutils installer without admin on windows

2005-06-08 Thread [EMAIL PROTECTED]
Hello all. We don't have admin privs on our Windows boxes, but I'd like to be able to install a package built using distutils. I was able to install Python without admin, but when I tried to run the installer for this package I'm trying to install, I get a message saying that I need admin privs.

Re: \r\n or \n notepad editor end line ???

2005-06-08 Thread [EMAIL PROTECTED]
Hello All, Thanks for the response. I use mysql and find something strange lately while load text file to my database table using LINES TERMINATED BY '\r\n', And I found that mysql think I have '\r\r\n'. this is happened because in one of my code I use 'w' to write element of string + '\r\n'. no

Re: running distutils installer without admin on windows

2005-06-08 Thread [EMAIL PROTECTED]
I didn't build the installer, someone else did. I did get the source and installed cygwin to see if I could recreate it; at least build the library, but when I tried to do a build_ext I got a message saying I needed to have the .NET SDK installed. -- http://mail.python.org/mailman/listinfo/python

array problems.. OverflowError

2005-06-08 Thread [EMAIL PROTECTED]
How do i fill 1 byte and 4 bytes in a single array? This array contains packet information. Python code... from array import * size = 526 pData = array("B", '\0'* 526) # Destination MAC address destAddress = for i in range(0, len(destAddress), 2): pData[i/2] = int(destAddress[i:

Re: different time tuple format

2005-06-08 Thread [EMAIL PROTECTED]
It is probably the best to calculate back to UTC. Assume "2005-06-07 15:07:12" the local time, then convert it as follows to UTC. Use the UTC time to store/manipulate/whatever you want to do. import time t = time.mktime(time.strptime("2005-06-07 15:07:12", "%Y-%m-%d %H:%M:%S")) print time.ctime

splitting strings with python

2005-06-09 Thread [EMAIL PROTECTED]
im trying to split a string with this form (the string is from a japanese dictionary file with mulitple definitions in english for each japanese word) str1 [str2] / (def1, ...) (1) def2 / def3 / (2) def4/ def5 ... / the varibles i need are str*, def*. sometimes the (1) and (2) are not inc

Re: running distutils installer without admin on windows

2005-06-09 Thread [EMAIL PROTECTED]
I found out how to build it with Cygwin python setup.py build --compiler=mingw32 bdist I can then unzip the zip file it creates and put it in site-packages. It looks like I can install a bdist_wininst installer with Python 2.4, but not 2.3.5 (without admin). -- http://mail.python.org/mailman/

Re: splitting strings with python

2005-06-09 Thread [EMAIL PROTECTED]
one problem is that str1 is unicode (japanese kanji), and str2 is japanese kana can i still use re.findall(~)? thanks for your help! -- http://mail.python.org/mailman/listinfo/python-list

Re: splitting strings with python

2005-06-09 Thread [EMAIL PROTECTED]
sorry, i should be more specific about the encoding it's euc-jp i googled alittle, and you can still use re.findall with the japanese kana, but i didnt find anything about kanji. -- http://mail.python.org/mailman/listinfo/python-list

ANN: Python for Maemo released!

2005-06-09 Thread [EMAIL PROTECTED]
We are proudly to announce the first release of Python for Maemo platform. This is in *alpha* stage yet. Bug fixes, wishes, suggestions, etc, are encouraged and welcomed. Please, contact us by mail (ok, bugzilla coming soon). * Ruda Moura <[EMAIL PROTECTED]> * Osvaldo Santana <[EMAIL

Re: EOFError not getting raised

2005-06-10 Thread [EMAIL PROTECTED]
See http://docs.python.org/lib/module-exceptions.html: EOFError gets raised when input() or raw_input() hit an EOF condition without reading data. -- http://mail.python.org/mailman/listinfo/python-list

Mod_python psp import module problem

2005-06-10 Thread [EMAIL PROTECTED]
Hi folks... I'm getting a weird problem while loading psp module from mod_python. It only happen somethimes, and I just can't figure out why. I saw other threads in other lists over the net, but none of them solved the problem. My last hope is this last thread before been forced to change my proje

Re: How to test if an object IS another object?

2005-06-12 Thread [EMAIL PROTECTED]
You can use the id() function to test equality of objects: [EMAIL PROTECTED]:~$ python Python 2.4.1 (#2, Mar 30 2005, 21:51:10) [GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>

Tk() doesn't bring up a window in Python2.4

2005-06-13 Thread [EMAIL PROTECTED]
Hello. I recently installed Python2.4 on both Linux (Redhat FC3) and Windows XP. The build and installed went fine as far as I could tell. I Windows, when I bring up IDLE, or pythonwin, I can't bring up a new Frame widget with Tk(). If I use idle from a DOS window, everything's fine. Python progr

Re: recursive import list

2005-06-13 Thread [EMAIL PROTECTED]
If you use your own import function, like below, you could create a list of all imported modules. #!/usr/bin/env python mod_list = [] def my_import(name, globals = None, locals = None, fromlist = None): mod_list.append(name) mod = __import__(name, globals, locals, fromlist) return mo

gobal var inside class without notice???

2005-06-14 Thread [EMAIL PROTECTED]
I have code like this: class A: def __init__(self,j): self.j = j def something(self): print self.j print i # PROBLEM is here there is no var i in class A but it works ??? if __name__ == '__main__': i = 10 a = A(5) a.something() I don't define global i but it will take

Re: gobal var inside class without notice???

2005-06-14 Thread [EMAIL PROTECTED]
Thanks a lot. pujo -- http://mail.python.org/mailman/listinfo/python-list

Hopefully simple regular expression question

2005-06-14 Thread [EMAIL PROTECTED]
I want to match a word against a string such that 'peter' is found in "peter bengtsson" or " hey peter," or but in "thepeter bengtsson" or "hey peterbe," because the word has to stand on its own. The following code works for a single word: def createStandaloneWordRegex(word): """ return a regu

Re: Resume after exception

2005-06-14 Thread [EMAIL PROTECTED]
Why does the first function return True? Shouldn't it return the file content? That's at least what the function name implies. You call the second function open_command() which returns a boolean. Feels wrong. Where you have written "How?" I suggest that you replace that by: return open_file("foo.b

Re: Resume after exception

2005-06-14 Thread [EMAIL PROTECTED]
Richard Lewis schreef: > Is it possible to have an 'except' case which passes control back to the > point after the exception occurred? No, not in Python. The concept has however been discussed, under the name "resumable exceptions". http://www.google.com/search?num=100&q=%22resumable+exceptions%

Re: Hopefully simple regular expression question

2005-06-14 Thread [EMAIL PROTECTED]
Thank you! I had totally forgot about that. It works. -- http://mail.python.org/mailman/listinfo/python-list

CodeWarrior Automation with Python?

2005-06-14 Thread [EMAIL PROTECTED]
When looking for a pythonic way to convert some Mac codewarrior projects, I came across some files hidden deap into the Python.Framework under: plat-mac/lib-scriptpackages/CodeWarrior What is this stuff? Would any of this be helpful in my search for an automated conversions of the exported xml

PIGIP (Python Interest Group In Princeton) Meeting Tonight

2005-06-15 Thread [EMAIL PROTECTED]
the forums or email Jon Fox (mailto:[EMAIL PROTECTED]) About PIGIP PIGIP is a forum for open discussion about the Python computer language and source of exchange for people at different levels of learning about Python. Meetings are monthly (generally on the third Wednesda

Re: How should threads be terminated? (related to 'Help with thread related tracebacks')

2005-06-16 Thread [EMAIL PROTECTED]
see http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65448 for a useful recipe on how to do threading -- http://mail.python.org/mailman/listinfo/python-list

Re: dir() with string as argument

2005-06-16 Thread [EMAIL PROTECTED]
What about [EMAIL PROTECTED]:~ $ python Python 2.4.1 (#2, Mar 30 2005, 21:51:10) [GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2 Type "help", "copyright", "credits" or "license" for more information. py > x = __import__('sys') py > dir(x) [&

wx GUI with other classes

2005-06-16 Thread [EMAIL PROTECTED]
hey, My situation is like this- whenever I create an application with a gui I put the gui source in one file that calls all the other classes (from imported modules). This creates a problem when needing to print something out on a gui control or something similar. It is then needed to send the call

pyrex problem

2005-06-17 Thread [EMAIL PROTECTED]
hi everyone i'm newbie i try to compile the pyrex module: def controlla(char *test): cdef int limitem,lunghezz,li,l2,f,ii,kk cdef char *t1 cdef char *t2 limitem=4 lunghezz=len(test) l1=lunghezz-limitem+1 l2=lunghezz-limitem+1 f=0 for ii from 0 <= ii < l1-1:

ANN: IssueTrackerProduct 0.6.9 with AJAX and Reports

2005-06-17 Thread [EMAIL PROTECTED]
(I don't know if this is the right place to make an announcement but I've seen other projects doing it so I thought why not?) I've now released version 0.6.9 of the IssueTrackerProduct http://www.issuetrackerproduct.com/News/0.6.9 It's a issue/bug tracker built on top of Zope (Python) that is kno

Re: ANN: IssueTrackerProduct 0.6.9 with AJAX and Reports

2005-06-17 Thread [EMAIL PROTECTED]
Oops! John points out that comp.lang.python.announce is where these things belong. Sorry guys. My fault. -- http://mail.python.org/mailman/listinfo/python-list

Migrating from Windows to OS X

2005-06-18 Thread [EMAIL PROTECTED]
Hello, fellow programmers! I am sitting in front of a nice new PowerBook portable which has OS 10.4 installed. The Python.org web site says that Apple has shipped OS 10.4 with Python 2.3.5 installed. How exactly do I access this? I have searched through the Applications and Libraries folders.

Re: MixIn method to call the method it overrides: how?

2005-06-18 Thread [EMAIL PROTECTED]
Something like this will do what you want to achieve. I think the above does as well what you want, but to me my solution is much more clear class Base(object): def foo(self): print 'Base foo' class Derived(Base): def foo(self): super(Derived, self)

Re: Migrating from Windows to OS X

2005-06-18 Thread [EMAIL PROTECTED]
Kalle Anke wrote: > On Sat, 18 Jun 2005 09:26:23 +0200, [EMAIL PROTECTED] wrote > (in article <[EMAIL PROTECTED]>): > > > I am sitting in front of a nice new PowerBook portable which has OS > > 10.4 installed. The Python.org web site says that Apple has shipped OS

pack() and the division of vertical space

2007-05-31 Thread [EMAIL PROTECTED]
I am trying to figure out how to stack two widgets in a frame vertically so that they both expand horizontally and during vertical expansion, the top one sticks to the top of the frame and the bottom one consumes the remaining vertical space. I thought this would do it but it doesn't. What am I m

Python in University

2007-06-01 Thread [EMAIL PROTECTED]
Hi all, My name is Tennessee Leeuwenburg. I am the Editor-In-Chief of The Python Papers (archive.pythonpapers.org). We're currently looking for contributions to our next issue. We'd love to hear from anyone who is interested in being involved. I'm also trying to track down anyone who may be usin

Re: pack() and the division of vertical space

2007-06-01 Thread [EMAIL PROTECTED]
On Jun 1, 3:13 am, "Eric Brunel" <[EMAIL PROTECTED]> wrote: > On Thu, 31 May 2007 19:45:04 +0200, [EMAIL PROTECTED] > > <[EMAIL PROTECTED]> wrote: > > I am trying to figure out how to stack two widgets in a frame > > vertically so that they b

Updated Jython Bibliography

2007-06-01 Thread [EMAIL PROTECTED]
To celebrate jython's recent progress I've updated my Jython Bibliography to include new resources I've tripped over in the last little while. Its available here: http://www.fishandcross.com/blog/?p=194 Please let me know if I've missed anything. -- http://mail.python.org/mailman/listinfo/pytho

YOUR PERSONAL ATM

2007-06-01 Thread [EMAIL PROTECTED]
click the moneyhttp://www.ondemandprofits.com/?cb=sagabec also visit http://www.dollaroffers.com/[EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: c[:]()

2007-06-03 Thread [EMAIL PROTECTED]
On 30, 22:48, "Warren Stringer" <[EMAIL PROTECTED]> wrote: > I want to call every object in a tupple, like so: > > #-- > def a: print 'a' > def b: print 'b' > c = (a,b) > > >>>c[:]()

Re: c[:]()

2007-06-03 Thread [EMAIL PROTECTED]
On 3, 18:44, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, > > >bla-bla-bla > > it is easy to read and understandable. > > And has the same issue as a list comprehension if all you want is the side > effect of the

Re: getting rid of leading zeros in float expotential

2007-06-03 Thread [EMAIL PROTECTED]
On 3, 11:47, [EMAIL PROTECTED] wrote: > Hi! I'm wondering whether there's an easy way to remove unnecessary > leading zeros from my floating point number. > > realS = float(-1.25e-5) > imgS = float(-7.6e4) > > print complex(realS, imgS) > > >> (-1.

Re: subexpressions (OT: math)

2007-06-03 Thread [EMAIL PROTECTED]
On 3, 14:05, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sun, 03 Jun 2007 09:02:11 +0200, Leonhard Vogt wrote: > >> bla-bla > > Hmmm... perhaps that's why the author of the "units" program doesn't > treat angles as dimensionless when taki

Re: subexpressions (OT: math)

2007-06-03 Thread [EMAIL PROTECTED]
On 3, 21:43, Gary Herron <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > angle is dimensionless unit. > > Of course not! Angles have units, commonly either degrees or radians. > > However, sines and cosines, being ratios of two lengths, are unit-l

Re: subexpressions (OT: math)

2007-06-03 Thread [EMAIL PROTECTED]
On 3, 22:07, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > angle is a ratio of two length and > dimensionless.http://en.wikipedia.org/wiki/Angle#Units_of_measure_for_angles > > only dimensionless values can be a argument of a sine and exponent! &g

WSGI/wsgiref: modifying output on windows ?

2007-06-03 Thread [EMAIL PROTECTED]
4\x08\x06\x00 \x00\x00oy\xc41\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d \x88\x00\x00\x00\x19tEX tSoftware\x00www.inkscape.org\x9b\xee<\x1a\x00\x00\x01\x95IDATh\x81\xed \xd9?K#A\ [EMAIL PROTECTED])*\xda\xd9(v\xd7+r \xb6\x82\xef\xc3 [EMAIL PROTECTED] \x8d1\x9a8\x16\x93\ x80\xc4F]u\x89\xfc>\xcd\xb0\x0fS<\

another thread on Python threading

2007-06-03 Thread [EMAIL PROTECTED]
Hi, I've recently been working on an application[1] which does quite a bit of searching through large data structures and string matching, and I was thinking that it would help to put some of this CPU-intensive work in another thread, but of course this won't work because of Python's GIL. There's

Re: another thread on Python threading

2007-06-03 Thread [EMAIL PROTECTED]
On Jun 3, 5:52 pm, Steve Howell <[EMAIL PROTECTED]> wrote: > The pitfall here is that to reduce code duplication, > you might initialize certain variables in a method > called by __init__, because your object might want to > return to its initial state. This is a good point. I

Re: WSGI/wsgiref: modifying output on windows ?

2007-06-04 Thread [EMAIL PROTECTED]
On Jun 3, 10:11 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > I am currently trying to port my web software AFoC <http://afoc.k.vu> > to Windows and have hit a strange problem: it seams that binary files > (PNG images in this case) get distorted

Re: WSGI/wsgiref: modifying output on windows ?

2007-06-04 Thread [EMAIL PROTECTED]
On Jun 3, 10:11 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Might this be a bug in wsgiref ? I will hopefully be able to do some > more testing, ... The following simple CGI script should, AFAIK, on any platform, output exactly the file specified in code. It d

Re: another thread on Python threading

2007-06-04 Thread [EMAIL PROTECTED]
On Jun 3, 9:10 pm, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > If you are doing string searching, implement the algorithm in C, and > call out to the C (remembering to release the GIL). I considered that, but...ick! The whole reason I'm writing this program in Python in the

Re: Who uses Python?

2007-06-04 Thread [EMAIL PROTECTED]
On Jun 4, 3:37 pm, walterbyrd <[EMAIL PROTECTED]> wrote: > I mean other than sysadmins, programmers, and web-site developers? > > I have heard of some DBAs who use a lot of python. > > I suppose some scientists. I think python is used in bioinformatics. I > think some mat

Re: *Naming Conventions*

2007-06-04 Thread [EMAIL PROTECTED]
On Jun 4, 12:20 am, Ninereeds <[EMAIL PROTECTED]> wrote: > On Jun 4, 5:03 am, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > > > for validanswer in validanswers: > > if myAnswers.myanswer in myAnswers.validAnswers[validanswer]: > > MyOptions['s

Re: Who uses Python?

2007-06-04 Thread [EMAIL PROTECTED]
On Jun 4, 2:37 pm, walterbyrd <[EMAIL PROTECTED]> wrote: I am using python for csound.. You can use it inside of csound as well as using it on csound files... python makes text files very easy... I have to say that the price was very good and that is very important because I don't

Re: itertools.groupby

2007-06-05 Thread [EMAIL PROTECTED]
On May 27, 7:50 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > The groupby itertool came-out in Py2.4 and has had remarkable > success (people seem to get what it does and like using it, and > there have been no bug reports or reports of usability problems). With due respect, I

Re: Who uses Python?

2007-06-05 Thread [EMAIL PROTECTED]
walterbyrd wrote: > On Jun 5, 3:01 am, Maria R <[EMAIL PROTECTED]> wrote: > > I tend to agree with some earlier poster that if you use Python you > > are, in a sense, a programmer :o) > > > > Yes, in a sense. But, in another sense, that is sort of like saying

Re: itertools.groupby

2007-06-05 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > On May 27, 7:50 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > The groupby itertool came-out in Py2.4 and has had remarkable > > success (people seem to get what it does and like using it, and > > there have been no bug reports or re

ANN: matplotlib 0.90.1 graphing package

2007-06-05 Thread [EMAIL PROTECTED]
matplotlib-0.90.1 has just been released. matplotlib is a graphing package for python which can be used interactively from the python shell ala Mathematica or Matlab, embedded in a GUI application, or used in batch mode to generate graphical hardcopy, eg in a web application server. Many raster a

Re: web development without using frameworks

2007-06-05 Thread [EMAIL PROTECTED]
On Jun 5, 9:24 pm, Christoph Haas <[EMAIL PROTECTED]> wrote: > On Tue, Jun 05, 2007 at 03:01:01PM -0400, Chris Stewart wrote: > > I'm interested in learning web based python without the use of fancy > > frameworks > > that are out there. I'm having a h

Re: Who uses Python?

2007-06-05 Thread [EMAIL PROTECTED]
On Jun 6, 12:07 pm, Steve Howell <[EMAIL PROTECTED]> wrote: > --- walterbyrd <[EMAIL PROTECTED]> wrote: > > I am getting the idea that most python "programmers" > > use python more > > like a tool, rather than as their primary > > specializati

Re: which "GUI module" you suggest me to use?

2007-06-05 Thread [EMAIL PROTECTED]
On Jun 6, 12:13 pm, Eric <[EMAIL PROTECTED]> wrote: > On Jun 5, 4:17 pm, ZioMiP <[EMAIL PROTECTED]> wrote: > > > > > Cameron Laird ha scritto: > > > > In article <[EMAIL PROTECTED]>, > > > ZioMiP <[EMAIL PROTECTED]> wrote: > >

Encoding problem with web application (Paste+Mako)

2007-06-06 Thread [EMAIL PROTECTED]
Hi I have a problem with encoding non-ascii characters in a web application. The application uses Paste and Mako. The code is here: http://www.webudkast.dk/demo.txt The main points are: After getting some user generated input using paste.request.parse_formvars, how should this be correctly save

Re: web development without using frameworks

2007-06-06 Thread [EMAIL PROTECTED]
On Jun 6, 5:57 am, Michele Simionato <[EMAIL PROTECTED]> wrote: > > IMO there is a third way: use wsgiref and/or paste. > > Michele Simionato Yes, Paste can handle request and sessions among other things. Also i can recommend Mako for templating. WSGI is a bit lowlevel.

Integer division

2007-06-07 Thread [EMAIL PROTECTED]
Hello all, I have two integers and I want to divide one by another, and want to get an integer result which is the higher side whenever the result is a fraction. 3/2 => 1 # Usual behavior some_func(3, 2) => 2 # Wanted Any easier solution other than int(math.ceil(float(3)/2)) - Suresh -- http

Re: Integer division

2007-06-07 Thread [EMAIL PROTECTED]
On Jun 7, 2:15 pm, Hamish Moffatt <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hello all, > > I have two integers and I want to divide one by another, and want to > > get an integer result which is the higher side whenever the result is > > a fractio

Bragging about Python

2007-06-07 Thread [EMAIL PROTECTED]
Is there a resource somewhere on the net that can be used to quickly and effectively show Python's strengths to non-Python programmers? Small examples that will make them go "Wow, that _is_ neat"? -- http://mail.python.org/mailman/listinfo/python-list

How does os.walk work?

2007-06-07 Thread [EMAIL PROTECTED]
In the example from help(os.walk) it lists this: from os.path import join, getsize for root, dirs, files in walk('python/Lib/email'): print root, "consumes", print sum([getsize(join(root, name)) for name in files]), print "bytes in", len(files), "non-directory files

Running a process every N days

2007-06-07 Thread [EMAIL PROTECTED]
What's the best way to run either an entire python process or a python thread every N days. I'm running Python 2.4.3 on Fedora Core 5 Linux. My code consists of a test and measurement system that runs 24/7 in a factory setting. It collects alot of data and I'd like to remove all data older than 30

Re: How does os.walk work?

2007-06-07 Thread [EMAIL PROTECTED]
On Jun 7, 5:13 pm, Gary Herron <[EMAIL PROTECTED]> wrote: > Simple: os.walk builds the list to contain all the subdirectories. > After giving you a chance to modify that list, ow.walk then goes through > the list (whatever contents it has at that point) and visits any > sub

Re: howto obtain directory where current (running) py-file is placed?

2007-06-08 Thread [EMAIL PROTECTED]
dmitrey wrote: > Hi all, > I guess this question was asked many times before, but I don't know > keywords for web search. > > Thank you in advance, D. In the future, please ask your question in the body of your message (not just in the subject line). This question has no answer in general. There

Re: The Concepts and Confusions of Prefix, Infix, Postfix and Fully Functional Notations

2007-06-08 Thread [EMAIL PROTECTED]
Mathematica language: vectorAngle[{a1_, a2_}] := Module[{x, y}, {x, y} = {a1, a2}/Sqrt[a1^2 + a2^2] // N; If[x == 0, [EMAIL PROTECTED] === 1, π/2, -π/2], If[y == 0, [EMAIL PROTECTED] === 1, 0, π], [EMAIL PROTECTED] === 1, [EMAIL PROTECTED], 2

Re: Working with fixed format text db's

2007-06-08 Thread [EMAIL PROTECTED]
On Jun 8, 6:18?pm, Ben Finney <[EMAIL PROTECTED]> wrote: > Neil Cerutti <[EMAIL PROTECTED]> writes: > > I was hoping for a module that provides a way for me to specify a > > fixed file format, along with some sort of interface for writing and > > reading files t

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

2007-06-10 Thread [EMAIL PROTECTED]
On Jun 9, 12:16 pm, James Stroud <[EMAIL PROTECTED]> wrote: > Terry Reedy wrote: > > In Python, you have a choice of recursion (normal or tail) > > Please explain this. I remember reading on this newsgroup that an > advantage of ruby (wrt python) is that ruby has tail re

Re: Third-party libs in version control

2007-06-10 Thread [EMAIL PROTECTED]
On Jun 10, 5:26 am, Marcus <[EMAIL PROTECTED]> wrote: > Good evening, > > I'm new to developing large subversion-controlled projects. This one > will involve a few third-party libraries like wxWidgets, and perhaps > Twisted. Ordinarily you could just install these into

Re: skip next item in list

2007-06-11 Thread [EMAIL PROTECTED]
On Jun 11, 8:49 am, ahlongxp <[EMAIL PROTECTED]> wrote: > list=('a','d','c','d') > for a in list: > if a=='a' : > #skip the letter affer 'a' > > what am I supposed to do? You could do this with it

Re: *Naming Conventions*

2007-06-11 Thread [EMAIL PROTECTED]
On Jun 8, 2:06 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-06-08, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > > Neil Cerutti a écrit : (snip) > > >> Certainly i and j are just as generic, but they have the > >> advantage over 'item&#

bgl Python on Mac OS X

2007-06-11 Thread [EMAIL PROTECTED]
I'm trying to build this. I've downloaded the boost libraries (version 1.34) and run configure, make and sudo make install without errors. Then I've downloaded bgl-python (0.9) and, as instructed, found the bjam executable from the boost hierarchy, copied it somewhere convenient and run it in the

Re: Who uses Python?

2007-06-11 Thread [EMAIL PROTECTED]
On Jun 4, 12:37 pm, walterbyrd <[EMAIL PROTECTED]> wrote: > I mean other than sysadmins, programmers, and web-site developers? > I use Python to teach mathematics and analytical thinking to both children and adults. The OO way of casting a problem has a lot of power. I'm wo

Re: SimplePrograms challenge

2007-06-11 Thread [EMAIL PROTECTED]
On Jun 11, 4:56?pm, Steve Howell <[EMAIL PROTECTED]> wrote: > Hi, I'm offering a challenge to extend the following > page by one good example: > > http://wiki.python.org/moin/SimplePrograms > > Right now the page starts off with 15 examples that > cover lots of gro

MS Word parser

2007-06-12 Thread [EMAIL PROTECTED]
Hi all, I'm currently using antiword to extract content from MS Word files. Is there another way to do this without relying on any command prompt application? -- http://mail.python.org/mailman/listinfo/python-list

questions about solving equations in scipy

2007-06-12 Thread [EMAIL PROTECTED]
Hi all, I have two questions about scipy. 1) When I was trying to solve a single variable equations using scipy, I found two methods: scipy.optimize.fsolve, which is designated to find the roots of a polynomial, and scipy.optimize.newton, which is used for Scalar function root finding according t

Problem Inheriting from "str" Class

2007-06-12 Thread [EMAIL PROTECTED]
I'm writing a program and want to create a class that is derived from the "str" base type. When I do so, however, I have problems with the __init__ method. When I run the code below, it will call my new __init__ method when there is zero or one (value) parameter. However, if I try to pass two pa

How to create a tuple quickly with list comprehension?

2007-06-13 Thread [EMAIL PROTECTED]
Hi all, I can use list comprehension to create list quickly. So I expected that I can created tuple quickly with the same syntax. But I found that the same syntax will get a generator, not a tuple. Here is my example: In [147]: a = (i for i in range(10)) In [148]: b = [i for i in range(10)] In

Re: questions about solving equations in scipy

2007-06-13 Thread [EMAIL PROTECTED]
Hi Robert, Thanks a lot for your kindness. Robert Kern wrote: > [EMAIL PROTECTED] wrote: >> Hi all, >> >> I have two questions about scipy. > > You're likely to get a better response from the scipy mailing list. Here, you'll > primarily get me, and

Re: MS Word parser

2007-06-13 Thread [EMAIL PROTECTED]
On Jun 13, 1:28 am, Tim Golden <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi all, > > I'm currently using antiword to extract content from MS Word files. > > Is there another way to do this without relying on any command prompt > > applic

Re: Method much slower than function?

2007-06-13 Thread [EMAIL PROTECTED]
Gabriel Genellina wrote: > In the function above, s is a local variable, and accessing local > variables is very efficient (using an array of local variables, the > compiler assigns statically an index for each one). > Using self.s, on the other hand, requires a name lookup for each access. > The m

lagrange multipliers in python

2007-06-14 Thread [EMAIL PROTECTED]
Hi all, Sorry for the cross-posting. I'm trying to find the minimum of a multivariate function F(x1, x2, ..., xn) subject to multiple constraints G1(x1, x2, ..., xn) = 0, G2(...) = 0, ..., Gm(...) = 0. The conventional way is to construct a dummy function Q, $$Q(X, \Lambda) = F(X) + \lambda_1 G

Re: Method much slower than function?

2007-06-14 Thread [EMAIL PROTECTED]
On Jun 14, 1:12 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 14 Jun 2007 01:39:29 -0300, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> escribió: > > > > > Gabriel Genellina wrote: > >> In addition, += is rather inefficient for

Re: Method much slower than function?

2007-06-14 Thread [EMAIL PROTECTED]
On Jun 14, 1:10 am, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > take virtually the same amount of time on my machine (2.5), and the > > non-join version is clearer, IMO. I'd still use join in case I

Re: Efficient way of generating original alphabetic strings like unix file "split"

2007-06-14 Thread [EMAIL PROTECTED]
On Jun 14, 1:41 pm, py_genetic <[EMAIL PROTECTED]> wrote: > Hi, > > I'm looking to generate x alphabetic strings in a list size x. This > is exactly the same output that the unix command "split" generates as > default file name output when splitting lar

Re: Efficient way of generating original alphabetic strings like unix file "split"

2007-06-14 Thread [EMAIL PROTECTED]
On Jun 14, 3:08 pm, Rob Wolfe <[EMAIL PROTECTED]> wrote: > py_genetic <[EMAIL PROTECTED]> writes: > > Hi, > > > I'm looking to generate x alphabetic strings in a list size x. This > > is exactly the same output that the unix command "split" gener

Re: Efficient way of generating original alphabetic strings like unix file "split"

2007-06-14 Thread [EMAIL PROTECTED]
On Jun 14, 4:39 pm, py_genetic <[EMAIL PROTECTED]> wrote: > > You didn't try hard enough. :) > > >http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/190465 > > > -- > > HTH, > > Rob > > Thanks Rob, "permutation" was the keyword I

Matrix Multiplication

2007-06-17 Thread [EMAIL PROTECTED]
Hi, Is there any direct function for matrix multiplication in Python or any of its packages? or do we have to multiply element by element? Thank you, Amit -- http://mail.python.org/mailman/listinfo/python-list

Re: global destructor not called?

2007-06-17 Thread [EMAIL PROTECTED]
On Jun 15, 7:07 pm, Neal Becker <[EMAIL PROTECTED]> wrote: > Bruno Desthuilliers wrote: > > Neal Becker a écrit : > >> To implement logging, I'm using a class: > > > If I may ask : any reason not to use the logging module in the stdlib ? > > Don't

PyRun_String with Py_single_input to stdout?

2007-06-17 Thread [EMAIL PROTECTED]
I'm using PyRun_String with Py_single_input for a python interpreter embedded in my application. I'm using Py_single_input. Py_single input is what I want, but it seems to output to stdout. Before when I was using Py_eval_input I was able to grab the result so I could print it in a text box:

PyRun_String with Py_single_input to stdout?

2007-06-17 Thread [EMAIL PROTECTED]
I'm using PyRun_String with Py_single_input for a python interpreter embedded in my application. I'm using Py_single_input. Py_single input is what I want, but it seems to output to stdout. Before when I was using Py_eval_input I was able to grab the result so I could print it in a text box:

Re: Memory problem with Python

2007-06-17 Thread [EMAIL PROTECTED]
On Jun 17, 8:51 pm, Squzer Crawler <[EMAIL PROTECTED]> wrote: > i am developing distributed environment in my college using Python. I > am using therads in client for downloading wepages. Even though i am > reusing the thread, memory usage get increased. I don know why.? I am > u

Re: The Modernization of Emacs

2007-06-18 Thread [EMAIL PROTECTED]
On 17 июн, 19:13, Xah Lee <[EMAIL PROTECTED]> wrote: > In the following, i describe some critical changes that are also very > easy to fix in emacs. If emacs officially adopt these changes, i think > it will make a lot people, at least programers, like emacs and choose > emacs as

<    21   22   23   24   25   26   27   28   29   30   >