Re: [Tutor] 3d manipulation [VPython, or pyopengl, or pymol?]

2005-07-19 Thread Danny Yoo
On Tue, 19 Jul 2005, mdcooper wrote: > I need to make a program that will allow a user to rotate and translate > a molecule (using the mouse) so as to bring any given atom of that > molecule (or plane encompassing a number of atoms) to the X-Y plane > (i.e. the Z component would be 0). I cannot

Re: [Tutor] Getting singal strength of the received packet

2005-07-19 Thread Danny Yoo
On Tue, 19 Jul 2005, sunny sunny wrote: > In C I have seen some programs such as kismet etc where c programs could > be written to get the SS from the card. The idea probably is to read the > prism 2 header from the driver. This I guess is a bit more lower than > the "raw socket" where we can ge

[Tutor] 3d manipulation

2005-07-19 Thread mdcooper
Hello all, I need to make a program that will allow a user to rotate and translate a molecule (using the mouse) so as to bring any given atom of that molecule (or plane encompassing a number of atoms) to the X-Y plane (i.e. the Z component would be 0). I cannot find appropriate modules to allow

Re: [Tutor] Getting singal strength of the received packet

2005-07-19 Thread sunny sunny
Hi, In C I have seen some programs such as kismet etc where c programs could be written to get the SS from the card. The idea probably is to read the prism 2 header from the driver. This I guess is a bit more lower than the "raw socket" where we can get the MAC layer frame. The prism 2 header giv

Re: [Tutor] Minesweeper the return

2005-07-19 Thread jfouhy
Quoting Alberto Troiano <[EMAIL PROTECTED]>: > Please let's talk about this more! *grin* > I'm not sure if I'm following you, what I see here is a function inside > other function and the first function returns its inside function, but > how does it work? In Python, as in other modern languages,

Re: [Tutor] Tkinter: justify label

2005-07-19 Thread jfouhy
Quoting Bernard Lebel <[EMAIL PROTECTED]>: > Can you specify a justification for a label widget? I'm reading there > is a justify option available on this page: > http://www.pythonware.com/library/tkinter/introduction/x611-text-formatting.htm > Although I don't know if this option works for label.

Re: [Tutor] Help with ebay profit/loss program error

2005-07-19 Thread jfouhy
Quoting Sam Klinger <[EMAIL PROTECTED]>: > Hi my name is Sam Klinger and I made a smal program to help find out > the cost of listing and selling an item on ebay. However I see nothing > wrong with the code but I get these error messages: Hi Sam, The problem is here: > def listing_price(): > p

Re: [Tutor] Getting singal strength of the received packet

2005-07-19 Thread Byron
sunny sunny wrote: >Hi, > >I am sending and receiving for a simple server application over wirless link. >Can I get the signal strength of the received packet in Python? > Isn't this done strictly at the hardware level of the NIC? I don't believe that one can get this information from Python.

Re: [Tutor] Pager in Python?

2005-07-19 Thread Lee Harr
>Is there a command like more(1) or less(1) in python to display >the output of a command (e.g. dir()) one page at a time? How are you using dir() ? Is it in the "DOS Window" ? One option would be to just get a better console. You also might want to look at something like ipython. Using that,

Re: [Tutor] newbie help> audio IO + python

2005-07-19 Thread Lee Harr
>I've been looking at lots of sites and checked out the docs, but can't >find the info I am looking for to be able to detect audio input from >my sound card. You do not say if you need to do this in a cross-platform way. I thought maybe SDL (which is wrapped by pygame) might help, but this is cl

Re: [Tutor] Getting singal strength of the received packet

2005-07-19 Thread Christian Wyglendowski
Signal strength is not stored in an IP packet. It is more of a radio-level statistic that would need to be gathered from the wireless device somehow. Christian > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of sunny sunny > Sent: Tuesday, July 19,

Re: [Tutor] Help with ebay profit/loss program error

2005-07-19 Thread Bell, Xaviea
It looks like theres a typo you have: price= price=.35. This would cause an error. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sam Klinger Sent: Tuesday, July 19, 2005 2:46 PM To: tutor@python.org Subject: [Tutor] Help with ebay profit/loss program

Re: [Tutor] SQL headache with column

