Re: Python 3 dict question

2011-05-06 Thread Rob Wolfe
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

Re: Running a command line program and reading the result as it runs

2013-08-22 Thread Rob Wolfe
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(

Re: WSAStartup failed: error code 10107

2006-07-28 Thread Rob Wolfe
[EMAIL PROTECTED] wrote: > Trying to get moinmoin wiki working on Windows 2000 using IIS and > python. I get the following error when trying to view the start page > after insalling moinmoin and python - key error seems to be at the end > related to socket.py (ImportError: WSAStartup failed: erro

Re: WSAStartup failed: error code 10107

2006-07-28 Thread Rob Wolfe
[EMAIL PROTECTED] wrote: > Thanks for the suggestion Rob. All I can find are 2 copies of > winsock.dll: > c:/WINNT/system32/winsock.dll > c:/WINNT/system32/dllcache/winsock.dll > They're both the same version 3.10.0.13 > > I assume it's ok to have a copy in the dllcach directory and that's not >

Re: problem with regex

2006-07-28 Thread Rob Wolfe
abcd wrote: > I have a regex: '[A-Za-z]:\\([^/:\*\?"<>\|])*' > > when I do, re.compile('[A-Za-z]:\\([^/:\*\?"<>\|])*') ...I get > > sre_constants.error: unbalanced parenthesis > > do i need to escape something else? i see that i have matching > parenthesis. You should use raw string: re.compile

Re: problem with regex

2006-07-28 Thread Rob Wolfe
abcd wrote: > not sure why this passes: > > > >>> regex = r'[A-Za-z]:\\([^/:\*\?"<>\|])*' > >>> p = re.compile(regex) > >>> p.match('c:\\test') > <_sre.SRE_Match object at 0x009D77E0> > >>> p.match('c:\\test?:/') > <_sre.SRE_Match object at 0x009D7720> > >>> > > the last example shouldnt give a ma

Re: import a user created python file as module

2006-07-30 Thread Rob Wolfe
> How and what should I do to import file1.py into file1-dir1.py ? Please > give me some references to the tutorial topic which I can study as > well. And some reference: http://docs.python.org/tut/node8.html Regards, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie help - test for data type

2006-07-31 Thread Rob Wolfe
> This is my function: > selecteddeptcodes = context.REQUEST.DEPTCODE > currentstatus = context.REQUEST.STATUS > > if currentstatus == 'pending': > for dptcd in selecteddeptcodes: >context.changetolive(DEPTCODE=dptcd) > if currentstatus == 'old': > for dptcd in selecteddeptcodes: >contex

Re: import help

2006-08-07 Thread Rob Wolfe
placid wrote: > Hi all, > > How do i import a module that has an hypen/dash (-) in its name ? I get > a SytaxError exception You can use function __import__. >>> print open("-test.py").read() def fun2(): return "Hello from -test !" >>> import -test File "", line 1 import -test

Re: do people really complain about significant whitespace?

2006-08-09 Thread Rob Wolfe
Slawomir Nowaczyk wrote: > Really, typing brace after function/if/etc should add newlines and > indent code as required -- automatically. Actually, for me, it is even > *less* typing in C and similar languages... I probably should teach my > Emacs to automatically add newline after colon in Pytho

Re: Advice on a TCP passthru daemon for HTTP proxy rotation

2006-08-10 Thread Rob Wolfe
Robin Haswell wrote: > Hey there > > Soon we will have many squid proxies on many seperate connections for use > by our services. I want to make them available to users via a single HTTP > proxy - however, I want fine-grained control over how the squid proxies > are selected for each connection. T

Re: sys.platform documentation?

2006-08-10 Thread Rob Wolfe
Michiel Sikma wrote: > So here's the question of the day: what does your sys.platform tell > you? :-) uname -srv HP-UX B.11.00 D python -c "import sys; print sys.platform" hp-ux11 Regards, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: do people really complain about significant whitespace?

2006-08-10 Thread Rob Wolfe
Slawomir Nowaczyk wrote: > On Wed, 09 Aug 2006 07:33:41 -0700 > Rob Wolfe <[EMAIL PROTECTED]> wrote: > > #> Slawomir Nowaczyk wrote: > #> > #> > Really, typing brace after function/if/etc should add newlines and > #> > indent code as required -

Re: using python to edit a word file?

2006-08-10 Thread Rob Wolfe
John Salerno <[EMAIL PROTECTED]> writes: > I figured my first step is to install the win32 extension, which I > did, but I can't seem to find any documentation for it. A couple of > the links on Mark Hammond's site don't seem to work. > > Anyway, all I need to do is search in the Word document for

Re: hide python code !

2006-08-11 Thread Rob Wolfe
John Machin wrote: > If you want to distribute obfuscated code, consider writing it in perl > :-) LOL That's really strong protection. Machine code is too easy to reverse engineer. :) Regards, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: sending values over classes

2006-08-19 Thread Rob Wolfe
"Rafał Janas" <[EMAIL PROTECTED]> writes: > Hi, > > How to read/write value over different classes (in different files) > Something like global values? You need to be more specific about what exactly you're trying to accomplish. Some code whould be great. Maybe import statement is what you're lo

Re: Create a Multilanguage PDF in Python

2006-08-20 Thread Rob Wolfe
"Perseo" <[EMAIL PROTECTED]> writes: > Hi guys, > > I'm disprate with the Pdf Unicode. I try to create a class using ufpdf > but some chars are not correct and now I would like try Python because > a friend tolds me that it's very powerful. > I need a simple script in Python that grab all Records

Re: Create a Multilanguage PDF in Python

2006-08-21 Thread Rob Wolfe
Perseo wrote: > Hi again, > > WORKS!!! I download all I need as python + reportlab. Only 2 questions: > > 1. I need all of this package? because it is 6Mb! I'm afraid you need all of it. BTW My reportlab package is only 3MB... hmm strange. > 2. How can I connect my software with MySql. In my Hos

Re: Regular Expression question

2006-08-21 Thread Rob Wolfe
[EMAIL PROTECTED] wrote: > Hi, I am having some difficulty trying to create a regular expression. > > Consider: > > > > > > > Whenever a tag1 is followed by a tag 2, I want to retrieve the values > of the tag1:name and tag2:value attributes. So my end result here > should be > john, tall >

Re: Regular Expression question

2006-08-21 Thread Rob Wolfe
[EMAIL PROTECTED] wrote: > Thanks, i just tried it but I got the same result. > > I've been thinking about it for a few hours now and the problem with > this approach is that the .*? before the (?=tag2) may have matched a > tag1 and i don't know how to detect it. Maybe like this: 'tag1.+?name="(.

Re: Regular Expression question

2006-08-21 Thread Rob Wolfe
[EMAIL PROTECTED] wrote: > got zero results on this one :) Really? >>> s = ''' ''' >>> pat = re.compile('tag1.+?name="(.+?)".*?(?:<)(?=tag2).*?="adj__(.*?)__', >>> re.DOTALL) >>> m = re.findall(pat, s) >>> m [('john', 'tall'), ('joe', 'short')] Regards, Rob -- http://mail.python.org/m

