Re: Newbie regular expression and whitespace question

2005-09-22 Thread Fredrik Lundh
Paul McGuire wrote: > If you're absolutely stuck on using RE's, then others will have to step > forward. Meanwhile, here's a pyparsing solution (get pyparsing at > http://pyparsing.sourceforge.net): so, let's see. using ... from pyparsing import * import re data = """ ... table example from o

Re: Help on regular expression match

2005-09-22 Thread Fredrik Lundh
Johnny Lee wrote: > I've met a problem in match a regular expression in python. Hope > any of you could help me. Here are the details: > > I have many tags like this: > xxxhttp://xxx.xxx.xxx"; xxx>xxx > xx > xxxhttp://xxx.xxx.xxx"; xxx>xxx > . > And I want to find

Re: C#3.0 and lambdas

2005-09-23 Thread Fredrik Lundh
Reinhold Birkenfeld wrote: >> And I think the discussion that followed proved your point perfectly >> Fredrik. Big discussion over fairly minor things, but no "big picture". >> Where are the initiatives on the "big stuff" (common documentation >> format, improved build system, improved web module

Re: Using distutils 2.4 for python 2.3

2005-09-23 Thread Fredrik Lundh
Noam Raphael wrote: > I want to distribute a package. It's compatible with Python 2.3. > Is there a way to use distutils 2.4 feature package_data, while > maintaining the distribution compatible with python 2.3 ? you can enable new metadata fields in older versions by assigning to the Distributio

Re: Single type for __builtins__ in Py3.0

2005-09-23 Thread Fredrik Lundh
Collin Winter wrote: > As it currently stands, the type of the global __builtins__ differs > depending on whether you're in the __main__ namespace (__builtins__ is > a module) or not (its a dict). I was recently tripped up by this > discrepancy, and googling the issue brings up half-a-dozen or so

Re: batch mkdir using a file list

2005-09-23 Thread Fredrik Lundh
DataSmash <[EMAIL PROTECTED]> wrote > I think I've tried everything now and can't figure out how to do it. > I want to read in a text list from the current directory, > and for each line in the list, make a system directory for that name. > > My text file would look something like this: > 1144 > 1

Re: Most direct way to strip unoprintable characters out of a string?

2005-09-25 Thread Fredrik Lundh
George Sakkis wrote: > No there's not a stripUnprintable in a standard module AFAIK, and > that's a good thing; if every little function that one might ever wanted > made it to the standard library, the language would be overwhelming. ...and if there was a stripUnprintable function in the standar

Re: Extending Embedded Python

2005-09-25 Thread Fredrik Lundh
Richard Townsend wrote: > In the "Extending and Embedding" part of the Python documentation: section > 5.4 "Extending Embedded Python" - it describes how to use a Python > extension module from Python that is embedded in a C application. > > Is it safe to call Py_InitModule() more than once in the

Re: cElementTree clear semantics

2005-09-25 Thread Fredrik Lundh
Igor V. Rafienko wrote: > Finally, I thought about keeping track of when to clear and when not > to by subscribing to start and end elements (so that I would collect > the entire -subtree in memory and only than release it): > > from cElementTree import iterparse > clear_flag = True > for event, e

Re: Reinhold Birkenfeld [Re: "Re: cElementTree clear semantics"]

2005-09-25 Thread Fredrik Lundh
Doug Holton wrote: > You're the only one making any association between this thread about > celementree and boo. really? judging from the Original-From header in your posts, your internet provider is sure making the same association... -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess considered harmfull?

2005-09-25 Thread Fredrik Lundh
Steven Bethard wrote: > > Using the following snippet: > > p = > > subprocess.Popen(nmake,stderr=subprocess.PIPE,stdout=subprocess.PIPE, \ > >universal_newlines=True, bufsize=1) > > os.sys.stdout.writelines(p.stdout) > > os.sys.stdout.writelines(p.stderr) > > Works

Re: cElementTree clear semantics

2005-09-25 Thread Fredrik Lundh
Igor V. Rafienko wrote: > The problem is that the file looks like this: > > ... lots of schnappi records ... okay. I think your first approach from cElementTree import iterparse for event, elem in iterparse("data.xml"): if elem.tag == "schnappi": count += 1

Re: cElementTree clear semantics

2005-09-25 Thread Fredrik Lundh
Paul Boddie wrote: > Regardless of anyone's alleged connection with Boo or newsgroup > participation level, the advice to contact the package > author/maintainer is sound. It happens every now and again that people > post questions to comp.lang.python about fairly specific issues or > packages tha

Re: cannot write to file after close()

2005-09-25 Thread Fredrik Lundh
Rainer Hubovsky wrote: > Thank you Reinhold, that was the solution. But just because I am curious: > what is this statement without the parentheses? After all it is a valid > statement... it's an expression that fetches the "close" method object, and throws it away. to see what it evaluates to,

Re: number of python users

2005-09-26 Thread Fredrik Lundh
Bryan wrote: > is there a rough estimate somewhere that shows currently how many python 1.5 > vs > 2.2 vs 2.3 vs 2.4 users there are? have a majority moved to 2.4? or are they > still using 2.3? etc... Here are current PIL download statistics (last 10 days): 75.6% /downloads/PIL-1.1.5.win32

Re: Need to pass Object by value into a list

2005-09-26 Thread Fredrik Lundh
Aaron wrote: > I have a data sructure setup and I populate it in a loop like so: > > y=0 > while X: >DS.name = "ASDF" >DS.ID = 1234 > >list[y] = DS; >y = y + 1 > > print list > > This does not work because DS is passed in by reference causing all > entries into the list to change t

Re: Plotting points to screen

2005-09-26 Thread Fredrik Lundh
Jason wrote: > Like I said, it's nothing complicated, no flashing wotsits or 3d > quad-linear vertexes with bi-linear real-time shading, just simple > 'points' a few lines or circles and nothing more. all UI toolkits can do that. just pick one, and read up on the graphics API. for Tkinter, you

Re: Plotting points to screen

2005-09-26 Thread Fredrik Lundh
Jay wrote: > One question, that's twice in as many days that someone has said "YMMV". > > What's it mean!? http://www.google.com/search?q=acronym+ymmv -- http://mail.python.org/mailman/listinfo/python-list

Re: A 'find' utility that continues through zipped directory structure?

2005-09-27 Thread Fredrik Lundh
"B Mahoney" wrote: > Is there a Python 'find' -like utility that will continue the file > search through any zippped directory structure on the find path? something like this? # File: zipfind.py import fnmatch, os, sys, zipfile program, root, name = sys.argv for dirpath, dirnames, filenames in

Re: number of python users

2005-09-27 Thread Fredrik Lundh
Bryan wrote: > just for fun, i looked at the top linux distros at distrowatch and looked at > what version of python the latest released version is shipping with out of > the box: > > 1. ubuntu hoary - python 2.4.1 > 2. mandriva 2005 - python 2.4 > 3. suse 9.3 - python 2.4 > 4. fedora core 4 - py

Re: Memory stats

2005-09-27 Thread Fredrik Lundh
Tarek Ziadé wrote: > > If you want a list of all objects (container or not), you have to > > compile a debug build of Python. > > I am amazed not to find an existing implementation for this. the debug build is an existing implementation, of course. -- http://mail.python.org/mailman/listinf

Re: What tools are used to write and generate Python Librarydocumentation.

2005-09-27 Thread Fredrik Lundh
Kenneth McDonald wrote: > More seriously, there is a major problem with docstrings in that they > can only document something that has a docstring; classes, functions, > methods, and modules. But what if I have constants that are > important? The only place to document them is in the module > docs

Re: How can I set the size of a window with tkinter?

2005-09-27 Thread Fredrik Lundh
Tor Erik Sønvisen wrote: > I create a canvas that is to big for the default window-size, so it gets cut > to fit... what default window size? what geometry management approach are you using? (if you're using pack or grid, your toplevel window should adapt itself to the canvas size, unless you'

Re: Silly function call lookup stuff?

2005-09-27 Thread Fredrik Lundh
Lucas Lemmens wrote: > Why isn't the result of the first function-lookup cached so that following > function calls don't need to do the function-lookup at all? > > And if the context changes (an import-statement say) reset the > cached 'function-lookups'. import isn't the only way for the "contex

Re: __call__ in module?

2005-09-27 Thread Fredrik Lundh
"ncf" wrote. >I have a feeling that this is highly unlikely, but does anyone in here > know if it's possible to directly call a module no. -- http://mail.python.org/mailman/listinfo/python-list

Re: What tools are used to write and generate PythonLibrarydocumentation.

2005-09-27 Thread Fredrik Lundh
Robert Kern wrote: > The one thing I dislike about PythonDoc is that it puts everything into > comments and thus docstrings are usually neglected. teaser: >>> from elementtree import ElementTree >>> help(ElementTree) Help on module ElementTree: NAME ElementTree DESCRIPTION # ElementTre

Re: Silly function call lookup stuff?

2005-09-27 Thread Fredrik Lundh
Lucas Lemmens wrote: >>> This way any function would only need to be looked up once. >> >> you haven't really thought this over, have you? > > You haven't really answered my questions have you? no, because you proposed a major change to the Python semantics, without spending any effort whatsoever

Re: Overhead of individual python apps

2005-09-27 Thread Fredrik Lundh
Paul Rubin wrote: >> Several apps using 4Mb each shouldn't be very much memory (maybe >> 20Mb at most). You didn't say how much memory was in your machine, >> but 256Mb of memory will cost you no more than $50. Not really >> worth a lot of effort. > > That is bogus reasoning. not if you're a pr

Re: Python 2.4 under WinXP, free VC71 toolkit and VC6 libraries

2005-09-28 Thread Fredrik Lundh
Berthold Höllmann wrote: > OK, then. ctypes works under Linux and Solaris. But before I even > think about converting my code to ctypes (and convert lots of Linux > libraries from static to dynamic libraries), would the conversion > really address my problem? As I understand it, if there is an > i

Re: Overhead of individual python apps

2005-09-28 Thread Fredrik Lundh
Paul Rubin wrote: > An awful lot of Python targeted users are not in that situation, so if > Python's usability suffers for them when it doesn't have to, then > something is wrong with Python. (and so we go from the OP:s "I'm setting up a system" to the usual c.l.python "but I can come up with a

Re: Will python never intend to support private, protected and public?

2005-09-28 Thread Fredrik Lundh
Tony Meyer wrote: >> I thought about it, but I didn't mention it in the end because this >> feature ("name mangling") isn't intended as a mechanism for making >> things private - it's intended to prevent namespace clashes when doing >> multiple inheritance. > > That's not what the documentation sa

Re: Wits end with Python and cron

2005-09-28 Thread Fredrik Lundh
Justin Delvecchio wrote: > I've researched this problem for the last few days. Say I have > the following script that I execute from cron on linux. Yes, the > following runs quite fine from the command line: > And the error I continually get is: > > Traceback (most recent call last): > File "

Re: Wits end with Python and cron

2005-09-28 Thread Fredrik Lundh
I wrote: > if you're running a python program directly from cron and I should really learn to tell the difference between a shell script and a python program (but hey, this is comp.lang.python). see jepler's reply for the quickest way to fix your problems. -- http://mail.python.org/mailma

Re: Will python never intend to support private, protected and public?

2005-09-28 Thread Fredrik Lundh
Tony Meyer wrote: > That elaborates on the intent, it doesn't change it. The sentence > clearly says that the intent is to easily define private variables, > whereas Simon said that it the intent was not to provide a mechanism > for making variables private. Are you aware of the fact that comput

Re: byte code generated under linux ==> bad magic number under

2005-09-28 Thread Fredrik Lundh
Shobha Rani wrote: (I think more people might read your posts if you skip the HTML stuff; if you insist on HTML, you could at least use a reasonable color) > How byte code is generated? For example when we run the java > program then the compiler generates the byte code? > How the byte code is ge

Re: A quick c.l.p netiquette question

2005-09-29 Thread Fredrik Lundh
Peter Hansen wrote: > Does it really have to be 158 lines to demonstrate these few issues? I > for one almost never take the time to dig through 158 lines of someone > else's code, partly on the assumption that almost any interesting issue > can be covered (using Python, specifically) in about a

Re: What python idioms for private, protected and public?

2005-09-29 Thread Fredrik Lundh
Michael Schneider wrote: > 1) mark an object as dirty in a setter (anytime the object is changed, > the dirty flag is set without requiring a user to set the dirty flag properties. > 2) enforce value constraints (even if just during debugging) properties. (when you no longer need to enforce th

Re: Will python never intend to support private, protected and public?

2005-09-29 Thread Fredrik Lundh
Steve Holden wrote: > To avoid naming conflicts, Python provides a mechanism (name mangling) > which pretty much guarantees that your names won't conflict with anybody > else's, *even if you subclass a class whose methods use the same name*. as long as you don't cheat, that is: # your code clas

Re: Will python never intend to support private, protected and public?

2005-09-29 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > What if the access to that variable was forbidden for reasons you never > foresaw? What if the class author decide to remove the variable in the next > version of the class, because it's not an interface, but only a part of the > class implementation? you mean when he b

Re: A rather unpythonic way of doing things

2005-09-29 Thread Fredrik Lundh
"fraca7" wrote: > print ''.join(map(lambda x: chrord(x) - ord('a')) + 13) % 26) + > ord('a')), 'yvfc')) that's spelled print "yvfc".decode("rot-13") or, if you prefer, print "yvfc".encode("rot-13") , in contemporary python. -- http://mail.python.org/mailman/listinfo/python

Re: Will python never intend to support private, protected and public?

2005-09-29 Thread Fredrik Lundh
could ildg wrote: > Encapsulation or information hiding or whatever You've got to be very careful if you don't know where you're looking for, because you might not find it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Will python never intend to support private, protected and public?

2005-09-29 Thread Fredrik Lundh
>> Encapsulation or information hiding or whatever > > You've got to be very careful if you don't know where you're looking > for, because you might not find it. message.sub("where", "what") # argh! -- http://mail.python.org/mailman/listinfo/python-list

Re: grouping array

2005-09-29 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > hi if I have an array > > say x = [[2,2,0,0,1,1], > [1,1,0,0,1,1], > [1,1,0,0,1,1]] > I basically want to group regions that are non zero like I want to get > the coordinates of non zero regions..as (x1,y1,x2,y2) > [(0,0,2,1),(0,4,2,5)] which show the top

Re: xml.sax removing newlines from attribute value?

2005-09-29 Thread Fredrik Lundh
Grant Edwards wrote: > I'm using xml.sax to parse the "datebook" xml file generated by > QTopiaDesktop. When I look at the xml file, some of the > attribute strings have newlines in them (as they are supposed > to). > > However, when xml.sax passes the attributes to my > startElement() method the

Re: converting Word to MediaWiki

2005-09-29 Thread Fredrik Lundh
ChiTownBob wrote: > does anyone know of a Python HTML - Wiki conversion > program? if your wiki markup isn't too complex, maybe you could adapt one of the examples on this page: http://effbot.org/librarybook/formatter.htm -- http://mail.python.org/mailman/listinfo/python-list

Re: Will python never intend to support private, protected and public?

2005-09-29 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Do you ever heard of that funny things named "an interface" and "an > implementation"? the "shared DLL:s ought to work" school of thought, you mean? -- http://mail.python.org/mailman/listinfo/python-list

Re: xml.sax removing newlines from attribute value?

2005-09-29 Thread Fredrik Lundh
Grant Edwards wrote: >> http://www.w3.org/TR/REC-xml/#AVNormalize > > I can't quite find it in the BNF, but I take it that chr(10) > isn't really allowed in XML attribute strings. IOW, the file > generate by Trolltech's app is broken. it's allowed, but the parser must not pass it on to the a

Re: python's performance

2005-09-29 Thread Fredrik Lundh
> > Have u been used such camera with PIL before? > > > > im_1= Image.fromstring("I", datasize, buf, 'raw', 'I;16') running on a 700 MHz box: c:\> timeit -s "import Image" -s "data = 1344*1024*2*'x'" "im = Image.fromstring('I', (1344, 1024), data, 'raw', 'I;16')" 10 loops, best of 3: 102 msec

Re: Feature Proposal: Sequence .join method

2005-09-29 Thread Fredrik Lundh
David Murmann wrote: > I could not find out whether this has been proposed before (there are > too many discussion on join as a sequence method with different > semantics). So, i propose a generalized .join method on all sequences so all you have to do now is to find the sequence base class, and

Re: Will python never intend to support private, protected and public?

2005-09-29 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Looks like you must know every one of the base classes of the NotSoSecret, > whether there is some base class named Secret? And, if so, you must also > know these classes _implementation_ that information isn't hidden, so there's nothing "you must know". finding out is

Re: Will python never intend to support private, protected and public?

2005-09-29 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: >> > Do you ever heard of that funny things named "an interface" and "an >> > implementation"? >> >> the "shared DLL:s ought to work" school of thought, you mean? > > No, the other way around: my app works when I upgrade libraries it depends > on. yeah, because it's only

Re: File Upload Script

2005-09-29 Thread Fredrik Lundh
"Chuck" wrote: > Hi, can anyone provide or point me in the direction of a simple python > file upload script? I've got the HTML form part going but simply > putting the file in a directory on the server is what I'm looking for. > Any help would be greatly appreciated. upload how? WebDAV? scp?

Re: threads, periodically writing to a process

2005-09-29 Thread Fredrik Lundh
Adam Monsen wrote: >I have a program that, when run, (1) does some task, then (2) prompts > for input: "Press ENTER to continue...", then repeats for about ten > different tasks that each take about 5 minutes to complete. There is no > way to disable this prompt. > > How would I go about writing a

Re: Will python never intend to support private, protected and public?

2005-09-30 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > So you have read every line of the python std library, I guess? yes, but that's irrelevant. in python, you don't need the source to find hidden stuff. finding out is a matter of writing a very small program, or tinkering at the interactive prompt for a couple of seco

Re: Will python never intend to support private, protected and public?

2005-09-30 Thread Fredrik Lundh
Steve Holden wrote: >> 1) Allow keywords like private (or implemetation) to mark certain >> variables, functions or classes as an implementation detail. >> Personnally I would prefer the opposite such as a interface >> to mark objects which are not private, but that would break too >> much code.

Re: return (PyObject*)myPyType; ...segmentation fault!

2005-09-30 Thread Fredrik Lundh
"elho" <[EMAIL PROTECTED]> wrote: > It is said that the object has a NULL-Pointer when I try to debug it? what object? > Here are the importent snips from my code: where's the PySDLXMLNode code? is the PySDLXMLNode constructor really doing a proper PyObject initialization? (PyObject subtypes

Re: Soap Question (WSDL)

2005-09-30 Thread Fredrik Lundh
Armin wrote: > I am trying to write a web app. that connects to flickr using SOAP. The > book 'Dive into python' says I need to have a WSDL file to connect, > while the only useful soap related url flickr api > (flickr.com/services/api) provides is the following: > > The SOAP Server Endpoint URL i

Re: Font management under win32

2005-09-30 Thread Fredrik Lundh
Stefano Masini wrote: > Do you think that is possible with win32 extensions? you can do this via PIL's ImageFont module: >>> import ImageFont >>> f = ImageFont.truetype("arial.ttf") >>> f.font.family 'Arial' >>> f.font.style 'Regular' or, if you don't want to ship the entire PIL library with yo

Re: return (PyObject*)myPyType; ...segmentation fault!

2005-09-30 Thread Fredrik Lundh
"elho" wrote: >> > It is said that the object has a NULL-Pointer when I try to debug it? >> what object? > the python one 'myNewPyType' > > Sorry, I forgot to change: > PySDLXMLNodeType = PyMyType > ..above the corrections >self = new PyMyObject >self->lAttribute = lAttribute; > >

Re: 'ascii' codec can't encode character u'\u2013'

2005-09-30 Thread Fredrik Lundh
Thomas Armstrong wrote: > I'm trying to parse a UTF-8 document with special characters like > acute-accent vowels: > > > ... > --- > > But I get this error message: > --- > UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in > position 122: ordinal not in range(

Re: Overloading __init__ & Function overloading

2005-09-30 Thread Fredrik Lundh
"Iyer, Prasad C" wrote: > a. Is there something like function overloading in python? not in the usual sense, no. function arguments are not typed, so there's nothing to dispatch on. there are several cute tricks you can use to add dispatching on top of "raw" python, but that's nothing you shou

Re: [Info] PEP 308 accepted - new conditional expressions

2005-09-30 Thread Fredrik Lundh
Reinhold Birkenfeld wrote: > after Guido's pronouncement yesterday, in one of the next versions of Python > there will be a conditional expression with the following syntax: > > X if C else Y > > which is the same as today's > > (Y, X)[bool(C)] hopefully, only one of Y or X is actually evaluated

Re: Overloading & Overriden

2005-09-30 Thread Fredrik Lundh
"Iyer, Prasad C" wrote: > Does python supports Overloading & Overriding of the function? Please avoid posting the same question over and over again with different subjects. Please read the replies to your original question before reposting the question. This is a mail list, not a chat channel;

Re: Help with syntax warnings

2005-09-30 Thread Fredrik Lundh
Peter Hansen wrote: > Wow... Python detects "dubious syntax"? And here I thought programming > was rather black and white, it's right or it's wrong. SyntaxWarnings are issued for things that has never been valid nor well- defined nor especially clever, but has been handled (in some more or less

Re: Overloading __init__ & Function overloading

2005-09-30 Thread Fredrik Lundh
Larry Bates wrote: >I may be reading this question different than Fredrik. it looks like you're using a non-standard definition of the word "overloading". here are the usual definitions (quoting from a random google page): "Overloading a method refers to having two methods which share the

Re: Overloading __init__ & Function overloading

2005-09-30 Thread Fredrik Lundh
"Iyer, Prasad C" wrote: > Thanks a lot for the reply. > But I want to do something like this > > class BaseClass: > def __init__(self): > # Some code over here > def __init__(self, a, b): > # Some code over here > def __init__(self, a, b, c): > # some code here did you read the FAQ I pointed you

Re: getattr

2005-09-30 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Is there any way by which the __getattr__(self,attr) method can > determine that in > case a) attr == 'bar' is the final component in the reference unlike in > case b) where attr=='bar' is NOT the ultimate(final) component of > reference and is an intermediate component

Re: getattr

2005-09-30 Thread Fredrik Lundh
> if you want to control further accesses, your __getattr__ has to return a > proxy object, and use a suitable syntax to get the final value. message.insert(index, "your users have to ") -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with syntax warnings

2005-10-01 Thread Fredrik Lundh
Ivan Shevanski wrote: > Well I've been experimenting with the warning filter and it doesn't seem to > be working. . .I think it has something to do with the fact that warnings > are issued during the compiling and not during the excecution. . .So the > filter would come in to late to block them? A

Re: Background process for ssh port forwarding

2005-10-01 Thread Fredrik Lundh
Jesse Rosenthal wrote: > If I end this with 'connection.interact()', I will end up logged in to the > forwarding server. But what I really want is to go on and run rsync to > localhost port 2022, which will forward to my_server port 22. So, how can > I put the ssh connection I set up in hostforwar

Re: Statement orders

2005-10-02 Thread Fredrik Lundh
Monu Agrawal wrote: > Hi I am making a gui based tool. When user preses a perticular button I > am running a heavy command, before this I want to say user to wait with > a image showing infront of her. > > My code is like: > > def loadData(self): >top=Toplevel(self.parent) >top.focus_set()

Re: Class Help

2005-10-02 Thread Fredrik Lundh
Ivan Shevanski wrote: > To continue with my previous problems, now I'm trying out classes. But I > have a problem (which I bet is easily solveable) that I really don't get. > The numerous tutorials I've looked at just confsed me.For intance: > > >>>class Xyz: > ... def y(self): > ...

Re: Problems posting with urlencode

2005-10-02 Thread Fredrik Lundh
Joseph Chase wrote: > When I go and view the inserted record, the record exists, but the field > values are null. It is my thinking that the backend needs the "id" value > for each input value; how do I add that data to the urlencode() call? since the id isn't part of the form data set: htt

Re: Distributing programs

2005-10-02 Thread Fredrik Lundh
Jason wrote: > A non-python programming friend of mine has said that any programs made > with Python must be distributed with, or an alternative link, to the source of > the program. > > Is this true? no. the license is here: http://www.python.org/doc/Copyright.html "Python is absolutel

Re: Distributing programs

2005-10-02 Thread Fredrik Lundh
> the license is here: > > http://www.python.org/doc/Copyright.html > >"Python is absolutely free, even for commercial use (including > resale). There is no GNU-like "copyleft" restriction." except that the current license is (no longer?) linked from that page. the current license is

Re: struct.unpack

2005-10-02 Thread Fredrik Lundh
"g.franzkowiak" wrote: > I've read a pipe and store it in a object. > My next step was the separation from 4 bytes with > obj = string.join(list(dataObject)[:4] ==> '\x16 \x00 \x00 \x00' > and the converting by > value = struct.unpack('I', obj) generated the error > "unpack str size does not matc

Re: A Moronicity of Guido van Rossum

2005-10-02 Thread Fredrik Lundh
"Michael" wrote: > List comprehensions get their name (AFAICT) very clearly from set > comprehensions in mathematics. As a result anyone who has ever seen > a set comprehension in maths goes "oooh, I see". They're not the same, but > IMO they're close enough to warrant that name. fwiw, they've al

Re: Bwidget for tkinter

2005-10-02 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > hi can i use the bwidgets in tkinter? if so from where can i download > the bwidget for tk inter. and i want to know the installation procedure googling for "bwidget for tkinter" gives you a library announcement as the first hit, which points to this page: http://t

Re: Bwidget for tkinter

2005-10-03 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > thanks u man. i am new to tk inter. i tried installing the lib. but > while running the demo script am getting following error. > > python sam.py > Traceback (most recent call last): > File "sam.py", line 1, in ? > import bwidget, Tkinter, sys, os > File "/usr/lo

Re: python getopt functionality

2005-10-03 Thread Fredrik Lundh
"M.N.A.Smadi" wrote: > I have a perl script that I need to port to python. The script takes > input from the command line. Is there a standard way of processing > command line arguments based on the -flag preceeding the argument? http://docs.python.org/lib/module-getopt.html http://docs.python.o

Re: Python Debug Build

2005-10-03 Thread Fredrik Lundh
"Celine & Dave" wrote: > What happens if I build Python with debug option > (--with-pydebug)? Do I see any changes in my program > output? What is --with-pydebug good for? from the README: --with-pydebug: Enable additional debugging code to help track down memory management problems. T

Re: Where to find python c-sources

2005-10-03 Thread Fredrik Lundh
Peter Hansen wrote: > Sorry, but this defense is less than weak. Using "python > socketmodule.c" you actually get the right answer as the third result, > while with the even-more-obvious-to-a-rookie "socketmodule.c" you get it > as the *first* result. using just "python" gives you a link to the

Re: question about smtplib

2005-10-03 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > cool. so this line > server = smtplib.SMTP(localhost) > is when i connect ? http://www.python.org/doc/lib/module-smtplib.html "If the optional host and port parameters are given, the SMTP connect() method is called with those parameters during initiali

Re: semi-newbie module namespace confusion

2005-10-03 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > The main jist of the problem is that I'm trying add data from one > module to a list and a dictionary in another module, and it doesn't > seem to stick over there. > > The programs below seem to illustrate the issue. (The results follow > the programs). > Why are the re

Re: cgi relay for python cgi script

2005-10-04 Thread Fredrik Lundh
Amir Michail wrote: > Is there an easy way to execute a python cgi script on a different > machine from the cgi server? http://www.google.com/search?q=reverse+proxy -- http://mail.python.org/mailman/listinfo/python-list

Re: semi-newbie module namespace confusion

2005-10-04 Thread Fredrik Lundh
David Murmann wrote: > I ran into the same problem some time ago and even wanted to post here > about it, but found out that it had been reported as a bug three times > at sourceforge (if i remember correctly). The comments there explained > it of course, but I still think that this behavior is so

Re: What is executed when in a generator

2005-10-04 Thread Fredrik Lundh
Jerzy Karczmarczuk wrote: > Could you tell me please where can I read something in depth about the > semantics of generators? I feel a bit lost. the behaviour is described in the language reference manual: http://docs.python.org/ref/yield.html "When a generator function is called, it re

Re: cgi relay for python cgi script

2005-10-04 Thread Fredrik Lundh
Amir Michail wrote: > Is there an easy way to do this without modifying the configuration of > the cgi server and without running a cgi server on the other machine > where the script will actually run? > > Perhaps someone wrote a simple server that provides the required > environment for the cgi s

Re: Dynamical loading of modules

2005-10-04 Thread Fredrik Lundh
Carsten Haese wrote: > I don't see how to make __import__ do that. hint: you might get more people to look at your problems/proposals if you actually trim the replies a little. (is 295 angle brackets in a single message perhaps some kind of c.l.py record?) -- http://mail.python.org/mailma

Re: Dynamical loading of modules

2005-10-04 Thread Fredrik Lundh
> (is 295 angle brackets in a single message perhaps some kind of c.l.py > record?) oh, nevermind. -- http://mail.python.org/mailman/listinfo/python-list

Re: ssh or other python editor

2005-10-04 Thread Fredrik Lundh
"projecktzero" wrote: > If samba isn't available/set-up, you can try using FTP. You can then > use Crimson Editor which does the syntax coloring and can ftp to/from a > server. are you guys for real? is there any major text editor for Unix that doesn't support Python syntax coloring and indentat

Re: ssh or other python editor

2005-10-04 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: >- I'm a newbie at freeBSD so I think there is , but I don't know where. I just complained when someone included the entire message thread in their replies, but not including anything at all is pretty annoying too. > And i'm using putty on a windows OS what don't understa

Re: how to get any available port

2005-10-04 Thread Fredrik Lundh
Mohammed Smadi wrote: > if am using s.bind for a tcp socket. On the client side i dont really > care which socket i use as long as i get an available socket. Is there a > funciton or a way to get an available socket? why are you using bind if you're on the client side? -- http://mail.pyt

Re: Newbie regular expression ?

2005-10-04 Thread Fredrik Lundh
"len" <[EMAIL PROTECTED]> wrote: >I have the following statement and it works fine; > >list1 = glob.glob('*.dat') that's a glob pattern, not a regular expression. > however I now have an additional requirement the the string must begin > with any form of "UNQ,Unq,unq,..." list1 = glob.g

Re: how to get any available port

2005-10-04 Thread Fredrik Lundh
Mohammed Smadi wrote: > what else would you do? I am using examples from the web and they all > bind to a port at the localhost before connecting to the remote host. pointers, please. > my code is like this > > #transmission socket > s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > s.se

Re: how to get any available port

2005-10-04 Thread Fredrik Lundh
Grant Edwards wrote: > IIRC, you just call bind() with a port number of zero, and then > use some method-or-other on the bound socket to find out what > port it's bound to. >>> s = socket.socket() >>> s.bind(("", 0)) >>> s.getsockaddr() ("0.0.0.0", 4711) -- http://mail.python.org/mailman/l

Re: Newbie Text Processing Question

2005-10-04 Thread Fredrik Lundh
Gregory Piñero wrote: >That's how Python works. You read in the whole file, edit it, and write it > back out. that's how file systems work. if file systems generally supported insert operations, Python would of course support that feature. -- http://mail.python.org/mailman/listinfo/python-

Re: Help needed in OOP-Python

2005-10-04 Thread Fredrik Lundh
Toufeeq Hussain wrote: > I have 3 modules which have class declarations in them and which implement > multiple inheritance. > Traceback (most recent call last): > File "E:\PyPBM\PyPBM\test_case.py", line 7, in ? >TH = constraint.Option1_Rule1() there's no line that says "TH = constraint.Option1_

Re: While and If messing up my program?

2005-10-05 Thread Fredrik Lundh
"CJ" wrote: >What does worry me, is that I can't seem to get the program by a > certain spot. It keeps giving me the same error, and I don't know why. quite often, exception messages means exactly what they say; if you get an index error, it's because you're trying to fetch an item that doesn

Re: Help needed in OOP-Python

2005-10-05 Thread Fredrik Lundh
Toufeeq Hussain wrote: > My coding is really really bad,that's why I changed the names to more human > readable form(Module1,2.. etc). the problem is that when you do that (and post using a tool that's not smart enough to preserve leading whitespace), anyone who wants to help will basically have

  1   2   3   4   5   6   7   8   9   10   >