2005-07-19 Thread Bernard Lebel
Stupid me, you're right. Thanks Danny Bernard On 7/19/05, Danny Yoo <[EMAIL PROTECTED]> wrote: > > > On Tue, 19 Jul 2005, Bernard Lebel wrote: > > > Ah yeah I to mention that I indeed tried fetchall(), but Python would > > raise an attribute error: > > Hi Bernard, > > The cursor itself

Re: [Tutor] use gzip with large files

2005-07-19 Thread Hugo González Monteverde
You're s right. missed that one, sorry... Kent Johnson wrote: > Hugo González Monteverde wrote: > >>for a file-like object with a read method: >> >>for line in file: >> if not line: >> break > > > The test > if not line: > break > is not needed with this form of looping; t

Re: [Tutor] SQL headache with column

2005-07-19 Thread Danny Yoo
On Tue, 19 Jul 2005, Bernard Lebel wrote: > Ah yeah I to mention that I indeed tried fetchall(), but Python would > raise an attribute error: Hi Bernard, The cursor itself holds some internal state that mutates when we call cursor.execute(). So we use cursor.execute() often for it's side-effe

Re: [Tutor] How do I add an argument too...

2005-07-19 Thread Hugo González Monteverde
I use optparse wich can take some getting used to in the beginnning, but it help you easily create very powerful command line options. I is shipped with th epython distro. As soon as I get an example I wrote, I will post it to the list... Hugo Joseph Quigley wrote: > How do I add an argument

Re: [Tutor] use gzip with large files

2005-07-19 Thread Kent Johnson
Hugo González Monteverde wrote: > for a file-like object with a read method: > > for line in file: > if not line: > break The test if not line: break is not needed with this form of looping; the loop will end automatically when it gets to the end of the file. > > line will

[Tutor] Help with ebay profit/loss program error

2005-07-19 Thread Sam Klinger
Hi my name is Sam Klinger and I made a smal program to help find out the cost of listing and selling an item on ebay. However I see nothing wrong with the code but I get these error messages: 1. Insertion fee. 2. Selling Fees. 7. Quit. type in a number (1-7): 1 What is the starting price?9 T

Re: [Tutor] SQL headache with column

2005-07-19 Thread Bernard Lebel
Ah yeah I to mention that I indeed tried fetchall(), but Python would raise an attribute error: def getTableColumns( sTableName ): """ Lists and returns the list of columns from a given table. """ oConnection = connect2db() oCursor = oConnection.cursor()

Re: [Tutor] Getting singal strength of the received packet

2005-07-19 Thread Hugo González Monteverde
How would you get it with C? Based on this, we can know if it is possible with plain Python (and not writing a python module written in C) Do you do this with a library call? or maybe using FCTL or IOCTL? I have done IOCTL in python and it is quite easy, but some provisions have to be taken res

Re: [Tutor] SQL headache with column

2005-07-19 Thread Danny Yoo
> oResult = oCursor.execute( "SHOW COLUMNS FROM " + sTableName + "" ) Hi Bernard, Try using oCursor.fetchall() after the execution. The return value of execute() are the number of rows affected, and you can then pull each fetched value by using either oCursor.fetchone() or oCursor.fetchall

Re: [Tutor] use gzip with large files

2005-07-19 Thread Hugo González Monteverde
for a file-like object with a read method: for line in file: if not line: break line will be "" for EOF, "\n" for an empty line. This will not read the whole file to RAM at once. I'm not familiar with the gzip module, but if the read() solution works for small files, the one I pr

[Tutor] SQL headache with column

2005-07-19 Thread Bernard Lebel
Hello, Not sure if it's a Python thing, but... When sending command to the MySQL server by command line, I can use SHOW COLUMNS FROM , the list of all columns with a bunch of properties is printed. However, when I run the same command from Python and I store the result, the result is an integer

[Tutor] Tkinter: justify label

2005-07-19 Thread Bernard Lebel
Hello, Can you specify a justification for a label widget? I'm reading there is a justify option available on this page: http://www.pythonware.com/library/tkinter/introduction/x611-text-formatting.htm Although I don't know if this option works for label. If I try for sField i

[Tutor] Getting singal strength of the received packet

2005-07-19 Thread sunny sunny
Hi, I am sending and receiving for a simple server application over wirless link. Can I get the signal strength of the received packet in Python? One way would be to get the value of the RSSI from /proc/net/wireless. However I would like to get the signal strength (in terms of RSSI or dBm) of t

Re: [Tutor] use gzip with large files