Re: Create a Multilanguage PDF in Python

2006-08-23 Thread Rob Wolfe
Perseo wrote: > Nothing to do! > I enable test2.py and the folder with 777 permission and I write at the > top of the file the PYTHONPATH "#!/usr/bin/python" as you told me but > it doesn't works as well. #!/usr/bin/python is not PYTHONPATH. I think you should read this: http://docs.python.org/tu

Re: How to ask sax for the file encoding

2006-10-04 Thread Rob Wolfe
"Edward K. Ream" <[EMAIL PROTECTED]> writes: > Can anyone tell me how the content handler can determine the encoding of the > file? Can sax provide this info? Try this: from xml.parsers import expat s = """ Title Chapter 1 """ class MyParser(object): def XmlDecl(self, version, encodin

Re: A curses-game I need help with.

2006-10-09 Thread Rob Wolfe
"Gasten" <[EMAIL PROTECTED]> writes: > Can you help? I'm not a guru on curses by any means, but I've moved one line of your code and IMHO it works fine now. Look below for the code I've changed. > I'll just append all my code here (for anyone to test), so you who > doesn't want to read this humb

Re: How to send E-mail without an external SMTP server ?

2006-10-15 Thread Rob Wolfe
[EMAIL PROTECTED] wrote: > Hi, > > I just want to send a very simple email from within python. > > I think the standard module of smtpd in python can do this, but I > haven't found documents about how to use it after googleing. Are there > any examples of using smtpd ? I'm not an expert,so I need

Re: How to send E-mail without an external SMTP server ?

2006-10-16 Thread Rob Wolfe
[EMAIL PROTECTED] wrote: > Do I have to setup a smtp server on my localhost ? If I see correctly your smtp server is gmail.com. HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for assignement operator

2006-10-17 Thread Rob Wolfe
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

Re: a little about regex

2006-10-18 Thread Rob Wolfe
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

Re: a little about regex

2006-10-19 Thread Rob Wolfe
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

Re: django's view.py as class not just methods

2006-08-25 Thread Rob Wolfe
Skink <[EMAIL PROTECTED]> writes: > Hi, > > I'm relatively new to django and maybe my question is stupid, but... > > Is it possible to map in urls.py some url not to function in views.py > (which has first argument with HttpRequest) but to some class method? > In that case each instance of such cl

Re: NEED HELP

2006-08-29 Thread Rob Wolfe
[EMAIL PROTECTED] wrote: > Below is my code, which is kind of virtual and with its help ill use it > in my main project. > Now what i am looking for is can anybody write all the code inside a > class...so that I can reuse it. I am kind of novice...n kind of stuc > with that. > > from Tkinter impor

Re: wxNotebook color change

2006-08-31 Thread Rob Wolfe
mardif wrote: > Hi ! > > this is my problem: > > I've a wxNotebook object, which contains 2 Panels. > On up, there is TAB section, I have 2 tabs. > I want to color the TAB section with ( for example ) red color. > > I've tried with SetBackgroundColour() for wxNotebook object and for 2 > panel insi

Re: wxNotebook color change

2006-08-31 Thread Rob Wolfe
mardif wrote: > If you set: > > frame.SetBackgroundColour(wx.RED) > > On unix, you can see that label "form1" and "form2" are grey, and > others elements are red. > But on Windows, on the same line of "form1" and "form2", the color is > not red, but grey as labels. > > I want to color this space

Re: Subclassing Tkinter Buttons

2006-09-01 Thread Rob Wolfe
Bob Greschke wrote: > I don't use classes much (mainly because I'm stupid), but I'd like to make a > subclass of the regular Tkinter Button widget that simply adds spaces to the > passed "text=" when the program is running on Windows (Linux, Solaris, Mac > add a little space between the button tex

