Re: Need help running external program
Rigga wrote: > Hi, > > I am running the line of code below from a shell script and it works fine, > however I am at a total loss on how i can run it from within a Python > script as every option I have tried fails and it appears to be down to the > escaping of certain characters. > > wget -q www.anywebpage.com -O - | tr '\r' '\n' | tr \' \" | sed -n > 's/.*url="\([^"]*\)".*/\1/p' If your problem is getting a python string without worrying about how to escape the escape sequences, try: r"""wget -q www.anywebpage.com -O - | tr '\r' '\n' | tr \' \" | sed -n 's/.*url="\([^"]*\)".*/\1/p'""" You should be able to pass this directly to a popen() function. -- http://mail.python.org/mailman/listinfo/python-list
Re: Need help running external program
Rigga wrote: >> No, the r was the point - it's there to tell Python not to do any >> escaping on the string. Try it again with the r and see what happens. >> > Brilliant!!! that works a treat thankyou!!, where on earth did you find > out > about the 'r' any pointers to documentation appreciated. This is a pretty common problem when working with regular expression (which usually contain many backslashes) - that's where I saw this syntax for the first time (e.g. http://docs.python.org/lib/match-objects.html). The official reference for string literals is here: http://docs.python.org/ref/strings.html c ya -- http://mail.python.org/mailman/listinfo/python-list
Re: "Static" python program
Daniel Frickemeier wrote: > Hi, > > I have a strange problem. > > I´m developing a small python-program wiht the mysql-python-module. > The program should run on a server without any mysql-installation. > Is there any posibility to "kompile" a python with static libaries? MySQL distributions (at least on Linux systems) are usually split into server and client packages. If you install the mysql-client package on the server, you'll have all you need (libs and stuff) to access a remote server - without the mysql server itself. Not sure about the windows, although I would guess that the installer let's you choose which parts to install (client libs/tools, server or both). -- http://mail.python.org/mailman/listinfo/python-list
######THEY DO DIFFERENT THINGS TO GET HERE#########
Hi girls and friends.. earn more money in my site its really very different you want like it see it . www.superthings4.blogspot.com www.superthings4.blogspot.com www.superthings4.blogspot.com www.superthings4.blogspot.com www.superthings4.blogspot.com www.superthings4.blogspot.com www.superthings4.blogspot.com www.superthings4.blogspot.com www.superthings4.blogspot.com www.superthings4.blogspot.com www.superthings4.blogspot.com www.superthings4.blogspot.com www.superthings4.blogspot.com www.superthings4.blogspot.com www.superthings4.blogspot.com www.superthings4.blogspot.com www.superthings4.blogspot.com www.superthings4.blogspot.com www.superthings4.blogspot.com www.superthings4.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list