2005-07-19 Thread Kent Johnson
Adam Bark wrote: > If you use something like this: > > for line in file.readlines(): This will read the whole file into a list of lines; the OP doesn't want to read the whole file at once. > then line is a string to the next newline and it automatically detects > the EOF and the same with file

Re: [Tutor] use gzip with large files

2005-07-19 Thread Adam Bark
If you use something like this: for line in file.readlines(): then line is a string to the next newline and it automatically detects the EOF and the same with file.readline() but that will give you one character at a time.On 7/19/05, frank h. <[EMAIL PROTECTED]> wrote: hello allI am trying to wri

Re: [Tutor] replaying

2005-07-19 Thread Philip Kilner
Hi John, John Montgomery wrote: > I am surprised that Thunderbird does not have a "Reply All" button. > It does - and I just hit it! ;-) -- Regards, PhilK Email: [EMAIL PROTECTED] PGP Public key: http://www.xfr.co.uk Voicemail & Facsimile: 07092 070518 "You'll find that one part's sweet a

[Tutor] use gzip with large files

2005-07-19 Thread frank h.
hello all I am trying to write a script in python that parses a gzipped logfile the unzipped logfiles can be very large (>2GB) basically the statements file = gzip.GzipFile(logfile) data = file.read() for line in data.striplines(): would do what I want, but this is not feasible becasue t

Re: [Tutor] Saving class data to a text file

2005-07-19 Thread Darryl Luff
Alan G wrote: > ... > Take a look at the OOP topic in my tutor. It includes an examnple > of how to save/load objects to text files. Thanks Alan, Javier and Jonathon. The answers I got all showed me bits of Python I haven't seen before! I'll have to take a while to digest the others. I left ano

Re: [Tutor] Minesweeper the return

2005-07-19 Thread Alberto Troiano
Hey Danny Thanks for the reply Please let's talk about this more! *grin* I'm not sure if I'm following you, what I see here is a function inside other function and the first function returns its inside function, but how does it work? I don't know Scheme, but I know a little of C#, VB.NET, Pasc

[Tutor] Buffering problem using subprocess module

2005-07-19 Thread Smith, Jeff
I am using the subprocess module in 2.4. Here's the fragment: bufcaller.py: import sys, subprocess proc = subprocess.Popen('python bufcallee.py', bufsize=0, shell=True, stdout=subprocess.PIPE) for line in proc.stdout: sys.stdout.write(line) bufcallee.py:

Re: [Tutor] Scrolling multilistbox help

2005-07-19 Thread Alberto Troiano
Hey Michael It worked like a charm Thank GOD you understood what I wanted, you see speaking Spanish made me so hard to explain what the problem were but...I guess you just figured out To my code was this: self.see(int(self.curselection()[0])) Thank you very much Best Regards Alberto >From: M

Re: [Tutor] Class variable & object variable

2005-07-19 Thread Damien
thx for your quick (and complete) answers. to Alan G : I will try to see what setattr() and getattr() can do for me. I'm not used to this stuff. to Alex Nedelcu : If I understand correctly : There are two different references (A.d in the dict of the class A and z.d in the dict of the object z)

Re: [Tutor] globals and map()

2005-07-19 Thread Kent Johnson
Luis N wrote: > On 7/19/05, *Kent Johnson* <[EMAIL PROTECTED] > > wrote: > > Luis N wrote: > > I'd appreciate some comments on my use of globals and the map > function. > > I don't see the need for the global declaration; desc, vw, > primaryKey are

Re: [Tutor] Class variable & object variable

2005-07-19 Thread Alan G
> class A(object): >d = 50 >def __init__(self): > print "Hello" > > >>> z = A() > >>> A.d > 50 > >>> z.d > 50 > 1) Why ?? d is not an object variable but a class variable !!! Yes which means (definition of a class variable) that it's part of every class and instance of the class. >

Re: [Tutor] replaying

2005-07-19 Thread Rob Andrews
> However, there are significant downsides to enabling Reply-to munging: > > http://www.unicom.com/pw/reply-to-harmful.html > > I agree with most of those reasons, and so I won't enable Reply-to munging > unless there's a real overriding reason that trumps the ones listed on > that page. I f

Re: [Tutor] Which is safer and easier to code, raw_input or int(raw_input))?

