Re: [Tutor] How do I add uvs to each vert line if a texture/bump map is used?

2007-09-14 Thread Kent Johnson
Does this have something to do with Python? What are uvs? vert line? texture/bump map? Kent Paul Coones wrote: > C3DModel > 4 > 2 > 0,50 > Cube > 1 > 1 > 8,1,12,0 > v1 > 1.00,0.500,0.500,0,1,NULL.TIF > "null.bump.tif" > -7.028856,3.349522,4.785803,0.23,0.46, > -0.46,0.00

Re: [Tutor] Is there some sort of Python Error log.

2007-09-14 Thread Kent Johnson
Lamonte Harris wrote: > Command prompt is a pain and it would be pretty nice to have this feature. I'm not sure what "this feature" is but look at the logging module. Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/t

Re: [Tutor] Just bought Python in a Nutshell

2007-09-14 Thread Danyelle Gragsone
Luckily that site still had one left .. so i brought it :D. I can always use another good and CHEAP book. Danyelle ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Just bought Python in a Nutshell

2007-09-14 Thread Danyelle Gragsone
awesome! I should see it in about 2 wks.. im poor. So I choose super snail mail. LN ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Is there some sort of Python Error log.

2007-09-14 Thread Luke Paireepinart
Lamonte Harris wrote: > Command prompt is a pain and it would be pretty nice to have this feature. If you're on windows, try using an IDE for your code editing. Then the errors will show up in the interactive shell that the IDE runs, and you won't have to deal with starting a DOS command prompt

Re: [Tutor] remove blank list items

2007-09-14 Thread Luke Paireepinart
Terry Carroll wrote: > On Fri, 14 Sep 2007, Michael Langford wrote: > > >> What you want is a set, not a list. Lucky for you, a python dict uses a >> set for its keys, so cheat and use that. >> > > Is that true? > > d={1:"a", 2:"b"} k=d.keys() type(k) > >

Re: [Tutor] [pygame] Re: Just bought Python in a Nutshell

2007-09-14 Thread Luke Paireepinart
Lamonte Harris wrote: > Wow I just got it, and its nice doesn't even look used god damn. :D. It's generally considered rude to curse in technical forums such as this. Also, please use more punctuation. You're hard to understand sometimes. -Luke ___ Tutor

Re: [Tutor] Is there some sort of Python Error log.

2007-09-14 Thread Rikard Bosnjakovic
On 15/09/2007, Lamonte Harris <[EMAIL PROTECTED]> wrote: > Command prompt is a pain and it would be pretty nice to have this feature. If you are using a Unixish system, do "python myscript.py 2> error.log". -- - Rikard - http://bos.hack.org/cv/ ___ T

Re: [Tutor] vi and python

2007-09-14 Thread wormwood_3
Hello, I go back and forth between SPE and VIM for Python myself. As for Python support in VIM, you can use most editions of VIM as a plain text editor, and it is fine for Python. But, if you install vim-python (http://ddtp.debian.net/ddt.cgi?desc_id=20183), you get some nice added features su

Re: [Tutor] vi and python

2007-09-14 Thread David Millar
Hi Bhaaluu and LadyNikon, I'm not exactly sure what you mean by Python support, but since I do most of my coding in plain text editors anyway I have had no trouble using vi/vim to edit/code. It's extremely useful for when my laptop is on battery mode - I have a terminal profile setup to be mostly

Re: [Tutor] vi and python

2007-09-14 Thread Danyelle Gragsone
Hi Bhaaluu, Sorry for the misunderstanding. Since vim points to vi automatically I have gotten used to calling it vi. But I did mean vim. LadyNikon ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] vi and python

2007-09-14 Thread bhaaluu
Greetings, I use vim (vi improved): http://www.ibiblio.org/obp/pyBiblio/tips/elkner/vim4python.php -- bhaaluu at gmail dot com On 9/14/07, Danyelle Gragsone <[EMAIL PROTECTED]> wrote: > Good Evening, > > I am running gentoo. I want to use vi to program in python. I > wondered are there any oth

Re: [Tutor] summing arrays, along a dimension

