Re: newb: Join two string variables

2006-12-05 Thread Cameron Walsh
johnny wrote: > How do I join two string variables? > I want to do: download_dir + filename. > download_dir=r'c:/download/' > filename =r'log.txt' > > I want to get something like this: > c:/download/log.txt > Hi Johnny, This is actually two questions: 1.) How do I concatenate strings 2.)

Re: newb: Join two string variables

2006-12-05 Thread johnny
In my code, I have the following: p = posixpath.basename(e).strip filename = download_dir+p I am getting the following error: filename = download_dir+p TypeError: cannot concatenate 'str' and 'builtin_function_or_method' objects Cameron Walsh wrote: > johnny wrote: > > How do I join two strin

Re: newb: Join two string variables

2006-12-05 Thread Robert Bauck Hamar
johnny wrote: Please don't top post. Arrange your answer so that your comments follow what you comment. > In my code, I have the following: > > p = posixpath.basename(e).strip make this: p = posixpath.basename(e).strip() > filename = download_dir+p > > I am getting the following error: > >

Re: newb: Join two string variables

2006-12-05 Thread John Machin
johnny wrote: > In my code, I have the following: > > p = posixpath.basename(e).strip > filename = download_dir+p > > I am getting the following error: > > filename = download_dir+p > TypeError: cannot concatenate 'str' and 'builtin_function_or_method' > objects > > You need to *call* the strip

Re: Mod_python vs. application server like CherryPy?

2006-12-05 Thread fumanchu
Vincent Delporte wrote: > I'm still a newbie when it comes to web applications, so would like > some help in choosing a solution to write apps with Python: What's the > difference between using running it through mod_python vs. building an > application server using Python-based tools like CherryPy

Re: PythonTidy

2006-12-05 Thread rzed
Chuck Rhode <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > That went well. PythonTidy has been looked at at least 10**2 > times, and I have received a couple of complaints, which I hope > I have addressed satisfactorily -- plenty good enough for a beta > test. The basic concept stands.

List of Events in wxPython

2006-12-05 Thread Jacksondf
What is that procedure for determining which events can be binded for a particular widget? The docs don't seem to help. For example, how can I know which events wx.SpinButton will send. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Parsing data from pyserial (final resolution)

2006-12-05 Thread Lone Wolf
After going back and reading everybody's suggestions, I finally got a simple, efficient solution. As was pointed out to me in several posts, I needed to use readline rather than read. That's obvious to me now ... but isn't everything obvious once you understand it :) Anyway, I am posting my code o

Re: how to invoke the shell command and then get the result in python

2006-12-05 Thread [EMAIL PROTECTED]
Nick Craig-Wood wrote: > > What if I entered "; rm -rf * ;" as my pattern? > Assuming the script isn't setuid, this would do no more damage than the user could do directly on the command line. I agree, when dealing with web applications or setuid programs, direct shell access isn't a good idea.

Re: Opening colour BMPs with PIL

2006-12-05 Thread Craig
Fredrik Lundh wrote: > Craig wrote: > > > I'm trying to open colour BMPs using PIL and I'm getting the following > > errors. > > what program did you use to produce those BMP files? can you prepare > reasonably small samples using the same program and post them somewhere? > > Thanks for the rep

Re: Submitting change requests through correct channels

2006-12-05 Thread Ben Finney
Fredrik Lundh <[EMAIL PROTECTED]> writes: > Ben Finney wrote: > > > I hope that, instead, it's possible to perform the research needed > > to describe the requested change, submit it as an email or online > > form > > are you perhaps volunteering to help setup and monitoring such a > sub- mission

Tkinter on Silicon Graphics machine?

2006-12-05 Thread David Lees
Does anyone have advice on installing Tkinter on s Silicon Graphics machine (under IRIX 6, I think). The SysAdmin at work build Python 2.4.3 for me on the SGI box, but it does not have Tkinter. Are there any prebuilt distributions for SGI machines that include Tkinter? TIA david lees -- http

X11 bitmap image conversion problem

2006-12-05 Thread Craig
Hi there, This could be a curly question. When I created the x11 bitmap image using the im.tobitmap() function I found out later that the display information in the array is big endian (I think) but I want little endian. Basically if an image byte in the X11 format is 0001 (0x3D), I want 101

Inheritance problem. Creating an instance.

2006-12-05 Thread .nu
#!/usr/bin/env python # -*- coding: utf-8 -*- # Name: Sleepy Hollow # Author: .nu import wx import os import sys NEW_ID = 1; OPEN_ID = 2; SAVE_ID = 3; SAVE_AS_ID = 4; QUIT_ID = 5; UNDO_ID = 6; REDO_ID = 7; HELPME_ID = 8; ABOUT_ID = 9; OPTIONS_ID = 10 APP_NAME = 'Sleepy Hollow' class SleepyHoll

Looking for a decent HTML parser for Python...

2006-12-05 Thread Just Another Victim of the Ambient Morality
I'm trying to parse HTML in a very generic way. So far, I'm using SGMLParser in the sgmllib module. The problem is that it forces you to parse very specific tags through object methods like start_a(), start_p() and the like, forcing you to know exactly which tags you want to handle. I

Re: PythonTidy

