Re: [capi-sig] Deploying embedded Python

2007-12-20 Thread Jeff Rush
Andreas Raab wrote: > > 1) How to define a useful subset of the stdlib that can serve as an > initial basis for the installation but later allows upgrade to the > "full" library if desirable. There is no formal way of doing this, although you could at least start with the full library and remov

Re: Best way to protect my new commercial software.

2007-12-20 Thread Steven D'Aprano
On Thu, 20 Dec 2007 21:23:05 -0800, Dennis Lee Bieber wrote: >> I expect a nice script in 15-35 lines that protects my software from >> working on another machine. > > Ah, but at that shortness, what will protect the protection script? ... > Proprietary information/trade-secret is only e

Re: Is there a simple way to parse this string ?

2007-12-20 Thread Steven D'Aprano
On Thu, 20 Dec 2007 20:27:23 -0800, [EMAIL PROTECTED] wrote: > Stef, > > For clarification, there is nothing hazardous about using eval on the > string that you presented. > > t = eval('(0, 0, 0, 255), (192, 192, 192, 255), True, 8') > > Whether or not this is the "simplest" solution, remains a

Re: 2D Game Development in Python

2007-12-20 Thread Steven Clark
On Dec 20, 2007 10:30 PM, Terry Reedy <[EMAIL PROTECTED]> wrote: > > "PatrickMinnesota" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > | I think I need at least this: 2D graphics, sound, input (kbd, mouse, > | joystick maybe), some IPC might be nice (Stuff like: Sockets, TCP, > |

socket in python with proxies

2007-12-20 Thread Astan Chee
Hi, I have a proxy server that requires authentication on a non-standard port and Im trying to connect to it via socket.connect() I tried doing this: import socket server = ("username:[EMAIL PROTECTED]",1234) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(server) I keep getting t

Re: Is there a simple way to parse this string ?

2007-12-20 Thread [EMAIL PROTECTED]
Stef, For clarification, there is nothing hazardous about using eval on the string that you presented. t = eval('(0, 0, 0, 255), (192, 192, 192, 255), True, 8') Whether or not this is the "simplest" solution, remains a question. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to spider through a secure site?

2007-12-20 Thread Gardner Pomper
Thanks, I tried googling 'python ssl certificate' and I am still not finding answers. I think part of my problem is that I am not clear on what is going on under the covers. I have found an example of connecting via https herebut that

Re: Passing by reference

2007-12-20 Thread Aahz
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: > >Is the following correct? Sort-of, but I would say that it's misleadingly correct. Try this: http://starship.python.net/crew/mwh/hacks/objectthink.html -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ "T

Re: It's ok to __slots__ for what they were intended (was: Don't use __slots__ (was Re: Why custom objects take so much memory?))

2007-12-20 Thread Aahz
In article <[EMAIL PROTECTED]>, Carl Banks <[EMAIL PROTECTED]> wrote: >On Dec 18, 4:49 pm, [EMAIL PROTECTED] (Aahz) wrote: >> In article <[EMAIL PROTECTED]>, >> Chris Mellon <[EMAIL PROTECTED]> wrote: >>> >>>You can reduce the size of new-style classes (inherit from object) by >>>quite a bit if yo

Re: How to spider through a secure site?

2007-12-20 Thread Terry Reedy
"Gardner Pomper" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Hi, | | My daughter's school just put up an "Infinite Campus" website, which | requires a login and does everything through https. I can find examples of | how to spider a regular web site with python, but I can't fig

Re: 2D Game Development in Python

2007-12-20 Thread Terry Reedy
"PatrickMinnesota" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | I think I need at least this: 2D graphics, sound, input (kbd, mouse, | joystick maybe), some IPC might be nice (Stuff like: Sockets, TCP, | UDP, pipes, msg queues, shared memory). The IPC stuff would only be | used

Re: Why does __builtins__ mean different things...

2007-12-20 Thread Terry Reedy
"James Stroud" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Butwhat the heck? You mean if I drop an s I get predictable behavior | and if I don't, I get unpredictable behavior? In 3.0, the __builtin__ module will be renamed 'builtins'. The internal __builtins__ variable mo

Re: Is this a bug in int()?

2007-12-20 Thread Terry Reedy
"Duncan Booth" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | [EMAIL PROTECTED] wrote under the subject line "Is this a | bug in int()?": | int('0x', 16) | > 0 | > | I think it is a general problem in the tokenizer, not just the 'int' | constructor. The syntax for integers says

