Tuple vs List: Whats the difference?

2007-07-11 Thread Shafik
Hello folks,

I am an experienced programmer, but very new to python (2 days). I
wanted to ask: what exactly is the difference between a tuple and a
list? I'm sure there are some, but I can't seem to find a situation
where I can use one but not the other.

Thanks in advance,
--Shafik

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tuple vs List: Whats the difference?

2007-07-11 Thread Shafik
On Jul 11, 12:05 pm, Alexander Schmolck <[EMAIL PROTECTED]> wrote:
> Shafik <[EMAIL PROTECTED]> writes:
> > Hello folks,
>
> > I am an experienced programmer, but very new to python (2 days). I
> > wanted to ask: what exactly is the difference between a tuple and a
> > list? I'm sure there are some, but I can't seem to find a situation
> > where I can use one but not the other.
>
> Try mutating the tuple or using the list as a hashkey.
>
> 'as

Cool thanks guys.

--Shafik


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tuple vs List: Whats the difference?

2007-07-12 Thread Shafik
Thanks to all of you, Im sure I'll pick your brains some more later
down the line.

--Shafik


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Using python with MySQL

2007-05-01 Thread Shafik
On May 1, 10:40 pm, HMS Surprise <[EMAIL PROTECTED]> wrote:
> Greetings,
>
> I need to peform some simple queries via MySQL. Searching the list I
> see that folks are accessing it with python. I am very new to python
> and pretty new to MySQL too. Would appreciate it if you could point me
> to some documentation for accessing MySQL via python. Something of the
> "Python and MySQL for Dummies" caliber would be about my speed, but of
> course I will be thankful for anything offered.
>
> Thanks,
>
> jvh

hi,
download this module:
http://sourceforge.net/projects/mysql-python
and look at the tutorial here:
http://www.kitebird.com/articles/pydbapi.html

-- 
http://mail.python.org/mailman/listinfo/python-list


Starting a thread before wxPython bootup ... interesting.

2007-10-04 Thread Shafik
Hello folks,

I'm having an issue with mixing wxPython and threading ... I realize
multi-threading always introduces subtle bugs, but the following
scenario is just odd:

I start a dummy thread, that does nothing but increment a counter and
print its value to the screen, then afterwards, I start the wxPython
application. I get nothing but weird behavior: sometimes the gui just
crashes, sometimes I get an exception, sometimes it runs for a little
but very slowly ...

Anyone know whats going on? I have a dual-core T5500, so multi
threading is piece of cake for it hardware -wise.


Cheers,
--Shafik

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Starting a thread before wxPython bootup ... interesting.

2007-10-05 Thread Shafik
My apologies for not supplying more info, I am at work and I am
technically not allowed to surf the web for anything.

I am using Python 2.5.1,  the latest wx version (2.8.xx, I dont recall
exactly). This is running under windows XP under the latest version of
cygwin (that could be the source of the issues too).

I was just looking for a general way to approach wx and
multithreading, not a detailed solution to my problem. There are lots
of tutorials online that describe how to perform a time-consuming task
in a separate thread in a wx-gui, but nothing that describes any other
use cases.

The real goal is to start the gui in a different thread, and have the
main thread regain control. That seems like a feasible thing to be
able to do, though I have been unsuccessful ... if anyone would like
to suggest something without being covertly insulting, I'm all ears.


Thanks,
--Shafik

On Oct 4, 5:58 pm, "[david]" <[EMAIL PROTECTED]> wrote:
> Since the observed behaviour is clearly undefined,
> I forgive you for the poorly specified behaviour
> description: asking for a close description of random
> behaviour is just ridiculous.
>
> The most obvious point is that wx is not re-entrant
> or thread safe: you have to make it so by using
> wx.CallAfter()
>
> Since you are talking about a bug in your screen
> display while using a screen library, it would
> also be interesting it you described the environment:
> Which operating system? Which windowing system?
> Which wx library? Which Python? Which IDE? What code?
>
> [david]
>
> Shafik wrote:
> > Hello folks,
>
> > I'm having an issue with mixing wxPython and threading ... I realize
> > multi-threading always introduces subtle bugs, but the following
> > scenario is just odd:
>
> > I start a dummy thread, that does nothing but increment a counter and
> > print its value to the screen, then afterwards, I start the wxPython
> > application. I get nothing but weird behavior: sometimes the gui just
> > crashes, sometimes I get an exception, sometimes it runs for a little
> > but very slowly ...
>
> > Anyone know whats going on? I have a dual-core T5500, so multi
> > threading is piece of cake for it hardware -wise.
>
> > Cheers,
> > --Shafik


-- 
http://mail.python.org/mailman/listinfo/python-list