Re: BeautifulSoup

2005-08-19 Thread Paul McGuire
Mike - Thanks for asking. Typically I hang back from these discussions of parsing HTML or XML (*especially* XML), since there are already a number of parsers out there that can handle the full language syntax. But it seems that many people trying to parse HTML aren't interested in fully parsing a

Re: Version of TAR in tarfile module? TAR 1.14 or 1.15 port to Windows?

2005-08-19 Thread Martin v. Löwis
Claudio Grondi wrote: > What TAR version is built into the tarfile module? None: the tarfile module is not built on top of GNU tar. Instead, it is a complete reimplementation. > Is there a TAR 1.14 or 1.15 port to Windows > available in Internet for download (which URL)? http://sources.redhat.co

Re: Well, another try Re: while c = f.read(1)

2005-08-19 Thread Robert Kern
James wrote: >>for data in iter(lambda:f.read(1024), ''): >>for c in data: > > What are the meanings of Commands 'iter' and 'lambda', respectively? I > do not want you to indicate merely the related help pages. Just your > ituitive and short explanations would be enough since I'm really newbie

Re: Well, another try Re: while c = f.read(1)

2005-08-19 Thread James
> for data in iter(lambda:f.read(1024), ''): > for c in data: What are the meanings of Commands 'iter' and 'lambda', respectively? I do not want you to indicate merely the related help pages. Just your ituitive and short explanations would be enough since I'm really newbie to Python. -James

Well, another try Re: while c = f.read(1)

2005-08-19 Thread en.karpachov
On 18 Aug 2005 22:21:53 -0700 Greg McIntyre wrote: > f = open("blah.txt", "r") > while True: > c = f.read(1) > if c == '': break # EOF > # ... work on c > > Is some way to make this code more compact and simple? It's a bit > spaghetti. > > This is what I would ideally like:

ANN: Binary Distribution of pyMinGW-241

2005-08-19 Thread A.B., Khalid
This is to inform those interested in Python and MinGW that a binary distribution of pyMinGW-241 is now available. This is mainly a packaging of the March release in binary form for those who are finding it difficult to build Python or its standard extensions in MinGW. WHAT'S INSIDE -

Re: Moinmoin config

2005-08-19 Thread mbstevens
Mark wrote: > The missing link under /var/www/html was exactly the problem. Somehow > missed this in the labyrinth of setup instructions. > > I have another question, and as of yet, have not found another > discussion group for moinmoin, so sorry, but here goes: > > I have a table and would like

Re: BeautifulSoup

2005-08-19 Thread Mike Meyer
"Paul McGuire" <[EMAIL PROTECTED]> writes: > Here's a pyparsing program that reads my personal web page, and spits > out HTML with all of the HREF's reversed. Parsing HTML isn't easy, which makes me wonder how good this solution really is. Not meant as a comment on the quality of this code or PyP

Re: Python jobs

2005-08-19 Thread Aahz
In article <[EMAIL PROTECTED]>, Mike Meyer <[EMAIL PROTECTED]> wrote: > >Maybe the Python jobs lists needs a "available developers" >counterpart? Or would it be to big/dynamic to maintain using whatever >is behind the jobs list? Part of the reason the Jobs page hasn't moved to a wiki is that ofte

Re: Save Binary data.

