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 index into an array
> whose values are the different functions. I haven't seen anything on how
> to do this in python.
Do you mean something li
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
Wolfgang Draxinger wrote:
> However this code works (tested) and behaves just like listdir,
> only that it sorts files chronologically, then alphabetically.
>
> def listdir_chrono(dirpath):
> import os
> files_dict = dict()
> for fname in os.listdir(dirpath):
>
Michael George Lerner <[EMAIL PROTECTED]> writes:
> Hi,
>
> (Python 2.5, OS X 10.4.10)
> I have a program called pdb2pqr on my system. It is installed so that
> "pdb2pqr" is in my path and looks like:
>
> #\!/bin/zsh -f
Are you sure that this shebang is correct?
I've tested that on bash and hav
Tomasz Toczyski <[EMAIL PROTECTED]> writes:
> My locale is set to UTF-8. The command:
> python -c "print u'\u03A9'"
> gives me the desired result and doesn't produce any error.
>
> But when I want to redirect the output to a file I invoke:
> python -c "print u'\u03A9'" > file.txt
> I get an error:
Tomek Toczyski <[EMAIL PROTECTED]> writes:
> Are there any command line option for telling python what encoding to
> use for stdout?
>
> To be honest I have a more complicated program than the example that I
> have presented - there are many print commands inside and it is not
> very feasible for
Horacius ReX <[EMAIL PROTECTED]> writes:
> Hi, sorry but after looking for information, I still did not get how,
> when reading a text file in python, can one jump to a concrete line
> and then read the different data (separated by spaces). In each line
> there is different number of columns so so
Carl K <[EMAIL PROTECTED]> writes:
> I need to take the take the pdf output from reportlab and create a
> preview image for a web page. so png or something. I am sure
> ghostscript will be involved. I am guessing PIL or ImageMagic ?
>
> all sugestions welcome.
Did you try to use `reportPM` from
Dimitrios Apostolou <[EMAIL PROTECTED]> writes:
> Hello list,
>
> I've been looking for a way to explicitly disable the use of proxies with
> urllib2, no matter what the environment dictates. Unfortunately I can't find
> a way in the documentation, and reading the source leads me to believe tha
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
Robert Hicks napisał(a):
> Do I have to install something extra to use the new look?
I managed to use Tile with Tk 8.4 and Python 2.5.
After installing Tile I followed these advices:
http://tkinter.unpythonic.net/wiki/UsingTile
and used this code:
http://tkinter.unpythonic.net/wiki/TileWrapper
A
"Jack" <[EMAIL PROTECTED]> writes:
> I'm trying to use a proxy server with urllib2.
> So I have managed to get it to work by setting the environment
> variable:
> export HTTP_PROXY=127.0.0.1:8081
>
> But I wanted to set it from the code. However, this does not set the proxy:
> httpproxy = '127
Dimitrios Apostolou <[EMAIL PROTECTED]> writes:
> P.S. And something simpler: How can I disallow urllib2 to follow
> redirections to foreign hosts?
You need to subclass `urllib2.HTTPRedirectHandler`, override
`http_error_301` and `http_error_302` methods and throw
`urllib2.HTTPError` exception.
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 among fetchurl( ) calls?
Creating an opener
"Jack" <[EMAIL PROTECTED]> writes:
>>> I'm trying to use a proxy server with urllib2.
>>> So I have managed to get it to work by setting the environment
>>> variable:
>>> export HTTP_PROXY=127.0.0.1:8081
>>>
>>> But I wanted to set it from the code. However, this does not set the
>>> proxy:
>>>
DwBear75 <[EMAIL PROTECTED]> writes:
> I am hoping to find some simple examples of how to create a logger
> instance using smtphandler. I don't want to create a separate ini
> file. I just want to sent the smtphost, from, to right in the code
> when I instantiate the logger. I can't seem to find s
Terry Jones <[EMAIL PROTECTED]> writes:
>> "Richard" == Richard Szopa <[EMAIL PROTECTED]> writes:
I don't see Richard's original post, so I reply to Terry.
>
> Richard> I am a devoted Emacs user and I write a lot in Python.
>
> Me too.
The good news is that I managed to configure completion
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,
Rob
--
http://mail.python.org/mailman/listinf
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
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:
> I am having some issues writing a telnet program, using telnetlib. I
> am not sure if it is the telnet on the connections end or it is my
> program.
>
> A little background, when I log in straight from the Linux Command
> prompt. The only thing I g
Neal Becker napisał(a):
> I'd like to output some data directly in .ods format. This format appears
> to be quite complex. Is there any python software available to do this? I
> did look at pyuno briefly. It looks pretty complicated also, and it looks
> like it uses it's own private version o
Daniel Mahoney <[EMAIL PROTECTED]> writes:
> On Thu, 21 Feb 2008 07:47:35 -0800, Kintaro wrote:
>
>> Oh wise usenet users,
>>
>> Please speak unto me the URL which contain the latest documentation on
>> Python/Tkinter programming.
>>
>> I have seen Fredrik Lundh's introduction to tkinter (and ot
[EMAIL PROTECTED] writes:
> Tkinter definitely deserves more respect! I'm making rapid progress
> and it looks good.
>
> But am stuck on this: I want the File/Save state to change from
> disabled to enabled, depending on whether or not there is something to
> save (Text modified). Google returns r
est <[EMAIL PROTECTED]> writes:
> Hi all,
>
> I need urllib2 do perform series of HTTP requests with cookie from
> PREVIOUS request(like our browsers usually do ). Many people suggest I
> use some library(e.g. pycURL) instead but I guess it's good practise
> for a python beginner to DIY something
Ken D'Ambrosio <[EMAIL PROTECTED]> writes:
> Is there an intro-to-Python book where the emphasis isn't so
> much on the language, but on OOP, itself? Or, failing that, at least
> a Python book which doesn't just introduce the language, but gives
> equal billing to OOP practices, etc.
Take a look
Alberto Griggio <[EMAIL PROTECTED]> writes:
> Hello,
>
>> I second Bruno's points, the older python-mode.el is much
>> better,
>
> I agree too. I can't really say what's missing from python.el, but I'm
> much more comfortable with python-mode.el. The triple-quote highlight is
> better in python.e
Alberto Griggio <[EMAIL PROTECTED]> writes:
> Hello,
>
>> I second Bruno's points, the older python-mode.el is much
>> better,
>
> I agree too. I can't really say what's missing from python.el, but I'm
> much more comfortable with python-mode.el. The triple-quote highlight is
> better in python.e
"Robert Rawlins" <[EMAIL PROTECTED]> writes:
> Hello guys,
>
>
>
> I?ve attached an example of my logging configuration file for you to look at.
> The problem I?m experiencing is that the log files are not rotating as I would
> expect them to, they just keep growing and growing.
>
>
>
> Can yo
samwyse <[EMAIL PROTECTED]> writes:
> In the Python 2.5 Library Reference, section 14.5.3 (Logging to
> multiple destinations), an example is given of logging to both a file
> and the console. This is done by using logging.basicConfig() to
> configure a log file, and then calling
> logging.getLog
Phillip B Oldham <[EMAIL PROTECTED]> writes:
> I'm wondering whether anyone can offer suggestions on FOSS projects/
> apps which exhibit solid OO principles, clean code, good inline
> documentation, and sound design principles?
>
> I'm devoting some time to reviewing other people's code to advance
Larry Bates <[EMAIL PROTECTED]> writes:
> Can multiple applications send SocketHandler logging records to the
> same socket server on the same port simultaneously?
Of course they can. Server can accept requests from many clients.
You have used `SocketServer.ThreadingTCPServer`. That server for
Larry Hale <[EMAIL PROTECTED]> writes:
> Since it seems I have a "unique" problem, I wonder if anyone could
> point me in the general/right direction for tracking down the issue
> and resolving it myself.
>
> See my prior post @
> http://groups.google.com/group/comp.lang.python/browse_thread/thre
"Miguel Beltran R." <[EMAIL PROTECTED]> writes:
> Using this script for connect to Zope I have this error
You forgot to add the authentication handler to the list of handlers.
See below.
>
> ---script:
> import urllib2
>
> protocolo='http://'
> servidor='10.28.1.239/'
> pagina='manage'
> fullur
Rob Wolfe <[EMAIL PROTECTED]> writes:
>> ---script:
>> import urllib2
>>
>> protocolo='http://'
>> servidor='10.28.1.239/'
>> pagina='manage'
>> fullurl=protocolo+servidor+pagina
>>
>> aut=urlli
Alexandru Mosoi napisał(a):
> why doesn't logging throw any exception when it should? how do I
> configure logging to throw exceptions?
>
> >>> try:
> ... logging.fatal('asdf %d', '123')
> ... except:
> ... print 'this line is never printed'
> ...
[...]
You need to subclass your handler and
Kevin McKinley napisał(a):
> So i've complete my first program with a GUI interface. I've noticed
> that everytime i click a tab or button the amount of memory the program
> takes up goes up by 50-200 kb. The program will start off at 4.5mb and
> by the time i'm done it can get up over 10 or 1
Vinay Sajip napisał(a):
> On Aug 26, 10:36 am, Alexandru Mosoi <[EMAIL PROTECTED]> wrote:
> > why doesn'tloggingthrow any exception when it should? how do I
> > configureloggingto throw exceptions?
> >
> > >>> try:
> >
> > ... logging.fatal('asdf %d', '123')
> > ... except:
> > ... print 'thi
Mike B <[EMAIL PROTECTED]> writes:
> I'm trying to get Subversion 'hook scripts' working on an Ubuntu box and the
> following fails.
>
> from svn import fs, repos, core, delta
>
> As far as I can tell there are two Python Subversion libraries, 'pysvn' and
> 'svn':
> 'pysvn' from http://pysvn.tigri
Tommy Grav <[EMAIL PROTECTED]> writes:
> I am trying to learn how to use cython, and while I am following the
> cython-dev
> mailing list I didn't feel like this question was totally appropriate
> for its audience
> so I am trying here first.
[...]
> Does anyone know what the ImportError means a
101 - 140 of 140 matches
Mail list logo