Re: Tkinter--unexpected behavior with pack_forget()

2007-12-20 Thread John McMonagle
Kevin Walzer wrote: > I'm trying to toggle the visibility of a Tkinter widget using > pack_forget(), and I'm running into unexpected behavior. The widget > "hides" correctly, but does not become visible again. My sample code is > below: > > > from Tkinter import * > > root = Tk() > > lab

Re: sending a rip1 request via python

2007-12-20 Thread scripteaze
On Dec 19, 5:50 pm, Dirk Loss <[EMAIL PROTECTED]> wrote: > scripteaze wrote: > > >>> I need to be able to send a rip1 request to my rip1 enabled device., ok i got everthing setup and its sending the packets, do i have to create a socket server or cant i simply setup a buf = 1024 and recieve the re

2D Game Development in Python

2007-12-20 Thread PatrickMinnesota
I like to do fun stuff when learning a new language. I've been working with Python for a little while on real world problems mostly fixing bugs and writing a simulator for work. I was thinking as a hobby project developing a simple 2d game (think Donkey Kong, Space Invaders, LoadRunner) and menti

Tkinter--unexpected behavior with pack_forget()

2007-12-20 Thread Kevin Walzer
I'm trying to toggle the visibility of a Tkinter widget using pack_forget(), and I'm running into unexpected behavior. The widget "hides" correctly, but does not become visible again. My sample code is below: from Tkinter import * root = Tk() label = Label(text="Hello") label.pack() def

Re: pop3_ssl Attachment problem

2007-12-20 Thread los117
On Dec 20, 6:57 am, Chris <[EMAIL PROTECTED]> wrote: > On Dec 20, 9:22 am, los117 <[EMAIL PROTECTED]> wrote: > > > > > > > I am trying to fetch email from gmail, but what I am really interested > > is theattachment. > > I manage to access the gmail server and get the messege but the > >attachmentca

A new group for MAYA - PYTHON lovers.

2007-12-20 Thread Farsheed Ashouri
New mailing list for Maya/Python users. http://groups.google.com/group/python_inside_maya -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I use trace to generate coverage data in multi-threaded programs?

2007-12-20 Thread Noah
On Dec 19, 7:33 pm, Noah <[EMAIL PROTECTED]> wrote: > /usr/lib/python2.5/trace.py --missing --count --summary tools/testall.py > > When I examine the *.cover files that are generated after a test run > I do not see coverage information for the methods that were run > in a separate thread. How c

Re: replace c-style comments with newlines (regexp)

2007-12-20 Thread Steven D'Aprano
On Fri, 21 Dec 2007 00:00:47 +, lex __ wrote: > I'm tryin to use regexp to replace multi-line c-style comments (like /* > this /n */ ) with /n (newlines). I tried someting like > re.sub('/\*(.*)/\*' , '/n' , file) but it doesn't work for multiple > lines. Regexes won't cross line boun

Re: Best way to protect my new commercial software.

2007-12-20 Thread Farsheed Ashouri
Well, I think my question was a programming question not a copyright question. I expect a nice script in 15-35 lines that protects my software from working on another machine. I don't want best protection method available, like flexlm or etc. My software is some kind of business secret and working

replace c-style comments with newlines (regexp)

2007-12-20 Thread lex __
I'm tryin to use regexp to replace multi-line c-style comments (like /* this /n */ ) with /n (newlines). I tried someting like re.sub('/\*(.*)/\*' , '/n' , file) but it doesn't work for multiple lines. besides that I want to keep all newlines as they were in the original file, so I can

Re: Need to open an Url and display it in a window created using Python win extensions

2007-12-20 Thread Farsheed Ashouri
Can you post your basic wx part code? -- http://mail.python.org/mailman/listinfo/python-list

How to spider through a secure site?

2007-12-20 Thread Gardner Pomper
Hi, My daughter's school just put up an "Infinite Campus" website, which requires a login and does everything through https. I can find examples of how to spider a regular web site with python, but I can't figure out how to deal with the ssl certificate and how to supply name and password. I have

Re: Why does __builtins__ mean different things...

2007-12-20 Thread James Stroud
Jean-Paul Calderone wrote: > On Thu, 20 Dec 2007 14:29:35 -0800, James Stroud <[EMAIL PROTECTED]> > wrote: >> Hello all, >> >> Say I have the following module >> >> # amodule.py >> print __builtins__ >> # end of module >> >> Then I have the following little helper script: >> >> # helper.py >> impo