2005-08-19 Thread Mike Meyer
Larry Bates <[EMAIL PROTECTED]> writes: > Directories with large numbers of files was a problem in FAT16 and > FAT32 filesystems but not really a problem in NTFS or Linux (at > least that I've found). Depends on how you define "large" and what Linux file system you're using. Of course, if you ope

Re: global interpreter lock

2005-08-19 Thread Mike Meyer
Bryan Olson <[EMAIL PROTECTED]> writes: > I don't see much point in trying to convince programmers that > they don't really want concurrent threads. They really do. Some > don't know how to use them, but that's largely because they > haven't had them. I doubt a language for thread-phobes has much >

Re: Python jobs

2005-08-19 Thread Mike Meyer
"Terry Reedy" <[EMAIL PROTECTED]> writes: > generally counter-indicated unless the name (.marketplace) or charter say > otherwise. Exceptions would be a low volume of things of direct and narrow > interest. So I consider the rare job announcements posted here ok. The > same for book announcem

Re: Moinmoin config

2005-08-19 Thread Mark
The missing link under /var/www/html was exactly the problem. Somehow missed this in the labyrinth of setup instructions. I have another question, and as of yet, have not found another discussion group for moinmoin, so sorry, but here goes: I have a table and would like the table borders to go a

Version of TAR in tarfile module? TAR 1.14 or 1.15 port to Windows?

2005-08-19 Thread Claudio Grondi
I need to unpack on a Windows 2000 machine some Wikipedia media .tar archives which are compressed with TAR 1.14 (support for long file names and maybe some other features) . It seems, that Pythons tarfile module is able to list far more files inside the archives than WinRAR or 7zip or TotalCommand

Re: How to get a unique id for bound methods?

2005-08-19 Thread Bengt Richter
On Fri, 19 Aug 2005 16:33:22 -0700, "Russell E. Owen" <[EMAIL PROTECTED]> wrote: [...] > >The current issue is associated with Tkinter. I'm trying to create a tk >callback function that calls a python "function" (any python callable >entity). > >To do that, I have to create a name for tk that is

wanna stop by my homemade glory hole?

2005-08-19 Thread Steph
my husband is installing an extra bathroom poolside. there is a perfect size hole (unless you have a huge cock) to stick your dick through into the adjoing room. come around the side of my house(perfect if you look like a repair man) enter into the unfisnished bathroom and I'll service you fro

Re: trying to check the creation date of a file

2005-08-19 Thread John Machin
David Fickbohm wrote: > People, > > I am trying to determine the creation date of files in a folder. > I am using the following code to find the folder and confirm that files > exist in the folder. Presumably you meant "intend to use the following pseudocode" (not "am using the following code")

Re: pickle.load not working?

2005-08-19 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > oh, well how do I make "derek" be an instance of 'chatuser' ? Spot the difference:: In [228]: class A: pass .228.: In [229]: a = A In [230]: repr(a) Out[230]: '' In [231]: b = A() In [232]: repr(b) Out[232]: '<__main__.A instance

Re: How to get a unique id for bound methods?

2005-08-19 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>, Benji York <[EMAIL PROTECTED]> wrote: >Russell E. Owen wrote: >> The id of two different methods of the same object seems to be the >> same, and it may not be stable either. > >Two facts you're (apparently) unaware of are conspiring against you: > >1) the "id" of

Karrigell tutorial published

2005-08-19 Thread Luis M. Gonzalez
Karrigell has new tutorial here: http://karrigell.sourceforge.net/en/tutorial.html For those who don't know what Karrigell is, I'd just say that it is the most pythonic, simple, fun, straightforward and full-featured web framework available today. Check it out! http://karrigell.sourceforge.net/

Re: global interpreter lock

2005-08-19 Thread Bryan Olson
Donn Cave wrote: > Bryan Olson wrote: >>On a uniprocessor system, the GIL is no problem. On multi- >>processor/core systems, it's a big loser. > > > I rather suspect it's a bigger winner there. > > Someone who needs to execute Python instructions in parallel > is out of luck, of course, b

Re: stdin -> stdout

2005-08-19 Thread John Machin
limodou wrote: > 2005/8/19, max(01)* <[EMAIL PROTECTED]>: > >>hi. >> >>i was wondering, what's the simplest way to echo the standard input to >>the standard output, with no modification. >> >>i came up with: >> >>... >>while True: >> try: >> raw_input() >> except EOFError: >> break >>.

Re: Newbie Question

2005-08-19 Thread John Machin
Tom Strickland wrote: > I have a file that contains many lines, each of which consists of a string > of comma-separated variables, mostly floats but some strings. Each line > looks like an obvious tuple to me. How do I save each line of this file as a > tuple rather than a string? Or, is that th

Re: How to get a unique id for bound methods?

2005-08-19 Thread Paolino
Russell E. Owen wrote: > The "hash" function looks promising -- it prints out consistent values > if I use it instead of "id" in the code above. Is it stable and unique? > The documentation talks about "objects" again, which given the behavior > of id makes me pretty nervous. > I dont know how

Re: Python jobs (was Re: Python for Webscripting (like PHP))

2005-08-19 Thread Terry Reedy
"Gregory Piñero" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I'd love Python work, just like everyone else here. On a related topic, >what's the >policy/etiquette of posting a resume on here, or mentioning >what kind of work >you're looking for? I would take absence of such p

Re: wanna stop by my homemade glory hole?

2005-08-19 Thread Stephen Kellett
>wanna stop by my homemade glory hole? I don't think anyone on this group will be interested in trying their Python with that. Take it somewhere else. -- Stephen Kellett Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html Computer Consultancy, Software Development Windows C++,

Re: while c = f.read(1)

2005-08-19 Thread John Machin
[EMAIL PROTECTED] wrote: > Alright, everyone seems to have gone off on a tangent here, so I'll try > to stick to your code... > """ > This is what I would ideally like: > > > f = open("blah.txt", "r") > while c = f.read(1): > # ... work on c > > > But I get a syntax error. > > >

Re: while c = f.read(1)

2005-08-19 Thread Bengt Richter
On Fri, 19 Aug 2005 16:31:47 +1000, John Machin <[EMAIL PROTECTED]> wrote: >Bengt Richter wrote: >> On 18 Aug 2005 22:21:53 -0700, "Greg McIntyre" <[EMAIL PROTECTED]> wrote: >> >> >>>I have a Python snippet: >>> >>> f = open("blah.txt", "r") >>> while True: >>> c = f.read(1) >>> if c ==

Re: Database of non standard library modules...

2005-08-19 Thread Nigel Rowe
Steve Holden wrote: > Robert Kern wrote: >> Jon Hewer wrote: >> >>>Is there an online database of non standard library modules for Python? >> >> >> http://cheeseshop.python.org/pypi >> > While cheeseshop might resonate with the Monty Python fans I have to say > I think the name sucks in terms

servers in python

2005-08-19 Thread Max
I am writing a Hashcash program in python. Rather than create an email client plugin, I have done this thru a proxy server which adds the Hashcash before forwarding. What I want to know is whether this is safe. I currently use this code: class HashcashServer (smtpd.PureProxy): def process_

Re: trying to check the creation date of a file

2005-08-19 Thread Larry Bates
use os.stat docs are here: http://docs.python.org/lib/module-stat.html Larry Bates David Fickbohm wrote: > People, > > I am trying to determine the creation date of files in a folder. > I am using the following code to find the folder and confirm that files > exist in the folder. If someone co

looking to GIVE my first oral favor

2005-08-19 Thread allie
im new to this, i guess you can say im still curious about having extra marital lovers. i've only had 1 encounter with a married man and I loved it so much. its such a strong burning desire now. when I look at men, i'm always wondering how they look nude, or their cock size. basically, i want

trying to check the creation date of a file

2005-08-19 Thread David Fickbohm
People, I am trying to determine the creation date of files in a folder. I am using the following code to find the folder and confirm that files exist in the folder. If someone could give me an idea how to check a creation date it would be appreciated. Thanks dave def delete_old_files (t:\dm\~

Re: Python jobs (was Re: Python for Webscripting (like PHP))

2005-08-19 Thread Aahz
In article <[EMAIL PROTECTED]>, Erik Max Francis <[EMAIL PROTECTED]> wrote: >Peter Decker wrote: >> >> Then start looking for telecommuting people. There are lots of us who >> can use work and have excellent telecommuting references, but who >> don't happen to live in a major metro area! > >And th

Re: How to get a unique id for bound methods?

2005-08-19 Thread Bengt Richter
On Fri, 19 Aug 2005 13:29:19 -0700, "Russell E. Owen" <[EMAIL PROTECTED]> wrote: >I have several situations in my code where I want a unique identifier >for a method of some object (I think this is called a bound method). I >want this id to be both unique to that method and also stable (so I can

Re: How to get a unique id for bound methods?

2005-08-19 Thread Benji York
Russell E. Owen wrote: > The id of two different methods of the same object seems to be the > same, and it may not be stable either. Two facts you're (apparently) unaware of are conspiring against you: 1) the "id" of an object is consistent for the lifetime of the object, but may be reused afte

wanna stop by my homemade glory hole?

2005-08-19 Thread Lacy
my husband is installing an extra bathroom poolside. there is a perfect size hole (unless you have a huge cock) to stick your dick through into the adjoing room. come around the side of my house(perfect if you look like a repair man) enter into the unfisnished bathroom and I'll service you fro

Re: while c = f.read(1)

2005-08-19 Thread Grant Edwards
On 2005-08-19, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Alright, everyone seems to have gone off on a tangent here, so I'll try > to stick to your code... > """ > This is what I would ideally like: > > > f = open("blah.txt", "r") > while c = f.read(1): > # ... work on c > > > But I

Re: Confused newbie needs help with "__init__() takes exactly 11 arguments (1 given)"

2005-08-19 Thread [EMAIL PROTECTED]
d'oh I'm an idiot... you are making a 'list' object. -- http://mail.python.org/mailman/listinfo/python-list

How to get a unique id for bound methods?

2005-08-19 Thread Russell E. Owen
I have several situations in my code where I want a unique identifier for a method of some object (I think this is called a bound method). I want this id to be both unique to that method and also stable (so I can regenerate it later if necessary). I thought the id function was the obvious choic

Re: while c = f.read(1)

2005-08-19 Thread [EMAIL PROTECTED]
Alright, everyone seems to have gone off on a tangent here, so I'll try to stick to your code... """ This is what I would ideally like: f = open("blah.txt", "r") while c = f.read(1): # ... work on c But I get a syntax error. while c = f.read(1): ^ SyntaxError: invalid

Re: Idempotent XML processing

2005-08-19 Thread Will McCutchen
> Read up on XML canonicalization (abrreviated as c14n). lxml implements > this, also xml.dom.ext.c14n in PyXML. You'll need to canonicalize on > both ends before hashing. I said normalization but I think canonicalization is the word I was looking for. I wasn't aware that lxml implented it (or th

Re: A script to run all of my project's pyunit tests

2005-08-19 Thread travislspencer
[EMAIL PROTECTED] wrote: > for file in glob(projHome + "/tests/*.py"): > start = file.rfind("/") + 1 > end = file.rfind(".") > moduleName = file[start:end] > module = __import__(moduleName) klass = module.__dict__[module.__name__] tests.append(unittest.makeSuite(klass,

Re: global interpreter lock

2005-08-19 Thread Gregory Piñero
Would a cheap solution just be to run two python interpreters and have the scripts communicating over COM or some other such thing?  I'd imagine that would give you true parallelism. -GregOn 8/19/05, Donn Cave <[EMAIL PROTECTED]> wrote: In article <[EMAIL PROTECTED] >, Bryan Olson <[EMAIL PROTECTE

Re: Confused newbie needs help with "__init__() takes exactly 11 arguments (1 given)"

2005-08-19 Thread [EMAIL PROTECTED]
it looks like your problem is in this line: reviews = [Review(*[field.strip() for field in row]) for row in reader] ouch! split that up a bit so we can understand what the heck you are trying to do here. Also, it appears the whole thing is in these [ ] ? why? -- http://mail.python.org/mailman/li

Re: python classes taught

2005-08-19 Thread Simon Percivall
Yeha, sure. The Royal Institute of Technology in Stockholm, Sweden teaches Python for some of its introductory programming and algorithm courses. -- http://mail.python.org/mailman/listinfo/python-list

Re: Idempotent XML processing

2005-08-19 Thread Michael Ekstrand
On Aug 19, 2005, at 1:20 PM, Robert Kern wrote: > Read up on XML canonicalization (abrreviated as c14n). lxml implements > this, also xml.dom.ext.c14n in PyXML. You'll need to canonicalize on > both ends before hashing. > > To paraphrase an Old Master, if you are running a cryptographic hash > over

A script to run all of my project's pyunit tests

2005-08-19 Thread travislspencer
Hey All, I am trying to write a script that runs all of my pyunit tests for me. Ideally, I would like to be able to drop a new module into my project's test subdirectory, and the testing script will pick it up automatically. At the moment, I have it working but it is kinda a kludge because every

[Jython-users] ANN: PyDev 0.9.7.99 released

2005-08-19 Thread Fabio Zadrozny
Hi All, PyDev - Python IDE (Python Development Enviroment for Eclipse) version 0.9.7.99 has just been released. Check the homepage (http://pydev.sourceforge.net/) for more details. Details for Release: 0.9.7.99 OK, what's with the strange release version number?... Well, this version undergo

ANN: PyDev 0.9.7.99 released

2005-08-19 Thread Fabio Zadrozny
Hi All, PyDev - Python IDE (Python Development Enviroment for Eclipse) version 0.9.7.99 has just been released. Check the homepage (http://pydev.sourceforge.net/) for more details. Details for Release: 0.9.7.99 OK, what's with the strange release version number?... Well, this version undergo

Re: Idempotent XML processing

2005-08-19 Thread Michael Ekstrand
On Aug 19, 2005, at 12:11 PM, Will McCutchen wrote: >> In my current project, I am working with XML data in a protocol that >> has >> checksum/signature verification of a portion of the document. >> ... >> the server sends me XML with empty elements as full open/close tags, >> but toxml() serializ

Python 2.1 Bible Source

2005-08-19 Thread SuppressedPen
Hi Everyone! Just started with Python 2 weeks ago and I can't put it down it's to easy and to powerful, I'm sure the goons will be after us for having it soon, Hi Hi. Was wondering if anyone might know where I can find the source code for PYTHON 2.1 BIBLE book. Apparently it was online until the

Re: BeautifulSoup

2005-08-19 Thread Paul McGuire
Here's a pyparsing program that reads my personal web page, and spits out HTML with all of the HREF's reversed. -- Paul (Download pyparsing at http://pyparsing.sourceforge.net.) from pyparsing import Literal, quotedString import urllib LT = Literal("<") GT = Literal(">") EQUALS = Literal("=")

python classes taught

2005-08-19 Thread araki
anyone know of any college/school that is teaching the python language? -- http://mail.python.org/mailman/listinfo/python-list

Re: BeautifulSoup

2005-08-19 Thread Paul McGuire
Steve - Is there a chance you could post a before and after example, so we can see just what you are trying to do instead of talking conceptually all around it and making us guess? If you are just doing some spot translations of specific values in an HTML file, you can probably get away with a si

Re: Idempotent XML processing

2005-08-19 Thread Robert Kern
Michael Ekstrand wrote: > Hello all, > > In my current project, I am working with XML data in a protocol that has > checksum/signature verification of a portion of the document. There is > an envelope with a header element, containing signature data; following > the header is a body. The signatu

Re: Python for Webscripting (like PHP)

2005-08-19 Thread Jeff Reavis
You might want to check out spyce. It uses a server page model (like jsp and php) so you can embed python in html. It has the standard stuff you would need for making a web site (session support, etc) and also contains features like custom tags. http://spyce.sourceforge.net/ -- http://mail.pytho

Re: global interpreter lock

2005-08-19 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Bryan Olson <[EMAIL PROTECTED]> wrote: > km wrote: > > Hi all, > > > > is true parallelism possible in python ? or atleast in the > > coming versions ? is global interpreter lock a bane in this > > context ? > > No; maybe; and currently, not usually. > > On

Re: __del__ pattern?

2005-08-19 Thread BranoZ
Bryan Olson wrote: > > Use file that is writeable by A and B in a directory that is > > writeable only by root. > > Is that portable? I have the feeling that you are asking if it works on Windows. No idea! I have only user experience with Windows. On UNIX it is as portable as 'flock', which mea

Re: Idempotent XML processing

2005-08-19 Thread Will McCutchen
> In my current project, I am working with XML data in a protocol that has > checksum/signature verification of a portion of the document. > ... > the server sends me XML with empty elements as full open/close tags, > but toxml() serializes them to the XML empty element (), so > the checksum winds

Re: while c = f.read(1)

2005-08-19 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Antoon Pardon <[EMAIL PROTECTED]> wrote: ... > But '', {}, [] and () are not nothing. They are empty containers. Oh come on, "empty" is all about nothing. > And 0 is not nothing either it is a number. Suppose I have > a variable that is either None if I'm not regi

sequence slicing documentation

2005-08-19 Thread Steven Bethard
In trying to work out what's different between the start, stop and step of slice.indices() and the start, stop and step of sequence slicing[1] I found that some of the list slicing documentation[2] is vague. I'd like to submit a documentation fix, but I want to make sure I have it right. Her

Re: Traceback Questions

2005-08-19 Thread Fernando Perez
ncf wrote: > I'm just beginning with tracebacks, building off of what I see in > asyncore's compact_traceback code, in order to hopefully store all the > values from the location in which the exception occured. > > I'm actually trying to make this into a python bug report system for my > current

Re: __del__ pattern?

2005-08-19 Thread Bryan Olson
BranoZ wrote: > [EMAIL PROTECTED] wrote: > >>For a reasonably portable solution, leave the lock file open. >>On most systems, you cannot delete an open file,.. > > On most UNIXes, you can delete an open file. > Even flock-ed. This is BTW also an hack around flock. Yes, sorry; my bad. > Us

Idempotent XML processing

2005-08-19 Thread Michael Ekstrand
Hello all, In my current project, I am working with XML data in a protocol that has checksum/signature verification of a portion of the document. There is an envelope with a header element, containing signature data; following the header is a body. The signatures are computed as cryptographic c

Re: stdin -> stdout

2005-08-19 Thread Steven Bethard
gry@ll.mit.edu wrote: > import sys > for l in sys.stdin: > sys.stdout.write(l) This is fine if you don't need the reads and writes of lines to run in lockstep. File iterators read into a buffer, so you'll probably read 4096 bytes from stdin before you ever write a line to stdout. If th

Re: certificate-based authentication (Martin v. Löwis)

2005-08-19 Thread Dennis . Hoffman
> The standard xmlrpclib should work fine. You need to inherit from the > SafeTransport class, overriding get_host_info to return the x509_info. > You then pass an instance of your transport to the ServerProxy. Ok - I have upgraded to the newer version of xmlrpclib that has the 'get_host_info' me

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

2005-08-19 Thread Steven Bethard
max(01)* wrote: > i was wondering, what's the simplest way to echo the standard input to > the standard output, with no modification. import sys for line in iter(sys.stdin.readline, ''): sys.stdout.write(line) Note that this uses the second form of iter(), which calls its first argument re

Re: Python for Webscripting (like PHP)

2005-08-19 Thread Florian Lindner
Florian Lindner wrote: > Hello, > I've been using Python a lot for scripting (mainly scripts for server > administration / DB access). All these scripts were shell based. > > Now I'm considering using Python (with mod_python on Apache 2) for a web > project, just how I've used PHP in some smaller

Re: while c = f.read(1)

2005-08-19 Thread Steven Bethard
Antoon Pardon wrote: > But '', {}, [] and () are not nothing. They are empty containers. > And 0 is not nothing either it is a number. Suppose I have > a variable that is either None if I'm not registered and a > registration number if I am. In this case 0 should be treated > as any other number.

Re: stdin -> stdout

2005-08-19 Thread gry
import sys for l in sys.stdin: sys.stdout.write(l) -- George -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Question

2005-08-19 Thread gry
Yes, "eval" of data from a file is rather risky. Suppose someone gave you a file containing somewhere in the middle: ... 22,44,66,88,"asd,asd","23,43,55" os.system('rm -rf *') 33,47,66,88,"bsd,bsd","23,99,88" ... This would delete all the files in your directory! The csv module mentioned above i

Re: Newbie Question

2005-08-19 Thread Sion Arrowsmith
Tom Strickland <[EMAIL PROTECTED]> wrote: >I have a file that contains many lines, each of which consists of a string >of comma-separated variables, mostly floats but some strings. Each line >looks like an obvious tuple to me. How do I save each line of this file as a >tuple rather than a string

Re: stdin -> stdout

2005-08-19 Thread Dan Sommers
On Fri, 19 Aug 2005 15:26:27 GMT, "max(01)*" <[EMAIL PROTECTED]> wrote: > ps: in perl you ca do this: > ... > while ($line = ) >{ > print STDOUT ("$line"); >} > ... import fileinput import sys for line in fileinput.input(): sys.stdout.write(line) Regards, Dan -- Dan Sommers

BeautifulSoup

2005-08-19 Thread Steve Young
I tried using BeautifulSoup to make changes to the url links on html pages, but when the page was displayed, it was garbled up and didn't look right (even when I didn't actually change anything on the page yet). I ran these steps in python to see what was up: >>from BeautifulSoup import BeautifulS

Re: Newbie Question

2005-08-19 Thread BranoZ
[EMAIL PROTECTED] wrote: > >>> x = '22,44,66,88,"asd,asd","23,43,55"' > >>> y = eval(x) > >>> y > (22, 44, 66, 88, 'asd,asd', '23,43,55') > > And now, a question for the experts. I'm no expert, just experienced. > Does anyone have a pointer as to why my code might be > dangerous? Well, the small

Re: global interpreter lock

2005-08-19 Thread Bryan Olson
km wrote: > Hi all, > > is true parallelism possible in python ? or atleast in the > coming versions ? is global interpreter lock a bane in this > context ? No; maybe; and currently, not usually. On a uniprocessor system, the GIL is no problem. On multi- processor/core systems, it's a big lo

Re: stdin -> stdout

2005-08-19 Thread limodou
2005/8/19, max(01)* <[EMAIL PROTECTED]>: > hi. > > i was wondering, what's the simplest way to echo the standard input to > the standard output, with no modification. > > i came up with: > > ... > while True: >try: > raw_input() >except EOFError: > break > ... > > but i guess

stdin -> stdout

2005-08-19 Thread max(01)*
hi. i was wondering, what's the simplest way to echo the standard input to the standard output, with no modification. i came up with: ... while True: try: raw_input() except EOFError: break ... but i guess there must be a simpler way. using bash i simply do 'cat', *sigh*! bye

Re: global interpreter lock

2005-08-19 Thread Gregory Piñero
KM, I eagerly await the answer to this question as well.  I'd love to see this explained in laymen's terms.  From what I understand of this issue, your best bet for getting parrelism is to use whatever the OS provides and just have multiple python instances running... but then I didn't understan

Re: Python jobs (was Re: Python for Webscripting (like PHP))

2005-08-19 Thread Gregory Piñero
I'd love Python work, just like everyone else here.  On a related topic, what's the policy/etiquette of posting a resume on here, or mentioning what kind of work you're looking for?  And what's the policy in general for most newsgroups and mailing lists? -Greg On 8/19/05, Steve Holden <[EMAIL PROT

Re: Save Binary data.

2005-08-19 Thread Benjamin Niemann
GMane Python wrote: > Hello All. > I have a program that downloads 'gigabytes' of Axis NetCam photos per > day. > Right now, I set up the process to put the images into a queue, and every > 30 > or so seconds, 'pop' them from the queue and save them to disc. I save > them as individual files

Re: Netware Python?

2005-08-19 Thread Larry Bates
I'm not really up on Netware, but I believe that Netware's Open Enterprise Server is based on Suse Linux as the underlying OS, so Python should run there just fine. Google turned up the following that you might want to review: http://www.python.org/workshops/2000-01/proceedings/papers/clements/cl

Re: Save Binary data.

2005-08-19 Thread Larry Bates
Images are binary data, don't do anything to them just save them to files on disk in their binary format. The extra processing of pickling them isn't going to help. Directories with large numbers of files was a problem in FAT16 and FAT32 filesystems but not really a problem in NTFS or Linux (at l

RE: Newbie Question

2005-08-19 Thread Michael . Coll-Barth
Tom, Well, as one newbie to another, I tried this; >>> x = '22,44,66,88,"asd,asd","23,43,55"' >>> y = eval(x) >>> y (22, 44, 66, 88, 'asd,asd', '23,43,55') given that x some how comes from a single line in your file. BTW, do you get the tutor list as well? My guess is that the 'experts' over h

Re: Newbie Question

2005-08-19 Thread Gabriel Cooper
look into the csv module. (for comma-separated-value text files.) Tom Strickland wrote: >I have a file that contains many lines, each of which consists of a string >of comma-separated variables, mostly floats but some strings. Each line >looks like an obvious tuple to me. How do I save each lin

Re: Implementing class methods in C

2005-08-19 Thread nmichaud
> If you implement _test in C, works none of the above. > The only difference I can see is that: > type(_test.func2) > > is for Python implemented function and > type(_test.func2) > > for C implementation > I would really like to know the answer too. > How do you implement some methods in C w

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

2005-08-19 Thread Cameron Laird
QOTW: "It seems to me that Java is designed to make it difficult for programmers to write bad code, while Python is designed to make it easy to write good code." -- Magnus Lycka "Code attracts people that like to code. Tedious, repetitive c.l.py threads attract people that like to write tedious,

RE: Adobe COM with Python

2005-08-19 Thread Tim Golden
[Andy W] | I wanting to print the PDF to a printer which is set to print | to file, | so efectively i end up with a ps file. | | so 1 pdf becomes 1 ps file It't not quite clear to me what you *want* to do as opposed to what actually happens when you try. If I understand, you have a PDF file, an

Re: python html

2005-08-19 Thread Fuzzyman
I do exactly that in my Python CGI proxy (approx). I wrote a very simple parser called scraper.py that makes it easy. It won't choke on bad html either. http://www.voidspace.org.uk/python/recipes.shtml All the best, Fuzzyman http://www.voidspace.org.uk/python -- http://mail.python.org/mailman

Re: global interpreter lock

2005-08-19 Thread Grant Edwards
On 2005-08-20, km <[EMAIL PROTECTED]> wrote: > is true parallelism possible in python? No, not for some values of "true parallelism". > or atleast in the coming versions? Not that I'm aware of. > is global interpreter lock a bane in this context? In what context? -- Grant Edwards

Re: Adobe COM with Python

2005-08-19 Thread Andy W
I wanting to print the PDF to a printer which is set to print to file, so efectively i end up with a ps file. so 1 pdf becomes 1 ps file Tim Golden wrote: > [Andy W] > > | What i want to do is use, python COM to fireup Adobe and > | print the pdf > | file to a printer. > > If that's all you

Re: GIS Related Scripting Issue

2005-08-19 Thread Dan Patterson
you might want to try http://forums.esri.com/forums.asp?c=93 and post in the geoprocessing section with code details "Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Mike Rose wrote: > >> I am currently using ArcGIS 9.1 and was referred to this list to ask my >> questi

Re: Module Name Conflicts

2005-08-19 Thread Rocco Moretti
[EMAIL PROTECTED] wrote: > I have a java program in a package called 'cmd'. This of course > conflicts with the builtin python package of the same name. The thing > is, I need to be able to import from both of these packages in the same > script. I can import either one first, but any future attemp

Re: Database of non standard library modules...

2005-08-19 Thread Jeff Schwab
Steve Holden wrote: > Robert Kern wrote: > >> Jon Hewer wrote: >> >>> Is there an online database of non standard library modules for Python? >> >> >> >> http://cheeseshop.python.org/pypi >> > While cheeseshop might resonate with the Monty Python fans I have to say > I think the name sucks in ter

RE: Adobe COM with Python

2005-08-19 Thread Tim Golden
[Andy W] | What i want to do is use, python COM to fireup Adobe and | print the pdf | file to a printer. If that's all you want to do, have a look at this: http://timgolden.me.uk/python/win32_how_do_i/print.html Or you could try for a Ghostscript solution. (Additionally, I seem to remember t

Newbie Question

2005-08-19 Thread Tom Strickland
I have a file that contains many lines, each of which consists of a string of comma-separated variables, mostly floats but some strings. Each line looks like an obvious tuple to me. How do I save each line of this file as a tuple rather than a string? Or, is that the right way to go? Thank you.

Re: Adobe COM with Python

2005-08-19 Thread Andy W
What i want to do is use, python COM to fireup Adobe and print the pdf file to a printer. import win32com.client import pythoncom pythoncom.CoInitializeEx(pythoncom.COINIT_APARTMENTTHREADED) acro = win32com.client.DispatchEx('PDF.PdfCtrl.1') The above does not work, Do i need to install the SD

  1   2   >