Ian Simcock writes:
> Greetings all.
>
> I'm using Python 2.7 under Windows and am trying to run a command line
> program and process the programs output as it is running. A number of
> web searches have indicated that the following code would work.
>
> import subprocess
>
> p = subprocess.Popen(
dmitrey writes:
> hi all,
> suppose I have Python dict myDict and I know it's not empty.
> I have to get any (key, value) pair from the dict (no matter which
> one) and perform some operation.
> In Python 2 I used mere
> key, val = myDict.items()[0]
> but in Python 3 myDict.items() return iterato
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
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
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
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
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
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
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
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
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
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
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
"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
Rob Wolfe <[EMAIL PROTECTED]> writes:
>> ---script:
>> import urllib2
>>
>> protocolo='http://'
>> servidor='10.28.1.239/'
>> pagina='manage'
>> fullurl=protocolo+servidor+pagina
>>
>> aut=urlli
"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
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
[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
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
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
"[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
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
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
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
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
"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:
>>>
"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
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
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.
"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
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
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
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
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
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
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
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:
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
brad <[EMAIL PROTECTED]> writes:
> Will len(a_string) become a_string.len()? I was just reading
>
> http://docs.python.org/dev/3.0/whatsnew/3.0.html
>
> One of the criticisms of Python compared to other OO languages is that
> it isn't OO enough or as OO as others or that it is inconsistent. And
>
Peter Bengtsson <[EMAIL PROTECTED]> writes:
> In UTF8, \u0141 is a capital L with a little dash through it as can be
> seen in this image:
> http://static.peterbe.com/lukasz.png
>
> I tried this:
import unicodedata
unicodedata.normalize('NFKD', u'\u0141').encode('ascii','ignore')
> ''
>
stef mientki <[EMAIL PROTECTED]> writes:
> hello,
>
> Why does Configparser change names to lowercase ?
>
> As Python is case sensitive (which btw I don't like at all ;-)
> but now when really need the casesensitivity,
> because it handles about names which should be recognized by human,
> it cha
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
Steven D'Aprano wrote:
> From a purely functional perspective, bools are unnecessary in Python. I
> think of True and False as syntactic sugar. But they shouldn't be
> syntactic sugar for 1 and 0 any more than they should be syntactic sugar
> for {"x": "foo"} and {}.
But `bools` are usefull in s
Sérgio Monteiro Basto wrote:
> Stefan Behnel wrote:
>
> > Sérgio Monteiro Basto wrote:
> >> but is one single error that blocks this.
> >> Finally I found it , it is :
> >> >> if I put :
> >> >>
> >> p = re.compile('"align')
> >> content = p.sub('" align', content)
> >>
> >> I can parse the html
[EMAIL PROTECTED] wrote:
> So, I'm writing this to have your opinion on what tools I should use
> to do this and what technique I should use.
Take a look at parsing example on this page:
http://wiki.python.org/moin/SimplePrograms
--
HTH,
Rob
--
http://mail.python.org/mailman/listinfo/python-l
py_genetic <[EMAIL PROTECTED]> writes:
> Hi,
>
> I'm looking to generate x alphabetic strings in a list size x. This
> is exactly the same output that the unix command "split" generates as
> default file name output when splitting large files.
>
> Example:
>
> produce x original, but not random s
Steven Bethard <[EMAIL PROTECTED]> writes:
>> I vote for example with ElementTree (without xpath)
>> with a mention of using ElementSoup for invalid HTML.
>
> Sounds good to me. Maybe something like::
>
> import xml.etree.ElementTree as etree
> dinner_recipe = '''
>
> 24slicesbaguette
> 2+tbspol
Steve Howell wrote:
> I suggested earlier that maybe we post multiple
> solutions. That makes me a little nervous, to the
> extent that it shows that the Python community has a
> hard time coming to consensus on tools sometimes.
We agree that BeautifulSoup is the best for parsing HTML. :)
> Th
Steven Bethard <[EMAIL PROTECTED]> writes:
> I'd hate to steer a potential new Python developer to a clumsier
"clumsier"???
Try to parse this with your program:
page2 = '''
URLs
http://domain1/page1";>some page1
http://domain2/page2";>some page2
'''
> libra
Steve Howell wrote:
> Hi, I'm offering a challenge to extend the following
> page by one good example:
>
> http://wiki.python.org/moin/SimplePrograms
What about simple HTML parsing? As a matter of fact this is not
language concept, but shows the power of Python standard library.
Besides, that's v
Jim <[EMAIL PROTECTED]> writes:
> Hello,
>
> I need a program that will traverse a directory tree to ensure that
> there
> are unix-style line endings on every file in that tree that is a text
> file.
> To tell text files from others I want to use the unix "file" command
> (Python's "mimetypes" is
[EMAIL PROTECTED] wrote:
> Hi
>
> I have a problem with encoding non-ascii characters in a web
> application. The application uses Paste and Mako.
>
> The code is here: http://www.webudkast.dk/demo.txt
>
> The main points are:
>
> After getting some user generated input using
> paste.request.parse
Thomas Dybdahl Ahle <[EMAIL PROTECTED]> writes:
> But you can't ever catch sigkill.
There is no protection against sigkill.
> Isn't there a way to make sure the os kills the childprocess when the
> parrent dies?
If the parent dies suddenly without any notification childprocesses
become zombies
Thomas Dybdahl Ahle wrote:
> Problem is - I can't do that when I get killed.
> Isn't it possible to open processes in such a way like terminals? If I
> kill the terminal, everything open in it will die too.
On POSIX platform you can use signals and ``os.kill`` function.
Fo example:
import os,
"Sebastian Bassi" <[EMAIL PROTECTED]> writes:
> I would like to remove the namespace information from my elements and
> have just the tag without this information. This
> "{http://uniprot.org/uniprot}"; is preapended into all my output.
> I understand that the solution is related with "_namespace_
Jon Clements wrote:
> Hi All.
>
> I'm using psycopg2 to retrieve results from a rather large query (it
> returns 22m records); unsurprisingly this doesn't fit in memory all at
> once. What I'd like to achieve is something similar to a .NET data
> provider I have which allows you to set a 'FetchSiz
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
Paul Rudin <[EMAIL PROTECTED]> writes:
> I can't get the gdb fringe interaction functionality to work with
> either pdb or pydb. Any hints as to versions or incantations I should
> try?
It works for me on Debian Etch and GNU Emacs 21.4.1.
I'm using this settings:
(setq pdb-path '/usr/lib/python2
"Jesse" <[EMAIL PROTECTED]> writes:
> Hi all, I have a problem using wget and Popen. I hope someone can help.
>
>
> -- Problem --
> I want to use the command:
> wget -nv -O "dir/cpan.txt" "http://search.cpan.org";
> and capture all it's stdout+stderr.
> (Note that option -O requires 'dir' to be ex
[EMAIL PROTECTED] writes:
> I am a true n00b... and I just using Python to complete some very
> small uneventful task, but need help with one last thing.
>
> Basically, this I what I am trying to do.
>
> make a temp directory (this part I can do)
>
> Need help with:
> ***unzip a JAR file with the
[EMAIL PROTECTED] writes:
> Hi,
> I guess this is a very trivial question --
> I am using a label widget to display text (black font in a white
> background color). I am trying to use my mouse to scroll over the
> displayed text to select it, but tkinter does not allow me to do it.
> Is there a me
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:
>>
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:
>
> import os, sys
> from path import path
>
> myfile = open("boxids.txt", "r")
> for line in myfile
Tobiah <[EMAIL PROTECTED]> writes:
> I wanted to do:
>
> query = "query text" % tuple(rec[1:-1].append(extra))
>
> but the append() method returns none, so I did this:
>
> fields = rec[1:-1]
> fields.append(extra)
> query = "query text" % tuple(fields)
What about this?
Antoon Pardon wrote:
> The following is part of the explanation on slices in the
> tutorial:
>
> The best way to remember how slices work is to think of the indices as
> pointing between characters, with the left edge of the first character
> numbered 0. Then the right edge of the last character o
Stephen M. Gava wrote:
> On Thu, 19 Apr 2007 06:09:33 -0700, kyosohma wrote:
>
> > On Apr 19, 6:29 am, "Stephen M. Gava" <[EMAIL PROTECTED]>
> > wrote:
> >> Hi all,
> >>
> >> I prefer using tkinter to wxpython (so sue me :) and i need to display
> >> a lot of html in a particular app. does anyone
Chad wrote:
> Is there anyway to set the individual options in Tkinter to a
> particular variable. For example, I have a menu option(code is below)
> which has January, February, March and so on, which I would like to
> have corresponding values of 01, 02, 03 and so on. Can someone please
> tell
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\boost_1_33_1\libs\python\example\tutorial>bjam -sT
Soren wrote:
> Unable to load Boost.Build: could not find "boost-build.jam"
> ---
> Attempted search from C:\boost\boost_1_33_1\libs\python\example
> \tutorial up to t
> he root and in these directories from BOOST_BUILD_PATH and BOOST_RO
Jorgen Bodde wrote:
> All I can think of is a 'crappy' construction where I use the iterator
> to see if there was something in there, but surely, there must be a
> better way to know?
>
> >>> r = c.execute('select * from song where id = 2')
> >>> notfound = True
> >>> for s in r:
> ... notfoun
Mark Elston <[EMAIL PROTECTED]> writes:
> This is probably a *really* stupid question but...
> I have looked at all the documentation I have for 2.4.3
> and all the docs I can download for 2.5 and I simply cannot
> find anything, anywhere that documents what egg files are.
>
> I have read posts re
"ianaré" <[EMAIL PROTECTED]> writes:
> hey all, I'm trying to get real time updates of batch file output.
[...]
> So I tried subprocess:
> proc = subprocess.Popen('"C:/path/to/test.bat"', bufsize=0,
> stdout=subprocess.PIPE)
Instead of that:
> for line in proc.stdout:
> self.display.Writ
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'm sure there are going to be o
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('', text_changed)
> root.mainloop()
--
HTH,
Rob
--
http://ma
"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 killing processes, yes.
> Any idea
Godzilla wrote:
> Hello,
>
> How do you create/spawn new processes in XP over telnet using python?
> I.e. I would like to create a new process and have it running in the
> background... when I terminate the telnet connection, I would what the
> spawned processes to keep running until I shut it off
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):
>
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
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
"Andy Dingley" <[EMAIL PROTECTED]> writes:
> I'm trying to write rot13, but to do it in a better and more Pythonic
> style than I'm currrently using. What would you reckon to the
> following pretty ugly thing? How would you improve it? In
> particular, I don't like the way a three-way selectio
mark wrote:
> is it possible to call a php function from python and use a class from
> php in python? i want to use mmslib which creates mms messages and the
> only implementation is a php mmslib implementation.
You can consider to use some kind of RPC (remote procedure call)
for example XML-RPC.
[EMAIL PROTECTED] wrote:
> >>> from Numeric import zeros
> >>> p=zeros(3)
> >>> p
> array([0,0,0])
> >>> p[0]
> 0
> >>> x=p[0]
`x' is now a reference to immutable integer object
with value 0, not to first element of array `p'
> >>> x=10
now `x' is a reference to immutable integer object
with va
Stef Mientki <[EMAIL PROTECTED]> writes:
> Is it possible to change the searchpath for modules on the flight,
> under winXP ?
> Most preferred is some command to extend the searchpath.
> (the environment variable PYTHONPATH needs a reboot)
Do you mean something like that?
>>> import some_module
jvdb wrote:
> Hi there,
>
> I am quite new on python programming and need some help on solving my
> problem..
>
> I have to make a (python) program which deletes files from
> directories. I don't think deleting, etc. is the problem. The problem
> is that the directories where i have to delete them
Jammer <[EMAIL PROTECTED]> writes:
> Does anyone that knows python want to write me a byte dump for strings? :-)
>
> I am trying to modify a plugin (that someone else wrote) that uses
> interprocess communication.
> It works on strings without special characters but it fails on other
> stings like
Stef Mientki <[EMAIL PROTECTED]> writes:
> I'm making special versions of existing functions,
> and now I want the help-text of the newly created function to exists of
> 1. an extra line from my new function
> 2. all the help text from the old function
>
> # the old function
> def triang(M,sym=1):
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
"Sergey Dorofeev" <[EMAIL PROTECTED]> writes:
> Hello.
>
> Why does not work?
[...]
> m=email.message.Message()
[...]
> p2=email.message.Message()
> p2.set_type("message/rfc822")
> p2.set_payload(m)
Payload is a _list_ of Message objects (is_multipart() == True)
or a _string_ object (is_multi
"Coby" <[EMAIL PROTECTED]> writes:
> Just to give you some background about my problem:
>
> I execute os.system(command), where command is a string.
>
> On the command line in windows, I get:
>
> "Continue, and unload these objects? [no]"
>
> I need to respond 'y' to continue, but I am uncertain o
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.__file__)
--
HTH,
Rob
--
http:
Gabriel Genellina <[EMAIL PROTECTED]> writes:
> At Tuesday 9/1/2007 14:56, Steven W. Orr wrote:
>
>>I *just* read the tutorial so please be gentle. I created a file called
>>fib.py which works very nicely thank you. When I run it it does what it's
>>supposed to do but I do not get a resulting .pyc
hg wrote:
> Hi,
>
> must I parse argv[0] to get it, or is there an easier way (that works under
> Windows and *nix)?
>
> Ex:
>
> python /home/hg/test/test.py ==> test.py #knows it is in /home/hg/test
IMHO it is easy enough:
>>> dname, fname = os.path.split("/home/hg/test/test.py")
>>> dname
'/ho
robert wrote:
> My code does recursion loops through a couple of functions. Due to
> problematic I/O input this leads sometimes to "endless" recursions and after
> expensive I/O to the Python recursion exception.
> What would be a good method to detect recursion loops and stop it by
> user-Exce
Frank Millman wrote:
> One small point. The docs have the following warning -
>
> "Important: the caller is responsible for closing the file argument, if
> it was not None, even when an exception is raised. This is best done
> using a try ... finally statement. "
>
> I have added this to my code.
Frank Millman wrote:
> Hi all
>
> I am writing a business/accounting application. Once a user has logged
> in they are presented with a menu. Each menu option has a description
> and an associated file name and program name. The file name is the name
> of a .py file (impName) and the program name
wo_shi_big_stomach wrote:
> Newbie to python writing a script to recurse a directory tree and delete
> the first line of a file if it contains a given string. I get the same
> error on a Mac running OS X 10.4.8 and FreeBSD 6.1.
>
> Here's the script:
>
> # start of program
>
> # p.pl - fix broken
Fulvio wrote:
> Great, it works perfectly. I found my errors.
> I didn't use r ahead of the patterns and i was close to the 'allow' pattern
> but didn't give positive result and KregexEditor reported wrong way. This
> specially because of '<' inside the stream. I thing that is not a normal
> reg
Fulvio wrote:
> I'm trying to get working an assertion which filter address from some domain
> but if it's prefixed by '.com'.
> Even trying to put the result in a negate test I can't get the wanted result.
[...]
> Seem that I miss some better regex implementation to avoid that both of the
> fi
Alexander Eisenhuth wrote:
> Hello,
>
> is there a assignement operator, that i can overwrite?
You can't overwrite assignment operator, but you can
overwrite methods of numeric objects:
http://docs.python.org/ref/numeric-types.html
HTH,
Rob
--
http://mail.python.org/mailman/listinfo/python-li
1 - 100 of 140 matches
Mail list logo