Re: Python vs. Lisp -- please explain

2006-02-22 Thread Donn Cave
Quoth Steven D'Aprano <[EMAIL PROTECTED]>: ... | Do you honestly believe that the CPU doesn't have to interpret the machine | code, or are you just deliberately playing silly buggers with language? I don't care whether the CPU has to interpret machine code. Are you suggesting that we might in nor

ANN: yet another python graphviz binding (yapgvb) 1.1.1

2006-02-22 Thread Lonnie Princehouse
Introducing Yapgvb, a Python wrapper around the AT&T's graph layout library Graphviz. Features: - A nice clean Pythonic interface - Boost.Python wrapper around the C libraries; no more fiddling with system calls to dot. - Read and write .dot files using Graphviz's own library routines. - T

Re: redirecting to a content page

2006-02-22 Thread bruno at modulix
Shreyas wrote: > I am a new user writing some scripts to store data entered via a > browser into a database. I have several content pages, and one > "processing" page. A content page often has a form like this: > > > > ... > > And the processing page goes like this: > > form = cgi.FieldStora

new wooden door step - fixing and finishing

2006-02-22 Thread jkn
Hi all I'm considering having a go at replacing the wooden door step to our back door. The original is loose and rotting. I'm sure some of this will be clearer when I remove the (metal) door frame - how is such a step fixed? Vertical frame fixings? Also, any suggestions for treating/finishing

Re: cPAMIE 2.0 released!!

2006-02-22 Thread Fabrizio Milo
you forgot the link :) http://pamie.sourceforge.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: number ranges (was Re: Matlab page on scipy wiki)

2006-02-22 Thread Antoon Pardon
Op 2006-02-20, Steven D'Aprano schreef <[EMAIL PROTECTED]>: > John Zenger wrote: > >> I strongly agree that Python should promote range or xrange to syntax. I >> favor [0..10] rather than [0:10] because 0..10 is inherently easier to >> understand. > > "Inherently"? > > You mean people are born wi

gmail written in python?

2006-02-22 Thread ongkokleong
any idea? -- http://mail.python.org/mailman/listinfo/python-list

Re: number ranges

2006-02-22 Thread Antoon Pardon
Op 2006-02-21, Tim Hochberg schreef <[EMAIL PROTECTED]>: > > [Lots of proposals snipped] > > 90% of my gripes with range disappeared with the addition of enumerate. > However, if there's going to be another round of range literal proposals > I might as well throw out what seems (to me anyway) lik