Re: Why does __builtins__ mean different things...

2007-12-20 Thread Jean-Paul Calderone
On Thu, 20 Dec 2007 14:29:35 -0800, James Stroud <[EMAIL PROTECTED]> wrote: >Hello all, > >Say I have the following module > ># amodule.py >print __builtins__ ># end of module > >Then I have the following little helper script: > ># helper.py >import amodule ># end of helper script > >Now, I do this

Re: readlines() reading incorrect number of lines?

2007-12-20 Thread John Machin
On Dec 21, 8:13 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > [Fixing top-posting.] > > > > > > On Thu, 20 Dec 2007 12:41:44 -0800, Wojciech Gryc wrote: > > On Dec 20, 3:30 pm, John Machin <[EMAIL PROTECTED]> wrote: > [snip] > >> > However, when I use Python's various methods

Re: Allowing Arbitrary Indentation in Python

2007-12-20 Thread Gary
On Dec 19, 10:10 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > ElementTree is a good candidate for processing xml: > http://effbot.org/zone/element.htm > It provides a "natural" way to access elements and attributes, instead of > writing the same handler again and again or using slow DOM

Re: Allowing Arbitrary Indentation in Python

2007-12-20 Thread Gary
On Dec 19, 10:10 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > ElementTree is a good candidate for processing xml: > http://effbot.org/zone/element.htm > It provides a "natural" way to access elements and attributes, instead of > writing the same handler again and again or using slow DOM

Re: wxPython FileDialog, select folder

2007-12-20 Thread SMALLp
farsheed wrote: > import wx > def dirchoose(): > 'Gives the user selected path. Use: dirchoose()' > global _selectedDir , _userCancel #you should define > them before > userPath = 'c:/' > app = wx.App() > dialog = wx.DirDialog(None, "Please choose your pr

Why does __builtins__ mean different things...

2007-12-20 Thread James Stroud
Hello all, Say I have the following module # amodule.py print __builtins__ # end of module Then I have the following little helper script: # helper.py import amodule # end of helper script Now, I do this at the command line: python amodule.py And I get the following output: Which is good.

Re: wxPython FileDialog, select folder

2007-12-20 Thread farsheed
import wx def dirchoose(): 'Gives the user selected path. Use: dirchoose()' global _selectedDir , _userCancel #you should define them before userPath = 'c:/' app = wx.App() dialog = wx.DirDialog(None, "Please choose your project directory:",\

Re: Connecting to SQL database

2007-12-20 Thread Rob Williscroft
bill ramsay wrote in news:[EMAIL PROTECTED] in comp.lang.python: > Hi > > I have successfully connected to SQL2000 and MSDEE databases in the > > Conn = Dispatch('ADODB.Connection') > Conn.ConnectionString = "Provider=SQLNCLI;Server=10.1.1.2; > Database=csrctest;Uid=bill;Pwd=bill" By

Re: Passing by reference

2007-12-20 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Is the following correct? | | x = "some string" | | x is a reference to "some string" x is a name bound to a string object with value 'some string'. Some people find is useful to call that a 'reference', as you seem to have. Others ge

Re: Python; jump to a concrete line

2007-12-20 Thread Tobiah
Horacius ReX wrote: > Hi, sorry but after looking for information, I still did not get how, > when reading a text file in python, can one jump to a concrete line > and then read the different data (separated by spaces). In each line > there is different number of columns so sometimes i get kind of

Re: wxPython FileDialog, select folder

2007-12-20 Thread SMALLp
Chris Mellon wrote: > On Dec 20, 2007 3:19 PM, SMALLp <[EMAIL PROTECTED]> wrote: >> How can i select folder either with wx.FileDialog or with any other. I >> managed to fine only how to open files but I need to select folder to >> get files from all sub folders. >> > > > There's a separate di

Re: Is this a bug in int()?

2007-12-20 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: int('0x', 16) > 0 > > I'm working on a tokenizer and I'm thinking about returning a > MALFORMED_NUMBER token (1.2E, .5E+) Somewhat surprisingly, "0x" is a valid integer literal in Python: >>> 0x 0 -- http://mail.python.org/mailman/listinfo/python-list

Re: Connecting to SQL database

