Re: [Tutor] [tutor] Formbuffer question in PIL

2007-10-13 Thread Varsha Purohit
oops.. i wanted to ask about frombuffer which is in image library of PIL. I read the documentation but wanted a small sample program to understand its function... On 10/13/07, Varsha Purohit <[EMAIL PROTECTED]> wrote: > > Hello all, > I need some help in using formbuffer function in PIL. Doe

[Tutor] [tutor] Formbuffer question in PIL

2007-10-13 Thread Varsha Purohit
Hello all, I need some help in using formbuffer function in PIL. Does anybody have sample program related to this ? thanks, -- Varsha ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] File upload from python shell

2007-10-13 Thread Paulino
Hello! How can I upload a file from python? If it is a form to fill with values it's simple: urlopen("http://site.com/action?key1=value1;key2=value2";) and I get the form filled. What about uploading a file programmaticaly? Thank you Paulino __

Re: [Tutor] upgrading Python

2007-10-13 Thread bhaaluu
Greetings, On my system I can have several python versions installed because they install as python2.3, python2.4, etc. $ which python /usr/bin/python $ ls -l /usr/bin/python ... /usr/bin/python -> python2.4 Here, we can see that "python" is just a link to /usr/bin/python2.4 So, I can install pyt

Re: [Tutor] Variables in workspace

2007-10-13 Thread Dave Kuhlman
On Sat, Oct 13, 2007 at 11:04:05AM +0200, Eli Brosh wrote: > > Hello > I am working with python interactively using IDLE. > > Since starting, I defined some variables: > s='string' > a=1 > b=[1,2] > c=1.02 > > and so on. > > Now, I want to know which variables are in my workspace. > That is, is

Re: [Tutor] slice lists and slicing syntax questions

2007-10-13 Thread Dave Kuhlman
On Sat, Oct 13, 2007 at 10:32:39AM -0400, Michael Langford wrote: > On 10/12/07, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > > > > I have been using Python for years now, in all kinds of environments, but > > example: x is vector of length 5, with value "a","b","c","d","e" , then: > > > > x[3,

Re: [Tutor] upgrading Python

2007-10-13 Thread David Millar
Hi there, I'm not familiar with Mandrake, but I use Ubuntu Linux and my package manager does updates for me. It looks like Madrake has a package manager called urpmi according to Wikipedia - have you tried using that to install a new RPM package for Python 2.5.1 or simply trying to have it automat

[Tutor] upgrading Python

2007-10-13 Thread LandSurveyor
I wish to upgrade Python from the [Vers.] 2.3.4 that came packaged with my Mandrake 10.1 Linux OS to the current 2.5.1. The 'hash/bang' line of my python scripts is "#!/usr/bin/python". There are two files, both executables, in my /usr/bin directory; they are 1)python, and 2)python2.3. I just

Re: [Tutor] Variables in workspace

2007-10-13 Thread Alan Gauld
"Eli Brosh" <[EMAIL PROTECTED]> wrote > Now, I want to know which variables are in my workspace. Try dir() That should give you the names in the current namespace. You will see some names you didn't define too. dir()is a really helpful command when you want to see whats possible. >>> dir('')

Re: [Tutor] Variables in workspace

2007-10-13 Thread bob gailer
Kent Johnson wrote: > bob gailer wrote: >> The del statement is the way to delete variables. Since dir() gives >> you their names one needs use eval. >> >> for varName in dir(): >> eval 'del ' + varName > > I think del globals()[varName] would work. Yep. That was nagging a corner of my brain,

Re: [Tutor] Variables in workspace

2007-10-13 Thread Kent Johnson
bob gailer wrote: > The del statement is the way to delete variables. Since dir() gives you > their names one needs use eval. > > for varName in dir(): > eval 'del ' + varName I think del globals()[varName] would work. Kent ___ Tutor maillist -

Re: [Tutor] slice lists and slicing syntax questions

2007-10-13 Thread Kent Johnson
Michael Langford wrote: > When you call [] on an object, it calls __getitem__The definition for > getitem is __getitem__(self,key), where key can be an integer or a slice > object. Or a tuple of integers/slices. > You may want to try to write a PEP for python 3000. So much is being > changed

Re: [Tutor] slice lists and slicing syntax questions

2007-10-13 Thread Michael Langford
On 10/12/07, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > > I have been using Python for years now, in all kinds of environments, but > example: x is vector of length 5, with value "a","b","c","d","e" , then: > > x[3,1,1,1,3,2] # gives [d, b, b, b, d, c] > > What is the python equivalent? a.

Re: [Tutor] Variables in workspace

2007-10-13 Thread bob gailer
Eli Brosh wrote: > > Hello > I am working with python interactively using IDLE. > > Since starting, I defined some variables: > s='string' > a=1 > b=[1,2] > c=1.02 > > and so on. > > Now, I want to know which variables are in my workspace. > That is, is there a command similar to "who" in MATLAB ?

Re: [Tutor] Help with packages and namespaces please

2007-10-13 Thread Kent Johnson
Andrew Wu wrote: > Let's say I have these files in one directory: > > PrintBase.py > PrintHello.py > PrintBye.py > I'd like to reorganize the files so they're like the Sound example in > the Python tutorial: > > PrintMe/ > PrintMe/PrintBase/PrintBase.py > PrintMe/PrintHello/PrintHello.py > Pri

Re: [Tutor] Variables in workspace

2007-10-13 Thread Kent Johnson
Eli Brosh wrote: > I am working with python interactively using IDLE. > > Since starting, I defined some variables: > > Now, I want to know which variables are in my workspace. RESTART >>> dir() ['__builtins__', '__doc__', '__name__'] >>> s='string' >>> a

[Tutor] Variables in workspace

2007-10-13 Thread Eli Brosh
Hello I am working with python interactively using IDLE. Since starting, I defined some variables: s='string' a=1 b=[1,2] c=1.02 and so on. Now, I want to know which variables are in my workspace. That is, is there a command similar to "who" in MATLAB ? I want to call "who" and get the output: