Re: problem installing python 2.6.2 from tarball

2009-07-01 Thread ptn
Sounds like you untarred directly into your home dir. You're OK if you delete those, they are the sources, although you should do so only after uninstalling, just in case. To unistall, follow this thread from the list from a while ago: http://mail.python.org/pipermail/python-list/2004-December/29

Re: problems displaying results in ibm_db

2009-07-01 Thread ptn
On Jul 1, 3:20 pm, digz wrote: > result = ibm_db.exec_immediate( conn, 'SELECT * FROM TEST FETCH FIRST > 1 ROWS ONLY') You have the same string split into two lines, which means that what you actually have is this: result = ibm_db.exec_immediate( conn, 'SELECT * FROM TEST FETCH FIRST 1 ROWS ONLY

Re: Flattening lists

2009-02-09 Thread ptn
On Feb 5, 2:07 pm, rdmur...@bitdance.com wrote: > Quoth J Kenneth King : > > > > > mk writes: > > > > Hello everybody, > > > > Any better solution than this? > > > > def flatten(x): > > >     res = [] > > >     for el in x: > > >         if isinstance(el,list): > > >             res.extend(flatten

Re: Location HTTP Header

2008-12-18 Thread ptn
On Dec 17, 6:47 pm, "Gabriel Genellina" wrote: > En Wed, 17 Dec 2008 20:52:42 -0200, ptn escribió: > > > I tried this stupid script on my server: > > >    #! /usr/bin/env python > > >    print 'Location:http://www.google.com\n' > > >

Location HTTP Header

2008-12-17 Thread ptn
Hi all. I tried this stupid script on my server: #! /usr/bin/env python print 'Location: http://www.google.com\n' and it didn't work, I get a blank page. I first tried the Location header in another script, and when execution got to that point, it would just sort of ignore it,

Re: Guido's new method definition idea

2008-12-09 Thread ptn
On Dec 6, 10:15 am, "Russ P." <[EMAIL PROTECTED]> wrote: > On Dec 6, 4:32 am, Andreas Waldenburger <[EMAIL PROTECTED]> wrote: > > > > > On Sat, 6 Dec 2008 04:02:54 -0800 (PST) [EMAIL PROTECTED] wrote: > > > > class C: > > >     def $method(arg): > > >         $value = arg > > > > (Note there's no p

Function editing with Vim throws IndentError

2008-07-22 Thread ptn
Hi everybody, I have a weird problem. Say I have a .py file with some functions in it, like this: # (...) def foo(): print("bar") When I open it and add a line to one of the functions, # (...) def foo(): troz = "bar" print(troz) I get the following trac

Re: Converting List of String to Integer

2008-07-22 Thread ptn
> n = [] > for k in a: >     n.append([int(v) for v in k]) > print n > > Does anyone know what I am doing wrong? > > Thanks in advance. > > Samir Use extend instead of append: * Append -> add the one item to the end of the list * Extend -> add the list of items to the end of the list -- http://ma

Re: Python Written in C?

2008-07-21 Thread ptn
On Jul 20, 5:50 pm, [EMAIL PROTECTED] wrote: > I'm just learning about Python now and it sounds interesting. But I > just read (on the Wiki page) that mainstream Python was written in C. > That's what I was searching for: Python was written in what other > language? > > See, my concern was somethin

Re: Question on Joining of list

2008-07-19 Thread ptn
On Jul 18, 6:43 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jul 18, 11:42 pm, ptn <[EMAIL PROTECTED]> wrote: > [snip] > > >  Remember C, where i, j, > > k are indices, p, q, r are pointers, s, t are strings and x, y, z are > > integers. > > Only b

Re: Question on Joining of list

2008-07-18 Thread ptn
On Jul 18, 5:40 am, SUBHABRATA <[EMAIL PROTECTED]> wrote: > Hi Peter,Peter Otten wrote: > > SUBHABRATA wrote: > > > > Thanx Peter, > > > I would change my variables next time I would post. > > > No, you should use meaningful variable names when you write your code no > > matter whether you plan to

Files, directories and imports - relative to the current directory only

2008-03-25 Thread ptn
Hello, group. I can only read files and import modules that are in the same directory as the one my script is. Here is a test script (path.py): import os import uno # some module I wrote print list(os.walk('~/hacking/python')) f = open('~/read/foo.txt')

Re: Probably simple syntax error

2007-07-02 Thread ptn
> > Problem 6: big_randomized_int can only have values in 0, 1, ..., 98, > 99. So small_randomized_int will have the value 0, always. > > Perhaps you meant: > small_randomised_float = big_randomized_int / 100.0 > > > small_randomized_int = Round(small_randomized_int, 2) > > # R

Re: Reversing a string

2007-06-27 Thread ptn
> mylist = [] > > That's bad. If you need to use a list in the rev function, you > should bind a new list to a local variable inside rev. > He's right. If you want to use a list to temporarily store the reversed version of your string, it should exist only in the local namespace of your funct

Re: Reversing a string

2007-06-27 Thread ptn
> > or one letter per line: > > >>> print "\n".join("spam"[::-1]) > > m > a > p > s > One liners rock ;) -- http://mail.python.org/mailman/listinfo/python-list