2007-09-14 Thread bob gailer
John wrote: > >>> d > array([[0, 0, 1], >[1, 2, 3], >[2, 2, 4], >[3, 6, 8]]) > >>> e=reshape((d[:,-2]+d[:,-1]),(4,1)) > >>> e > array([[ 1], >[ 5], >[ 6], >[14]]) > > is there a better way to accomplish this? Which module are you using? In APL we'd

[Tutor] vi and python

2007-09-14 Thread Danyelle Gragsone
Good Evening, I am running gentoo. I want to use vi to program in python. I wondered are there any other gentooovians out there who know if python support is already installed. Thanks, LadyNikon ___ Tutor maillist - Tutor@python.org http://mail.pyth

[Tutor] writing the correct map names

2007-09-14 Thread Paul Coones
# Test for maps #if faceUV = 0: texture_map = "NULL.TIF"

[Tutor] Is there some sort of Python Error log.

2007-09-14 Thread Lamonte Harris
Command prompt is a pain and it would be pretty nice to have this feature. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] summing arrays, along a dimension

2007-09-14 Thread Alan Gauld
"John" <[EMAIL PROTECTED]> wrote d > array([[0, 0, 1], > [1, 2, 3], > [2, 2, 4], > [3, 6, 8]]) e=reshape((d[:,-2]+d[:,-1]),(4,1)) e > array([[ 1], > [ 5], > [ 6], > [14]]) > > is there a better way to accomplish this? Better? Maybe. More reada

Re: [Tutor] remove blank list items

2007-09-14 Thread Terry Carroll
On Fri, 14 Sep 2007, Michael Langford wrote: > What you want is a set, not a list. Lucky for you, a python dict uses a > set for its keys, so cheat and use that. Is that true? >>> d={1:"a", 2:"b"} >>> k=d.keys() >>> type(k) ___ Tutor maillist -

Re: [Tutor] Just bought Python in a Nutshell

2007-09-14 Thread Terry Carroll
On Thu, 13 Sep 2007, Lamonte Harris wrote: > http://www.powells.com/biblio/63-9780596001889-7 Used, has anyone read this > book. Any additional information that you like,dislike about this book? I love it, and use it more than any other Python book. Much as I hate to be the bearer of bad news

Re: [Tutor] summing arrays, along a dimension

