Re: HTMLParser.HTMLParseError: EOF in middle of construct

2007-06-20 Thread Rob Wolfe
, I > have to install the scripts in many machines. > And I have to parse many different sites, I just want extract the links, so > with a clean up before parse solve very quickly my problem. In Python 2.4 you have to use some third party module. There is no other option for _invalid_ HTML. IMHO BeautifulSoup is the best among them. -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-25 Thread Rob Warnock
f it didn't. +--- It does. And the default startup splash screen tells you how to access it. -Rob - Rob Warnock <[EMAIL PROTECTED]> 627 26th Avenue http://rpw3.org/> San Mateo, CA 94403 (650)572-2607 -- http://mail.python.org/mailman/listinfo/python-list

Re: bicycle repair man help

2007-06-27 Thread Rob Weir
gt;.. > } Some more articles: http://refactoring.com/catalog/introduceExplainingVariable.html and http://c2.com/cgi-bin/wiki?IntroduceExplainingVariable have discussions of them. -rob -- http://mail.python.org/mailman/listinfo/python-list

Tool for finding external dependencies

2007-07-08 Thread Rob Cakebread
long time. I'm aware of Python's modulefinder.py, but it doesn't find external dependencies (or at least I don't know how to make it do them). Thanks, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Tool for finding external dependencies

2007-07-09 Thread Rob Cakebread
On Jul 9, 7:17 am, [EMAIL PROTECTED] wrote: > > Recently I ran into some debugging issues and the freeware app > "Dependency Walker" was suggested to me. I still haven't used it much > since I only got it last Friday, but it looks > promising:http://www.dependencywalker.com > > Mike Thanks Mike,

Re: Tool for finding external dependencies

2007-07-09 Thread Rob Cakebread
cies easily enough because of 'install_requires', but for packages that don't, I need another way to find them. Thanks, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Tool for finding external dependencies

2007-07-09 Thread Rob Cakebread
s, re import sqlobject I only want to know about sqlobject. I don't want any of sqlobject's dependencies, such as MySQLdb, pysqlite2, psycopg2 etc. which modulefinder shows also. And as far as I can tell, modulefinder needs a Python script, but its much easier for me to find a package&#x

Re: bool behavior in Python 3000?

2007-07-11 Thread Rob Wolfe
quot;} and {}. But `bools` are usefull in some contexts. Consider this: >>> 1 == 1 True >>> cmp(1, 1) 0 >>> 1 == 2 False >>> cmp(1, 2) -1 At first look you can see that `cmp` does not return boolean value what not for all newbies is so obvious. Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: bool behavior in Python 3000?

2007-07-11 Thread Rob Wolfe
Marc 'BlackJack' Rintsch wrote: > On Wed, 11 Jul 2007 00:37:38 -0700, Rob Wolfe wrote: > > > Steven D'Aprano wrote: > > > >> From a purely functional perspective, bools are unnecessary in Python. I > >> think of True and False as syntactic suga

ANN: PyDSTool 0.85 released

2007-07-11 Thread Rob Clewley
We have released an update to the PyDSTool dynamical systems and modeling package at http://sourceforge.net/projects/pydstool. There are lots of minor improvements and fixes in this version, but a powerful new feature is the support for user-defined functions for continuation using PyCont. We hav

Re: Question about Tkinter MenuOption variable

