Re: web crawler in python or C?

2006-02-15 Thread abhinav
It is DSL broadband 128kbps.But thats not the point.What i am saying is that would python be fine for implementing fast crawler algorithms or should i use C.Handling huge data,multithreading,file handling,heuristics for ranking,and maintaining huge data structures.What should be the language so as

Re: Databases and python

2006-02-15 Thread Jonathan Gardner
I'm no expert in BDBs, but I have spent a fair amount of time working with PostgreSQL and Oracle. It sounds like you need to put some optimization into your algorithm and data representation. I would do pretty much like you are doing, except I would only have the following relations: - word to wo

How to call a mothod in a class by the method name string and the instance?

2006-02-15 Thread yy x
hi, all:   for example, the following class: class test:    def funca(self):    print  "in funca"     def funcb(self):    print  "in funcb" t = test() t.funca()       In the plain way,  i will excute the funca by the code "t.funca() ", but if i wanna to excute the funca by "t" and string "f

Re: How to run shell commands within python

2006-02-15 Thread fileexit
thanks... i was to hasty to post this question, i found a good answer here: http://groups.google.com/group/comp.lang.python/browse_thread/thread/ffdab847125f81b6 -- http://mail.python.org/mailman/listinfo/python-list

Re: How to run shell commands within python

2006-02-15 Thread limodou
On 15 Feb 2006 23:21:09 -0800, fileexit <[EMAIL PROTECTED]> wrote: > How can I execute shell commands from within python. Specifically, I > am looking for something like the shell "cat". But this also made me > wonder how to execute shell commands anyway, just if i needed to do > that in the futu

Re: web crawler in python or C?

2006-02-15 Thread Paul Rubin
"abhinav" <[EMAIL PROTECTED]> writes: > The crawler which will be working on huge set of pages should be > as fast as possible. What kind of network connection do you have, that's fast enough that even a fairly cpu-inefficient crawler won't saturate it? -- http://mail.python.org/mailman/listinfo/

Re: Xah's Edu Corner: accountability & lying thru the teeth

2006-02-15 Thread IchBin
Claudio Grondi wrote: > Anno Siegel wrote: >> Xah Lee <[EMAIL PROTECTED]> wrote in comp.lang.perl.misc: >> >> >>> ...a mechanism, so that any fuckhead tech geekers with their >>> loud cries will hurt badly when they open their mouths in public... > In this above I hear the voice of someone badly di

Re: any ftpd written in python?

2006-02-15 Thread Paul Rubin
Kenneth Xie <[EMAIL PROTECTED]> writes: > I need a simple ftpd example in pure python. Is there already such a > ftpd available? www.twistedmatrix.com -- http://mail.python.org/mailman/listinfo/python-list

any ftpd written in python?

2006-02-15 Thread Kenneth Xie
I need a simple ftpd example in pure python. Is there already such a ftpd available? Thank you very much in advance. -- http://mail.python.org/mailman/listinfo/python-list

web crawler in python or C?

2006-02-15 Thread abhinav
Hi guys.I have to implement a topical crawler as a part of my project.What language should i implement C or Python?Python though has fast development cycle but my concern is speed also.I want to strke a balance between development speed and crawler speed.Since Python is an interpreted language it i

Re: Safe Python Execution

2006-02-15 Thread Paul Rubin
"Graham" <[EMAIL PROTECTED]> writes: > I've been messing around with trying to get a small sandbox like > environment where i could execute python code in a "safe" way. > Basically what the old restricted execution module attempted to do. The old rexec module was removed for the precise reason tha

Re: mapping functions and lambda

2006-02-15 Thread Steve Holden
Suresh Jeevanandam wrote: > I got it: > dict([k.split('=') for k in s.split(',')]) > > Suresh Jeevanandam wrote: > >>Given a string >>s = 'a=1,b=2' >> >>I want to create a dictionary {'a': '1', 'b': '2'} >> >>I did, >> >>dict(map(lambda k: k.split('='), s.split(','))) >> >>Is it possible to get r

Re: mapping functions and lambda