2007-12-20 Thread thebjorn
On Dec 20, 10:01 pm, bill ramsay <[EMAIL PROTECTED]> wrote: > On Fri, 14 Dec 2007 23:35:00 -0300, "Gabriel Genellina" > > <[EMAIL PROTECTED]> wrote: > >En Fri, 14 Dec 2007 23:24:24 -0300, Unknown <[EMAIL PROTECTED]> > >escribió: > > >> I have successfully connected to SQL2000 and MSDEE databases in

Re: Is this a bug in int()?

2007-12-20 Thread Duncan Booth
[EMAIL PROTECTED] wrote under the subject line "Is this a bug in int()?": int('0x', 16) > 0 > I think it is a general problem in the tokenizer, not just the 'int' constructor. The syntax for integers says: hexinteger ::= "0" ("x" | "X") hexdigit+ but 0x appears to be accepted in source

RE: xml-filter with XMLFilterBase() and XMLGenerator() shuffles attributes

2007-12-20 Thread Brian Smith
> > I want prevent it from shuffling attributes, i.e. preserve original > > file's attribute order. Is there any ContentHandler.features* > > responsible for that? > > I suspect not. attrs is a dictionary which does not maintain > order, and XML attributes are unordered to begin with. Is > t

Re: Passing by reference

2007-12-20 Thread Michael Sparks
[EMAIL PROTECTED] wrote: > ... the first element of the list to which x refers is a reference to > the new string and back outside foo, the first element of the list to > which x refers will be a reference to the new string. I'd rephrase that as: * Both the global context and the inside of foo

Re: Using ctypes with lib not found via ldconfig

2007-12-20 Thread Sam
Hello, May be I misunderstand your problem, but is it not possible do link it as follow? import ctypes libgaak = ctypes.CDLL("/home/me/otherLibs/libgaak.so.6") Kind regards. Sam -- http://mail.python.org/mailman/listinfo/python-list

Need to open an Url and display it in a window created using Python win extensions

2007-12-20 Thread shaik_saleem
I'm pretty new to Python and I've been searching all over the place to find a solution for this. I have a html page with some javascript in it and I need to load this page in my own window (which I will create using PythonWin). The reason for this is to have capability to control the window propert

Re: wxPython FileDialog, select folder

2007-12-20 Thread Chris Mellon
On Dec 20, 2007 3:19 PM, SMALLp <[EMAIL PROTECTED]> wrote: > How can i select folder either with wx.FileDialog or with any other. I > managed to fine only how to open files but I need to select folder to > get files from all sub folders. > There's a separate dialog, wx.DirDialog. -- http://m

Is this a bug in int()?

2007-12-20 Thread MartinRinehart
>>>int('0x', 16) 0 I'm working on a tokenizer and I'm thinking about returning a MALFORMED_NUMBER token (1.2E, .5E+) -- http://mail.python.org/mailman/listinfo/python-list

wxPython FileDialog, select folder

2007-12-20 Thread SMALLp
How can i select folder either with wx.FileDialog or with any other. I managed to fine only how to open files but I need to select folder to get files from all sub folders. Thanks in advance! -- http://mail.python.org/mailman/listinfo/python-list

Re: Hexadecimal list conversion

2007-12-20 Thread Gabriel Genellina
En Thu, 20 Dec 2007 12:51:33 -0300, Peter Otten <[EMAIL PROTECTED]> escribió: > Mark T wrote: > >> "Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message > >>> If you got that from a file, I bet you read it using the wrong >>> encoding. Try opening the file using codecs.open("filename", "rb",

Re: Using ctypes with lib not found via ldconfig

2007-12-20 Thread Jean-Paul Calderone
On 20 Dec 2007 20:36:20 GMT, Cylops <[EMAIL PROTECTED]> wrote: >I'd like to use ctypes for my Linux app, but the libraries i want to >use it on aren't in a standard location, and can't be found via ldconfig. >They aren't in any of the directories listed in /etc/ld.so.conf, and they >won't be. Our I

Re: Connecting to SQL database

2007-12-20 Thread kyosohma
On Dec 14, 8:24 pm, bill ramsay <[EMAIL PROTECTED]> wrote: > Hi > > I have successfully connected to SQL2000 and MSDEE databases in the > past, however I have to move to SQL2005 and SQLEXPRESS databases now. > > I've tried the following but with no luck [this is what i used in the > earlier incarn

Re: readlines() reading incorrect number of lines?

