Re: UnicodeError for join()

2009-01-15 Thread tmallen
On Jan 15, 4:09 pm, "Martin v. Löwis" wrote: > >> One of self.title and self.content is a Unicode string, the other is > >> a byte string. You need to change them to have the same type (depending > >> on whether you want to process them as Unicode or byte strings). > > > How can I do that? > > Fir

Re: UnicodeError for join()

2009-01-15 Thread tmallen
On Jan 15, 3:34 pm, "Martin v. Löwis" wrote: > > rc_file.write("\n\n".join([self.title, "### BEGIN CONTENT ###", > > self.content])) > > . > > UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position > > 442: ordinal not in range() > > > What should I change to make thi

UnicodeError for join()

2009-01-15 Thread tmallen
This line of code is throwing a UnicodeError for a handful of the few hundred files I'm processing: rc_file.write("\n\n".join([self.title, "### BEGIN CONTENT ###", self.content])) . UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 442: ordinal not in range() Wh

Re: Wx broken?

2009-01-15 Thread tmallen
On Jan 15, 10:56 am, Mark Smith wrote: > >   File "C:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", > > line 6, in > >     new_instancemethod = new.instancemethod > > AttributeError: 'module' object has no attribute 'instancemethod' > > I'm guessing you either have a python file cal

Re: Wx broken?

2009-01-15 Thread tmallen
On Jan 15, 10:46 am, tmallen wrote: > I've tried a few of the examples > fromhttp://wiki.wxpython.org/Getting%20Started > , but after "Hello World" (window) nothing works. I get the following > error message with the other examples: > > Traceback (most recent c

Wx broken?

2009-01-15 Thread tmallen
I've tried a few of the examples from http://wiki.wxpython.org/Getting%20Started , but after "Hello World" (window) nothing works. I get the following error message with the other examples: Traceback (most recent call last): File "C:/Documents and Settings/MyUserName/Desktop/WxExample.py", line

Re: mod_python resources

2008-12-19 Thread tmallen
Here's my problem (it's a conceptual one). Coming from the world of mod_php, each file can represent a page with no intervention. I was not able to achieve the same with mod_python when I tried, and for that matter, couldn't put the pieces together in a usable way. Let me start simply: If I wanted

mod_python resources

2008-12-16 Thread tmallen
I'm trying again because I'm stubborn. Maybe the fourth time will be the charm... Are there any good tutorials out there for setting up Apache with mod_python? Thanks, Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a better/simpler way to filter blank lines?

2008-11-05 Thread tmallen
m, Jorgen Grahn <[EMAIL PROTECTED]> wrote: > On Tue, 04 Nov 2008 15:36:23 -0600, Larry Bates <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] wrote: > >> tmallen: > >>> I'm parsing some text files, and I want to strip blank lines in the > >>> pro

Re: Is there a better/simpler way to filter blank lines?

2008-11-04 Thread tmallen
e.strip()] +1 for "list_o_lines" Thanks for the help! Thomas On Nov 4, 6:36 pm, Falcolas <[EMAIL PROTECTED]> wrote: > On Nov 4, 3:30 pm, tmallen <[EMAIL PROTECTED]> wrote: > > > > > On Nov 4, 4:30 pm, [EMAIL PROTECTED] wrote: > > > > tmallen: >

Re: Is there a better/simpler way to filter blank lines?

2008-11-04 Thread tmallen
On Nov 4, 4:30 pm, [EMAIL PROTECTED] wrote: > tmallen: > > > I'm parsing some text files, and I want to strip blank lines in the > > process. Is there a simpler way to do this than what I have here? > > lines = filter(lambda line: len(line.strip()) > 0, lines) >

Is there a better/simpler way to filter blank lines?

2008-11-04 Thread tmallen
I'm parsing some text files, and I want to strip blank lines in the process. Is there a simpler way to do this than what I have here? lines = filter(lambda line: len(line.strip()) > 0, lines) Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: An FTP Client...My first real program!

2008-08-14 Thread tmallen
On Aug 14, 9:54 am, tmallen <[EMAIL PROTECTED]> wrote: > On Aug 13, 11:53 pm, "Python Nutter" <[EMAIL PROTECTED]> wrote: > > > > > sorry cut off due to original email being sent not to the list due to gmail: > > > A second for that suggestion--the

Re: An FTP Client...My first real program!

2008-08-14 Thread tmallen
On Aug 13, 11:53 pm, "Python Nutter" <[EMAIL PROTECTED]> wrote: > sorry cut off due to original email being sent not to the list due to gmail: > > A second for that suggestion--the ftp module in the python standard library is > very low level and not very useful for beginners as a lot of the heavy

Re: An FTP Client...My first real program!

2008-08-13 Thread tmallen
On Aug 13, 3:27 pm, tmallen <[EMAIL PROTECTED]> wrote: > Here's the code:http://pastebin.com/m21dfcc19 > > What could be improved? The script feels clumsy, and I have no > experience refactoring Python code. This will eventually be a GUI FTP > client. I'm mainly loo

An FTP Client...My first real program!

2008-08-13 Thread tmallen
Here's the code: http://pastebin.com/m21dfcc19 What could be improved? The script feels clumsy, and I have no experience refactoring Python code. This will eventually be a GUI FTP client. I'm mainly looking for design advice... -- http://mail.python.org/mailman/listinfo/python-list

Hide raw_input text?

2008-08-13 Thread tmallen
I'm working on a little FTP project to get comfortable with ftplib. It's all terminal-based right now, and one issue I'm having is hiding password input text. I'd like one of two things to happen with this: Either don't show any characters while I'm typing (like $ su), or better, a '*' for every ch

Re: New variable?

2008-06-03 Thread tmallen
On Jun 3, 3:03 pm, Chris <[EMAIL PROTECTED]> wrote: > On Jun 3, 8:40 pm, tmallen <[EMAIL PROTECTED]> wrote: > > > What's the proper way to instantiate a new variable? x = ""? > > You don't need to pre-declare your variables. Just assign them as y

Picking apart strings

2008-06-03 Thread tmallen
Is there a way to pick apart this text without resorting to regular expressions? p { color: black; } p -> element color -> property black -> value -- http://mail.python.org/mailman/listinfo/python-list

New variable?

2008-06-03 Thread tmallen
What's the proper way to instantiate a new variable? x = ""? -- http://mail.python.org/mailman/listinfo/python-list