2007-04-19 Thread Rob Wolfe
IONS = dict(Jan="01", Feb="02", Mar="03", Apr="04", May="05", June="06", July="07", # Aug="08", Sep="09", Oct="10", Nov="11", Dec="12") default_option = Tk.StringVar() default_option.set("Jan") month_option = Tk.OptionMenu(root, default_option, *OPTIONS.keys()) month_option.grid(row=1, column=2, sticky=Tk.W) Tk.Button(root, command=state, text='state').grid(row=2, column=1) root.mainloop() -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: matplotlib basic question

2007-04-19 Thread Rob Clewley
try are: In site-packages/matplotlib/backends/backend_tkagg.py uncomment the line #os.environ['PYTHONINSPECT'] = '1' Set interactive=True in share/matplotlib/.matplotlibrc Start IDLE with the -n flag In site-packages/matplotlib/backends/backend_tkagg.py comment out the line Tk.mainloop() in the function "show" -Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: using tkinter to display html

2007-04-20 Thread Rob Wolfe
s ideas in it: > > http://mail.python.org/pipermail/python-list/2001-October/107989.html > > thanks mike, i found that thread before i posted here, it doesn'rt answer > my question though. Why not? Did you try to use tkhtml [1]_ with python wrapper [2]_. IMHO it works

Re: Tutorial creates confusion about slices

2007-04-23 Thread Rob Wolfe
t;HelpA"[2:4]=> "lp" > > > But it give the wrong idea when using the following extended slice: > > "HelpA"[4:2:-1] => "Ap" > > So this doesn't result in the reverse of the previous expression while > the exp

Re: I wish that [].append(x) returned [x]

2007-05-01 Thread Rob Wolfe
uot;query text" % tuple(fields) What about this? query = "query text" % tuple(rec[1:-1] + [extra]) -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: read list of dirnames and search for filenames

2007-05-01 Thread Rob Wolfe
childList = self.listdir() > File "C:\Python24\Lib\site-packages\path.py", line 328, in listdir > names = os.listdir(self) > WindowsError: [Errno 3] The system cannot find the path specified: u'X: > \\Instructions\\97544546294\n/*.*' > -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: read list of dirnames and search for filenames

2007-05-01 Thread Rob Wolfe
Rob Wolfe <[EMAIL PROTECTED]> writes: > fscked <[EMAIL PROTECTED]> writes: > >> I cannot seem to get this to work. I am hyst trying to read in a list >> of paths and see if the directory or any sub has a filename pattern. >> Here is the code: >>

Re: How do I use the config parser?

2007-05-05 Thread Rob Williscroft
, > and to write thoses back after reading. > ConfigParser is derived from RawConfigParser, so you need to look at RawConfigParser's docs here: http://docs.python.org/lib/RawConfigParser-objects.html Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Error when using Custom Exception defined in a different python module.

2007-05-06 Thread Rob Williscroft
prompt (type python at a command prompt, or click on IDLE) and try this: >>> import exceptions >>> help( exceptions ) I got this response (clipped): Help on built-in module exceptions: NAME exceptions - Python's standard exception class hierarchy. Another co

Re: tkinter - label widget text selection

2007-05-06 Thread Rob Wolfe
x27;) ent.config(textvariable=var, relief='flat') ent.pack() root.mainloop() -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter get widget option value

2007-05-08 Thread Rob Williscroft
gt; > print w.state >> to print out >> 'disabled' > print w.cget( "state" ) Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Unzip then Zip help

2007-05-09 Thread Rob Wolfe
pack(archname, paths): arch = ZipFile(archname, 'w', ZIP_DEFLATED) for path in paths: for root, dirs, files in os.walk(path): for fname in files: fname = join(root, fname) print fname arch.write(fname)

Re: Interesting list Validity (True/False)

2007-05-11 Thread Rob Williscroft
([]) False >>> bool(['-o']) True >>> There is *never* any need to write things like: expression == True or: expression == False Once you stop doing this things will become much simpler. Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Popen and wget, problems

2007-05-12 Thread Rob Wolfe
I don't know exactly why in this case Popen doesn't work, but the counterpart of os.system is Popen with option shell=True and the first parameter should be a string instead of list. That seems to work: proc = Popen("wget -nv -O dir/cpan.txt http://search.span.org";, shell=True, stdout=PIPE, stderr=PIPE) and this variant seems to work too: cmd_set = ['wget', '-nv', '-O', 'dir/cpan.txt', 'http://search.span.org'] -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Is wsgi ready for prime time?

2007-05-17 Thread Rob Williscroft
uot;", line 1, in > AttributeError: 'module' object has no attribute 'util' > IDLE 1.2 >>> import wsgiref.util >>> wsgiref.util >>> Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: emacs python debugging: pydb or pdb fringe interaction

2007-05-18 Thread Rob Wolfe
(file-name-nondirectory buffer-file-name) -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: emacs python debugging: pydb or pdb fringe interaction