2007-09-14 Thread Ricardo Aráoz
John wrote: d > array([[0, 0, 1], >[1, 2, 3], >[2, 2, 4], >[3, 6, 8]]) e=reshape((d[:,-2]+d[:,-1]),(4,1)) e > array([[ 1], >[ 5], >[ 6], >[14]]) > > is there a better way to accomplish this? > >>> d [[0, 0, 1], [1, 2, 3], [2, 2, 4],

Re: [Tutor] Just bought Python in a Nutshell

2007-09-14 Thread Lamonte Harris
Wow I just got it, and its nice doesn't even look used god damn. :D. On 9/14/07, Lamonte Harris <[EMAIL PROTECTED]> wrote: > > Lol, you bought it, dude theres not one left imho. When I bought it, it > still said 1 More left Lol...mines should be her no less then a hour -.-... > Taking SO LONG. >

Re: [Tutor] evaluating AND

2007-09-14 Thread Ricardo Aráoz
Orest Kozyar wrote: > Given a variable x that can either be None or a tuple of two floats [i.e. > (0.32, 4.2)], which syntax is considered most appropriate under Python > coding standards? > > if x and x[0] > 0: > pass > > =OR= > > if x: > if x[0] > 0: > pass >

[Tutor] summing arrays, along a dimension

2007-09-14 Thread John
>>> d array([[0, 0, 1], [1, 2, 3], [2, 2, 4], [3, 6, 8]]) >>> e=reshape((d[:,-2]+d[:,-1]),(4,1)) >>> e array([[ 1], [ 5], [ 6], [14]]) is there a better way to accomplish this? ___ Tutor maillist - Tutor@python

[Tutor] How do I add uvs to each vert line if a texture/bump map is used?

2007-09-14 Thread Paul Coones
C3DModel 4 2 0,50 Cube 1 1 8,1,12,0 v1 1.00,0.500,0.500,0,1,NULL.TIF "null.bump.tif" -7.028856,3.349522,4.785803,0.23,0.46, -0.46,0.00,0.00 -7.028856,1.349522,4.785803,0.816492,-0.408246, -0.408246,0.00,0.00 -9.028855,1.349522,4.785803,-0.577349,-0.577349,

Re: [Tutor] evaluating AND

2007-09-14 Thread Terry Carroll
On Fri, 14 Sep 2007, Rikard Bosnjakovic wrote: > For me, "if x" would be enough. If you think it's a bad thing when x > is of the wrong data, then you really should check that it contains > *correct* data as well. That's an okay approach, but, but it's also non-Pythoninc; more of the look-before

Re: [Tutor] Just bought Python in a Nutshell

2007-09-14 Thread Lamonte Harris
Right, I like reading books it comes handier then reading ebooks, less programs and its right there in your hands. Main reason I'm going to use it for is to find questions without asking them on the python list or tutor list for a quicker referrence. On 9/14/07, [EMAIL PROTECTED] <[EMAIL PROTECT

Re: [Tutor] how to add arguments to a command line program

2007-09-14 Thread shawn bright
Just what i was looking for, thanks shawn On 9/14/07, Alan Gauld <[EMAIL PROTECTED]> wrote: > > > "shawn bright" <[EMAIL PROTECTED]> wrote > > > i am sure i do it with sys args, but don't know how. > > > > like > > > > python run_my_script.py somevar > > > > does this make sense ? > > > > Check my

Re: [Tutor] Problem with assigning list elements

2007-09-14 Thread Eric Brunson
That is not the expected behavior and not the behavior I see: Python 2.5.1 (r251:54863, May 1 2007, 13:27:01) [C] on sunos5 >>> z = [[1,2],[3,4]] >>> z[0][0]=100 >>> print z [[100, 2], [3, 4]] [EMAIL PROTECTED] wrote: > I'm having a problem assigning numbers to a 2-D list. > > for the 2d li

Re: [Tutor] deleting one line in multiple files

2007-09-14 Thread Alan Gauld
"bhaaluu" <[EMAIL PROTECTED]> wrote > I'm also looking into 'sed' for doing this. I've used 'sed' in the > past for > deleting a specific line from files, as well as doing simple search > and > replace in a file. I just figured that if it can be done in 'sed,' > it > can be done in Python muc

Re: [Tutor] how to add arguments to a command line program

2007-09-14 Thread Alan Gauld
"shawn bright" <[EMAIL PROTECTED]> wrote > i am sure i do it with sys args, but don't know how. > > like > > python run_my_script.py somevar > > does this make sense ? > Check my Talking to the User topic in my tutorial. The second half talks about using command line arguments. -- Alan G

Re: [Tutor] Problem with assigning list elements

2007-09-14 Thread bob gailer
[EMAIL PROTECTED] wrote: > I'm having a problem assigning numbers to a 2-D list. > > for the 2d list z for example, when I type in > > z[0][0]=67 > > every zeroth element of every sublist will be set to 67, instead of just > element > [0,0] being set to 67. > > If z = [[1,2],[3,4]] > > then z[0][0

Re: [Tutor] Problem with assigning list elements

2007-09-14 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > I'm having a problem assigning numbers to a 2-D list. > > for the 2d list z for example, when I type in > > z[0][0]=67 > > every zeroth element of every sublist will be set to 67, instead of just > element > [0,0] being set to 67. http://effbot.org/pyfaq/how-do-i-cre

[Tutor] Problem with assigning list elements

2007-09-14 Thread rgh2
I'm having a problem assigning numbers to a 2-D list. for the 2d list z for example, when I type in z[0][0]=67 every zeroth element of every sublist will be set to 67, instead of just element [0,0] being set to 67. If z = [[1,2],[3,4]] then z[0][0]=100 results in z= [[100,2],[100,4]] Is this

Re: [Tutor] how to add arguments to a command line program

2007-09-14 Thread Tom Tucker
See optparse or sys.argv. On 9/14/07, shawn bright <[EMAIL PROTECTED]> wrote: > > lo there all, > > i want to write a program that will be called from another program. > I need to pass it one variable. > i s

[Tutor] how to add arguments to a command line program

2007-09-14 Thread shawn bright
lo there all, i want to write a program that will be called from another program. I need to pass it one variable. i suppose i could also do this with a module, and create a new instance of whatever i want to pass it to, but all the same, how would i go about this. like if i had a program that i wa

Re: [Tutor] Class Inheritance

2007-09-14 Thread Eric Brunson
You're still using the wrong terminology... A "subclass" is "derived" (or "subclassed") from its "parent class" (or "super" class) A function that is part of the class definition (def func1(self): pass) is a "method" A variable that is part of the class definition or added after instantiation

Re: [Tutor] remove blank list items

2007-09-14 Thread Kent Johnson
Michael Langford wrote: > First off: > What you want is a set, not a list. Lucky for you, a python dict uses > a set for its keys, so cheat and use that. Python has had a set type in the stdlib since 2.3 and built-in since 2.4 so there is no need to cheat any more. > change: > for j in inpu

Re: [Tutor] remove blank list items

2007-09-14 Thread Michael Langford
First off: What you want is a set, not a list. Lucky for you, a python dict uses a set for its keys, so cheat and use that. change: for j in input: print j, to mySet={} for j in input: mySet[j]=j for item in mySet.keys(): print item Secondly, to not print blank lines, strip items and

[Tutor] remove blank list items

2007-09-14 Thread sacha rook
Hi i was expanding my program to write urls parsed from a html page and write them to a file so i chose www.icq.com to extract the urls from. when i wrote these out to a file and then read the file back I noticed a list of urls then some blank lines then some more urls then some blank lines,

Re: [Tutor] deleting one line in multiple files

2007-09-14 Thread bhaaluu
Greetings, Okay, I've had a chance to experiment with both solutions, and both of them work as advertised. For those just tuning in, what I wanted to do was delete a line in each file in a directory that had a specific pattern in the line. There were over two hundred files in the directory, and I

Re: [Tutor] deleting one line in multiple files

2007-09-14 Thread Michael Langford
Sed is a little easier than python for this project, but python is more flexible. Sed would be sed -e "s/^.*\

Re: [Tutor] deleting one line in multiple files

2007-09-14 Thread bhaaluu
Greetings, Many thanks to wormwood_3 and Kent for their help. Summary: The working script looks like this: # the lines with '

Re: [Tutor] deleting one line in multiple files

2007-09-14 Thread Kent Johnson
bhaaluu wrote: > On 9/13/07, wormwood_3 <[EMAIL PROTECTED]> wrote: > >> I think the problem is that the original script you borrowed looks >> at the file passed to input, and iterates over the lines in that file, removing them if they match your pattern. What you actually want to be doing is itera

Re: [Tutor] deleting one line in multiple files

2007-09-14 Thread bhaaluu
On 9/13/07, wormwood_3 <[EMAIL PROTECTED]> wrote: > I think the problem is that the original script you borrowed looks at the > file passed to input, and iterates over the lines in that file, removing them > if they match your pattern. What you actually want to be doing is iterating > over the

Re: [Tutor] Killing an instance

2007-09-14 Thread Kent Johnson
Ara Kooser wrote: >I have two instances called and running. They interact with each > other and I would like one of the instances to cease to exist in the > second round based on a given condition. How do you kill an instance? What you really need is for your main code to stop using the instan

[Tutor] list iteration question for writing to a file on disk

2007-09-14 Thread sacha rook
Hi can someone help with this please? i got to this point with help from the list. from BeautifulSoup import BeautifulSoupdoc = ['Page title', 'This is paragraph one.', 'This is paragraph two.', 'http://www.google.co.uk";>', 'http://www.bbc.co.uk";>', 'http:/

Re: [Tutor] How can I extend my vocabulary that fits well with python.

2007-09-14 Thread Alan Gauld
"Lamonte Harris" <[EMAIL PROTECTED]> wrote > See theres a lot of words that I know and some that I don't know, > how can I > extend and improve my python vocabulary so I can interpret > information in a > faster manor. Makes things easier to understand if you actually > understand > the thing

[Tutor] Just bought Python in a Nutshell

2007-09-14 Thread Lamonte Harris
http://www.powells.com/biblio/63-9780596001889-7 Used, has anyone read this book. Any additional information that you like,dislike about this book? [I like having real books and stead of ebooks because its better on the eyes.] Should be her 2morrow Afternoon :), few hours before I get home great