2005-07-19 Thread Alan G
> Subject: [Tutor] Which is safer and easier to code,raw_input or > int(raw_input))? val = int(raw_input()) is the same as val = raw_input() val = int(val) in terms of safety because it is the same I/O mechanism. Arguably wrapping the int() call around it makes it marginally safer since it th

Re: [Tutor] globals and map()

2005-07-19 Thread Luis N
On 7/19/05, Kent Johnson <[EMAIL PROTECTED]> wrote: Luis N wrote:> I'd appreciate some comments on my use of globals and the map function.>> import metakit> import marshal>> db = metakit.storage('addy.mk ',1)> dbs = db.getas('dbs[db:S,marshal:B]')>> def li(i):> i = i[:-2]>

Re: [Tutor] globals and map()

2005-07-19 Thread Kent Johnson
Luis N wrote: > I'd appreciate some comments on my use of globals and the map function. > > import metakit > import marshal > > db = metakit.storage('addy.mk ',1) > dbs = db.getas('dbs[db:S,marshal:B]') > > def li(i): > i = i[:-2] > return i > > def selectDB(f): > i

Re: [Tutor] replaying

2005-07-19 Thread Liam Clarke
OT, but wasn't Sylpheed some futuristic fighter/bomber they made a bad movie about in the eighties?On 7/19/05, John Montgomery < [EMAIL PROTECTED]> wrote:On Tue, 19 Jul 2005 07:12:54 +0200geon < [EMAIL PROTECTED]> wrote:>> * My TB doesnt support it. And maybe even others mail clients.Its really> wa

[Tutor] Class variable & object variable

2005-07-19 Thread Damien
Hi, I am a little bit confuse about class variable & object variable (Python 2.4). I have: class A(object): d = 50 def __init__(self): print "Hello" >>> z = A() Hello >>> A.d 50 (it's nice) >>> z.d 50 (°) 1) Why ?? d is not an object variable but a class variable !!! For the

Re: [Tutor] Scrolling multilistbox help

2005-07-19 Thread Michael Lange
On Mon, 18 Jul 2005 13:54:45 + "Alberto Troiano" <[EMAIL PROTECTED]> wrote: > Hey tutors > > I'm using the Multilistbox class and I noticed that it only handles the > mouse scroll and the scrollbar to go down or up.I succesfully implemented > the sort function that came with the class > I a

Re: [Tutor] This should be easy

2005-07-19 Thread Michael Dunn
I'm not sure why your first example worked: "Table" is a reserved word in SQL (i.e. it's used as a SQL command), so you shouldn't use it as a table name. Imagine a poor dumb computer trying to parse "create table table"... Cheers, Michael ___ Tutor maill

Re: [Tutor] ListBox in Tkinter

2005-07-19 Thread Michael Lange
On Mon, 18 Jul 2005 17:54:34 +0200 geon <[EMAIL PROTECTED]> wrote: > Alan G napsal(a): > > >> I would like to ask if it is possible to create such a listbox > >> (attached) in TKinter itself or must have pmw ot tix...or ... > > > > > > PMW is written in Tkinter so yes, you could do it yourself b

[Tutor] globals and map()

2005-07-19 Thread Luis N
I'd appreciate some comments on my use of globals and the map function. The idea here is that (simple) Metakit database definitions can be loaded dynamically from another Metakit database detifintion. (Yes this would likely be easier with a SQL database, don't ask!) Nasty code ahead: import metak

Re: [Tutor] replaying

2005-07-19 Thread John Montgomery
On Tue, 19 Jul 2005 07:12:54 +0200 geon <[EMAIL PROTECTED]> wrote: > > * My TB doesnt support it. And maybe even others mail clients.Its really > wasting of time to change the adress all the time. I like to help, but > if the was more of such a inconvieniencies I would give it up. My time > is

[Tutor] [OT] Re: OFFLIST replaying

2005-07-19 Thread Brian van den Broek
Oh dear. You want all help to be in public so much that you will reply to a private email by taking it back to the list. Then you probably should have left in the part where I gave you step by step instructions on how to set Thunderbird up to Reply to All. I do think it is considered rude to p

Re: [Tutor] OT, Tcl & Python

2005-07-19 Thread Luis N
On 7/16/05, Alan G <[EMAIL PROTECTED]> wrote: > I was wondering if someone knowledgeable of both Tcl and Python could suggest whether it would   > be a good or a bad idea to write a Python/Tk application, with the motive to rewrite the application in > Tcl/TkOooh that's a tough one, it would depend