2007-05-18 Thread Rob Wolfe
Paul Rudin <[EMAIL PROTECTED]> writes: > Unfortunately this doesn't make any difference for me, with either > emacs 22 or 21. I guess I'll just have to dig deeper into the code. So what happens after M-x pdb? -- http://mail.python.org/mailman/listinfo/python-list

Re: psycopg2 & large result set

2007-05-25 Thread Rob Wolfe
CPython > 2.5 if possible. psycopg2 is DB-API 2.0 [1]_ compliant, so you can use ``fetchmany`` method and set ``cursor.arraysize`` accordingly. [1] .. http://www.python.org/dev/peps/pep-0249/ -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Removing NS in ElementTree

2007-05-26 Thread Rob Wolfe
tand that the solution is related with "_namespace_map" but I > don't know much more. > > >>>> for x in eleroot[0]: > print x.tag > print x.text Try this: NS = "{http://uniprot.org/uniprot}"; for x in eleroot[0]: x.tag = x.tag[len(NS):] print x.tag -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Connection acception with confirmation

2007-05-29 Thread Rob Williscroft
ueue.html so that your main thread reads stdin and then uses an instance of Queue to post the 'y's and 'n's it recives to your server thread. Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Xah's Edu Corner: Under the spell of Leibniz's dream

2007-08-19 Thread Rob Warnock
er sixty others have done] to contribute to the transcriptions, see <http://www.cs.utexas.edu/~EWD/transcriptions/invitation.html>. Otherwise, just count your blessings that these gems are available at all... -Rob - Rob Warnock <[EMAIL PROTECTED]> 627 26th Avenue

Re: I want py2exe not to create library.zip

2007-09-12 Thread Rob Williscroft
delete the .zip. I can't remember of the top of my head, but you may actually need to rename the new directory to library.zip for your application to work. -- Rob. -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: PyDSTool now compatible with numpy 1.0.1, scipy 0.5.2 and 64-bit CPUs.

2007-03-02 Thread Rob Clewley
f our ModelSpec model-building tools. All ideas and code contributions are welcome! Cheers, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: PyDSTool now compatible with numpy 1.0.1, scipy 0.5.2 and 64-bit CPUs.

2007-03-05 Thread Rob Clewley
to interface to (most are commercial), but on close inspection it turns out there's a lot of very technical issues involved -- although at least modelica is open source! Sorry to be taking a short-term view here (I try to avoid that), but we're just a couple of guys trying to concentrat

Re: Box plot in Python

2007-03-15 Thread Rob Clewley
Matplotlib supports boxplots in a very straightforward fashion and is reasonably documented (just google it!) I actually just submitted a patch for extra boxplot features in matplotlib, which you can find on the sourceforge patch tracker. -Rob -- http://mail.python.org/mailman/listinfo/python

Re: urgent - Matplolib with IDLE!

2007-03-19 Thread Rob Clewley
ures. i.e. uncomment the parts of your script that actually do stuff and run it again. At least that's a quick fix that's working for me while I await a better answer too... Perhaps this hack will outrage someone's sensibilities sufficiently that we'll hear of a better IDLE soluti

Re: Create new processes over telnet in XP

2007-03-23 Thread Rob Wolfe
ame): pid, comm = None, None for line in buf.split("\n"): try: pid, _, _, comm = line.split() except ValueError: continue if comm == progname: return pid tn = telnetlib.Telnet(HOST, PORT) #tn.set_debuglevel(1) login(tn, "login", "passwd", "/home/user") run_proc(tn, "python ~/test.py") #kill_proc(tn, "login", "/home/user", "python") -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Create new processes over telnet in XP

2007-03-24 Thread Rob Wolfe
"Godzilla" <[EMAIL PROTECTED]> writes: > Rob, I would be logging into another XP machine to do some software I was afraid of that. :) > installation... the code you provided, correct me if I'm wrong, seems > to work under Unix/Linux. This part of running and

Re: Tkinter <> and bindtags ordering