Re: Javadoc style python manual?

2006-09-08 Thread Rob Wolfe
[EMAIL PROTECTED] wrote: > Hi there, > > I'm new to python and I'm from the java world. > Though I love to learn python, I'm not very comfortable with the python > documentation. > Because when i read jdk doc, i can see the class hierachy, class > member, class methods etc in html docs. It's very

Re: best way of testing a program exists before using it?

2006-09-11 Thread Rob Wolfe
Hari Sekhon wrote: > I am writing a wrapper to a binary command to run it and then do > something with the xml output from it. > > What is the best way of making sure that the command is installed on the > system before I try to execute it, like the python equivalent of the > unix command "which"?

Re: best way of testing a program exists before using it?

2006-09-11 Thread Rob Wolfe
Steve Holden <[EMAIL PROTECTED]> writes: > Rob Wolfe wrote: >> Hari Sekhon wrote: >> >>>I am writing a wrapper to a binary command to run it and then do >>>something with the xml output from it. >>> >>>What is the best way of making sure th

Re: error

2006-09-12 Thread Rob Wolfe
[EMAIL PROTECTED] wrote: > Hi, [...] > Step 3: Wrote the given script of multipication in a file named as > multiply (using vi editor) The name of module should be multiply.py HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: error

2006-09-12 Thread Rob Wolfe
John Machin wrote: > Rob Wolfe wrote: > > [EMAIL PROTECTED] wrote: > > > Hi, > > [...] > > > Step 3: Wrote the given script of multipication in a file named as > > > multiply (using vi editor) > > > > The name of module should be multiply.p

Re: How to compare to directories?

2006-09-13 Thread Rob Wolfe
[EMAIL PROTECTED] wrote: > I want to compare 2 directories: dir1 and dir2. > What I want to do is to get these informations: > 1. does they have the same number of files and sub-directories? > 2. does each file with the same name have the same size and date > information? > > So, how can I do it i

Re: Cross-process dictionary/hashtable

2006-09-18 Thread Rob Wolfe
"Sandra-24" <[EMAIL PROTECTED]> writes: > A dictionary that can be shared across processes without being > marshaled? > > Is there such a thing already for python? Check this out: http://poshmodule.sourceforge.net/ -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: jpype package, could be path problem

2006-09-20 Thread Rob Wolfe
kelemen.viktor wrote: > everything worked correctly but when i wrote a short script: > " > from jpype import * > > jpype.startJVM('/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/jre/lib/i386/client/libjvm.so','-ea') > java.lang.System.out.println("hello world") > shutdownJVM() > " > and tried to run it thi

Re: jpype package, could be path problem

2006-09-20 Thread Rob Wolfe
kelemen.viktor wrote: > Hi > > thanks for your suggestions > > ive modified the sample code You've modified it incorrect. > " > import jpype > from jpype import * You should use "import jpype" OR "from jpype import *" (not recommended) but NOT BOTH. > jpype.startJVM('/usr/lib/jvm/java-1.5.0-su

Re: How to change menu text with Tkinter?

2006-09-27 Thread Rob Wolfe
Phil Schmidt wrote: > I am making a little Tkinter GUI app that needs to be in several > languages (english, french, etc.), adjustable at runtime via a menu > pick to select the language. The only way I can see to change text in > the menus entries is to destroy them and recreate them usiing diffe

