Under Kent's tutelage, I've been experimenting with having no
PYTHONDOC, and instead putting a .pth file in
E:\Python25\lib\site-packages\ I named pointers.pth. The contents of
pointers.pth is:
E:\Python25\
E:\PythonWork\
E:\PythonWork\Functions\
E:\Python25\lib\site-packages\
E:\Python25\lib\si
Okay, I'm making a program that turns xml code into python code. Here's
the an example of input-
And here would be the corresponding output (well, what I've got so far...)
from Tkinter import *
import tk
"Ricardo Aráoz" <[EMAIL PROTECTED]> wrote
>> Thanks guys it was really helpful i m just a beginner in
>> python
>> start to program since two days back. So finding little difficulty
>> with
>> some concepts.
>>
>
> Don't worry, I'm a 20 days "old timer". ;c)
And I've been using Python for
Varsha Purohit wrote:
>
> Thanks guys it was really helpful i m just a beginner in python
> start to program since two days back. So finding little difficulty with
> some concepts.
>
Don't worry, I'm a 20 days "old timer". ;c)
___
Tutor maillist
"Ricardo Aráoz" <[EMAIL PROTECTED]> wrote
>>From Python 2.5 documentation :
>
> index( sub[, start[, end]])
> Like find(), but raise ValueError when the substring is not found.
As opposed to find() which returns -1 when the string is
not found. That means you can use try/except with
index but mu
Thanks guys it was really helpful i m just a beginner in python start
to program since two days back. So finding little difficulty with some
concepts.
On 9/2/07, Ricardo Aráoz <[EMAIL PROTECTED]> wrote:
>
> Varsha Purohit wrote:
> > Hello,
> > i have again very basic question in python stri
Varsha Purohit wrote:
> Hello,
> i have again very basic question in python string management.
>
> I am not able to understand how find and index works and what do they
> actually return.
>
line = "this is varsha"
print line.find("is")
> 2
print line.rfind("is")
> 5
print li
"jim stockford" <[EMAIL PROTECTED]> wrote
> If I write a little .py file, its name is __main__
>
> assuming no big nit-picks in the claim above,
> is __main__ a class?
No, its the name of your module when its run as a script
rather than imported. Its assigned by the interpreter.
(At least i ass
Hello,
i have again very basic question in python string management.
I am not able to understand how find and index works and what do they
actually return.
>>> line = "this is varsha"
>>> print line.find("is")
2
>>> print line.rfind("is")
5
>>> print line.rfind("varsha")
8
>>> print line.index(
jim stockford wrote:
> I've gotten red-eyed looking through google pages
> to find answers. I've read the python.org docs and
> tutorials entirely (some parts very quickly).
>
> If I write a little .py file, its name is __main__
>
> assuming no big nit-picks in the claim above,
> is __main__ a cl
Hello. I'm working on a text adventure game right now, and I seem to be kind
of stuck. There's a huge chunk of code called moreaction() that pulls
scripted events for certain locations. It's ever-changing so I'm not looking
for specifics, but can anyone suggest good ways to clean up or condense the
I've gotten red-eyed looking through google pages
to find answers. I've read the python.org docs and
tutorials entirely (some parts very quickly).
If I write a little .py file, its name is __main__
assuming no big nit-picks in the claim above,
is __main__ a class?
What exactly does it mean "mod
"Sean Cronin[tutor]" <[EMAIL PROTECTED]> wrote
> (in case you couldn't tell :) ). However, I can't understand why
> you want
> to make a separate function called parse.
OK, I want to make a separate *method* called parse, not a function.
Methods are what you have inside classes. You send messa
shimon gurman wrote:
> Can someone explain to me why this program isnt working? i.e. I always get
> 'backup failed'?
> This is a program from byte of python tutorial and im using windows xp.
>
>
>
>
> import os, time
>
>
>
> source = ['d:\\python']
>
>
> target_directory = 'd:\\python1'
Can someone explain to me why this program isnt working? i.e. I always
get 'backup failed'?
This is a program from byte of python tutorial and im using windows xp.
import os, time
source = ['d:\\python']
target_directory = 'd:\\python1'
target = target_directory + time.strftime('%Y%m%d_%H%
Varsha Purohit wrote:
> Thanks Eric and Alan i did that with while loop. I donno i was getting
> an error while using a for loop for subindexing. Here is what i did
>
> i=0
> selectCols=0
> arr2=[]
> while i selectCols=grid[i][colID]
> i+=1
> arr2.append(selectCols)
>
> print "col"
Thanks Eric and Alan i did that with while loop. I donno i was getting an
error while using a for loop for subindexing. Here is what i did
i=0
selectCols=0
arr2=[]
while icolID is the value of the requested column to print. which remains the
same throughout the iteration of while.
On 9/2/07, Ala
Hey,
Thanks Alan for the help on the classes. This is my first time using them
(in case you couldn't tell :) ). However, I can't understand why you want
to make a separate function called parse. What I am trying to do by having
different functions in the class like maxtemp, and mintemp, is to a
At 08:17 AM 9/2/2007, Kent Johnson wrote:
>Dick Moores wrote:
>>
>>>- add a .pth file to site-packages/ that contains the path to the
>>>dir you want to add to sys.path
>>I tried this with no PYTHONPATH. I put pointers.pth in
>>site-packages\ with the single line, E:\PythonWork\Functions\ .
>>Fu
Dick Moores wrote:
> Thanks, Kent.
>
> At 05:40 AM 9/2/2007, Kent Johnson wrote:
>> There are quite a few ways to get a module into the search path,
>> modifying PYTHONPATH is just one way. Some others:
>> - create a site-packages/ dir in the Python lib dir. Put your
>> modules and packages ther
Thanks, Kent.
At 05:40 AM 9/2/2007, Kent Johnson wrote:
>There are quite a few ways to get a module into the search path,
>modifying PYTHONPATH is just one way. Some others:
>- create a site-packages/ dir in the Python lib dir. Put your
>modules and packages there and they will be found by Pytho
"Kent Johnson" <[EMAIL PROTECTED]> wrote
> PYTHONPATH is for your own customizations of sys.path, it is not the
> entirety of sys.path. AFAIK you don't have to define it at all if
> you
> don't want to use it.
All true. The point of PYTHONPATH is that you could have several
users all running pyt
"Varsha Purohit" <[EMAIL PROTECTED]> wrote
> grid = [[1,1,2,7,6,9],\
> [,9,1,1,1,9,1],\
> [8,1,2,0,0,4],\
> [1,4,1,1,8,5]]
You don't need the '\' characters, the fact that the closing
bracket has not been reached means Python will ignore
the newline characters.
> ho
Dick Moores wrote:
> At 01:08 AM 9/1/2007, Alan Gauld wrote:
>
>> "Dick Moores" <[EMAIL PROTECTED]> wrote
>>
>> > > > And another question is, exactly what should go into PYTHONPATH?
>> >
>> > >Its what goes into sys.path.
PYTHONPATH is for your own customizations of sys.path, it is not the
enti
>
> COL = 5
> [i[COL-1] for i in grid]
Should have guessed...
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Varsha Purohit wrote:
>
>
> Hello,
> Suppose i have a 2D list(grid) like
>
> grid = [[1,1,2,7,6,9],\
> [,9,1,1,1,9,1],\
> [8,1,2,0,0,4],\
> [1,4,1,1,8,5]]
>
> how can i access to all the elements of the list from column no. 5.
>
> output should be like [6,9,0,
> grid = [[1,1,2,7,6,9],\
> [,9,1,1,1,9,1],\
> [8,1,2,0,0,4],\
> [1,4,1,1,8,5]]
>
> how can i access to all the elements of the list from column no. 5.
>
> output should be like [6,9,0,8]...
Your basic tool is sub-indexing: you can reach items in the sub-lists
by us
At 01:08 AM 9/1/2007, Alan Gauld wrote:
"Dick Moores"
<[EMAIL PROTECTED]> wrote
> > > And another question is, exactly what should go into
PYTHONPATH?
>
> >Its what goes into sys.path.
I've found that whether I'm using Command Prompt, IDLE, or Ulipad, that
they add a lot to sys.path.
When PYTHONP
Hello,
Suppose i have a 2D list(grid) like
grid = [[1,1,2,7,6,9],\
[,9,1,1,1,9,1],\
[8,1,2,0,0,4],\
[1,4,1,1,8,5]]
how can i access to all the elements of the list from column no. 5.
output should be like [6,9,0,8]...
thanks,-
Varsha Purohit,
__
Hello,
Suppose i have a 2D list(grid) like
grid = [[1,1,2,7,6,9],\
[,9,1,1,1,9,1],\
[8,1,2,0,0,4],\
[1,4,1,1,8,5]]
how can i access to all the elements of the list from column no. 5.
output should be like [6,9,0,8]...
thanks,-
Varsha Purohit,
__
"Sean Cronin[tutor]" <[EMAIL PROTECTED]> wrote
> Right now I have two modules named libndfdsoap and weatherpy.
> Module
> libndfdsoap contains one function that gets the XML and saves it to
> a file
> named weather.xml.
Seems fair enough.
> Module weatherpy contains some constants and a class
31 matches
Mail list logo