2007-04-03 Thread Rob Wolfe
bytecolor wrote: [...] > changing = False > root = tk.Tk() > t = tk.Text(master=root) > t.pack() > t.focus_set() > t.tk.call(t._w, 'edit', 'modified', 0) What about instead of: > t.bind('<>', text_changed) this event: t.bind(&#

Re: Tkinter <> and bindtags ordering

2007-04-03 Thread Rob Wolfe
bytecolor wrote: > Hey Rob, > I actually started with that event, until I came across the modified > event. I'm working on syntax highlighting. So I need any text change. > Also, colorizing on a key release is annoyingly noticeable to the > user. I tried it :) > > I&#x

Re: real time updating of popen, bufsize=0 problems

2007-04-06 Thread Rob Wolfe
of method ``next``): http://docs.python.org/lib/bltin-file-objects.html -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does not my wx.html.HtmlWindow work?

2007-04-08 Thread Rob Williscroft
"Simple HTML Browser") frm.Show() app.MainLoop() Note: the URL you loading takes ages to show, which is why I use: http://www.google.co.uk above. Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: About Eggs

2007-04-10 Thread Rob Wolfe
; > I have read posts referring to them and have been able to > deduce that they are some form of zip file for the distribution > of modules but beyond that I cannot find *any* docs for them > anywhere. Start here: http://peak.telecommunity.com/DevCenter/setuptools -- HTH, Rob -

Re: sqlite3 question

2007-04-12 Thread Rob Wolfe
can tell me how many rows > are there? What about this: if not c.fetchone(): print "No rows" or print "rowcount=", len(cur.fetchall()) -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: is laziness a programer's virtue?

2007-04-16 Thread Rob Warnock
ives of Lazarus Long") entitled "The Tale of the Man Who Was Too Lazy To Fail". It's about a man who hated work so much that he worked very, *very* hard so he wouldn't have to do any (and succeeded). -Rob - Rob Warnock <[EMAIL PROTECTED]> 627 26t

Re: Boost Problem! Boost.Build not found

2007-04-16 Thread Rob Wolfe
need one as long as I set BOOST_BUILD_PATH .. Try to create boost-build.jam file like this: # boost-build.jam boost-build C:\boost\boost_1_33_1\tools\build\v1 ; -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Boost Problem! Boost.Build not found

2007-04-16 Thread Rob Wolfe
Soren wrote: > > Try to create boost-build.jam file like this: > > > > # boost-build.jam > > boost-build C:\boost\boost_1_33_1\tools\build\v1 ; > > > Hi Rob, Thanks for the answer! > > It did solve the error.. but produced a new one: > > C:\boost\b

Re: why does Configparser change names to lowercase ?

2007-09-14 Thread Rob Wolfe
on1] option1=item1 Option2=item2 option2=item3 # cfg.py from ConfigParser import ConfigParser config = ConfigParser() config.optionxform = str config.read('config') print config.get('section1', 'option1') print config.get('section1', 'Option2') print config.options('section1') HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: List append

2007-09-15 Thread Rob E
p! Yes, that's easy: class myclass: var1 = [] means that var1 is associated with the class. If you want an attribute: class myclass: def __init__ (self): self.var1 = [] is the correct way. Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: The fundamental concept of continuations

2007-10-12 Thread Rob Warnock
erences are faster and heap allocation is limited, the running time for most programs is greatly decreased. ... -Rob [1] As suggested in: http://home.pipeline.com/~hbaker1/CheneyMTA.html "CONS Should Not CONS Its Arguments, Part II: Cheney on the M.T.A" Hen

Re: Normalize a polish L

2007-10-15 Thread Rob Wolfe
ITAL LETTER L WITH STROKE;Lu;0;L;N;LATIN CAPITAL LETTER L SLASH \ ;;;0142; 2. 0105;LATIN SMALL LETTER A WITH OGONEK;Ll;0;L;0061 0328N;LATIN SMALL LETTER A OGONEK \ ;;0104;;0104 In the second position there is in the 6-th field canonical equivalent but in the 1-st there is nothing. I don't know what justification is behind that, but probably there is something. ;) Regards, Rob -- http://mail.python.org/mailman/listinfo/python-list

multi-protocol url-based IO -- pure python kioslave-like module?