2007-12-20 Thread Steven D'Aprano
[Fixing top-posting.] On Thu, 20 Dec 2007 12:41:44 -0800, Wojciech Gryc wrote: > On Dec 20, 3:30 pm, John Machin <[EMAIL PROTECTED]> wrote: [snip] >> > However, when I use Python's various methods -- readline(), >> > readlines(), or xreadlines() and loop through the lines of the file, >> > the li

Re: Connecting to SQL database

2007-12-20 Thread kyosohma
On Dec 14, 8:24 pm, bill ramsay <[EMAIL PROTECTED]> wrote: > Hi > > I have successfully connected to SQL2000 and MSDEE databases in the > past, however I have to move to SQL2005 and SQLEXPRESS databases now. > > I've tried the following but with no luck [this is what i used in the > earlier incarn

Re: Passing by reference

2007-12-20 Thread MartinRinehart
... the first element of the list to which x refers is a reference to the new string and back outside foo, the first element of the list to which x refers will be a reference to the new string. Right? -- http://mail.python.org/mailman/listinfo/python-list

Re: readlines() reading incorrect number of lines?

2007-12-20 Thread John Machin
On Dec 21, 7:41 am, Wojciech Gryc <[EMAIL PROTECTED]> wrote: > Hi, > > Python 2.5, on Windows XP. Actually, I think you may be right about > \x1a -- there's a few lines that definitely have some strange > character sequences, so this would make sense... Would you happen to > know how I can actually

Re: Connecting to SQL database

2007-12-20 Thread bill ramsay
On Fri, 14 Dec 2007 23:35:00 -0300, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: >En Fri, 14 Dec 2007 23:24:24 -0300, Unknown <[EMAIL PROTECTED]> >escribió: > >> I have successfully connected to SQL2000 and MSDEE databases in the >> past, however I have to move to SQL2005 and SQLEXPRESS datab

Re: Regex Matching on Readline()

2007-12-20 Thread John Machin
On Dec 21, 7:21 am, jwwest <[EMAIL PROTECTED]> wrote: > On Dec 20, 2:13 pm, John Machin <[EMAIL PROTECTED]> wrote: > > > > > On Dec 21, 6:50 am, jwwest <[EMAIL PROTECTED]> wrote: > > > > Anyone have any trouble pattern matching on lines returned by > > > readline? Here's an example: > > > > string

Re: readlines() reading incorrect number of lines?

2007-12-20 Thread Wojciech Gryc
Hi, Python 2.5, on Windows XP. Actually, I think you may be right about \x1a -- there's a few lines that definitely have some strange character sequences, so this would make sense... Would you happen to know how I can actually fix this (e.g. replace the character)? Since Python doesn't see the res

Using ctypes with lib not found via ldconfig

2007-12-20 Thread Cylops
I'd like to use ctypes for my Linux app, but the libraries i want to use it on aren't in a standard location, and can't be found via ldconfig. They aren't in any of the directories listed in /etc/ld.so.conf, and they won't be. Our IT dept. controls this, and won't make them normally accessible for

Re: readlines() reading incorrect number of lines?

2007-12-20 Thread John Machin
On Dec 21, 6:48 am, Wojciech Gryc <[EMAIL PROTECTED]> wrote: > Hi, > > I'm currently using Python to deal with a fairly large text file (800 > MB), which I know has about 85,000 lines of text. I can confirm this > because (1) I built the file myself, and (2) running a basic Java > program to count

Re: xml-filter with XMLFilterBase() and XMLGenerator() shuffles attributes

2007-12-20 Thread infidel
> def startElement(self, name, attrs): > self.__downstream.startElement(name, attrs) > return > I want prevent it from shuffling attributes, i.e. preserve original > file's attribute order. Is there any ContentHandler.features* > responsible for that? I sus

Re: Regex Matching on Readline()

2007-12-20 Thread jwwest
On Dec 20, 2:13 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Dec 21, 6:50 am, jwwest <[EMAIL PROTECTED]> wrote: > > > > > Anyone have any trouble pattern matching on lines returned by > > readline? Here's an example: > > > string = "Accounting - General" > > pat = ".+\s-" > > > Should match on "

Re: Regex Matching on Readline()

2007-12-20 Thread John Machin
On Dec 21, 6:50 am, jwwest <[EMAIL PROTECTED]> wrote: > Anyone have any trouble pattern matching on lines returned by > readline? Here's an example: > > string = "Accounting - General" > pat = ".+\s-" > > Should match on "Accounting -". However, if I read that string in from > a file it will not ma

Re: Passing by reference

