Re: up to date books?

2005-08-18 Thread Alessandro Bottoni
John Salerno wrote: > hi all. are there any recommendations for an intro book to python that > is up-to-date for the latest version? I do not know how much up-to-date they are but I have to suggest you these books: - Learning Python By Mark Lutz and David Ascher published by O'Reilly Most likely

Re: win32pipe.popen3

2005-08-18 Thread Adriaan Renting
Well, on Linux I use select first to see if there's something to read. Maybe this works on Windows too? This is my code: fd = os.open(filename, os.O_NONBLOCK) ready = select.select([fd], [], [], 0.25) ## timeout after 0.25 seconds. if

Re: Library vs Framework (was Dr. Dobb's Python-URL!)

2005-08-18 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Kay Schluehr <[EMAIL PROTECTED]> wrote: . . . >What are frameworks really good for - a very true success story. > >A colleague of mine used to spread all kinds of flags ( state- and >property mar

Re: up to date books?

2005-08-18 Thread Adriaan Renting
I learned Python from the "Learning Python" book that's first on Alessandros list. If you have the Second Edition, that includes coverage for Python 2.3, I think you have quite a nice introductory book. As a reference book "Python in a Nutshell" and of course the Python documentation itself are

Re: Bug in slice type

2005-08-18 Thread Michael Hudson
[EMAIL PROTECTED] writes: > Michael Hudson wrote: >> Bryan Olson writes: >> In some sense; it certainly does what I intended it to do. > > [...] >> I'm not going to change the behaviour. The docs probably aren't >> especially clear, though. > > The docs and the behavior contradict: > > [...]

An observer pattern application.

2005-08-18 Thread Paolino
Lately I was needing to use multiple inheritance to split behaviour of a class and modularize it. But the problem raises when the need is to add operations to a method already present in one of them from another. I think the technical solution is the use of 'super'. Then I tried to write a decora

Re: up to date books?

2005-08-18 Thread Paul Dale
I highly recommend the "Safari" library service from Oreilly ( http://safari.oreilly.com ) you can check out all of the books listed below and about 10,000 more. The library contains much more than just Oreilly's books, but they are, of course, all in there. The first 2 weeks is free after tha

Some questions

2005-08-18 Thread Titi Anggono
Hi all, I have some questions: 1. Can we use Tkinter for web application such as Java ? 2. I use gnuplot.py module for interfacing with gnuplot in linux. Can we make the plot result shown in web ? I tried using cgi, and it didn't work. Thanks __

Re: Iterparse and ElementTree confusion

2005-08-18 Thread paul . sherwood
Ofcourse! Thankyou so much. All is well, using the Iterparse takes a mere 3mins to find the last product in the xml and this is probably due to my checking 1 products for a specific. I feel rather honoured to have 'the' effbot reply to my humble post Thanks again Paul -- http://mail.p

how do i add a new path into sys.path?

2005-08-18 Thread wen
on my system(win2k server, python 2.3.5), >>> import sys >>> print sys.path ['C:\\', 'C:\\WINNT\\system32\\python23.zip', 'C:\\Python23\\lib\\site-packages\\Pythonwin', 'C:\\Python23\\lib\\site-packages\\win32', 'C:\\Python23\\lib\\site-packages\\win32\\lib', 'C:\\Python23\\lib\\site-packages', 'C:

Re: how do i add a new path into sys.path?

2005-08-18 Thread apa
You can do it this way: sys.path.append("C:\Temp") Alejandro -- http://mail.python.org/mailman/listinfo/python-list

Re: how do i add a new path into sys.path?

2005-08-18 Thread bruno modulix
wen wrote: > on my system(win2k server, python 2.3.5), > import sys print sys.path > > ['C:\\', 'C:\\WINNT\\system32\\python23.zip', > 'C:\\Python23\\lib\\site-packages\\Pythonwin', > 'C:\\Python23\\lib\\site-packages\\win32', > 'C:\\Python23\\lib\\site-packages\\win32\\lib', > 'C:\\Pytho

Re: how do i add a new path into sys.path?

2005-08-18 Thread wen
if i wanna add the path "C:\temp" into sys.path, and make it available for any other new python apps, like i add C:\temp into windows path , how? thank you. "apa" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > You can do it this way: > > sys.path.append("C:\Temp") > > Alejandro >

Re: question about binary and serial info

2005-08-18 Thread nephish
this is exactly what i need. i have not previously had a need for this kind of thing, but i sure need some documentation for it now. is there a resource out there to find out how to convert decimal number to a byte, a byte to a decimal and more about the & operator? i really appreciate this info. t

Re: Some questions

2005-08-18 Thread Alessandro Bottoni
Titi Anggono wrote: > 1. Can we use Tkinter for web application such as Java? What do you mean? If you want to build up a GUI (something like a HTML page) for a web-based application, you can do it with TKinter. Your TKinter app can connect to a web server (or any other kind of server) using the s

Re: question about binary and serial info

2005-08-18 Thread nephish
oh wait, i found it. i found how to do the conversions and thanks to you the operators. appreciate everything, shawn -- http://mail.python.org/mailman/listinfo/python-list

Re: up to date books?

2005-08-18 Thread Jon Hewer
mark pilgrim's dive into python is a good book if you're new to python i also have python cookbook, and foundations of python network programming - i haven't really had a chance to look at these in detail yet but both of these look good On 8/18/05, Paul Dale <[EMAIL PROTECTED]> wrote: > > I high

Python for Webscripting (like PHP)

2005-08-18 Thread Florian Lindner
Hello, I've been using Python a lot for scripting (mainly scripts for server administration / DB access). All these scripts were shell based. Now I'm considering using Python (with mod_python on Apache 2) for a web project, just how I've used PHP in some smaller Projects before ().. How suitable

Re: PyPE 2.1 run problem

2005-08-18 Thread TonyHa
[EMAIL PROTECTED] wrote: > Hello, > > I have downloaded the PyPE2.1-win-unicode.zip, after unzip it with winzip > into PyPE2.1-win-unicode dierctory on window XP. I try to run "pype.exe" > by double > click on it, but nothing has happen, then when I run it with "run as..." > using the right click

Re: up to date books?

2005-08-18 Thread dimitri pater
On 8/18/05, Jon Hewer <[EMAIL PROTECTED]> wrote: mark pilgrim's dive into python is a good book if you're new to python I agree that dive into python is a *very* good python book, but as it is says on http://diveintopython.org/ it is "for experienced programmers". So if you are new to Python to pr

Re: up to date books?

2005-08-18 Thread Magnus Lycka
John Salerno wrote: > hi all. are there any recommendations for an intro book to python that > is up-to-date for the latest version? It depends on what kind of books you like, and of course on your previous experience. I think "Python: Visual QuickStart Guide" by Chris Fehily is a rather nice be

Re: how do i add a new path into sys.path?

2005-08-18 Thread poyol
wen wrote: > if i wanna add the path "C:\temp" into sys.path, and make it available for > any other new python apps, like i add C:\temp into windows path , how? > thank you. Then use PYTHONPATH as you would use PATH . -- http://mail.python.org/mailman/listinfo/python-list

Re: how do i add a new path into sys.path?

2005-08-18 Thread wen
if i wanna add the path "C:\temp" into sys.path, and make it available for any other new python apps, like i add C:\temp into windows path , how? thank you. "apa" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > You can do it this way: > > sys.path.append("C:\Temp") > > Alejandro >

Re: Testing for presence of arguments

2005-08-18 Thread Peter Maas
Madhusudan Singh schrieb: > Dan Sommers wrote: [...] >>class _SemiPrivateClass: >>pass >> >>def f(required_argument=_SemiPrivateClass): >>if required_argument == _SemiPrivateClass: >>print "required_argument was probably not present" >>else: >>

time.clock() problem under linux (precision=0.01s)

2005-08-18 Thread Szabolcs Nagy
I have to measure the time of a while loop, but with time.clock i always get 0.0s, although python manual sais: "this is the function to use for benchmarking Python or timing algorithms" So i tested timer functions capabilities with a short script: import time import os def test_timer_func(func)

Re: Python for Webscripting (like PHP)

2005-08-18 Thread Micetto Nero
Florian Lindner ha scritto: > Hello, > I've been using Python a lot for scripting (mainly scripts for server > administration / DB access). All these scripts were shell based. > > Now I'm considering using Python (with mod_python on Apache 2) for a web > project, just how I've used PHP in some sma

Re: List of string

2005-08-18 Thread Mohammed Altaj
> > > > > >Mohammed Altaj wrote: > > >>Hi All >> >>I am having problem with delete line if its belong to another one , example >> >> > >I think, you mean to remove all lines that are substrings of another >line. > >l =

Re: GIS Related Scripting Issue

2005-08-18 Thread Fredrik Lundh
Mike Rose wrote: > I am currently using ArcGIS 9.1 and was referred to this list to ask my > question. I am using a python script to loop through a series of > features, select all polygons that are within 5 miles, run statistics on > those selected polygons, then append the values to a new datab

Re: Python for Webscripting (like PHP)

2005-08-18 Thread Szabolcs Nagy
I don't think stdlib offers anything like that The problem with python is it's white space sensible and html is not. However there are some nice solutions: http://www.webwareforpython.org/Papers/Templates/ my favourite is not listed here: http://karrigell.sourceforge.net/ For web development wi

Re: List of string

2005-08-18 Thread Marco Aschwanden
> Thanks , but , this work for an ordered substrings , just like what we > had ['0132442\n', '13\n', '24\n'] , I would like to remove all > substrings from the list , example > > ['0134314244133', '132443', '234'] > > > 2nd and 3rd strings are also substrings from the 1st one , so it should > be

unsubscriptable object error

2005-08-18 Thread MCollins
getting an unsubscriptable object error on an if else statement db = MSSQL.connect(server,login,pwd,database) c = db.cursor() c.execute(mySQL) rows = c.fetchone()         #determine recipient if str(rows[3]) == str(rows[4]):         recipient = str(rows[0]) + " " + str(rows[1])         else:

RE: unsubscriptable object error

2005-08-18 Thread Tim Golden
[EMAIL PROTECTED] > getting an unsubscriptable object error on an if else statement > db = MSSQL.connect(server,login,pwd,database) > c = db.cursor() > c.execute(mySQL) > rows = c.fetchone() > #determine recipient > if str(rows[3]) == str(rows[4]): > recipient = str(rows[0]) + " "

Event objects Threading on Serial Port on Win32

2005-08-18 Thread elcinturapartida
Hello all, I am not sure if this question is about threading or serial i/o - it has elements of both. I'm on WinXP (desktop) and WinNT (labtop), when I run miniterm.py there is no problem both writing, reading, opening the com port, no errors, etc. But if I run wxTerminal.py when read from it not

Re: creating/modifying sparse files on linux

2005-08-18 Thread Benji York
Terry Reedy wrote: > megastring = 100*'a' # t < 1 sec on my machine >>(other than keep appending to a string until it reaches 1MB len)? > > You mean like (unexecuted) > s = '' > for i in xrange(100): s += 'a' #? > > This will allocate, copy, and deallocate 100 successively longer >

Re: List of strings

2005-08-18 Thread Tomi Kyöstilä
Paul Watson wrote: > Mohammed Altaj wrote: > >> Hi All >> >> Thanks for your reply , what i am doing is , i am reading from file , >> using readlines() , I would like to check in these lines , if there is >> line belong to another one or not , if it is , then i would like to >> delete it >> >> ['0

Re: Python for Webscripting (like PHP)

2005-08-18 Thread Alessandro Bottoni
Florian Lindner wrote: > How suitable is Python for these kind of projects? What do think? Does the > stdlib offers all basic functions for this kind of requirements? Python is extremely well suited for the web-app development and the STDLib supply most of what you need for this task. As a matter

Which Python library for Jabber?

2005-08-18 Thread Alessandro Bottoni
[I just asked this on Jabber Dev but I did get very few answers. Please, excuse me for this kind of a cross-posting and give me some advise, if you can.] Which Python library would you use for developing a small Jabber client? jabber.py (seems to be dead since 2003) http://jabberpy.sourceforge.ne

RE: Which Python library for Jabber?

2005-08-18 Thread Tim Golden
[Alessandro Bottoni] | Which Python library would you use for developing a small | Jabber client? | | jabber.py (seems to be dead since 2003) | http://jabberpy.sourceforge.net/ | | pyxmpp (looks like the "official" python library) | http://pyxmpp.jabberstudio.org/ | | xmpp.py (a russian alterna

Re: Some questions

2005-08-18 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Alessandro Bottoni <[EMAIL PROTECTED]> wrote: >Titi Anggono wrote: >> 1. Can we use Tkinter for web application such as Java? > >What do you mean? If you want to build up a GUI (something like a HTML page) >for a web-based application, you can do it with TKinter. Yo

Re: Python for Webscripting (like PHP)

2005-08-18 Thread Luis M. Gonzalez
Mod_python has a PSP (python server pages - ala php) implementation. However it's still not mature enough and, imho, it has a serious drawback in its way to handle indentation. But this is just the first release and I hope it will improve in the near future. My favorite is Karrigell ( http://karri

Re: Python for Webscripting (like PHP)

2005-08-18 Thread Valentino Volonghi aka Dialtone
Alessandro Bottoni <[EMAIL PROTECTED]> wrote: > (Python has even been told to be used by Yahoo! and Google, among others, > but nobody was able to demonstrate this, so far) ? Google and Microsoft and Nokia had talks during PyCon 2005. If you look at the GMAIL help system you would see that all

Re: As Simple As Possible?

2005-08-18 Thread Tom Anderson
On Thu, 18 Aug 2005, Jules Dubois wrote: > On Wednesday 17 August 2005 22:11, jitya <[EMAIL PROTECTED]> > (<[EMAIL PROTECTED]>) wrote: > >> After three years of study, I have concluded that Python is about as >> simple as a full-powered object-oriented language can get. >> >> I know of no languag

Dr. Dobb's Python-URL! - weekly Python news and links (Aug 18)

2005-08-18 Thread Cameron Laird
QOTW: "It seems to me that Java is designed to make it difficult for programmers to write bad code, while Python is designed to make it easy to write good code." -- Magnus Lycka "Code attracts people that like to code. Tedious, repetitive c.l.py threads attract people that like to write tedious,

RE Question

2005-08-18 Thread Yoav
I don't understand why the two REs produce a different result. I read the RE guide but still I can't seem to figure it out. >>> t 'echo user=name password=pass path="/ret files"\r\n' >>> re.findall(r'(?<=\s)[^=]+=((?:".*")|(?:\S*))(?=\s)', t) ['name', 'pass', '"/ret files"'] >>> re.findall(r'(

Re: Tkinter and gnuplot module

2005-08-18 Thread Grant Edwards
On 2005-08-18, Titi Anggono <[EMAIL PROTECTED]> wrote: > 1. Can we use Tkinter for web application such as Java? No. You can't use Tkinter in a Java app, since Tkinter is a Python module (unless it works with Jython). > 2. I use gnuplot.py module for interfacing with gnuplot in > linux. Can we m

Re: creating/modifying sparse files on linux

2005-08-18 Thread [EMAIL PROTECTED]
My goal is very simple. Have a mechanism to create sparse files and modify them by writing arbitratry ranges of bytes at arbitrary offsets. I did get the information I want (xrange instead of range, and a simple way to generate 1Mb string in memory). Thanks for pointing out about using "len" as va

Re: Bug in slice type

2005-08-18 Thread Steven Bethard
Michael Hudson wrote: > [EMAIL PROTECTED] writes: >> I'm fine with your favored behavior. What do we do next to get >> the doc fixed? > > I guess one of us comes up with some less misleading words. It's not > totally obvious to me what to do, seeing as the returned values *are* > indices is a sen

Re: Python for Webscripting (like PHP)

2005-08-18 Thread Peter Hansen
Alessandro Bottoni wrote: > (Python has even been told to be used by Yahoo! and Google, among others, > but nobody was able to demonstrate this, so far) Nobody, except Google's founders? http://www-db.stanford.edu/~backrub/google.html (Among many other references.) -Peter -- http://mail.python

New to python

2005-08-18 Thread pcaro8a
Hi, I am new to python I am trying to install the numeric library and I get the following error: error: Python was built with version 6 of Visual Studio, and extensions need to be built with the same version of the compiler, but it isn't installed. Do I need Visual Studio to make this work or

gnuplot-py: plotoutput in string?

2005-08-18 Thread Nicola Kaiser
Hi, I´m using Gnuplot via gnuplot.py and I´m looking for a way to get the plotting output (terminal set to png in my case) piped in a string instead of to stdout or a file. Is there any method in gnuplot.py that does this for me? If not, I tried something like: p=Gnuplot.Gnuplot(debug=1) p('

Strange email.Parser error?

2005-08-18 Thread Andrey Smirnov
I am getting the following traceback after upgrading my app to Python 2.4.1. It's telling me that there is an error in Parser.py. It tells me that 'fp.read(8192)' is given 2 arguments, but it is clearly not true. Does anybody know what's going on here? Traceback (most recent call last): File

Re: RE Question

2005-08-18 Thread Jorge Godoy
Yoav wrote: > I don't understand why the two REs produce a different result. I read > the RE guide but still I can't seem to figure it out. > > >>> t > 'echo user=name password=pass path="/ret files"\r\n' > >>> re.findall(r'(?<=\s)[^=]+=((?:".*")|(?:\S*))(?=\s)', t) > ['name', 'pass', '"/ret fi

Re: RE Question

2005-08-18 Thread Yoav
Thanks, it seems like the first answer covers the second as well. Thank you. Jorge Godoy wrote: > Yoav wrote: > > >>I don't understand why the two REs produce a different result. I read >>the RE guide but still I can't seem to figure it out. >> >> >>> t >>'echo user=name password=pass path="/re

Confused newbie needs help with "__init__() takes exactly 11 arguments (1 given)"

2005-08-18 Thread googleboy
I've written a little script to parse a csv file then use seach/replace over a template to create a file for each line in the file. It pikes out when I call the function that parses the csv (read_revs). If I have inadvertantly left an extra comma or two in the comma field, it gives an error that

Re: Strange email.Parser error?

2005-08-18 Thread Anthony Botrel
Hi, in the call fp.read(8192) the function read() gets 2 arguments : and <8192> Member functions implicitely get their object as first argument, this is why you get this error. So you have 2 possibilities : either read() doesn't take an argument anymore, or read() is not a member of fp. Anthony

Re: RE Question

2005-08-18 Thread Yoav
What is the difference between the RE module and the SRE one? Original Message From: Jorge Godoy <[EMAIL PROTECTED]> To: Subject: Re:RE Question Date: 18/8/2005 17:44 > Yoav wrote: > > >>I don't understand why the two REs produce a different result. I read >>the RE guide but s

Creating watermark with transparency on jpeg using PIL?

2005-08-18 Thread tvmaly
I have been trying to add a watermark to a jpeg using PIL, but the watermark has a black box around it. I looked at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/362879 and http://mail.python.org/pipermail/python-list/1999-May/003369.html but I think these only refer to gif or png.

Coin-operated kiosk written in python -- need some help...

2005-08-18 Thread Jon Monteleone
Greetings, I posted a few days back and didnt get much of a response, so I figured I would post again with more detail. I am running gnome under fedora core 4. I want a kid to be able to drop a quarter into a coin slot and get 15 minutes of time on an account that has "restricted" Internet acces

Re: Strange email.Parser error?

2005-08-18 Thread Andrey Smirnov
Ah - this makes more sense. Did the implementation of 'fp' file-like object change in 2.4.1 and it no longer has a read()? Andre. Anthony Botrel wrote: > Hi, > > in the call fp.read(8192) the function read() gets 2 arguments : and > <8192> > > Member functions implicitely get their object as

Re: Bug in slice type

2005-08-18 Thread Steven Bethard
I wrote: > I wanted to say something about what happens with a negative stride, to > indicate that it produces (9, -1, -2) instead of (-1, -11, -2), but I > wasn't able to navigate the Python documentation well enough. > > Looking at the Language Reference section on the slice type[1] (section

Re: pickle.load not working?

2005-08-18 Thread [EMAIL PROTECTED]
oh, well how do I make "derek" be an instance of 'chatuser' ? -- http://mail.python.org/mailman/listinfo/python-list

Implementing class methods in C

2005-08-18 Thread nmichaud
I am having a problem implementing some methods of a python class in C. The class is defined in python, but I would like to rewrite some methods in c. Here is an example of what I want to do: file _test.c: #include static PyObject * func2(PyObject *self, PyObject *args) { if (self == NULL) {

Put a url in a browsers address bar

2005-08-18 Thread Colin Gillespie
Dear All, I would like to place a url in my browsers address bar, then execute. How can do this? e.g. def goToGoogle(): url = "www.google.com" b = openBrowser() b.goToUrl(url) return True Thanks for any help Colin -- http://mail.python.org/

Re: gnuplot-py: plotoutput in string?

2005-08-18 Thread Grant Edwards
On 2005-08-18, Nicola Kaiser <[EMAIL PROTECTED]> wrote: > I´m using Gnuplot via gnuplot.py and I´m looking for a way to get the > plotting output (terminal set to png in my case) piped in a string > instead of to stdout or a file. Plotting to a file and then reading the file is pretty trivial:

Re: Confused newbie needs help with "__init__() takes exactly 11 arguments (1 given)"

2005-08-18 Thread [EMAIL PROTECTED]
That's great, but it seems like a lot of work just to read in everything. Take a look at the sample that I did with the interpreter... First, X is a simulated input line... --- x = " param1,param2,param3,param4,param5,param6,param7,param8,param9,comments blah , blah, test" --- Ok, so just like you

Re: Put a url in a browsers address bar

2005-08-18 Thread Alan Kemp
On Thu, 18 Aug 2005 12:01:16 -0400, Colin Gillespie <[EMAIL PROTECTED]> wrote: > I would like to place a url in my browsers address bar, then execute. > How can do this? > > e.g. > > def goToGoogle(): > url = "www.google.com" > b = openBrowser() > b.goToUrl(url) > retu

Re: Implementing class methods in C

2005-08-18 Thread Jeremy Moles
I honestly don't know the answer to this and I am entirely guessing but--does it work without using the new module? That is: import _test class Foo: pass foo = Foo() foo.bar = _test.func2 foo.bar() On Thu, 2005-08-18 at

(OT) Is there something that people can use instead of full blown Python to run Python programs?

2005-08-18 Thread Nathan Pinno
Hi all,   Is there something besides the full blown version of Python that people can use to run Python programs, or do they have to use the full blown version of it?   Thanks, Nathan ---Early to bed,Early to rise,Makes a man healthy

Re: List of string

2005-08-18 Thread [EMAIL PROTECTED]
to quote you : "['0134314244133', '132443', '234'] 2nd and 3rd strings are also substrings from the 1st one , so it should be removed " Actually, no, the 2nd string does not substring match the first, nor does the 3rd. If you are referring to matching individual characters, then yes, characters

Re: Put a url in a browsers address bar

2005-08-18 Thread Colin Gillespie
> >> I would like to place a url in my browsers address bar, then execute. >> How can do this? >> > > def goToGoogle(): > import webbrowser > webbrowser.open("www.google.com"); > Thanks for the quick reply. Do you know what module I would use to fill out a form on an open web page? Th

Re: New to python

2005-08-18 Thread Alessandro Bottoni
pcaro8a wrote: > I am new to python I am trying to install the numeric library and I > get the following error: > > error: Python was built with version 6 of Visual Studio, and > extensions need to > be built with the same version of the compiler, but it isn't installed. > > Do I need Visual Stud

Re: (OT) Is there something that people can use instead of full blown Python to run Python programs?

2005-08-18 Thread Gregory Piñero
I'm no expert, but I'm guessing you could compile a python with less libraries.  I bet that would slim it down a lot. -Greg On 8/18/05, Nathan Pinno <[EMAIL PROTECTED]> wrote: Hi all,   Is there something besides the full blown version of Python that people can use to run Python programs,

Re: Put a url in a browsers address bar

2005-08-18 Thread Peter Hansen
Colin Gillespie wrote: >> >>> I would like to place a url in my browsers address bar, then execute. >>> How can do this? >>> >> >> def goToGoogle(): >> import webbrowser >> webbrowser.open("www.google.com"); >> > > Thanks for the quick reply. Do you know what module I would use to fill >

Re: question about binary and serial info

2005-08-18 Thread nephish
i got the bitwise part, i just cant seem to convert the incomming ascii into hex, binary, integer, or decimal. how do i do this, my serial port bytes just come in all weird looking ascii characters thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Testing for presence of arguments

2005-08-18 Thread Madhusudan Singh
Peter Maas wrote: >> Thanks for the suggestion, but seems needlessly complicated for > > something very simple. > > What is "very simple"? The problem or the solution? :) If you examine The form of the solution. > this suggestion more closely you will note that it is more or less > the same as

Re: Implementing class methods in C

2005-08-18 Thread nmichaud
Nope, it still doesn't work. Anyway, that's not exactly what i want, since i want func2 to be accessible from all instances of Test() Naveen On Thu, 18 Aug 2005, Jeremy Moles wrote: > I honestly don't know the answer to this and I am entirely guessing > but--does it work without using the new m

Re: (OT) Is there something that people can use instead of full blown Python to run Python programs?

2005-08-18 Thread Alan Kemp
On Thu, 18 Aug 2005 12:38:30 -0400, Gregory Piñero <[EMAIL PROTECTED]> wrote: > I'm no expert, but I'm guessing you could compile a python with less > libraries. I bet that would slim it down a lot. > > -Greg > > > On 8/18/05, Nathan Pinno <[EMAIL PROTECTED]> wrote: >> >> Hi all, >> Is there so

Re: how do i add a new path into sys.path?

2005-08-18 Thread Steve Holden
apa wrote: > You can do it this way: > > sys.path.append("C:\Temp") > > Alejandro > Better: sys.path.append("C:\\Temp") or sys.path.append(r"C:\Temp") regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mai

Re: List of string

2005-08-18 Thread BranoZ
Dennis Lee Bieber wrote: > On Thu, 18 Aug 2005 13:30:45 +0200, Mohammed Altaj <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > > Thanks , but , this work for an ordered substrings , just like what we > > had ['0132442\n', '13\n', '24\n'] , I would like to remove all > > su

Re: question about binary and serial info

2005-08-18 Thread Grant Edwards
On 2005-08-18, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > i got the bitwise part, i just cant seem to convert the > incomming ascii into hex, binary, integer, or decimal. So you've got an ASCII string in one format and you want to convert into an ASCII string in a different format? For exa

Re: (OT) Is there something that people can use instead of full blown Python to run Python programs?

2005-08-18 Thread Nathan Pinno
I was thinking something like Java's Runtime Environment, but that might also do.   Thanks, Nathan Pinno ---Early to bed,Early to rise,Makes a man healthy, wealthy, and wise.--Benjamin Franklin

Re: Python for Webscripting (like PHP)

2005-08-18 Thread Steve Holden
Peter Hansen wrote: > Alessandro Bottoni wrote: > >>(Python has even been told to be used by Yahoo! and Google, among others, >>but nobody was able to demonstrate this, so far) > > > Nobody, except Google's founders? > > http://www-db.stanford.edu/~backrub/google.html > > (Among many other ref

Re: Put a url in a browsers address bar

2005-08-18 Thread Steve Holden
Colin Gillespie wrote: >>>I would like to place a url in my browsers address bar, then execute. >>>How can do this? >>> >> >>def goToGoogle(): >>import webbrowser >>webbrowser.open("www.google.com"); >> > > > Thanks for the quick reply. Do you know what module I would use to fill > out a

RE: Coin-operated kiosk written in python -- need some help...

2005-08-18 Thread Sells, Fred
I've done a similar app, but it keeps a gui up awaiting a timeclock punch. You need to tackle this in phases: 1. what os and get the gui to start at bootup. 2. start a separate thread that reads/blocks on the coin. you need more specific questions to get better help -Original Message- Fro

Re: Python for Webscripting (like PHP)

2005-08-18 Thread Scott Kilpatrick
Alessandro Bottoni wrote: > (Python has even been told to be used by Yahoo! and Google, among others, > but nobody was able to demonstrate this, so far) If you use Yahoo! Maps, you will notice they use Python. Scott -- http://mail.python.org/mailman/listinfo/python-list

Re: Put a url in a browsers address bar

2005-08-18 Thread Steve Holden
Colin Gillespie wrote: >>>I would like to place a url in my browsers address bar, then execute. >>>How can do this? >>> >> >>def goToGoogle(): >>import webbrowser >>webbrowser.open("www.google.com"); >> > > > Thanks for the quick reply. Do you know what module I would use to fill > out a

Re: List of string

2005-08-18 Thread bryanjugglercryptographer
BranoZ wrote: > "132443" is a 'subsubstring' "0134314244133" because: For the record, that's called a "subsequence". http://www.google.com/search?hl=en&q=subsequence -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: question about binary and serial info

2005-08-18 Thread nephish
i have an ascii string comming in the serial port and i need to convert it to something else, like an integer, or binary, or even a hex so i can use the bitwise comparison on it. thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Some questions

2005-08-18 Thread Thomas Ganss
Cameron Laird schrieb: > In article <[EMAIL PROTECTED]>, > Alessandro Bottoni <[EMAIL PROTECTED]> wrote: > >>Titi Anggono wrote: >>>1. Can we use Tkinter for web application such as Java? ... > ... or, if you mean, "is Python an apt language for client-side > Web development in the way Java is, w

Bitwise operations in Python?

2005-08-18 Thread Carl
Dear friends, I am currently porting a fortran program to Python but am stuck on the intrinsic IBITS function. Does anyone know about a replacement function for IBITS in Python? Yours, Carl IBITS(I, POS, LEN) Extracts a sequence of bits. I must be of type integer. PO

Re: question about binary and serial info

2005-08-18 Thread Grant Edwards
On 2005-08-18, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > i have an ascii string comming in the serial port and i need to convert > it to something else, like an integer, or binary, or even a hex so i > can use the bitwise comparison on it. But what do you mean by "integer", "binary", and "he

Re: Bitwise operations in Python?

2005-08-18 Thread Paul Rubin
Carl <[EMAIL PROTECTED]> writes: > IBITS(I, POS, LEN) > Extracts a sequence of bits. > The result has the value of the sequence of LEN bits in I beginning at bit > POS, right-adjusted and with all other bits zero. > > The bits are numbered from 0 to BIT_SIZE(I)-1, from right to left. > > Examples

Confused newbie needs help with "__init__() takes exactly 11 arguments (1 given)"

2005-08-18 Thread googleboy
Mostly I posted to try to find out more about the arguments being passed to __init__, and why they'd be 13 one second and 1 the next. I also was hoping to get a little more background on what is happening under the hood of the csv function I've plagiarised. I haev read the online python doco on

Re: question about binary and serial info

2005-08-18 Thread nephish
>>> import serial >>> ser = serial.Serial('/dev/ttyS0', 2400, timeout= 10, bytesize=8, stopbits=1) >>> a = ser.read(1) >>> print a ^ >>> ser.close() >>> type(a) >>> int(a, 16) Traceback (innermost last): File "", line 1, in ? ValueError: invalid literal for int(): ^ so i run it again the same

Re: up to date books?

2005-08-18 Thread [EMAIL PROTECTED]
I would suggest Alex Martelli's "Python in a Nutshell" or the "Python Cookbook" as the best Python books from Oreilly. I also like M. Pilgrim's "Dive into Python". -- http://mail.python.org/mailman/listinfo/python-list

Re: extending: new type instance

2005-08-18 Thread BranoZ
Michael Hudson wrote: > PyObject_New is the usual way, although there are others -- Thanks for an answer ! > MyType.tp_new, PyObject_Call ... Does this mean, that I can call my newly defined MyType_new, MyType_init directly ?? I was afraid that Python might do some pretty important housekeeping

Python jobs (was Re: Python for Webscripting (like PHP))

2005-08-18 Thread Aahz
In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: > >There's informal evidence that the Python secret is getting out. Sharpen >up your resumes, guys, you may not have to limit Python to home usage >soon :-) OTOH, the big sucking sound from Google and Yahoo (plus other plac

certificate-based authentication

2005-08-18 Thread Dennis . Hoffman
I have been using XML-RPC to get information from one of our remote servers. To improve security, the server now has a certificate installed, and when I try to access it, I get an 'Unauthorized' exception. Is there an xmlrpclib module that supports (client-side) certificate-based authentication?

Re: question about binary and serial info

2005-08-18 Thread Grant Edwards
On 2005-08-18, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: import serial ser = serial.Serial('/dev/ttyS0', 2400, timeout= 10, bytesize=8, stopbits=1) a = ser.read(1) print a > ^ That's not a hex number. Hex numbers are composed of '0-9A-F' 0F48A is a hex number. ^ is

Re: question about binary and serial info

2005-08-18 Thread Peter Hansen
[EMAIL PROTECTED] wrote: import serial ser = serial.Serial('/dev/ttyS0', 2400, timeout= 10, bytesize=8, stopbits=1) a = ser.read(1) print a It sounds like you want to convert characters into their corresponding integer values. To do this, use the ord() builtin function. >>> ord

  1   2   >