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
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
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
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
[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:
>
> [...]
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
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
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
__
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
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:
You can do it this way:
sys.path.append("C:\Temp")
Alejandro
--
http://mail.python.org/mailman/listinfo/python-list
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
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
>
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
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
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
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
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
[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
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
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
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
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
>
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:
>>
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)
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
>
>
>
>
>
>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 =
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
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
> 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
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:
[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]) + " "
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
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
>
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
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
[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
[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
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
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
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
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
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,
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'(
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
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
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
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
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
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('
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
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
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
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
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
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
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.
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
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
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
oh, well how do I make "derek" be an instance of 'chatuser' ?
--
http://mail.python.org/mailman/listinfo/python-list
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) {
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/
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:
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
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
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
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
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
>
>> 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
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
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,
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
>
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
>>> 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
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
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
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
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?
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
[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 - 100 of 178 matches
Mail list logo