2007-10-27 Thread Rob McMullen
E can interface with the KDE shared libraries, but obviously that's not pure python. (Or standalone or small. :) * the somewhat related PEP-268 for WebDAV support, but that was withdrawn. My google-fu doesn't show much else. Any pointers would be appreciated! Thanks, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: multi-protocol url-based IO -- pure python kioslave-like module?

2007-10-27 Thread Rob McMullen
me new ideas for google search words and found http://wiki.python.org/moin/CodingProjectIdeas/FileSystemVirtualization with a few more ideas. Thanks for the help. Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: A Python 3000 Question

2007-10-29 Thread Rob Wolfe
hod? > > a_string.lower() makes sense, as does a_string.split(), > a_string.strip()... why not a_string.len()? I wonder why people always complain about `len` function but never about `iter` or `pprint.pprint`? :) And to answer the question. In OO programming generic functions are no less

Re: Question about compiling.

2007-01-10 Thread Rob Wolfe
rated. Only when a > module is imported (See section 6.1.2 on the tutorial). And don't > worry about it... That's not the whole truth. :) If you want to compile your script, you can do that, of course: $ ls fib* fib.py $ python2.4 -mpy_compile fib.py $ ls fib* fib.py fib.pyc -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: module file

2007-01-12 Thread Rob Wolfe
Imbaud Pierre <[EMAIL PROTECTED]> writes: > I am willing to retrieve the file an imported module came from; > module.__file__, or inspect.getfile(module) only gives me the > relative file name. How do I determine the path? >>> import os >>> os.path.abspath(module

Re: How to respond to a confirmation prompt automatically

2007-01-12 Thread Rob Wolfe
en, PIPE p = Popen(command, shell=True, stdin=PIPE) p.stdin.write("y\n") http://docs.python.org/lib/module-subprocess.html -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: module email

2007-01-24 Thread Rob Wolfe
s (is_multipart() == True) or a _string_ object (is_multipart() == False) but never just Message object. http://docs.python.org/lib/module-email.message.html -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: module email

2007-01-25 Thread Rob Wolfe
Sergey Dorofeev wrote: > "Rob Wolfe" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > >> p2=email.message.Message() > >> p2.set_type("message/rfc822") > >> p2.set_payload(m) > > > > Payload is a _lis

Re: howto redirect and extend help content ?

2007-01-28 Thread Rob Wolfe
. >>> help(triang) Help on function triang in module __main__: triang(M, sym=1) The M-point triangular window. >>> def add_doc(f): ... def wrap(g): ... g.__doc__="chunked version of %s\n%s" % (f.__name__,f.__doc__) ... return g ... return wrap ... >

Re: string byte dump

2007-01-28 Thread Rob Wolfe
ils on other > stings like "Björk". > > It calls decode('utf8') but I guess the strings are not utf8 so I need > to find out what is being input. Try this: >>> "abc".encode("hex") '616263' -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Help needed on config files

2007-01-31 Thread Rob Wolfe
[PROJECTx] path=/path/to/dir1 [PROJECTy] path=/path/to/dir2 # cfg.py from ConfigParser import ConfigParser cfg = ConfigParser() cfg.read("proj.cfg") for proj in cfg.sections(): path = cfg.items(proj)[0][1] print "proj: %s, path: %s" % (proj, path) Is that not enough? -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: PYTHONPATH or any other way to set seachpath (winXP) ?

2007-02-04 Thread Rob Wolfe
>> import some_module Traceback (most recent call last): File "", line 1, in ? ImportError: No module named some_module >>> import sys >>> sys.path.append("..") >>> import some_module http://docs.python.org/tut/node8.html#SECTION00811000

Re: python references

2007-02-05 Thread Rob Wolfe
a > vector3 class. i dont want accessor methods. i know python can do > this, but it's been a long time since I used it and am unsuccessful in > my googling and docreading. a little help please? You can have such a reference to mutable objects. Consider this: >>>

Re: calling php function from python

2007-02-14 Thread Rob Wolfe
e XML-RPC. This is a platform and language independent solution. Here you have some information: http://www.faqs.org/docs/Linux-HOWTO/XML-RPC-HOWTO.html http://groups.google.pl/group/comp.lang.python/msg/5a6ae6290593fc97 -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: rot13 in a more Pythonic style?

2007-02-14 Thread Rob Wolfe
uppercase)) def f(s): return "".join([d.get(c) or c for c in s]) return f >>> rot13 = rot(13) >>> rot13('Sybevk Tenohaqnr, Fcyhaqvt ihe guevtt') 'Florix Grabundae, Splundig vur thrigg' >>> rot_13 = rot(-13) >>> rot_13('Florix Grabundae, Splundig vur thrigg') 'Sybevk Tenohaqnr, Fcyhaqvt ihe guevtt' -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I create an array of functions?