Re: combining the path and fileinput modules

2006-11-23 Thread Rob Wolfe
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

Re: Question about import and sys.path

2006-11-28 Thread Rob Wolfe
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

Re: Question about import and sys.path

2006-11-29 Thread Rob Wolfe
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.

Re: Detecting recursion loops

2006-11-29 Thread Rob Wolfe
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

Re: get script path

2006-12-04 Thread Rob Wolfe
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

Re: SLUT distibution mangled?

2006-01-29 Thread Rob Wolfe
Actually when you remember the ancient history of Windows and MS/DOS you will see why. That filename, and a lot of others (as noted by Fredrik) are legacies of that time. They were special filenames (think "/dev/null") that related to specific devices. Gives us a good example of one of the little

Re: subprocess leaves child living

2007-06-05 Thread Rob Wolfe
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,

Re: subprocess leaves child living

2007-06-05 Thread Rob Wolfe
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

Re: Encoding problem with web application (Paste+Mako)

2007-06-06 Thread Rob Wolfe
[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

Re: subprocess call acts differently than command line call?

2007-06-07 Thread Rob Wolfe
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

Re: SimplePrograms challenge

2007-06-12 Thread Rob Wolfe
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

Re: SimplePrograms challenge

2007-06-12 Thread Rob Wolfe
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

Re: SimplePrograms challenge

2007-06-13 Thread Rob Wolfe
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

Re: SimplePrograms challenge

2007-06-13 Thread Rob Wolfe
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

Re: Efficient way of generating original alphabetic strings like unix file "split"

2007-06-14 Thread Rob Wolfe
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

Re: Parsing HTML, extracting text and changing attributes.

2007-06-18 Thread Rob Wolfe
[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

Re: HTMLParser.HTMLParseError: EOF in middle of construct

2007-06-20 Thread Rob Wolfe
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

Re: bool behavior in Python 3000?

2007-07-11 Thread Rob Wolfe
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

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

Re: Question about Tkinter MenuOption variable

2007-04-19 Thread Rob Wolfe
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

Re: using tkinter to display html

2007-04-20 Thread Rob Wolfe
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

Re: Tutorial creates confusion about slices

2007-04-23 Thread Rob Wolfe
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

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

2007-05-01 Thread Rob Wolfe
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?

Re: read list of dirnames and search for filenames

2007-05-01 Thread Rob Wolfe
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

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: tkinter - label widget text selection

2007-05-06 Thread Rob Wolfe
[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

Re: Unzip then Zip help

2007-05-09 Thread Rob Wolfe
[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

Re: Popen and wget, problems

2007-05-12 Thread Rob Wolfe
"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

Re: emacs python debugging: pydb or pdb fringe interaction

2007-05-18 Thread Rob Wolfe
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

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
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

Re: Removing NS in ElementTree

2007-05-26 Thread Rob Wolfe
"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_

Re: Create new processes over telnet in XP

2007-03-23 Thread Rob Wolfe
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

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 killing processes, yes. > Any idea

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('', text_changed) > root.mainloop() -- HTH, Rob -- http://ma

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'm sure there are going to be o

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

2007-04-06 Thread Rob Wolfe
"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

Re: About Eggs

2007-04-10 Thread Rob Wolfe
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

Re: sqlite3 question

2007-04-12 Thread Rob Wolfe
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

Re: Boost Problem! Boost.Build not found

2007-04-16 Thread Rob Wolfe
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

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\boost_1_33_1\libs\python\example\tutorial>bjam -sT

Re: why does Configparser change names to lowercase ?

2007-09-14 Thread Rob Wolfe
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

Re: Normalize a polish L

2007-10-15 Thread Rob Wolfe
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') > '' >

Re: A Python 3000 Question

2007-10-29 Thread Rob Wolfe
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 >

Re: Question about compiling.

2007-01-10 Thread Rob Wolfe
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

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.__file__) -- HTH, Rob -- http:

Re: How to respond to a confirmation prompt automatically

2007-01-12 Thread Rob Wolfe
"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

Re: module email

2007-01-24 Thread Rob Wolfe
"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

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
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):

Re: string byte dump

2007-01-28 Thread Rob Wolfe
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

Re: Help needed on config files

2007-01-31 Thread Rob Wolfe
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

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

2007-02-04 Thread Rob Wolfe
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

Re: python references

2007-02-05 Thread Rob Wolfe
[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

Re: calling php function from python

2007-02-14 Thread Rob Wolfe
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.

Re: rot13 in a more Pythonic style?

2007-02-14 Thread Rob Wolfe
"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

  1   2   >