2007-12-20 Thread John Machin
On Dec 21, 5:57 am, [EMAIL PROTECTED] wrote: > Is the following correct? > > x = "some string" > > x is a reference to "some string" > > foo(x) > > Reference is passed to function. > > In foo: > x += " change" > > Strings are immutable, so x in foo() now points to a different string > than x ou

Re: Passing by reference

2007-12-20 Thread Ben Finney
[EMAIL PROTECTED] writes: > Is the following correct? > > [lots of references to "references"] All good so far. > x[0] += " other" > > Another string is created, the first element of x is modified to point > to the new string and back outside foo(), x[0] will point to the new > string. Change

Regex Matching on Readline()

2007-12-20 Thread jwwest
Anyone have any trouble pattern matching on lines returned by readline? Here's an example: string = "Accounting - General" pat = ".+\s-" Should match on "Accounting -". However, if I read that string in from a file it will not match. In fact, I can't get anything to match except ".*". I'm almost

readlines() reading incorrect number of lines?

2007-12-20 Thread Wojciech Gryc
Hi, I'm currently using Python to deal with a fairly large text file (800 MB), which I know has about 85,000 lines of text. I can confirm this because (1) I built the file myself, and (2) running a basic Java program to count lines yields a number in that range. However, when I use Python's vario

Re: Hexadecimal list conversion

2007-12-20 Thread John Machin
On Dec 21, 2:51 am, Peter Otten <[EMAIL PROTECTED]> wrote: > Mark T wrote: > > "Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message > >> If you got that from a file, I bet you read it using the wrong > >> encoding. Try opening the file using codecs.open("filename", "rb", > >> encoding="utf-16-b

Re: Python; jump to a concrete line

2007-12-20 Thread Rob Wolfe
Horacius ReX <[EMAIL PROTECTED]> writes: > Hi, sorry but after looking for information, I still did not get how, > when reading a text file in python, can one jump to a concrete line > and then read the different data (separated by spaces). In each line > there is different number of columns so so

Accessing Visuall C++ DLL with Python

2007-12-20 Thread Murray, John
I recently obtained USB device. Other users of the device apparently use C or C++ to access it. I am more comfortable with Python and have used it for other USB devices on a Windows system. I'm more of a hacker than a programmer especially when it comes to Windows. The manufacturor supplies xxx.h,

Re: Ping Implementation in Python

2007-12-20 Thread Roger Miller
On Dec 20, 5:41 am, Mrown <[EMAIL PROTECTED]> wrote: > Hi, > I was wondering if there was a ping implementation written in > Python. http://www.gnist.org/~lars/code/ping/ping.html -- http://mail.python.org/mailman/listinfo/python-list

Re: How to make this Python code print blocks of text?

