, 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
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
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
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
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,
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
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
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
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
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
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
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
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
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
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
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
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:
>>
,
> 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
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
x27;)
ent.config(textvariable=var, relief='flat')
ent.pack()
root.mainloop()
--
HTH,
Rob
--
http://mail.python.org/mailman/listinfo/python-list
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
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)
([])
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
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
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
(file-name-nondirectory buffer-file-name)
--
HTH,
Rob
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
f our ModelSpec model-building tools. All ideas and code
contributions are welcome!
Cheers,
Rob
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
"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
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(
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
of method ``next``):
http://docs.python.org/lib/bltin-file-objects.html
--
HTH,
Rob
--
http://mail.python.org/mailman/listinfo/python-list
"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
;
> 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
-
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
.
>>> 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
...
>
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
[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
>> 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
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:
>>>
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
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
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
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
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
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
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
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
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
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
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
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 "
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
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
> 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
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
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'
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
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
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
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
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
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
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
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
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
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
r` exception.
http://diveintopython.org/http_web_services/redirects.html
HTH,
Rob
--
http://mail.python.org/mailman/listinfo/python-list
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
"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
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
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
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
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
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,
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
601 - 700 of 1008 matches
Mail list logo