2006-12-05 Thread Chuck Rhode
rzed wrote this on Tue, Dec 05, 2006 at 08:19:28PM -0500. My reply is below. > I ran PythonTidy on a wxPython sample, and found that wx.CONSTANTS > were being translated to wx.Constants, which won't do at all. Find the first line in the PythonTidy code where the following global variables are d

Re: Tkinter on Silicon Graphics machine?

2006-12-05 Thread [EMAIL PROTECTED]
David Lees wrote: > Does anyone have advice on installing Tkinter on s Silicon Graphics > machine (under IRIX 6, I think). The SysAdmin at work build Python 2.4.3 > for me on the SGI box, but it does not have Tkinter. Are there any > prebuilt distributions for SGI machines that include Tkinter? >

Re: Looking for a decent HTML parser for Python...

2006-12-05 Thread Just Another Victim of the Ambient Morality
"Just Another Victim of the Ambient Morality" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I'm trying to parse HTML in a very generic way. >So far, I'm using SGMLParser in the sgmllib module. The problem is > that it forces you to parse very specific tags through object

PyQt, designer, and directional flow

2006-12-05 Thread borntonetwork
I am creating a simple form using designer (qt4) on Ubuntu. I use pyuic to create a python script from the form. I run the script and the form shows up fine. The idiosyncrasy occurs when I try to type text into a QTextEntry widget. The text is right-aligned, not left-aligned as I had set it up in t

Re: Ensure a variable is divisible by 4

2006-12-05 Thread Jonathan Smith
MRAB wrote: >> if ( x % 4 ) == 0: >> whatever # x is divisible by 4 >> >> modulus is your friend :) >> >> -smithj > > > It's "modulo"; "modulus" is a different operation. > > Wikipedia says "modulus may refer to... %, the modulo operator of various programming languages" http://en.wikip

Re: PythonTidy

2006-12-05 Thread Chuck Rhode
Thomas Heller wrote this on Tue, Dec 05, 2006 at 07:06:30PM +0100. My reply is below. > I suggest you open the file with open(input-file, "rU"). This doesn't work so pretty good while reading from sys.stdin, so I'm still at the drawing board. -- .. Chuck Rhode, Sheboygan, WI, USA .. 1979 Honda

Re: Looking for a decent HTML parser for Python...

2006-12-05 Thread Just Another Victim of the Ambient Morality
"Just Another Victim of the Ambient Morality" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > >Okay, I think I found what I'm looking for in HTMLParser in the > HTMLParser module. Except it appears to be buggy or, at least, not very robust. There are websites for which i

Re: Coding standards without control?

2006-12-05 Thread Stephan Kuhagen
Soni Bergraj wrote: > editormt wrote: >> A majority of the participating organisations have coding standards... >> and a majority does not control them ;o) What is the situation at your >> location? Does this lack of control really hurt? > > """A Foolish Consistency is the Hobgoblin of Little Min

Re: Looking for a decent HTML parser for Python...

2006-12-05 Thread Fredrik Lundh
> Except it appears to be buggy or, at least, not very robust. There are > websites for which it falsely terminates early in the parsing. which probably means that the sites are broken. the amount of broken HTML on the net is staggering, as is the amount of code in a typical web browser

Re: how to invoke the shell command and then get the result in python

2006-12-05 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Assuming the script isn't setuid, this would do no more damage than the > user could do directly on the command line. except that when the user is typing things into the command line, he *knows* that he's typing things into the command line. -- http://mail.python.o

Re: Subprocess with a Python Session?

2006-12-05 Thread Nick Craig-Wood
Calvin Spealman <[EMAIL PROTECTED]> wrote: > No matter what I do I cant get the following code to do what I expect. > I hadn't used subprocess t o read and write to pipes of a > still-running app, and I just can't seem to get it right. What gives? > > import subprocess > > p = subprocess.Pop

ANN: M2Crypto 0.17beta1

2006-12-05 Thread Heikki Toivonen
First beta of M2Crypto 0.17 is available for testing. This is a pretty minor release compared to the previous one. The planned release date is December 15, 2006. Please try this beta out and let me know if there are any issues. Homepage has information on how to get the source and how to report bu

Re: What are python closures realy like?

2006-12-05 Thread Paddy
Karl Kofnarson wrote: > > Karl, > > > > Usually when using this idiom, fun_basket would return a tuple of all of the > > defined functions, rather than one vs. the other. So in place of: > >>if f == 1: > >>return f1 > >>if f == 2: > >>return f2 > > Just do > >>return

CVXOPT

2006-12-05 Thread [EMAIL PROTECTED]
Hi, I want to use CVXOPT for my optimization problem but I am not able to find a good tutorial for that. Can someone give me a good link or tell me some basic steps how to write a simple code for a problem like following: min c'x subject to: x'Ax=0 x'Bx=b Thanks Amit -- http://

Adults Only! 96112

2006-12-05 Thread Chrismdgr
-- http://mail.python.org/mailman/listinfo/python-list

Python Plugin for Web Browser

2006-12-05 Thread Sébastien Ramage
I've an idea and I've made some search but I found nothing really interesting. There is somebody who have (or can help me to) try to developp a python plugin for web browser just like java ?? I search an how-to for creating a plugin for Firefox and only find how create extension... I've find some

Re: Python Plugin for Web Browser

2006-12-05 Thread MC
Bonjour ! Pour IE, il y a des exemples de plugins, fournis avec PyWin32. Pour FF (comme pour Opera), je ne sais pas. -- @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

<    1   2