Hello, I have what should be a basic math question, but I keep messing
it up.
How do I code an equation so that when I have an object facing an
arbitrary vector, pressing a key will make it move forwards in that
direction?
(I understand all the key-based setup, it's just the equation for moving
Thanks a lot for all that info. I am going to start with the doc/lib index for an overview and dir looks like a good runtime help command.Ravi.On 10/27/06,
Danny Yoo <[EMAIL PROTECTED]> wrote:
On Fri, 27 Oct 2006, Ravi Kondamuru wrote:> How does one figure all the builtin libraries/ classes that p
>> It looks like people have identified the problem, that your site.py
>> module isn't being found because it conflicts with something from
>> Python's Standard Library.
>>
>> This isn't the first time this kind of problem has hit people. This
>> problem is well known and is the subject of a Pyt
On Fri, 27 Oct 2006, Ravi Kondamuru wrote:
> How does one figure all the builtin libraries/ classes that python
> supports?
>
> For example if I want to sort a list of names, I would normally think of
> implementing the sorting routine in C. I am just beginning to learn
> python. It looks lik
Ravi Kondamuru wrote:
> Hi,
>
> How does one figure all the builtin libraries/ classes that python
> supports?
>
> For example if I want to sort a list of names, I would normally think
> of implementing the sorting routine in C. I am just beginning to learn
> python. It looks like there is a ri
Hi,How does one figure all the builtin libraries/ classes that python supports?For example if I want to sort a list of names, I would normally think of implementing the sorting routine in C. I am just beginning to learn python. It looks like there is a rich set available builtin libraries. So, is t
> For example
> with "SELECT * FROM a", I use this code
>
> ... to know how many columns are in the result,
As a general rule its better to avoid "Select * From" in production
SQL.
If the table definition changes the data returned can change in
unexpected
ways and break your application. In addi
"Pine Marten" <[EMAIL PROTECTED]> wrote
> it is just a small dataset. But how small is small?
A potentially big topic.
But heres my purely arbitrary guidelines:
Less than 1000 records use a text file (or maybe XML)
1,000 - 100,000 records consider an in memory database
or something like g
"Etrade Griffiths" <[EMAIL PROTECTED]> wrote
>
> I want to check the type of a variable so that I know which format
> to use
> for printing eg
That's sometimes necessary but you may find that just
using %s will suffice.
print "%s\n" % 42
print "%s\n" % "42"
print "%s\n" % 42.0
You usually only
I'm hoping to create an app which takes user data via a GUI with checkboxes,
textcontrols, spinner controls, etc. The data would be some text, some
numbers, some checkboxes checked or not, etc. I've been making a little
progress on that via wxPython and Boa Constructor.
Now I want to save th
Greetings:
I agree completely with David. There are plenty of places to discuss
controvercial topics. Let's not do it here, where it will only disrupt,
and possibly ruin, an exceptionally useful teaching and learning
channel.
Regards,
Barry
[EMAIL PROTECTED]
541-302-1107
___
On Fri, Oct 27, 2006 at 11:24:00AM +0100, Asrarahmed Kadri wrote:
> Hi Folks,
>
> ANy comments about ELementTree module...
>
> I have heard that it is more 'Pythonic'...
>
> I need some basic examples to start learning the stuff.. If anyone has got
> the information, please pass it along..
>
E
Chris:
See below.
> -Original Message-
> Message: 7
> Date: Fri, 27 Oct 2006 12:20:51 -0700
> From: "Chris Hengge" <[EMAIL PROTECTED]>
> Subject: Re: [Tutor] Why is this only catching one occurance?
> To: "Bob Gailer" <[EMAIL PROTECTED]>
> Cc: Tutor
> Message-ID:
> <[EMAIL PROTE
That was supposed to say "Thanks for this" but I was in a hurry.Anyways, here is my solution:# Remove any copies of .hex that aren't BMC for foundItem in directoryList: try:
if ".hex" in foundItem.lower(): if "bmc" in foundItem.lower():
Bob Gailer wrote:
> Duncan Gibson wrote:
>
>> [snip]
>>
>
>
>> but I would like to record the line number in the file.
>>
>>
> How about using enumerate():
>
>> for line_num, data in enumerate(reader):
>> # print reader.line_num, data # SHOULD BE:
>> print
I've tried to use your example:for unWantedItem in directoryList[,,-1]:but I get an error:for unWantedItem in directoryList[,,-1]: ^SyntaxError: invalid syntax
I understand what you are saying to do, and it makes sense, but I'm not sure how to implime
Thats for this very humorous reply =DOn 10/26/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote:
Chris Hengge wrote:> Here is my code:> for unWantedItem in directoryList:> try:
> if "hex" in unWantedItem.lower():> if not "bmc" in unWantedItem.lower():>
Duncan Gibson wrote:
> [snip]
> but I would like to record the line number in the file.
>
How about using enumerate():
>
> for line_num, data in enumerate(reader):
> print reader.line_num, data
>
>
--
Bob Gailer
510-978-4454
___
Tu
> What are generators and iterators...??And why are they are needed..??
>
> I can do my stuff with a 'for' or a 'while' loop.. so why do I need an
> ITERATOR..?
>
> And what is a generator ..? I did try to read about these two things on the
> web, but still I AM CONFUSED.
here are some more place
> > I want to check the type of a variable so that I know which format to use
> > for printing eg
> >
> Alternatively, you could just cast it as a string.
what joshua is saying is that for just displaying something, that it's
just as easy to convert it to a string, or, if you're using print, to
no
On 10/27/06, Etrade Griffiths
<[EMAIL PROTECTED]>
wrote:
Hi
I want to check the type of a variable so that I know which format to
use
for printing egAlternatively, you could just cast it as a string.
___
Tutor maillist - Tutor@python.org
http
May I invite EVERYONE to NOT introduce political or religious elements
into these discussions. It has no place here and can destroy this
excellent discussion group. I've seen it happen.
PLEASE take it elsewhere.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Beh
Bob Gailer wrote:
> Asrarahmed Kadri wrote:
>>
>> What are generators and iterators...??And why are they are needed..??
>>
>> I can do my stuff with a 'for' or a 'while' loop.. so why do I need an
>> ITERATOR..?
> iterators & generators do not replace while or for loops!
No, actually iterato
Duncan Gibson wrote:
> If I have the following data file, data.csv:
> 1 2 3
> 2 3 4 5
>
> then I can read it in Python 2.4 on linux using:
>
> import csv
> f = file('data.csv', 'rb')
> reader = csv.reader(f)
> for data in reader:
> print data
>
> OK, that's all well
Asrarahmed Kadri wrote:
>
>
> Hi Folks,
>
> What are generators and iterators...??And why are they are needed..??
>
> I can do my stuff with a 'for' or a 'while' loop.. so why do I need an
> ITERATOR..?
iterators & generators do not replace while or for loops!
>
> And what is a generato
Chris Hengge wrote:
> Here is my code:
> for unWantedItem in directoryList:
> try:
> if "hex" in unWantedItem.lower():
> if not "bmc" in unWantedItem.lower():
>print unWantedItem + " removed!"
>directory
Thanks, guys - like so many things, easy when you know how!
Alun Griffiths
At 14:27 27/10/2006, you wrote:
Use this:
if type(a) == type(1):
print "a is int %d"
elif type(a) == type(1.1):
...
HTH..
Regards,
Asrarahmed Kadri
On 10/27/06, Etrade Griffiths
<[EMAIL PROTECTED]>
wrote:
Use this:
if type(a) == type(1):
print "a is int %d"
elif type(a) == type(1.1):
...
HTH..
Regards,
Asrarahmed Kadri
On 10/27/06, Etrade Griffiths <[EMAIL PROTECTED]> wrote:
HiI want to check the type of a variable so that I know which format to usefor printing eg
def print_correct_f
Etrade Griffiths wrote:
> Hi
>
> I want to check the type of a variable so that I know which format to use
> for printing eg
>
> def print_correct_format(a):
>
> if type(a) == 'int':
> print "a is an integer, value %i" % (a)
> elif type(a) == 'float':
> p
Etrade Griffiths wrote:
>Hi
>
>I want to check the type of a variable so that I know which format to use
>for printing eg
>
>def print_correct_format(a):
>
> if type(a) == 'int':
> print "a is an integer, value %i" % (a)
> elif type(a) == 'float':
> print "
Hi
I want to check the type of a variable so that I know which format to use
for printing eg
def print_correct_format(a):
if type(a) == 'int':
print "a is an integer, value %i" % (a)
elif type(a) == 'float':
print "a is a float, value %f" % (a)
this is cool, ill give it a shotskOn 10/27/06, euoar <[EMAIL PROTECTED]> wrote:
euoar escribió:> mc collilieux escribió:>> euoar wrote:>> I'm learning the use of liststores and treeviews. I have wrotten this litle class as exercice:
# name is the name of the new column to add, valu
Duncan Gibson wrote:
>
> Kent Johnson wrote:
>> The line_num attribute is new in Python 2.5. This is a doc bug,
>> it should be noted in the description of line_num.
>
> Is there some way to create a wrapper around a 2.4 csv.reader to
> give me pseudo line number handling? I've been experimenting
Kent Johnson wrote:
> The line_num attribute is new in Python 2.5. This is a doc bug,
> it should be noted in the description of line_num.
Is there some way to create a wrapper around a 2.4 csv.reader to
give me pseudo line number handling? I've been experimenting with:
import csv
clas
euoar escribió:
> mc collilieux escribió:
>> euoar wrote:
>>
I'm learning the use of liststores and treeviews. I have wrotten
this litle class as exercice:
>>
>>
# name is the name of the new column to add, values is a tuple with
the values to add def add_result (self, name, va
Hi Folks,
What are generators and iterators...??And why are they are needed..??
I can do my stuff with a 'for' or a 'while' loop.. so why do I need an ITERATOR..?
And what is a generator ..? I did try to read about these two things on the web, but still I AM CONFUSED.
To be honest, I am
Asrarahmed Kadri wrote:
>
>
> Hi Folks,
>
> ANy comments about ELementTree module...
>
> I have heard that it is more 'Pythonic'...
>
> I need some basic examples to start learning the stuff.. If anyone has
> got the information, please pass it along..
http://effbot.org/zone/element.htm
Hi Folks,
ANy comments about ELementTree module...
I have heard that it is more 'Pythonic'...
I need some basic examples to start learning the stuff.. If anyone has got the information, please pass it along..
Thanks.
Regards,
Asrarahmed Kadri-- To HIM you shall return.
_
Duncan Gibson wrote:
> If I have the following data file, data.csv:
> 1 2 3
> 2 3 4 5
>
> then I can read it in Python 2.4 on linux using:
>
> import csv
> f = file('data.csv', 'rb')
> reader = csv.reader(f)
> for data in reader:
> print data
>
> OK, that's all we
Chris Hengge wrote:
> Here is my code:
> for unWantedItem in directoryList:
> try:
> if "hex" in unWantedItem.lower():
> if not "bmc" in unWantedItem.lower():
>print unWantedItem + " removed!"
>directory
On Fri, 27 Oct 2006 11:35:40 +0200
Duncan Gibson <[EMAIL PROTECTED]> wrote:
>
> If I have the following data file, data.csv:
> 1 2 3
> 2 3 4 5
>
> then I can read it in Python 2.4 on linux using:
>
> import csv
> f = file('data.csv', 'rb')
> reader = csv.reader(f)
> for
rolando wrote:
> Well, I don't know if I can ask this question here, but never mind that :)
Yes, it's fine.
>
> It´s like this, I created this python script that translates "human
> language" to Al-bhed language (it's a language from the game Final
> Fantasy 10, it's basicly a change in the let
I'm learning to use python with the database mysql. I'm writing a
widget in pygtk that should show the results of a sql query. For example
with "SELECT * FROM a", I use this code
count = 0
a = db.cursor.description
for tuple in a:
print tuple[0][0]
count = count + 1
If you're just going for a simple two-textbox, one button, 'type here,
hit the button, and the translated text appears in the other box'
Yeah, its something like that :D
Nothing to much fancy, it just that it can get kind of boring always
going to the linux console to run the script.
I'm go
If I have the following data file, data.csv:
1 2 3
2 3 4 5
then I can read it in Python 2.4 on linux using:
import csv
f = file('data.csv', 'rb')
reader = csv.reader(f)
for data in reader:
print data
OK, that's all well and good, but I would like to record
the li
rolando wrote:
> Well, I don't know if I can ask this question here, but never mind
> that :)
>
> It´s like this, I created this python script that translates "human
> language" to Al-bhed language (it's a language from the game Final
> Fantasy 10, it's basicly a change in the letters for exampl
Kent Johnson пишет:
> Basil Shubin wrote:
>> Hi, friends!
>>
>> Is there exist a module for working with config file? Simple enough,
>> just read/write config file (like for most unix app), determine where
>> row is contain config words with it's parameters (like
>> 'config_word=parameter') or i
Well, I don't know if I can ask this question here, but never mind that :)
It´s like this, I created this python script that translates "human
language" to Al-bhed language (it's a language from the game Final
Fantasy 10, it's basicly a change in the letters for example A becomes W
or B become
Oh, ok :D
Luke Paireepinart escreveu:
> rolando wrote:
>> I just use the reply button in my Thunderbird, and then change the
>> email I want to send to tutor@python.org
> It's better to use reply-all, in my opinion, because then, if
> someone's involved in an e-mail thread, they'll get an insta
49 matches
Mail list logo