> Danny Yoo wrote:
> >
> > file('filename.txt').readlines()[-1]
> Not to hijack the thread, but what stops you from just putting a
> file.close() after your example line?
> >>> Which file should file.close() close? The problem is that we don't
> >>> have a handle on the particular fi
Folks,
Sorry for asking you such a trivial question.!!! But i want to size up all the buttons with the same size as the largest one in the interface.. And thats why I am asking this question..
Regards,
Asrarahmed
-- To HIM you shall return.
___
T
Asrarahmed Kadri wrote:
>
>
>
> Folks,
>
> Sorry for asking you such a trivial question.!!! But i want to size up
> all the buttons with the same size as the largest one in the
> interface.. And thats why I am asking this question..
Oops, in your hurry to send the e-mail you seem to have fo
I've been looking into this, and I am not understanding how to get this
task done. I need to be able to look at a time object and know if it si
between now and a set point 120 days in the future. I can get a value
for now (currently I am using datetime.datetime.now()), but I haven't
found a way t
Hey there,I am trying to create a module with one classthe module name is group.pyit looks like this so farimport DbConnectorclass Group(object): def __init__(self, id):
self.id = id con = DbConnector.DbConnector() query = con.getOne("select `name`, `position` from `groups`
On Fri, October 20, 2006 8:55 am, William O'Higgins Witteman wrote:
> I've been looking into this, and I am not understanding how to get
> this task done. I need to be able to look at a time object and know
> if it si between now and a set point 120 days in the future. I can
> get a value for n
On Fri, Oct 20, 2006 at 11:55:39AM -0400, William O'Higgins Witteman wrote:
> I've been looking into this, and I am not understanding how to get this
> task done. I need to be able to look at a time object and know if it si
> between now and a set point 120 days in the future. I can get a value
>
shawn bright wrote:
Hey there,
I am trying to create a module with one class
the module name is group.py
it looks like this so far
import DbConnector
class Group(object):
def __init__(self, id):
self.id = id
con = DbConnector.DbConnector()
query = con.
Hey thanks for the help, yes, the class in in another file called group. the class Group is the only class in the module. I am doing this because the script that will call it is not the only place in all our scripts where it can be used. I have been doing stuff with python for over a year now, thou
oh, one more thing.these objects are going to be created at the rate of about 20 / minute in a thread.at some point is this going to be a problem ? do they go away over time?Or do i need to write something that will kill them?
thanksskOn 10/20/06, shawn bright <[EMAIL PROTECTED]> wrote:
Hey thanks
On 10/20/06, shawn bright <[EMAIL PROTECTED]> wrote:
> oh, one more thing.
> these objects are going to be created at the rate of about 20 / minute in a
> thread.
> at some point is this going to be a problem ? do they go away over time?
> Or do i need to write something that will kill them?
If yo
William O'Higgins Witteman wrote:
> I've been looking into this, and I am not understanding how to get this
> task done. I need to be able to look at a time object and know if it si
> between now and a set point 120 days in the future. I can get a value
> for now (currently I am using datetime.da
if i name them, like bob = group.Group(some_id) ?what is going to happen is that each time, the variable will create a different objectlike while 1: group = group.Group(some_id) do some stuff with group.
so since it keeps getting replaced, it should be ok without some way to destroy it ?thank
On Fri, 2006-10-20 at 13:44 -0500, shawn bright wrote:
> if i name them, like bob = group.Group(some_id) ?
>
> what is going to happen is that each time, the variable will create a
> different object
>
> like
> while 1:
> group = group.Group(some_id)
> do some stuff with group.
>
> so
way cool, thanks much guys.skOn 10/20/06, Python <[EMAIL PROTECTED]> wrote:
On Fri, 2006-10-20 at 13:44 -0500, shawn bright wrote:> if i name them, like bob = group.Group(some_id) ?>> what is going to happen is that each time, the variable will create a> different object
>> like> while 1:> grou
I'm trying to build a little piece of code that replaces an item in a list. Here is a sample of what I'd like to do.str = "This was replaced"ff item in list: replace item with str
I know I can do list.remove(item), but how do I place str back into that exact location?Is this how / best way?if ite
Why not:if item in list: loc = list.index(item) list[loc] = strOn 10/20/06, Chris Hengge <
[EMAIL PROTECTED]> wrote:I'm trying to build a little piece of code that replaces an item in a list.
Here is a sample of what I'd like to do.str = "This was replaced"ff item in list: replace item with str
Will that replace the location? or add to it? Thanks.On 10/20/06, Jason Massey <[EMAIL PROTECTED]
> wrote:Why not:if item in list: loc = list.index(item)
list[loc] = strOn 10/20/06, Chris Hengge <
[EMAIL PROTECTED]> wrote:
I'm trying to build a little piece of code that replaces an item in a list
You can access and change the elements in a list by directly referencing their position in the list.Something like:>>> foo = [1,2,3]>>> foo[0]1>>> foo[0] = 'a'>>> foo
['a', 2, 3]On 10/20/06, Chris Hengge <[EMAIL PROTECTED]> wrote:
Will that replace the location? or add to it? Thanks.On 10/20/06, Ja
On Fri, 20 Oct 2006 11:55:10 +0100
"Asrarahmed Kadri" <[EMAIL PROTECTED]> wrote:
> Folks,
>
> Sorry for asking you such a trivial question.!!! But i want to size up all
> the buttons with the same size as the largest one in the interface.. And
> thats why I am asking this question..
>
Hi Asrara
Hi.
I am pretty new to Python, but am trying to get up to speed so I move over
to Python from Perl. One progam I wrote in Perl I am trying to re-write in
Python. It controls the mixer settings on my sound card. I managed to
rewrite most of it by borrowing and stealing from the mixertest.py i
"Asrarahmed Kadri" <[EMAIL PROTECTED]> wrote
> I have the Tkinter book by Grayson (Python and Tkinter
> Programming).. *But
> I must say, its quite boring..*
It is a bit dense. And it jumps from basic to advanced pretty quickly.
But it is thorough and so far I've found very few mistakes.
That
"Asrarahmed Kadri" <[EMAIL PROTECTED]> wrote
> Sorry for asking you such a trivial question.!!! But i want to size
> up all
> the buttons with the same size as the largest one in the interface..
> And
> thats why I am asking this question..
Assuming you mean in Tkinter(given yor other posts) it
Chris,
> Will that replace the location? or add to it?
>
>> if item in list:
>> loc = list.index(item)
>> list[loc] = str
Jason already showed you the answer, but significantly he also
showed you how to find out for yourself. Use the >>> prompt.
Its what its there for.
For some reason peopl
Chris Hengge wrote:
> I'm trying to build a little piece of code that replaces an item in a
> list.
>
> Here is a sample of what I'd like to do.
>
> str = "This was replaced"
>
> ff item in list:
>replace item with str
>
> I know I can do list.remove(item), but how do I place str back into
>
I like it because it different.. and it reads cleanly... =PAs far as the first occurance.. I'm not concerned about checking extra, because the first occurance is the only one I should ever need.
On 10/20/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote:
Chris Hengge wrote:> I'm trying to build a li
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
I have been a sysadmin for quite a while now and used to do a lot of
perl. I haven't done much programming at all in the last couple of years
but have been meaning to dump perl for python anyhow (for the usual
reasons) and have finally gotten around to
All I can say to this... LOLLERSKATES =DOn 10/20/06, Tracy R Reed <[EMAIL PROTECTED]> wrote:
-BEGIN PGP SIGNED MESSAGE-Hash: SHA1I have been a sysadmin for quite a while now and used to do a lot of
perl. I haven't done much programming at all in the last couple of yearsbut have been mea
28 matches
Mail list logo