interpreting the fractional portion of time.clock() vs time.time(0 measurements

2006-02-22 Thread john peter
let's say i'm taking timing measurements in Windows XP   t1 = time.clock() ... t2 = time.clock()   t3 = t2 - t1 = say, 0.018 what is the unit of measurement for t3? is it correct to say that t3 = 18 milliseconds? microsends?   what if the timing function used for t1 and t2 was time.time()

Re: gmail written in python?

2006-02-22 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > any idea? http://panela.blog-city.com/python_at_google_greg_stein__sdforum.htm -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs. Lisp -- please explain

2006-02-22 Thread Torsten Bronger
Hallöchen! Peter Mayne <[EMAIL PROTECTED]> writes: > Torsten Bronger wrote: > >> My definiton would be that an interpreted language has in its >> typical implementation an interpreting layer necessary for typical >> hardware. Of couse, now we could discuss what is "typical", >> however, in pract

Re: Pyserial never read

2006-02-22 Thread luca72
Thanks to all for the help, here you find the code, pls note if i use handshaking = 1 the application don't start. in the delphi configuratio of com port if i use or not handshaking the application work. Best Regards at all Luca import serial import win32file port = 2 ba

Re: warning for google api users

2006-02-22 Thread William
Isn't this because the index that the api uses is (a lot) older than the index used by www.google.com? total results are always estimated, so they are not reliable (seen the variance) Gabriel B. schreef: > the google webservices (aka google API) is not even close for any kind > of real use yet >

cookielib

2006-02-22 Thread sri2097
Hi, I need to get to a particular page in a website. The site uses cookeis and naturally I had to use cookielib since urllib2 does not support cookies. But even after adding the cookies to the headers, I keep getting a error message from the web-site saying that - 'My Browser has disabled cookies a

Re: question about scope

2006-02-22 Thread Magnus Lycka
John Salerno wrote: > But as far as ifs and loops, is there such a thing as scope in them? No. Local scopes are introduced with "def" or "class", nothing else (or did I forget something?). There is nothing in Python that corresponds directly to the { } in C and C++. If you want data to exist in

Re: May i customize basic operator (such as 1==3)?

2006-02-22 Thread Carl Friedrich Bolz
kanchy kang wrote: > many people write test cases with python scripts. > in these test scripts, there are many validation statements, > for example, in unittest, failUnless(a == b),(a/b may be stringType or > intType...) > > during running test scripts, if there is one exception raised from > fa

Re: cookielib

2006-02-22 Thread Paul Rubin
"sri2097" <[EMAIL PROTECTED]> writes: > Hi, I need to get to a particular page in a website. The site uses > cookeis and naturally I had to use cookielib since urllib2 does not > support cookies. It's poorly documented but urllib2 does support cookies now. http://docs.python.org/lib/http-cookie-p

Re: May i customize basic operator (such as 1==3)?

2006-02-22 Thread Thomas Heller
Carl Friedrich Bolz wrote: > kanchy kang wrote: >> many people write test cases with python scripts. >> in these test scripts, there are many validation statements, >> for example, in unittest, failUnless(a == b),(a/b may be stringType or >> intType...) >> >> during running test scripts, if there

Re: No

2006-02-22 Thread Fredrik Lundh
Gaz wrote: > Aye, but the file is in MY drive, not the server. Perhaps thats the > issue? I bet it's so... how should i deal with it? Perhaps should be a > script that uploads the files to the server and then emails it... assuming that the web server can read files on your local disk is perhaps

Re: Determing whether two ranges overlap

2006-02-22 Thread Magnus Lycka
Fredrik Lundh wrote: > def overlap(a, b): > return a[1] > b[0] and a[0] < b[1] Assuming that x[1] can't be smaller than x[0], this is the right way to compare two ranges. Well, I guess you need to figure out the borderline cases. Is it a[1] > b[0] or a[1] >= b[0] which is relevant? An

Re: May i customize basic operator (such as 1==3)?

2006-02-22 Thread Kent Johnson
Thomas Heller wrote: > The standard unittest module can do this also: replace > calls to failUnless(a == b) with failUnlessEqual(a, b). or assertEquals(a, b) -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing my own typing monitor program for RSI sufferers...

2006-02-22 Thread Carl Friedrich Bolz
[EMAIL PROTECTED] wrote: > I want to write a program that will let me know after thirty minutes of > typing that I need to take a five minute typing break. But when I stop > typing it's smart enough to pause the 30 minute timer automatically. > This is under the X-Window System (Linux). > > The t

Re: Python vs. Lisp -- please explain

2006-02-22 Thread Steven D'Aprano
On Wed, 22 Feb 2006 10:15:21 +0100, Torsten Bronger wrote: >> And, as someone in this thread has pointed out, it is likely that >> your important modern (x86) processor is not natively executing >> your x86 code, and indeed meets your definition of having "in its >> typical implementation an inter

Re: No

2006-02-22 Thread Steven D'Aprano
On Wed, 22 Feb 2006 11:42:19 +0100, Fredrik Lundh wrote: > Gaz wrote: > >> Aye, but the file is in MY drive, not the server. Perhaps thats the >> issue? I bet it's so... how should i deal with it? Perhaps should be a >> script that uploads the files to the server and then emails it... > > assum

Path (graph) shower utility

2006-02-22 Thread Durumdara
Hi ! I need to create a program that read eml file headers, analyze the receive tags and create a path database. I finished with this program section. But I want to show a graphical summary about the paths. This is (what I want to show) like a graph - show ways, stations, etc, and I want to show

Re: With pyMinGW

2006-02-22 Thread A.B., Khalid
[EMAIL PROTECTED] wrote: > To use Pyrex, SWIG and the like on a Win2K I have followed this way: > > http://jove.prohosting.com/iwave/ipython/pyMinGW.html > > I already had MinGW 3.4.2, so I have decompressed the Python 2.4.2 > sources, I have merged in the pyMinGW patch, and I have run the global >

Re: Video Capture modules in linux

2006-02-22 Thread [EMAIL PROTECTED]
ok..i'll check with that...but wait libfg binaries arent available in any software repos..and Diez, I would like to mention that there is a VideoCapture lib exclusively for python..(only that its for win32).. >So - that _is_ a >C-domain. So can i kinda embed that code into C using the libraries th

Re: Python vs. Lisp -- please explain

2006-02-22 Thread Kay Schluehr
Steven D'Aprano wrote: > But over time, as PyPy, Psycho, and other technologies bear fruit, Python > will speed up, even though it will remain interpreted. I talked to Richard Emslie recently and he told me that the PyPy team works on a mechanism to create CPython-extension modules written in RP

Re: embedding python in HTML

2006-02-22 Thread Magnus Lycka
John Salerno wrote: > Thanks, that makes much more sense to me now. But does this mean I can > still write HTML normally? What would an example be of having HTML > within a Python script? I have a hard time picturing this, because I > imagine that most of my pages will be almost all HTML, with j

Re: Python vs. Lisp -- please explain

2006-02-22 Thread Paul Rubin
"Kay Schluehr" <[EMAIL PROTECTED]> writes: > I talked to Richard Emslie recently and he told me that the PyPy team > works on a mechanism to create CPython-extension modules written in > RPython i.e. a statically translateable subset of Python. So even > without dynamic code specialization there wi

Re: odt -> pdf

2006-02-22 Thread LB
pyUNO ia a bridge between python and Openoffice.org. Nothing directly to do with export in pdf format. If you prefer you can "print" a pdf file from a.odt or .doc or .* source with external freeware/shareware or business utilities as pdf creator, adobe acrobat etc. sometimes with more control on re

Re: Little tool - but very big size... :-(

2006-02-22 Thread Sion Arrowsmith
BJ in Texas <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] wrote: >|| 11MB is seldom a concern for today's machine. >A good windows/microsoft attitude.. :-) I wish 8-( : PID USER PR NI VIRT RES SHR S %CPU %MEMTIME+ COMMAND 3715 root 15 0 288m 128m 154m S 1.0 6.3 14902:4

[OT] Re: number ranges

2006-02-22 Thread Sion Arrowsmith
Steven D'Aprano <[EMAIL PROTECTED]> wrote: >> Colin J. Williams <[EMAIL PROTECTED]> wrote: >>>1. Why not treat '2 to 5' or '(2 to 5)' as a semi-open interval? >I intellectually understand that semi-open intervals >are the only way to go. But reading the words, the part >of my brain that speaks E

What's happened to Jython?

2006-02-22 Thread aprasad21k
Jython does not seem to have been updated for more than a year. Any idea whether Jython enhancements are likely to be released in the near future? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs. Lisp -- please explain

2006-02-22 Thread Kay Schluehr
Paul Rubin wrote: > "Kay Schluehr" <[EMAIL PROTECTED]> writes: > > I talked to Richard Emslie recently and he told me that the PyPy team > > works on a mechanism to create CPython-extension modules written in > > RPython i.e. a statically translateable subset of Python. So even > > without dynamic

Python CGI not working in Firefox but does in IE

2006-02-22 Thread Harlin Seritt
I have this Python CGI script running: [CODE] print 'Content-type: text/plain\n' location = 'http://server1.com' page = ''' ''' print page [/CODE] It works fine and redirects perfectly when using Internet Explorer but only shows this in a Firefox window: [OUTPUT] http://server1.com";>

Re: Komodo - Will it Lock Me In?

2006-02-22 Thread Ilias Lazaridis
Matt Trivisonno wrote: > Hi Everybody, > > If I were to use Komodo to write in Python, would it add a lot of goo to my > code such that I would not be able to switch to another IDE without having to > claw my way out of a tarpit first? > > Any other thoughts on Komodo? I am considering it becau

Re: Python vs. Lisp -- please explain

2006-02-22 Thread Torsten Bronger
Hallöchen! Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Wed, 22 Feb 2006 10:15:21 +0100, Torsten Bronger wrote: > >>> And, as someone in this thread has pointed out, it is likely >>> that your important modern (x86) processor is not natively >>> executing your x86 code, and indeed meets your

Re: Python vs. Lisp -- please explain

2006-02-22 Thread Torsten Bronger
Hallöchen! Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Wed, 22 Feb 2006 10:15:21 +0100, Torsten Bronger wrote: > >>> And, as someone in this thread has pointed out, it is likely >>> that your important modern (x86) processor is not natively >>> executing your x86 code, and indeed meets your

Re: Python CGI not working in Firefox but does in IE

2006-02-22 Thread Richard Brodie
"Harlin Seritt" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > [CODE] > print 'Content-type: text/plain\n' That's your problem. You've said text/plain when you meant text/html. -- http://mail.python.org/mailman/listinfo/python-list

Re: why does close() fail miserably on popen with exit code -1 ?!

2006-02-22 Thread Jeffrey Schwab
Atanas Banov wrote: > Jeffrey Schwab wrote: > >>_PyPclose returns the exit status of the popened process (the popenee?), >>or -1 on error. Of course, if the status is supposed to be -1, there's >>some confusion. > > > yes, that's what i thought the root of the problem is. > > >>In the snippet

Re: Python CGI not working in Firefox but does in IE

2006-02-22 Thread Iain King
Harlin Seritt wrote: > I have this Python CGI script running: > > [CODE] > print 'Content-type: text/plain\n' > > location = 'http://server1.com' > > page = ''' > > > > > > ''' > > print page > [/CODE] > > It works fine and redirects perfectly when using Internet Explorer but > only shows thi

Re: Python CGI not working in Firefox but does in IE

2006-02-22 Thread Harlin Seritt
Ack... I'm an idiot... Thanks Richard -- You're the Man! -- http://mail.python.org/mailman/listinfo/python-list

Re: Which is faster? (if not b in m) or (if m.count(b) > 0)

2006-02-22 Thread Farel
Thank you, Peter! Please understand, I was attempting to get more info on the WHY x is faster than y... from those with more experience. Timer cannot give me that info. -- http://mail.python.org/mailman/listinfo/python-list

Re: interpreting the fractional portion of time.clock() vs time.time(0 measurements

2006-02-22 Thread Peter Hansen
john peter wrote: > let's say i'm taking timing measurements in Windows XP > > t1 = time.clock() > ... > t2 = time.clock() > > t3 = t2 - t1 = say, 0.018 > what is the unit of measurement for t3? is it correct to say that t3 = > 18 milliseconds? > microsends? > > what if the timing function u

Re: Python CGI not working in Firefox but does in IE

2006-02-22 Thread Iain King
Iain King wrote: > Harlin Seritt wrote: > > I have this Python CGI script running: > > > > [CODE] > > print 'Content-type: text/plain\n' > > > > location = 'http://server1.com' > > > > page = ''' > > > > > > > > > > > > ''' > > > > print page > > [/CODE] > > > > It works fine and redirects pe

Re: Python vs. Lisp -- please explain

2006-02-22 Thread Paul Boddie
Kay Schluehr wrote: > Paul Rubin wrote: > > "Kay Schluehr" <[EMAIL PROTECTED]> writes: > > > I talked to Richard Emslie recently and he told me that the PyPy team > > > works on a mechanism to create CPython-extension modules written in > > > RPython i.e. a statically translateable subset of Python

Re: That's really high-level: bits of beautiful python

2006-02-22 Thread Jeffrey Schwab
Max wrote: > I have a friend who has been programming in C for many years, and he is > a great fan of the language. However, he (and I) are about to start a > python course, and he has been asking me a lot of questions. He often > responds to my answers with "Urgh! Object-orientation!" and suchl

Re: Pyserial never read

2006-02-22 Thread Grant Edwards
On 2006-02-22, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: >> Anything's possible, but given that in his original post he says it >> works when he uses Delphi, it seems unlikely making a change to the >> hardware is necessary. > > Sorry missed that bit! > > Pyserial works very well in my exper

Re: Python vs. Lisp -- please explain

2006-02-22 Thread Carl Friedrich Bolz
Paul Rubin wrote: > "Kay Schluehr" <[EMAIL PROTECTED]> writes: > >>I talked to Richard Emslie recently and he told me that the PyPy team >>works on a mechanism to create CPython-extension modules written in >>RPython i.e. a statically translateable subset of Python. So even >>without dynamic code

Question about struct.unpack

2006-02-22 Thread Eric Jacoboni
Hi, To experiment with unpacking, i've written a little C code which stores one record in a file. Then, i try to reread this file to unpack the record. Here's the struct of a record: typedef struct { char nom[30]; double taille; int age; char plop; } enreg_t; The whole

Re: Python CGI not working in Firefox but does in IE

2006-02-22 Thread Kent Johnson
Harlin Seritt wrote: > Also, is there a redirect command somewhere within Python CGI that can > get this done instead as I would actually prefer to have the CGI code > execute this rather than depend on the HTML to do it. http://groups.google.com/group/comp.lang.python/msg/6e929fab0d414b2c shows

Re: With pyMinGW

2006-02-22 Thread bearophileHUGS
Thank you for your answers, Khalid. > It seems you may be using an old version of pyMinGW, I have downloaded it yesterday from your site. > the relevant part dealing with include directories in zlib.mak > should read now as follows: I have checked, and that relevant part is the same in my zlib

Re: cookielib

2006-02-22 Thread Rene Pijlman
sri2097: >urllib2 does not support cookies. It does in 2.4. This code enables cookie support in all consequent calls through urrlib2: import cookielib, urllib2 opener = urllib2.build_opener(urllib2.HTTPCookieProcessor()) urllib2.install_opener(opener) -- René Pijlman -- http://mai

Re: Python vs. Lisp -- please explain

2006-02-22 Thread bearophileHUGS
Carl Friedrich Bolz: > Indeed, there are similarities to pyrex. Of course in pyrex you have to > give the types yourself, but since the type inference engine of PyPy can > sometimes be hard to understand this is maybe not the worst trade-off. > A nice advantage of the PyPy approach would be that yo

Re: That's really high-level: bits of beautiful python

2006-02-22 Thread gene tani
Jeffrey Schwab wrote: > Max wrote: > > I was just thinking perhaps we should create some kind of collection of > > bits of "impressive" code like this. > > Do you mean something like the ASPN Cookbooks? > > http://aspn.activestate.com/ASPN/Cookbook/ > repositories, indexes and search engine

Re: No

2006-02-22 Thread Gaz
@ Steven: LOL =P @ Frederik: aye, i uploaded the script by FTP, but the idea of this little program is to allow a technician on field to upload photos from their laptops when they get into a hotel, along with some text, anywere in the world. We need the reports to be daily. Email is not an option,

bunding options

2006-02-22 Thread msoulier
I work at home on Linux desktops, but would like to bundle a Python/wxPython application for Windows desktops, Linux desktops, etc. I am currently using py2exe to distribute a zipfile that is then usable by anyone on win32. On Linux, a source tarball is available, and the users can sync up with th

Re: What's happened to Jython?

2006-02-22 Thread Ravi Teja
According to http://sourceforge.net/project/showfiles.php?group_id=12867 The last release of 2.2a was on July 17, 2005 - about 7 months. -- http://mail.python.org/mailman/listinfo/python-list

Re: Basic coin flipper program - logical error help

2006-02-22 Thread Jeffrey Schwab
wes weston wrote: > DannyB wrote: > >> I'm just learning Python. I've created a simple coin flipper program - ... > Dan, >Looping is easier with: > for x in range(100): >if random.randint(0,1) == 0: > heads += 1 >else: > tails += 1 > Or, continuing with that theme:

can't use NetcdfFile

2006-02-22 Thread [EMAIL PROTECTED]
Hi, I'm trying to open a Netcdf file using NetcdfFile but I always get an import error DLL failed even though I've tried using all these: import Numeric from Scientific.IO.NetCDF import NetCDFFile from Scientific.IO import NetCDF from Scientific import * from Scientific.IO.NetCDF import * I've go

Re: a little more help with python server-side scripting

2006-02-22 Thread John Salerno
Steve Holden wrote: > Note that purists might suggest this isn't the best way to use Python on > the web. If it gets you where you want to be, feel free to ignore them :-) Thanks for the info. Basically I don't plan to do big stuff with Python on the internet (at least not right now while I'm s

Re: What are COM-enabled applications?

2006-02-22 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Tempo <[EMAIL PROTECTED]> wrote: >As the subject of this post suggests, I have one question; what are >COM-enabled applications? I believe Microsoft Word is one of these >apps, but what else? Is a web browser, Paint, Solitare, games, etc? I'm >not sure if it varies f

Re: Basic coin flipper program - logical error help

2006-02-22 Thread Brian van den Broek
DannyB said unto the world upon 21/02/06 06:14 PM: > I'm just learning Python. I've created a simple coin flipper program - > here is the code: > > [source] > #Coin flipper > import random > > heads = 0 > tails = 0 > counter = 0 > > coin = random.randrange(2) > > while (counter < 100): > i

Re: No

2006-02-22 Thread Kent Johnson
Gaz wrote: > Aye, but the file is in MY drive, not the server. Perhaps thats the > issue? I bet it's so... how should i deal with it? Perhaps should be a > script that uploads the files to the server and then emails it... i > believed this was handled using the root in my PC, but now i see this >

Re: Python vs. Lisp -- please explain

2006-02-22 Thread Michele Simionato
I replied to this message yesterday, but it did not appear, so let's try again. I agree with your points, but I would not say that Lisp is intrinsically more dynamic than Python as a language; it is just more interactive and has more features (and more complexities too). BTW, regarding your first

Re: Python vs. Lisp -- please explain

2006-02-22 Thread Daniel Harding
Steven D'Aprano wrote: > Who says Python is so slow? I've just got Python to count from 0 up to > 100,000, and it only took 7 milliseconds. That's at least 12 milliseconds > faster than I can count on my fingers. +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

PyUNO with different Python

2006-02-22 Thread Katja Süss
Hi! maybe somebody can give me an hint to my problem setting up PyUNO on my Mac to work with my Python not the Python delivered with OpenOffice. As said in installation instructions I've set OPENOFFICE_PATH="/usr/lib/openoffice/program" export PYTHONPATH="$OPENOFFICE_PATH" export LD_LIBRA

Re: No

2006-02-22 Thread Sion Arrowsmith
Gaz <[EMAIL PROTECTED]> wrote: >So, they can not upload the photos by FTP because its too "geek" for >them. And i need to have a standarized form to handle the reports, >because otherwise its a organizational mess. Am I missing something here, or is all you need a on your form? Then you don't wor

Re: define loop statement?

2006-02-22 Thread Magnus Lycka
David Isaac wrote: > PS Here's the motivation. Python closely resembles pseudocode. With > a very little LaTeX hacking, it is often possible to write algorithms is > Python that typeset as reasonable pseudocode. A simple repetitive > loop is a bit of a sticking point. With slightly more LaTeX

Re: Basic coin flipper program - logical error help

2006-02-22 Thread Paul McGuire
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > sort, then groupby. > > > import itertools > import random > h,t = [len(list(g)) for k,g in itertools.groupby(sorted([random.randrange(2) > for i in xrange(

Re: a little more help with python server-side scripting

2006-02-22 Thread John Salerno
John Salerno wrote: > I contacted my domain host about how Python is implemented on their > server, and got this response: Uh, okay, I asked a related question to them and now I got this: Hello John, There are some corrections based on last reply. The python installation on our wi

Re: a little more help with python server-side scripting

2006-02-22 Thread Sybren Stuvel
John Salerno enlightened us with: > What I had asked was if I could just embed Python code within my > HTML files, like you do with PHP, but they didn't address that yet. Check out PSP. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidi

except clause not catching IndexError

2006-02-22 Thread Derek Schuff
I'm sorry if this is a FAQ or on an easily-accesible "RTFM" style page, but i couldnt find it. I have some code like this: for line in f: toks = line.split() try: if int(toks[2],16) == qaddrs[i]+0x1000 and toks[0] == "200": #producer wri

Re: can't use NetcdfFile

2006-02-22 Thread Rocco Moretti
[EMAIL PROTECTED] wrote: > Hi, > I'm trying to open a Netcdf file using NetcdfFile but I always get an > import error DLL failed > even though I've tried using all these: > > import Numeric > from Scientific.IO.NetCDF import NetCDFFile > from Scientific.IO import NetCDF > from Scientific import *

Tkinter canvas size determination

2006-02-22 Thread Dean Allen Provins
I need to determine the size of a canvas while the process is running. Does anyone know of a technique that will let me do that? Thanks, Dean -- http://mail.python.org/mailman/listinfo/python-list

Re: getting the line just before or after a pattern searched

2006-02-22 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > hi > > i have a file something like this > > abcdefgh > ijklmnopq > 12345678 > rstuvwxyz > . > . > . > 12345678 > . > > whenever i search the file and reach 12345678, how do i get the line > just above and below ( or more than 1 line above/below) the pa

Re: Pyserial never read

2006-02-22 Thread Petr Jakes
Well, I think it is better to start with some simple code first. Try to read serial port and print it out. something like this could work: import serial s = serial.Serial(port=2,baudrate=38400, timeout=20) while 1: print s.readline() Petr Jakes -- http://mail.python.org/mailman/listinfo/p

cx_Oracle and UTF8

2006-02-22 Thread Harald Armin Massa
Hello, I am looking for a method to convince cx_Oracle and oracle to encode it's replies in UTF8. For the moment I have to... cn=cx_Oracle.connect("user","password", "database") cs=cn.Cursor() cs.execute("select column1, column2, column3 from table") for row in cs.fetchall(): t=[] for i

Re: except clause not catching IndexError

2006-02-22 Thread Erwin S. Andreasen
Derek Schuff <[EMAIL PROTECTED]> writes: > I have some code like this: [...] > except IndexError: #happens if theres a partial line at the > end of file > print "indexerror" > break > > However, when I run it, it seems that I'm not catchin

Re: Question about struct.unpack

2006-02-22 Thread Scott David Daniels
Eric Jacoboni wrote: > Hi, > > To experiment with unpacking, i've written a little C code which > stores one record in a file. Then, i try to reread this file to unpack > the record. > > Here's the struct of a record: > > typedef struct { > char nom[30]; > double taille; > int

Re: except clause not catching IndexError

2006-02-22 Thread Ben Cartwright
Derek Schuff wrote: > I have some code like this: > for line in f: > toks = line.split() > try: > if int(toks[2],16) == qaddrs[i]+0x1000 and toks[0] == > "200": #producer > write > prod = int(toks[3], 16) >

Re: No

2006-02-22 Thread Gaz
(the Input type = FILE is in the field) please check this out import ftplib import os ... def upload(ftp, file): ext = os.path.splitext(file)[1] if ext in (".txt", ".htm", ".html"): ftp.storlines("STOR " + file, open(file)) else: ftp.storbinar

Re: Python vs. Lisp -- please explain

2006-02-22 Thread Alexander Schmolck
"Michele Simionato" <[EMAIL PROTECTED]> writes: > I replied to this message yesterday, but it did not appear, so let's > try again. > > I agree with your points, but I would not say that Lisp is > intrinsically more dynamic than Python as a language; Neither would I -- I don't think either is ob

Re: Pyserial never read

2006-02-22 Thread sam
luca72 wrote: > Thanks to all for the help, > > here you find the code, pls note if i use handshaking = 1 the > application don't start. > in the delphi configuratio of com port if i use or not handshaking the > application work. > Best Regards at all > > Luca > > import serial > import win

Re: except clause not catching IndexError

2006-02-22 Thread Scott David Daniels
Derek Schuff wrote: > I have some code like this: > However, when I run it, it seems that I'm not catching the IndexError: > Traceback (most recent call last): > File "/home/dschuff/bin/speeds.py", line 202, in ? > if int(toks[2],16) == qaddrs[i]+0x1000 and toks[0] == "200": #produ

Re: except clause not catching IndexError

2006-02-22 Thread Derek Schuff
Erwin S. Andreasen wrote: > Did you by any chance do something like: > > except ValueError, IndexError: > > at some point earlier in this function? That, when catching ValueError > assigns the resulting exception to IndexError (and so the following > except IndexError: wouldn't work as IndexErro

Re: Pyserial never read

2006-02-22 Thread Grant Edwards
On 2006-02-22, sam <[EMAIL PROTECTED]> wrote: > luca72 wrote: >> Thanks to all for the help, >> >> here you find the code, pls note if i use handshaking = 1 the >> application don't start. >> in the delphi configuratio of com port if i use or not handshaking the >> application work. >> Best Regards

How to force creation of a .pyc?

2006-02-22 Thread mrstephengross
I would like to distribute a python program, but only in .pyc form (so that people cannot simply look at my code). Is there a way to do this? I've read up a little on the logic by which python creates .pyc's, and it sounds like python requires the main executed program to be in .py format. Any idea

Re: Pyserial never read

2006-02-22 Thread sam
Thanks for the info Grant. It'll teach me not to read the documentation :>) Sam -- http://mail.python.org/mailman/listinfo/python-list

Re: No

2006-02-22 Thread Gerard Flanagan
Gaz wrote: > (the Input type = FILE is in the field) > > please check this out > > import ftplib > import os > > ... > > def upload(ftp, file): > ext = os.path.splitext(file)[1] > if ext in (".txt", ".htm", ".html"): > ftp.storlines("STOR " + file, open(file)) >

Re: Tkinter canvas size determination

2006-02-22 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Dean Allen Provins <[EMAIL PROTECTED]> wrote: >I need to determine the size of a canvas while the process is running. >Does anyone know of a technique that will let me do that? . . . Does >>>

graph display(please help)

2006-02-22 Thread questions?
I heard from my friend who used to program in JAVA, it is really easy to do graph display in JAVA. I wonder whether there are similiar packages in Python I can use. Since I know a little bit Python syntax already, I can easily learn more in Python. I want to display connected graph(directed or u

Re: Exiting os.spawnv's subroutine

2006-02-22 Thread IamIan
Strange but removing the try/except part of the second script (leaving only the processing) removed the 2 minute lag at the end of each subroutine. -- http://mail.python.org/mailman/listinfo/python-list

Re: PyUNO with different Python

2006-02-22 Thread Michele Petrazzo
� wrote: > Hi! maybe somebody can give me an hint to my problem setting up PyUNO > on my Mac to work with my Python not the Python delivered with > OpenOffice. As said in installation instructions I've set > OPENOFFICE_PATH="/usr/lib/openoffice/program" export > PYTHONPATH="$OPENOFFICE_PATH" expor

Re: graph display(please help)

2006-02-22 Thread Bill Scherer
questions? wrote: > I heard from my friend who used to program in JAVA, it is really easy > to do graph display in JAVA. > > I wonder whether there are similiar packages in Python I can use. Since > I know a little bit Python syntax already, I can easily learn more in > Python. > > I want to disp

Re: Python vs. Lisp -- please explain

2006-02-22 Thread Luis M. González
Carl Friedrich Bolz wrote: > Paul Rubin wrote: > Well. "... the PyPy team works on ..." is definitively much too strong. > It is more like "... the PyPy team is thinking about ...". It is very > unclear whether it will work on a technical level and whether the EU > will allow us to allocate resourc

Re: How to force creation of a .pyc?

2006-02-22 Thread Nick Smallbone
mrstephengross wrote: > I would like to distribute a python program, but only in .pyc form (so > that people cannot simply look at my code). Is there a way to do this? > I've read up a little on the logic by which python creates .pyc's, and > it sounds like python requires the main executed program

Re: Python vs. Lisp -- please explain

2006-02-22 Thread Isaac Gouy
Steven D'Aprano wrote: > On Tue, 21 Feb 2006 09:46:27 -0800, Donn Cave wrote: > > > In article <[EMAIL PROTECTED]>, > > Steven D'Aprano <[EMAIL PROTECTED]> wrote: > > ... > >> Hey Donn, here is a compiled program for the PowerPC, > >> or an ARM processor, or one of IBM's Big Iron > >> mainframes.

Re: How to force creation of a .pyc?

2006-02-22 Thread Jeffrey Schwab
mrstephengross wrote: > I would like to distribute a python program, but only in .pyc form (so > that people cannot simply look at my code). Is there a way to do this? > I've read up a little on the logic by which python creates .pyc's, and > it sounds like python requires the main executed program

  1   2   >