2006-02-15 Thread Suresh Jeevanandam
I got it: dict([k.split('=') for k in s.split(',')]) regards, Suresh Suresh Jeevanandam wrote: > Given a string > s = 'a=1,b=2' > > I want to create a dictionary {'a': '1', 'b': '2'} > > I did, > > dict(map(lambda k: k.split('='), s.split(','))) > > Is it possible to get rid of the lambda here

mapping functions and lambda

2006-02-15 Thread Suresh Jeevanandam
Given a string s = 'a=1,b=2' I want to create a dictionary {'a': '1', 'b': '2'} I did, dict(map(lambda k: k.split('='), s.split(','))) Is it possible to get rid of the lambda here, without having to define another function just for this. Is this the easiest/straight-forward way to do this? r

RE: Which is faster? (if not b in m) or (if m.count(b) > 0)

2006-02-15 Thread Delaney, Timothy (Tim)
Two additional things beyond the important lesson to always time things: 1. Be careful with operator precedence. In this case, people got lucky: not b in m has the precedence: not (b in m) 2. Python has a "not in" operator: b not in m which is the clearest and fastest way to test

Re: Is empty string cached?

2006-02-15 Thread Steve Holden
Farshid Lashkari wrote: >>I really don't understand why it's so important: it's not a part of the >>language definition at all, and therefore whatever behavior you see is >>simply an artifact of the implementation you observe. > > > I guess I should rephrase my question in the form of an exampl

Re: Safe Python Execution

2006-02-15 Thread Steven Bethard
Graham wrote: > The way i'm controlling functionality is with some games and exec, so > if 'code' was the text code you wanted to execute i run: > > exec code in {'__builtins__':None"} > > obviously this doesn't give you much to play with, but it does remove > file access and importing as far as

Re: Safe Python Execution

2006-02-15 Thread Devan L
Graham wrote: > I've been messing around with trying to get a small sandbox like > environment where i could execute python code in a "safe" way. > Basically what the old restricted execution module attempted to do. > I've written a small amount of code to get custom interpreter running, > but i'm

Re: Is empty string cached?

2006-02-15 Thread Farshid Lashkari
> It just boils down to either a LOAD_CONST vs. a LOAD_NAME - either way > the string isn't duplicated. Great, that's exactly what I wanted to know. Thanks Steve! -Farshid -- http://mail.python.org/mailman/listinfo/python-list

Re: Which is faster? (if not b in m) or (if m.count(b) > 0)

2006-02-15 Thread Steve Holden
Steven D'Aprano wrote: [...] (On the other hand, lousy testing is practically worthless.) +1 QOTW -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/ -- http://mail.python.org/mailman/l

Weekly Python Patch/Bug Summary

2006-02-15 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 399 open ( +8) / 3042 closed ( +4) / 3441 total (+12) Bugs: 923 open ( +8) / 5553 closed (+13) / 6476 total (+21) RFE : 209 open ( +0) / 198 closed ( +1) / 407 total ( +1) New / Reopened Patches __ urllib pr

Re: urllib, caching

2006-02-15 Thread Steve Holden
AndrewJ wrote: > I've got code: > > f= urllib.urlopen("http://www.stuff/nb5.php";) ; > > This connects to a page that changes in real time. Works ok, and > retrieves the data the first time. > > But then any subsequent calls all return the same data, even though the > web page itself has change

Re: Is empty string cached?

2006-02-15 Thread Farshid Lashkari
> I really don't understand why it's so important: it's not a part of the > language definition at all, and therefore whatever behavior you see is > simply an artifact of the implementation you observe. I guess I should rephrase my question in the form of an example. Should I assume that a new

Re: Soduku