2007-02-19 Thread Rob Wolfe
functions d = dict([(fname, f) for fname, f in globals().items() if callable(f)]) tab = [fname for fname, f in sorted(globals().items()) if callable(f)] print d[tab[2]]() -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I create an array of functions?

2007-02-19 Thread Rob Wolfe
Steven D'Aprano wrote: > On Mon, 19 Feb 2007 00:16:39 -0800, Rob Wolfe wrote: > > > > > Steven W. Orr wrote: > >> I have a table of integers and each time I look up a value from the table > >> I want to call a function using the table entry as an inde

Re: Sorting directory contents

2007-02-20 Thread Rob Wolfe
files_dict.setdefault(mtime, []).append(fname) filenames = [] for mtime in sorted(files_dict): for fname in sorted(files_dict[mtime]): filenames.append(fname) return filenames -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

ANN: PyDSTool now compatible with numpy 1.0.1, scipy 0.5.2 and 64-bit CPUs.

2007-02-20 Thread Rob Clewley
documentation, and http://sourceforge.net/projects/pydstool for downloading. As ever, please send us feedback if you have any problems with this new release or ideas and code contributions for future releases. Regards, Rob, Erik, and Drew. Center for Applied Mathematics

Re: PyCon blogs?

2007-03-01 Thread Rob Andrews
Now that I've half recovered from PyCon, I've uploaded some initial prattle: http://trekkingbob.blogspot.com/2007/03/pycon-all-up-in-my-veins.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Trouble with subprocess.call(...) and zsh script (OSError: [Errno 8] Exec format error)

2007-11-11 Thread Rob Wolfe
t error But running that directly through the shell works: >>> call(['./t1.sh'], shell=True) t1 0 However this script works fine also without `shell=True` option: # t2.sh #!/bin/sh echo "t2" >>> call(['./t2.sh']) t2 0 HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: pipeline encoding

2007-12-06 Thread Rob Wolfe
you print to a terminal Python can use terminal encoding, but if you redirect to a file Python doesn't know what encoding to use (e.g. how was encoded existing file) and refuses to guess. You have to specify that encoding explicit: python -c "print u'\u03A9'.encode('utf-8')" > file.txt HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: pipeline encoding

2007-12-06 Thread Rob Wolfe
e that: PYTHONPATH=. python -c "print u'\u03A9'" > file.txt But remember that when you copy this file to the global PYTHONPATH on your system it will affect all Python programs. .. [1] http://docs.python.org/lib/module-site.html HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Python; jump to a concrete line

2007-12-20 Thread Rob Wolfe
mber of columns so sometimes i get kind of "index > out" error. Is there a better way to read the different data on each > row and avoiding to know the exact number of columns ? Consider using linecache: http://docs.python.org/lib/module-linecache.html HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Connecting to SQL database

2007-12-20 Thread Rob Williscroft
be: "Provider=SQLNCLI;Server=.\SQLEXPRESS;Datab..." *) IIRC you can't install express as the "Default" instance so this will be required. If you need to enable TCP/IP use the "SQL Server Configuration Manager" about 4 levels deep from the "

Re: convert pdf to png

2007-12-25 Thread Rob Wolfe
rtlab.graphics import renderPM d = Drawing(400, 200) d.add(String(150, 100, 'Hello World', fontSize=18)) renderPM.drawToFile(d, 'test.png', 'PNG') .. [1] http://www.reportlab.co.uk/svn/public/reportlab/trunk/rl_addons/ .. [2] http://www.reportlab.com/ftp/fonts/pfbf