2007-12-20 Thread Chris
On Dec 20, 9:00 pm, chriswilliams <[EMAIL PROTECTED]> wrote: > This code prints output in rows like this: > ** > ** > ** > How to make print in blocks like this? > * * ** > * * ** > * * * > > start= int (raw_input("StartTable?")) > upperlimit= int (ra

Re: Python; jump to a concrete line

2007-12-20 Thread Chris
On Dec 20, 8:13 pm, "Russell Blau" <[EMAIL PROTECTED]> wrote: > "Horacius ReX" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > Hi, sorry but after looking for information, I still did not get how, > > when reading a text file in python, can one jump to a concrete line > > and

How to make this Python code print blocks of text?

2007-12-20 Thread chriswilliams
This code prints output in rows like this: ** ** ** How to make print in blocks like this? * * ** * * ** * * * start= int (raw_input("StartTable?")) upperlimit= int (raw_input ("FinalTable?")) cycle= start while cycle <= upperlimit: ...table= c

Passing by reference

2007-12-20 Thread MartinRinehart
Is the following correct? x = "some string" x is a reference to "some string" foo(x) Reference is passed to function. In foo: x += " change" Strings are immutable, so x in foo() now points to a different string than x outside foo(). Right? Back outside foo. x = ["some string"] x is a r

Re: pydoc - how to generate documentation for an entire package?

2007-12-20 Thread Florian Diesch
kirillrd <[EMAIL PROTECTED]> wrote: > On Nov 20, 4:28 pm, Jens <[EMAIL PROTECTED]> wrote: >> On 20 Nov., 08:19, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> >> > On Mon, 19 Nov 2007 10:50:28 -0800, Jens wrote: >> > > Generating documentation form code is a nice thing, but this pydoc.py >

Re: Problem untaring python2.5

2007-12-20 Thread Florian Diesch
abhishek <[EMAIL PROTECTED]> wrote: > Hi everyone , i am not able to untar python 2.5 source code using " > tar -xvzf " . Is it a problem with my system settings or python 2.5 > itself. > > When i tried to do it it resulted in following errors -- > > tar: Skipping to next header > Python-2.5/Mac/R

Re: Python; jump to a concrete line

2007-12-20 Thread Russell Blau
"Horacius ReX" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, sorry but after looking for information, I still did not get how, > when reading a text file in python, can one jump to a concrete line > and then read the different data (separated by spaces). In each line > there is

xml-filter with XMLFilterBase() and XMLGenerator() shuffles attributes

2007-12-20 Thread Dmitry Teslenko
Hello! I've made a trivial xml filter to modify some attributes on-the-fly: ... from __future__ import with_statement import os import sys from xml import sax from xml.sax import saxutils class ReIdFilter(saxutils.XMLFilterBase): def __init__(self, upstream, downstream):

Re: 3D plotting with python 2.5 on win32

2007-12-20 Thread Peter Wang
On Dec 19, 8:15 am, anton <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to know if some of you knows a > - working > - actual > - out of the box (for me: binaries available) > Package/Lib to do 3D plotting out of the box. > There is MayaVi from enthon but you need to use their python (2.4.3)

Re: Python; jump to a concrete line

2007-12-20 Thread Chris
On Dec 20, 7:56 pm, Horacius ReX <[EMAIL PROTECTED]> wrote: > Hi, sorry but after looking for information, I still did not get how, > when reading a text file in python, can one jump to a concrete line > and then read the different data (separated by spaces). In each line > there is different numbe

Re: How to memoize/cache property access?

2007-12-20 Thread Michele Simionato
On Dec 20, 6:40 pm, thebjorn > I'm a bit ambivalent about the reset functionality. While it's a > wonderful demonstration of a staticmethod, the very few times I've > felt the need to "freshen-up" the object, I've always felt it was best > to create it again from scratch. Do you have many uses of i

Python; jump to a concrete line

2007-12-20 Thread Horacius ReX
Hi, sorry but after looking for information, I still did not get how, when reading a text file in python, can one jump to a concrete line and then read the different data (separated by spaces). In each line there is different number of columns so sometimes i get kind of "index out" error. Is there

Re: How to memoize/cache property access?

2007-12-20 Thread thebjorn
On Dec 20, 5:43 pm, Michele Simionato <[EMAIL PROTECTED]> wrote: > On Dec 20, 5:02 pm, thebjorn <[EMAIL PROTECTED]> > wrote: > > > I seem to be writing the following boilerplate/pattern quite > > frequently to avoid hitting the database until absolutely necessary ... > > I use the following module:

Amusement - rotational palindrome generator

2007-12-20 Thread Paul McGuire
Here is some semi-obfuscated Python, to generate rotational palindromes: from random import choice base = "sznuoxpqbdMWOINZXSH" rot = dict(zip(base,"szunoxdbqpWMOINZXSH")) for i in range(40): s1 = [choice(base) for j in range(choice((2,3,4)))] start = (1,2)[rot[s1[-1]]==s1[-1] and choice

Re: Is there *any* real documentation to PyWin32?

2007-12-20 Thread kyosohma
On Dec 20, 9:57 am, [EMAIL PROTECTED] wrote: > On Dec 20, 6:35 am, Benoit <[EMAIL PROTECTED]> wrote: > > > I understand that the Win32 has been said to be itself poorly > > documented, so perhaps that the documentation that comes with the > > modules is of similar quality is no coincidence. Maybe

Re: Ping Implementation in Python

2007-12-20 Thread Lorenzo Mainardi
Nel mezzo del cammin di nostra vita, mi ritrovai con Mrown che diceva: > Hi, > I was wondering if there was a ping implementation written in > Python. I'd rather using a Python module that implements ping in a > platform/OS-independent way than rely on the underlying OS, especially > as every O

Re: Ping Implementation in Python

2007-12-20 Thread Mrown
On Dec 20, 6:13 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On Dec 20, 2007 9:41 AM, Mrown <[EMAIL PROTECTED]> wrote: > > > Hi, > > I was wondering if there was a ping implementation written in > > Python. I'd rather using a Python module that implements ping in a > > platform/OS-independent

Re: How to memoize/cache property access?

2007-12-20 Thread Michele Simionato
On Dec 20, 5:02 pm, thebjorn <[EMAIL PROTECTED]> wrote: > I seem to be writing the following boilerplate/pattern quite > frequently to avoid hitting the database until absolutely necessary ... I use the following module: $ cat cache.py class cached(property): 'Convert a method into a cached a

Re: Is there a simple way to parse this string ?

2007-12-20 Thread George Sakkis
On Dec 19, 8:44 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > I think the last thread of this nature also cited a similar tool by > the effbot, which he describes > here:http://www.effbot.org/zone/simple-iterator-parser.htm. > This parser is about 10X faster than the equivalent pyparsing parser.

Re: How to memoize/cache property access?

2007-12-20 Thread Duncan Booth
thebjorn <[EMAIL PROTECTED]> wrote: > It would have been nice to be able to write > > class Foo(object): > @property > def expensive(self): > self.expensive = > return self.expensive > > but apparently I "can't set [that] attribute" :-( You can set and access it directl

Re: Where best to put local modules?

2007-12-20 Thread Zentrader
Wherever it is physically located, I would suggest linking the dir to / usr/lib/python/site-python (on a Linux system). AFAIK the sole purpose of this dir is for the type of thing you are describing. On my system it also gets copied when Python is updated. What permissions you give the dir is up

Re: 3D plotting with python 2.5 on win32

2007-12-20 Thread Jason
On Dec 20, 8:48 am, anton <[EMAIL PROTECTED]> wrote: > Hi Jason, > > I know ctypes, my problem is not PyOpenGL itself, > but during my tests with different python based 3D tools, > some of them depend on PyOpenGL and since PyOPenGL > is only available for python 2.4 the story ends here. > > So

Re: Ping Implementation in Python

2007-12-20 Thread Chris Mellon
On Dec 20, 2007 9:41 AM, Mrown <[EMAIL PROTECTED]> wrote: > Hi, > I was wondering if there was a ping implementation written in > Python. I'd rather using a Python module that implements ping in a > platform/OS-independent way than rely on the underlying OS, especially > as every OS has a differ

Re: Where best to put local modules?

2007-12-20 Thread tinnews
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] a écrit : > > Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > >> [EMAIL PROTECTED] a écrit : > >>> I'm just beginning to create some python modules for my own use and > >>> I'm wondering where to put them. Initially I have put the

How to memoize/cache property access?

2007-12-20 Thread thebjorn
I seem to be writing the following boilerplate/pattern quite frequently to avoid hitting the database until absolutely necessary, and to only do it at most once: class Foo(object): @property def expensive(self): if not hasattr(self, '_expensiv'): self._expensive =

Re: where is uno?

2007-12-20 Thread Zentrader
It's installed by default with Python 2.5 on Ubuntu. Actually it is a link to /usr/share/pycentral/python-uno/site-packages/uno.py so first do a search for uno.py. If not found post back. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there *any* real documentation to PyWin32?

2007-12-20 Thread rurpy
On Dec 20, 6:35 am, Benoit <[EMAIL PROTECTED]> wrote: > I understand that the Win32 has been said to be itself poorly > documented, so perhaps that the documentation that comes with the > modules is of similar quality is no coincidence. Maybe I'm still too > young in my programming to grasp the go

Re: where is uno?

2007-12-20 Thread Carsten Haese
On Thu, 2007-12-20 at 07:44 -0800, johnf wrote: > I'm using SUSE 10.3 have installed OpenOffice Python interface from the > distro DVD. But still I need help because I can't "import uno". And > that's because it's not in my site-packages. > > I read about how to use it and have reviewed code t

Re: How to generate pdf file from an html page??

2007-12-20 Thread Grant Edwards
On 2007-12-20, MonkeeSage <[EMAIL PROTECTED]> wrote: > This looks a little better for me ... | a2ps -B --borders=0 -- > columns=1 -f 10.0 | ... Right. I forgot that I've adjusted my a2ps defaults to using a single column and a readable font size instead of the standard 2-up tiny-font mode. -- G

Re: Hexadecimal list conversion

2007-12-20 Thread Peter Otten
Mark T wrote: > "Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message >> If you got that from a file, I bet you read it using the wrong >> encoding. Try opening the file using codecs.open("filename", "rb", >> encoding="utf-16-be") instead of plain open. > There is an odd number of bytes in

  1   2   >