Thanks a lot Danny,
That certainly does make sense. I'll look into implementing the Queue
approach in my program tomorrow. I remember you recommending me this
module as well not long ago, although in a different discussion (where
I suspected problem with file access from multiple thread, but I gue
On Thu, 19 Jan 2006, Kent Johnson wrote:
> In your original desing were you sharing a connection between threads?
> That could cause trouble. But if each connection has its own thread and
> you are using transactions and isolation levels appropriately, they
> shouldn't stomp on each other.
Hi
On 1/19/06, Kent Johnson <[EMAIL PROTECTED]> wrote:
> Hi Bernard,
>
> I'm glad you got it working but kind of surprised at what you had to do.
> You shouldn't have to have a single thread to access the database. In
> your original desing were you sharing a connection between threads? That
> could c
Hi Bernard,
I'm glad you got it working but kind of surprised at what you had to do.
You shouldn't have to have a single thread to access the database. In
your original desing were you sharing a connection between threads? That
could cause trouble. But if each connection has its own thread and
Hello,
For the record, in case anyone would like to know what happened with
this issue...
It seems that the problem was related to the way I managed MySQL
connections. There was the main thread that would query every 5
seconds the database to see if a someone wanted to abort the job
running on t
On Fri, 20 Jan 2006, ps python wrote:
> In my XML file some attributes have text within an element. I want to
> get that text. How can I do that.
Hello,
The problems you have don't have to do with the calls to gettext, but to
selecting namespaced nodes as with your previous questions. Let's
Dear group,
In my XML file some attributes have text within an
element. I want to get that text. How can I do that.
I looked into ElementTree -bits and pieces: and there
is a small function.
>>> def gettext(elem):
... text = elem.text or ""
... for e in elem:
... text += get
On Thu, 19 Jan 2006, Vincent Zee wrote:
> Any pointers to other curses howto's?
There's http://heather.cs.ucdavis.edu/~matloff/Python/PyCurses.pdf ; but
it's mostly a couple of example programs, without a lot of explanation.
___
Tutor maillist - Tut
Assuming you are on a Unix style OS/terminal you can read the
output of stty. Look at the rows value
Here are a couple of runs of rows at different terminal sizes:
$ stty -a | grep rows
speed 38400 baud; rows 41; columns 80; line = 0;
$ stty -a | grep rows
speed 38400 baud; rows 26; columns 80;
Victor Bouffier wrote:
>I had to do the string-to-list-then-reverse-string-then-back-to-string
>process myself before knowing about this marvelous operand.
>It works on tuples (all immutable objects) too:
>
[SNIP]
Not all immutable objects, just those that define __getslice__
(basically, those t
Hi,
I have a python script that I want my users to execute with a
"Right-Mouse-Click" on a file under Windows XP.
(If possible without changing the default "Open with ..." behavior from
Windows.)
Does anybody has a simple example on how to do that?
Thanks,
-- Bernd
__
On Thursday, 19 January 2006 at 12:37:38 -0800, Danny Yoo wrote:
>
>
> On Thu, 19 Jan 2006, Vincent Zee wrote:
>
> > say you want to write a more-like program. How do you know how many
> > lines the terminal window can display.
>
> Hi Vincent,
>
> It's possible that this information might alre
On Thu, 19 Jan 2006, Vincent Zee wrote:
> say you want to write a more-like program. How do you know how many
> lines the terminal window can display.
Hi Vincent,
It's possible that this information might already be in your environment.
If you're using the 'bash' shell, and if the 'checkwinsiz
On Wed, 2006-01-18 at 23:03 -0800, Danny Yoo wrote:
> > > There are tradeoffs here. On the one hand, Python folks get caught
> > > off guard when they first encounter list aliasing. On the other, Perl
> > > folks get caught off guard when they first try to make a hash whose
> > > values are thems
On Thursday, 19 January 2006 at 11:29:29 -0800, Bill Campbell wrote:
> On Thu, Jan 19, 2006, Vincent Zee wrote:
> >Hi,
> >
> >say you want to write a more-like program.
> >How do you know how many lines the terminal window
> >can display.
>
> Use the curses library, and it will take care of this f
On Thu, Jan 19, 2006, Vincent Zee wrote:
>Hi,
>
>say you want to write a more-like program.
>How do you know how many lines the terminal window
>can display.
Use the curses library, and it will take care of this for you.
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
Hmm, a very newby question but I never had to deal with escaping spaces etc.I want to read a directory with spaces in it and it errors out (because of the space).I need to escape it with a \ I guess. I saw alot about that on some websites but they all talk about why and how you escape and not what
> I was trying to get the some result , eg
> describe table, select * from table
> but my program does not give the expected results ,
> nor it gives any error
First of all you have only defined init() but not created an instance
so it never actually gets called! But if you do call
>I wanted to try out python with MySQL databases
What do you need to know about?
Do you already know about MySql and just want to know how
to connect to a database and execute a SQL statement?
Or do you need to know about databases too?
If the latter you can try the database topic in my
Hi,
say you want to write a more-like program.
How do you know how many lines the terminal window
can display.
/\
Vincent
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
This was just posted by John Fouhy (snipped part of it):
Basically, the syntax is [start:stop:step].
If step is negative, you work backwards. eg:
>>> string.lowercase[20:10:-2] # letters 20, 18, 16, 14, 12
'usqom'
And if you omit the sta
On Thu, 19 Jan 2006, John Joseph wrote:
> Hi
>I tried out my first Pyhton program with MySQL
> I was trying to get the some result , eg
> describe table, select * from table
Hi John,
Unlike Java, Python doesn't force you to put everything in a class. You
can try the simpl
On Thu, 19 Jan 2006, Jon Moore wrote:
> I need some help for a program I am writing as a newbie to Python.
>
> I have created a series:
>
> WORDS = ("python", "program", "code", "xylophone")
>
> and then assigned one of them randomly to the variable 'word':
>
> word = random.choice(WORDS)
>
> I
Srinivas Iyyer wrote:
> Hi Group,
>
> my Problem:
>
> I have soms list for variety of animals, birds,
> bacteria
>
>
> I have another list:
> search_list =
> ['cat','python','parrot','donkey','e.coli']
>
> animals = ['cat','tiger','donkey','zebra','lemur']
> birs = ['parrot','mina','oriole','
Yes you can.you can make: search_list =['cat','python','parrot','donkey','e.coli'] animals = ['python','cat','tiger','donkey','zebra','lemur'] birds = ['parrot','mina','oriole','blue jay'] bacteria = ['
e.coli','bacillus','staphy','acetobacter'] mydic = {} for animal in animals :
Hi Group,
my Problem:
I have soms list for variety of animals, birds,
bacteria
I have another list:
search_list =
['cat','python','parrot','donkey','e.coli']
animals = ['cat','tiger','donkey','zebra','lemur']
birs = ['parrot','mina','oriole','blue jay']
bacteria =
['e.coli','bacillus','staphy
Another approach would be to change your data structure to include the words
and hints together as tuples in the same tuple.
ie...
WORDS=( ("python","The python hint"),("program","The program hint"),
("code","The code hint") )
then you can do...
word, hint = random.choice(WORDS)
>>> WORDS=(
Jon Moore wrote:
> Hello
>
> I need some help for a program I am writing as a newbie to Python.
>
> I have created a series:
>
> WORDS = ("python", "program", "code", "xylophone")
>
> and then assigned one of them randomly to the variable 'word':
>
> word = random.choice(WORDS)
>
> I know tha
Hello Jon,Why don't use randint so you can record the index and the value Example: WORDS = ("python", "program", "code", "xylophone") Indword = random.randint
(0,len(WORDS)-1) word = WORDS[Indword] print Indword print wordCheers,pujoOn 1/19/06, Jon Moore <
[EMAIL PROTECTED]> wrote:He
HelloI need some help for a program I am writing as a newbie to Python.I have created a series:WORDS = ("python", "program", "code", "xylophone")
and then assigned one of them randomly to the variable 'word':word = random.choice(WORDS)I know that if I do:
print wordThe randomly chosen word will be
You should fetch the results. try:
result
= cursor.fetchall() print result
Cheers,pujo import MySQLdbclass learnpython_db:def __init__(self):
db =MySQLdb.connect(host="localhost",user ="john",password = "asdlkj", db = learnpython)cursor = db.cursor(
Hi
I tried out my first Pyhton program with MySQL
I was trying to get the some result , eg
describe table, select * from table
but my program does not give the expected results ,
nor it gives any error
I am adding my code in this mail
P
Hi!
Ben Vinger wrote:
> Hello
>
> I've been reading about how a class has access to its
> own 'self', so I tried the following, but it is not
> working as I would expect:
>
> class Skill:
>def __init__(self):
> self.history = []
>
>def setName(self, skill):
> self.nam
John Joseph wrote:
> Hi I wanted to try out python with MySQL databases , I would like
> to get info about the link to sites , which gives you examples on how
> to do python programming by using MySQL database Please guide
> Thanks Joseph John
>
>
Try this one:
http://sourceforge.net/docman/
andy senoaji wrote:
> Thanks Danny & Alan,
>
> your print repr(os.listdir("C:/")) has embarrased myself :(. I found out
> the file name is Test.txt.txt in my c: drive. I guess I learn something
> here.
If you tell Windows not to hide file extensions you won't make that
mistake again. On my com
Hi
I wanted to try out python with MySQL databases
, I would like to get info about the link to sites ,
which gives you examples on how to do python
programming by using MySQL database
Please guide
Thanks
Joseph John
36 matches
Mail list logo