getattr from local scope

2006-04-23 Thread rob . haswell
lso not using eval limits the scope damage that can be caused by any errors in my application which could cause the database to be poisoned. Cheers for any help :-) -Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: scope of variables

2006-05-03 Thread Rob E
> is the code below correct? > > b = 3 > def adding(a) > print a + b > > it seams not to see the up-level scope where b is defined. Yes except for the missing : at the end of the "def" line. Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: A critic of Guido's blog on Python's lambda

2006-05-09 Thread Rob Warnock
BASE-TX NIC] is plenty to service 100K *small* requests/s... ;-} Of course, you might have to write it in assembler on bare metal, but the good news is that with only a 1000 cycle budget, at least the code won't be very large! ;-} -Rob [someone who remembers 0.5 MIPS DEC PDP-10s being use

Re: A critic of Guido's blog on Python's lambda

2006-05-09 Thread Rob Warnock
Pisin Bootvong <[EMAIL PROTECTED]> wrote: +--- | Rob Warnock wrote: | > | No matter how scalable your language is, you cannot make a | > | 100MHz/128MB server serve 100,000 client a second over the internet. | > +--- | > | > Sure you can! That'

Re: A critic of Guido's blog on Python's lambda

2006-05-10 Thread Rob Warnock
urce code in the "name" slot for debugging printouts [e.g., stack backtraces]. -Rob - Rob Warnock <[EMAIL PROTECTED]> 627 26th Avenue http://rpw3.org/> San Mateo, CA 94403 (650)572-2607 -- http://mail.python.org/mailman/listinfo/python-list

Re: A critic of Guido's blog on Python's lambda

2006-05-15 Thread Rob Warnock
s three units of effort, and a programming systems *product* takes nine units of effort. -Rob - Rob Warnock <[EMAIL PROTECTED]> 627 26th Avenue http://rpw3.org/> San Mateo, CA 94403 (650)572-2607 -- http://mail.python.org/mailman/listinfo/python-list

Re: mysqldb SELECT COUNT reurns 1

2007-12-27 Thread Rob Williscroft
eed to do: res = cursor.fetchone()[0] > print res > > > It prints 1, and there are 88 rows in table. SELECT works fine, but > SELECT COUNT(*) makes problems. Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Extracting files from an ISO image?

2008-01-02 Thread Rob Williscroft
have is daemon tools will mount cd images that aren't iso images, where as isoinfo appears to handle only genuine iso file systems. Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib2 disable proxy

2008-01-02 Thread Rob Wolfe
way is to use `urllib2.ProxyHandler`. Take a look at: http://www.voidspace.org.uk/python/articles/urllib2.shtml HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Who's to blame?

2008-01-03 Thread Rob Williscroft
lf) > ##if d.ShowModal() == wx.ID_OK: > if d.ShowModal() == wx.ID_YES: > self.Close() > http://www.wxpython.org/docs/api/wx.Dialog-class.html Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib2 disable proxy

2008-01-03 Thread Rob Wolfe
Dimitrios Apostolou <[EMAIL PROTECTED]> writes: > On Wed, 2 Jan 2008, Rob Wolfe wrote: > >> Dimitrios Apostolou <[EMAIL PROTECTED]> writes: >> >>> Hello list, >>> >>> I've been looking for a way to explicitly disable the use of pro

Re: Cost of "unicode(s)" where s is Unicode

2008-01-06 Thread Rob Williscroft
ocs.python.org/lib/built-in-funcs.html#l2h-78 ... More precisely, if object is a Unicode string or subclass it will return that Unicode string without any additional decoding applied. ... Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: New Tk look (aka Ttk or Tile widgets)

2008-01-10 Thread Rob Wolfe
per Actually, I wanted to use Treeview, so I needed to tweak a little bit this code, but it's very simple to do. HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Using a proxy with urllib2