2006-02-15 Thread Jack Diederich
On Wed, Feb 15, 2006 at 06:56:56PM -0800, Raymond Hettinger wrote: > [Jack Diederich] > > Is my math off or does 27ms mean 0.027 seconds? On my laptop (1.3GHz) > > an empty python program takes 10ms to run (0.010 secs). I ask out of > > vanity, my own solver takes .15 seconds to run (20 seconds fo

Re: Is empty string cached?

2006-02-15 Thread Steve Holden
Farshid Lashkari wrote: >>It takes far too little evidence to induce belief: >> >> >>> a = "hello" >> >>> b = "h"+"ello" >> >>> a is b >>False >> >>> c = "hello" >> >>> b is a >>False >> >>> > > > I don't understand the point of your last expression. Were you intending > this instead: > > >>>

Re: Is empty string cached?

2006-02-15 Thread Farshid Lashkari
> It takes far too little evidence to induce belief: > > >>> a = "hello" > >>> b = "h"+"ello" > >>> a is b > False > >>> c = "hello" > >>> b is a > False > >>> I don't understand the point of your last expression. Were you intending this instead: >>> c is a True However, the following c

Re: Xah's Edu Corner: accountability & lying thru the teeth

2006-02-15 Thread Claudio Grondi
Anno Siegel wrote: > Xah Lee <[EMAIL PROTECTED]> wrote in comp.lang.perl.misc: > > >>...a mechanism, so that any fuckhead tech geekers with their >>loud cries will hurt badly when they open their mouths in public... In this above I hear the voice of someone badly disappointed seeking an apology

Safe Python Execution

2006-02-15 Thread Graham
I've been messing around with trying to get a small sandbox like environment where i could execute python code in a "safe" way. Basically what the old restricted execution module attempted to do. I've written a small amount of code to get custom interpreter running, but i'm not really sure if its s

Re: Soduku

2006-02-15 Thread Raymond Hettinger
[Jack Diederich] > Is my math off or does 27ms mean 0.027 seconds? On my laptop (1.3GHz) > an empty python program takes 10ms to run (0.010 secs). I ask out of > vanity, my own solver takes .15 seconds to run (20 seconds for a 16x16 grid). Comparisons for individual puzzles are likely to be meani

Re: Win32_Process.Create -- not starting process

2006-02-15 Thread Matt
"abcd" <[EMAIL PROTECTED]> wrote: >.however the python script that is called from the batch script One thing I have learned about launching programs from batch files like this is that if the launched program tries to prompt the user for imput at the command line, everthing goes haywire sinc

Re: Which is faster? (if not b in m) or (if m.count(b) > 0)

2006-02-15 Thread Steven D'Aprano
Georg Brandl wrote: > Steven D'Aprano wrote: > >>On Wed, 15 Feb 2006 08:44:10 +0100, Marc 'BlackJack' Rintsch wrote: >> >> >>>In <[EMAIL PROTECTED]>, Farel wrote: >>> >>> Which is Faster in Python and Why? >>> >>>``if not b in m`` looks at each element of `m` until it finds `b` in it >>>and s

Re: Mac OS X - Deployment

2006-02-15 Thread Matt
James Stroud <[EMAIL PROTECTED]> wrote: >py2app works for this. I'm not sure if it works from windows. That's what I need, Thanks, Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Is empty string cached?

2006-02-15 Thread Steve Holden
Farshid Lashkari wrote: > When I pass an empty string to a function is a new string object created > or does python use some global pre-created object? I know python does > this with integer objects under a certain value. For instance, in the > following code is a new string object created for e

Re: %SystemDrive%

2006-02-15 Thread Bryan Olson
rtilley wrote: > Carsten Haese wrote: > >> Is there a reason why os.environ['SYSTEMDRIVE'] shouldn't work? > > I didn't know it was in os! It returns C: instead of C:\ like my method. > Other than that, it seems to do the trick. To get it with the \, you might use: os.path.abspath(os.envi

Re: how do you pronounce 'tuple'?

2006-02-15 Thread Steve Holden
Paddy wrote: > So thats were its from. > My Parents used to quote it to me when I were a 'wee lad', > So they read Burns > Maybe, it's fairly well known. But I rendered it incorrectly, the actual quote is "Mony a mickle maks a muckle" me-and-my-fingers-ly y'rs - steve -- Steve Holde

Re: is socket thread safe?

2006-02-15 Thread Bryan Olson
Carl J. Van Arsdall wrote: > Steve Horsley wrote: > >> [EMAIL PROTECTED] wrote: >> >> >>> thread1: >>> while 1: >>> buf = s.read() >>> process(buf) >>> >>> thread2: >>> while 1: >>> buf = getdata() >>> s.write(buf) >> >> >> It is safe, but watch out fo

HTTP & tcl

2006-02-15 Thread alf
Hi I would like to convert the wctpXml-1.3.py program to Tcl (line by line). See http://sourceforge.net/project/showfiles.php?group_id=29217 This program sends pages using WCTP. I know nothing about Python or XML but this program is small and seems straightforward and I am sure that I will be abl

Re: Poisson Distribution (for a newbie)

2006-02-15 Thread Duncan Smith
[EMAIL PROTECTED] wrote: > I am simulating an event where users come into the pool randomly > starting at time T=0, i.e. For Example, 2 users came at T= 0 into the > the pool, 3 users came at T= 1 into the the pool, 5 users came at T=2 > ,..,54 users came at T=45 etc. As cumulative number o

Re: apache mod_python problem

2006-02-15 Thread grahamd
Ido Yehieli wrote: > Thank you for your response, > but I think it's not it - that didn't make any difference. Suggest you read: http://www.dscpl.com.au/articles/modpython-001.html It contains helpful hints for getting a basic handler working in mod_python. If you can get that working, then t

Re: how to get function names from the file

2006-02-15 Thread Larry Bates
Petr Jakes wrote: > I have got names of functions stored in the file. For the simplicity > expect one row only with two function names: printFoo, printFOO > In my code I would like to define functions and then to read function > names from the file, so the functions can be executed in the order the

Re: multiple inheritance

2006-02-15 Thread Jan Niklas Fingerle
Sébastien Boisgérault <[EMAIL PROTECTED]> wrote: > and search for the "cooperative methods and super" section > in http://www.python.org/2.2/descrintro.html ..., then read http://fuhm.org/super-harmful/ (not the evangelism, just the examples) and http://mail.python.org/pipermail/python-dev/2005-J

urllib, caching

2006-02-15 Thread AndrewJ
I've got code: f= urllib.urlopen("http://www.stuff/nb5.php";) ; This connects to a page that changes in real time. Works ok, and retrieves the data the first time. But then any subsequent calls all return the same data, even though the web page itself has changed. Is there caching going on her

Re: how to write a C-style for loop?

2006-02-15 Thread bearophileHUGS
Steven D'Aprano>That's a completely different question, so of course it has a completely different answer. Here is one way:< Other versions without the creation of a list: for i in (2**n for n in xrange(6)): do_something(i) for i in (1

Re: How to import a module with spaces in the name

2006-02-15 Thread Gregory Piñero
Thanks, that did work! On 2/15/06, Farshid Lashkari <[EMAIL PROTECTED]> wrote: > Gregory Piñero wrote: > > Let's say I have a module named "Excellent Module.py" > > ExcellentModule = __import__('Excellent Module') > > -Farshid > -- > http://mail.python.org/mailman/listinfo/python-list > -- Greg

Re: Question about xmlrpc and threading

2006-02-15 Thread David Hirschfield
I definitely didn't make it clear enought what I was talking about. I know all about the thread issues as far as namespaces go and that sort of thing. Let me try and be clearer: Forget how my xmlrpc server is implemented, it doesn't matter for this question. Just imagine it works and will proce

multi/double dispatch, multifunctions once again

2006-02-15 Thread AndyL
Hi, Where I can find a module supporting that? A. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to cat None

2006-02-15 Thread LittlePython
Thx , I will give this a try. <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Seems that what you want to do is to create a string in the form of : > > "55Init=Init\n55First=first\n55Last=Last\n55Alias=None" > > for each dictionary. If that is the case, may be you can try this : > >

[OT] Separation of Functionality in C (was: Re: how to write a C-style for loop?)

2006-02-15 Thread Dan Sommers
On 15 Feb 2006 12:48:11 GMT, Duncan Booth <[EMAIL PROTECTED]> wrote: > Putting the question the other way round: how would you move the > control logic out of the loop in C? I have written many functions not unlike this one (untested): void for_each_record( void (*callback)( RECORD * ), void

Re: is socket thread safe?

2006-02-15 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Bryan Olson <[EMAIL PROTECTED]> wrote: > Is it safe for one thread to receive from a socket while > another sends over the socket? Yes, that much is safe and > perfectly reasonable. I hear it works on most common platforms these days, anyway. I have seen socket i

Re: Scientific Computing with NumPy

2006-02-15 Thread Robert Kern
Tariq wrote: > Has anyone been able to successfully install numpy 0.9.4 on python 2.4 > under cygwin? > > I'm getting a few errors, especially while it installs the C source. I don't know of anyone compiling numpy under cygwin, but we will be happy to help you on [EMAIL PROTECTED] if you will giv

Re: is socket thread safe?

2006-02-15 Thread Jean-Paul Calderone
On Wed, 15 Feb 2006 12:59:03 -0800, "Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote: >Steve Horsley wrote: >> [EMAIL PROTECTED] wrote: >> >>> thread1: >>> while 1: >>> buf = s.read() >>> process(buf) >>> >>> thread2: >>> while 1: >>> buf = getdata() >>> s.wr

Encryption

2006-02-15 Thread dirvine
HI hope you can help (know you can). I am looking for a very strong AIS or better symetrical encryption in python. Any suggestions ideas welcome. I have spent a lot of time looking everywhere at pycrypto and many others but is a wee bit of a minefield out there. Anyone have any experience of a tru

Re: Scientific Computing with NumPy

2006-02-15 Thread Tariq
Has anyone been able to successfully install numpy 0.9.4 on python 2.4 under cygwin? I'm getting a few errors, especially while it installs the C source. -- Tariq -- http://mail.python.org/mailman/listinfo/python-list

Re: Encryption application/NEED A HACKER TO TRY IT

2006-02-15 Thread Evan Monroig
On Feb.15 18h18, atanas Cosmas Nkelame wrote : > I got an idea to write a python application which ciphers and > enciphers informationation (converting it to a format which only the > person who changed it understands as he is the only one who has the > program to decode the information). Hi,

Re: by reference

2006-02-15 Thread dirvine
Many thanks Martin You right - possible and ugly. Looks like I will doing a from __future__ as it looks better and perhaps this ugly method may be depreciated. Thanks again for your help David Martin P. Hellwig wrote: > dirvine wrote: > > Yes I did > > > > I was trying to do something like (pseu

Re: Attached images by plain email.

2006-02-15 Thread Gaz
You are the man! -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about xmlrpc and threading

2006-02-15 Thread Martin P. Hellwig
David Hirschfield wrote: > An xmlrpc client/server app I'm writing used to be super-simple, but now > threading has gotten into the mix. > > On the server side, threads are used to process requests from a queue as > they come in. > On the client side, threads are used to wait on the results of r

Re: is socket thread safe?

2006-02-15 Thread Bryan Olson
[EMAIL PROTECTED] wrote: > thread1: > while 1: > buf = s.read() > process(buf) > > thread2: > while 1: > buf = getdata() > s.write(buf) Sockets don't have read() and write() methods. Connected sockets have recv() and send()/sendall(). Python's socket module

Re: Pythonic gui format?

2006-02-15 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, DH wrote: >> And what about true vs True and false vs False ?-) > > The syntax is the same, except for, as I said, JSON's multiline comments. > The semantics do differ, but that has nothing to do with the user's > question, about an alternative to XML for data representati

Re: apache mod_python problem

2006-02-15 Thread Ido Yehieli
Thank you for your response, but I think it's not it - that didn't make any difference. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get function names from the file

2006-02-15 Thread Terry Reedy
"Petr Jakes" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I have got names of functions stored in the file. For the simplicity > expect one row only with two function names: printFoo, printFOO > In my code I would like to define functions and then to read function > names from the

Re: apache mod_python problem

2006-02-15 Thread Dennis Benzinger
Ido Yehieli schrieb: > [...] > Anyone has any idea as to what went wrong? > [...] If you compiled mod_python as a Dynamic Shared Object (DSO) you have to tell Apache to load that module. For example like this: LoadModule python_module libexec/mod_python.so See the mod_python documentation, espe

Re: Is empty string cached?

2006-02-15 Thread Bryan Olson
Farshid Lashkari wrote: > When I pass an empty string to a function is a new string object created > or does python use some global pre-created object? I know python does > this with integer objects under a certain value. For instance, in the > following code is a new string object created for e

Re: how to get function names from the file

2006-02-15 Thread Kamilche
The following will return a dictionary containing the names and functions of all the public functions in the current module. If a function starts with an underscore _, it is considered private and not listed. def _ListFunctions(): import sys import types d = {} module = sys.modules

Re: Unable to get PIL to load jpeg images

2006-02-15 Thread gr
Found it...and will share. You need to install the "X Software Developement" library (standard only is enough) from you Fedora distro...not sure what will be required on other Linux distro's. Worked like a charm...thanks Peter. gerry rodman http://www.gerryrodman.com/ -- http://mail.python.org

Re: how to get function names from the file

2006-02-15 Thread Kent Johnson
Petr Jakes wrote: > I have got names of functions stored in the file. For the simplicity > expect one row only with two function names: printFoo, printFOO > In my code I would like to define functions and then to read function > names from the file, so the functions can be executed in the order the

Re: Attached images by plain email.

2006-02-15 Thread luis . armendariz
Hi Gaz, Perhaps this will help? http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52243 -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple inheritance

2006-02-15 Thread luis . armendariz
Hi Thomas, When an object is created, the __init__ function will be called. Since you didn't define it in Foobar, the search path finds the __init__ function in Foo, so that's the one that is called. The second __init__ in Bar is masked since it comes second in the inheritance list.. If you want

Re: multiple inheritance

2006-02-15 Thread Sébastien Boisgérault
Thomas Girod a écrit : > Hi. > > I think I'm missing something about multiple inheritance in python. > > I've got this code. > > class Foo: > def __init__(self): > self.x = "defined by foo" > self.foo = None > > class Bar: > def __init__(self): > self.x = "defined

ANN: PyIE - Python Inference Engine

2006-02-15 Thread Ralph Miller
PyIE, Python Inference Engine, is now available at "DFWPython.org", under "Our Source Repository", thanks to Jeff Rush. The current revision is 0.9.10. What's PyIE ? - PyIE is an hypothesis based, agenda driven, object oriented inference engine written in Python. I

apache mod_python problem

2006-02-15 Thread Ido Yehieli
Hi all, I have succesfully installed apache+mod_python (ubuntu 5.10 (Breezy), libapache2-mod-python2.4 Version: 3.1.3-3ubuntu1, apache2 Version: 2.0.54-5ubuntu4, python2.4 Version: 2.4.2-1). It seems apache and everything functions fine. I tried to run the example application from the mod_pyth

Re: Unable to get PIL to load jpeg images

2006-02-15 Thread gr
Peter, Can you share the name of the library on the Fedora distro? thx, gerry rodman http://www.gerryrodman.com/ [EMAIL PROTECTED] wrote: > Thanks for that tip > > Following a dialogue in that discussion group it is now working. The > problem was that I didn't have the right jpeg library inst

multiple inheritance

2006-02-15 Thread Thomas Girod
Hi. I think I'm missing something about multiple inheritance in python. I've got this code. class Foo: def __init__(self): self.x = "defined by foo" self.foo = None class Bar: def __init__(self): self.x = "defined by bar" self.bar = None class Foobar(Foo

Poisson Distribution (for a newbie)

2006-02-15 Thread diffuser78
I am simulating an event where users come into the pool randomly starting at time T=0, i.e. For Example, 2 users came at T= 0 into the the pool, 3 users came at T= 1 into the the pool, 5 users came at T=2 ,..,54 users came at T=45 etc. As cumulative number of users goes above 1024, we stop

Re: Clearing the screen

2006-02-15 Thread Graham
you could always use ANSI escape codes: print "\\033[2J" for a screen clear, or print "\\022[2j \033[0;0H" to clear and reset the way "os.system('clear')" would work. check out http://www.termsys.demon.co.uk/vtansi.htm Seems like all that mud programming came in handy after all. Graham. --

PyXML SAX Q?

2006-02-15 Thread mitsura
Hi, is it possible to use SAX to parse XML that is not in a file but in a large string? If I open my XML file and read the content into a string variable. Is there a way I can pass it to the PyXML Sax handler? The reason I want to know is that I need to parse XML that is generated by a process on

Re: how to get function names from the file

2006-02-15 Thread luis . armendariz
Try the following: def printFoo(): print "Foo" def printFOO(): print "FOO" functions = ("printFoo", "printFOO")# list or tuple of strings from file, or wherever for function in functions: call = function + "()" eval(call) -- http://mail.python.org/mailman/listinfo/python-li

logging problem on Windows XP

2006-02-15 Thread john peter
i'm using python's logging facilities in all of my application modules. my logging.conf file is: [loggers]keys=root [handlers]keys=roth [formatters]keys=simpleFormatter [logger_root]level=DEBUGhandlers=roth [handler_roth]class=handlers.RotatingFileHandlerlevel=DEBUGformatter=simpleFormatterar

how to get function names from the file

2006-02-15 Thread Petr Jakes
I have got names of functions stored in the file. For the simplicity expect one row only with two function names: printFoo, printFOO In my code I would like to define functions and then to read function names from the file, so the functions can be executed in the order the function names are stored

Re: How to import a module with spaces in the name

2006-02-15 Thread Farshid Lashkari
Gregory Piñero wrote: > Let's say I have a module named "Excellent Module.py" ExcellentModule = __import__('Excellent Module') -Farshid -- http://mail.python.org/mailman/listinfo/python-list

Re: Python, Forms, Databases

2006-02-15 Thread Terry Hancock
On 15 Feb 2006 11:13:08 -0800 "Tempo" <[EMAIL PROTECTED]> wrote: > Pyton and ASP together. The next solution I stumbled upon > was to use Zope. However, I wasn't sure if I should spend > more of my time looking into this or not, and I found a > possible way around this, which is by using the CGI >

How to import a module with spaces in the name

2006-02-15 Thread Gregory Piñero
Let's say I have a module named "Excellent Module.py" How would I import that into a script? I'm guessing it will involve the imp module somehow (http://www.python.org/doc/2.4.2/lib/module-imp.html) but I didn't figure it out. And let's go ahead and pretend I have a good reason for doing t

pyHook and Win98 key events

2006-02-15 Thread RayS
(Note: there's not a lot of traffic on Win32, so I'm cross-posting here...) To debug pyKeyLogger, I wrote this with pyHook (and compiled with py2exe on Win2K), which prints the ascii codes as expected on Win2K: import pyHook import time import pythoncom def OnKeyboardEvent(event): pri

Re: %SystemDrive%

2006-02-15 Thread rtilley
Atanas Banov wrote: > using >os.chdir('/') >os.getcwd() > is plain wrong in Windows. > > what it does is change the current directory to root of the CURRENT > DRIVE (i.e. the drive of the directory where script was started from), > not the system drive. for example, if current directory wa

Re: Embedding an Application in a Web browser

2006-02-15 Thread Atanas Banov
paron wrote: > I forgot -- I like the idea of Kerrigell, too. It runs on top of > CherryPy, and lets you use python either in the server (which is just a > little program on your local machine) or embedded in the html pages, or > in a Kerrigell service, which is an application server based on Pytho

Is empty string cached?

2006-02-15 Thread Farshid Lashkari
When I pass an empty string to a function is a new string object created or does python use some global pre-created object? I know python does this with integer objects under a certain value. For instance, in the following code is a new string object created for each function call? func(0,'') f

Attached images by plain email.

2006-02-15 Thread Gaz
Hi guys. Im doing a simple CGI form to send data by email. They are for some technicians on field so they can send daily reports about what they made. The thing is, i dont know how to send images attached to the email i generate with sendmail. I put the combos in the form, but i dont know how to sa

Re: pop line from file

2006-02-15 Thread Atanas Banov
Sybren Stuvel wrote: > If you're working on a UNIX platform, you could use FIFO pipes, see > 'mkfifo'. named pipes exist on windows, see win32pipe.CreateNamedPipe -- http://mail.python.org/mailman/listinfo/python-list

Re: Python, Forms, Databases

2006-02-15 Thread Bruno Desthuilliers
Tempo a écrit : > Larry I do see your point. There does seem to be a lot more support for > PHP and MySQL together than there is Python and ASP. But I want to > first try to accomplish my goal by using Python first before I give up > and revert back to PHP. So if I was going to parse HTML forms and

Re: is socket thread safe?

2006-02-15 Thread Carl J. Van Arsdall
Steve Horsley wrote: > [EMAIL PROTECTED] wrote: > >> thread1: >> while 1: >> buf = s.read() >> process(buf) >> >> thread2: >> while 1: >> buf = getdata() >> s.write(buf) >> >> > > It is safe, but watch out for this gotcha: If thread B calls > s.close

Publish/subscribe event manager using weakrefs

2006-02-15 Thread Kamilche
''' event.py An event manager using publish/subscribe, and weakrefs. Any function can publish any event without registering it first, and any object can register interest in any event, even if it doesn't exist yet. The event manager uses weakrefs, so lists of listeners won't stop them from being

Re: how do you pronounce 'tuple'?

2006-02-15 Thread Paddy
So thats were its from. My Parents used to quote it to me when I were a 'wee lad', So they read Burns -Pad. -- http://mail.python.org/mailman/listinfo/python-list

Re: %SystemDrive%

2006-02-15 Thread Atanas Banov
using os.chdir('/') os.getcwd() is plain wrong in Windows. what it does is change the current directory to root of the CURRENT DRIVE (i.e. the drive of the directory where script was started from), not the system drive. for example, if current directory was c:\myscripts and system drive is d

Re: Python advocacy in scientific computation

2006-02-15 Thread beliavsky
I have posted your essay in a thread "Python for Fortran programmers" in comp.lang.fortran since it is written in part for a Fortran audience, and since you are more likely to get critical (but hopefully constructive) comments there. -- http://mail.python.org/mailman/listinfo/python-list

Re: Linux application in python

2006-02-15 Thread Carsten Haese
On Wed, 2006-02-15 at 15:02, [EMAIL PROTECTED] wrote: > Hi all , > > I have a linux application that needs to run on a python interpreter Why does it "need to" run "on" a python interpreter? > .So what is the best way to have the same functionalities provided by > "C" to be implemented in python

Re: Python, Forms, Databases

2006-02-15 Thread Tim Parkin
Xavier Morel wrote: > Tempo wrote: > >>Larry I do see your point. There does seem to be a lot more support for >>PHP and MySQL together than there is Python and ASP. But I want to >>first try to accomplish my goal by using Python first before I give up >>and revert back to PHP. So if I was going t

Re: Python, Forms, Databases

2006-02-15 Thread Xavier Morel
Tempo wrote: > Larry I do see your point. There does seem to be a lot more support for > PHP and MySQL together than there is Python and ASP. But I want to > first try to accomplish my goal by using Python first before I give up > and revert back to PHP. So if I was going to parse HTML forms and pl

Linux application in python

2006-02-15 Thread sundarashiv
Hi all , I have a linux application that needs to run on a python interpreter .So what is the best way to have the same functionalities provided by "C" to be implemented in python . WORST IDEA : Recode the entire application in Python . ..looking for ideas better than mine Shiv Shankar -- ht

Re: Xah's Edu Corner: accountability & lying thru the teeth

2006-02-15 Thread alex . gman
John Bokma wrote: > Al Balmer <[EMAIL PROTECTED]> wrote: > > > have for a long time, and I can understand that it would be better if > > everyone filtered or ignored him, > > The best would be if everybody instead of posting replies would complain > to his ISP and Usenet provider. Xah is a major an

Re: Xah's Edu Corner: accountability & lying thru the teeth

2006-02-15 Thread John Bokma
Al Balmer <[EMAIL PROTECTED]> wrote: > have for a long time, and I can understand that it would be better if > everyone filtered or ignored him, The best would be if everybody instead of posting replies would complain to his ISP and Usenet provider. Xah is a major and offensive troll. Those onl

  1   2   3   >