2008-01-10 Thread Rob Wolfe
r(urllib2.HTTPHandler) if proxy: proxy_support = urllib2.ProxyHandler({"http": "http://"; + proxy}) opener.add_handler(proxy_support) return opener def fetchurl(url, opener): f = opener.open(url) data = f.read() f.close() return data print fetchurl('http://www.python.org', getopener('127.0.0.1:8081')) HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib2 rate limiting

2008-01-10 Thread Rob Wolfe
r` exception. http://diveintopython.org/http_web_services/redirects.html HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib2 rate limiting

2008-01-10 Thread Rob Wolfe
Dimitrios Apostolou <[EMAIL PROTECTED]> writes: > On Thu, 10 Jan 2008, Rob Wolfe wrote: > >> Dimitrios Apostolou <[EMAIL PROTECTED]> writes: >> >>> P.S. And something simpler: How can I disallow urllib2 to follow >>> redirections to fo

Re: Using a proxy with urllib2

2008-01-11 Thread Rob Wolfe
"Jack" <[EMAIL PROTECTED]> writes: > Rob, > > I tried your code snippet and it worked great. I'm just wondering if > getopener( ) call > is lightweight so I can just call it in every call to fetchurl( )? Or I > should try to share > the opener object am

Re: Persistent HTTP Connections with Python?

2008-01-11 Thread Rob Kapteyn
actually very simple. What happens when you open the data URL with a web browser ? Does the connection stay open and automatically update each time there is new data ? If so, just use urllib, leave the connection open and do a read() every so often to see if there is new data. Good luck! -Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Using a proxy with urllib2

2008-01-12 Thread Rob Wolfe
r(cj)) > urllib2.install_opener(opener) > > and they override the proxy opener. Could anyone tell me how to use both > openers? > You don't have to create another opener if you only want to add some handler. You can use `add_handler` method, e.g.: opener.add_handler(urllib2.HTTPCookieProcessor(cj)) HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: examples of logger using smtp

2008-01-17 Thread Rob Wolfe
ormatter('%(asctime)s %(name)-12s %(levelname)-8s %(message)s', '%Y-%m-%d %H:%M:%S') hdlr.setFormatter(fmt) logger.addHandler(hdlr) hdlr.setLevel(level) return logger logger = smtp_logger(DEBUG, 'mailhost', 'fromaddr', 't

Re: writing Python in Emacs

2008-01-20 Thread Rob Wolfe
m = None for i in range(1, len(dots)): s = ".".join(dots[:i]) try: sym = eval(s, globals(), dlocals) except NameError: try: sym = __import__(s, globals(), dlocals, []) except ImportError: return [] if sym is not None: s = dots[-1] return [k for k in dir(sym) if k.startswith(s)] def _test(): print ' ->', pycomplete('', debug=True) print 'sys.get ->', pycomplete('sys.get', debug=True) print 'settr ->', pycomplete('settr', debug=True) print 'settr (plat in context) ->', print pycomplete('settr', imports=['from sys import settrace'], debug=True) print 'foo. ->', pycomplete('foo.', debug=True) print 'Enc (email * imported) ->', print pycomplete('Enc', imports=['from email import *'], debug=True) print 'E (email * imported) ->', print pycomplete('E', imports=['from email import *'], debug=True) print 'Enc ->', pycomplete('Enc', debug=True) print 'E ->', pycomplete('E', debug=True) if __name__ == "__main__": _test() # end of pycomplete.py HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Set ulimit when using subprocess.Popen?

2008-01-28 Thread Rob Wolfe
Jarek Zgoda napisał(a): > Hi, all, > > anybody has an idea on how to set ulimit (-v in my case, linux) for > process started using subprocess.Popen? What about: from subprocess import call call('ulimit -v 1000 && ulimit -v && ls', shell=True) HTH,

Re: Set ulimit when using subprocess.Popen?

2008-01-28 Thread Rob Wolfe
Jarek Zgoda napisał(a): > Rob Wolfe napisa�(a): > > > > Jarek Zgoda napisa�(a): > >> Hi, all, > >> > >> anybody has an idea on how to set ulimit (-v in my case, linux) for > >> process started using subprocess.Popen? > > > > What

<    2   3   4   5   6   7   8   9   10   11   >