Re: How to protect Python source from modification

2005-09-12 Thread Bryan Olson
Steve M wrote: [...] > 1. Based on your description, don't trust the client. Therefore, > "security", whatever that amounts to, basically has to happen on the > server. That's the right answer. Trying to enforce security within your software running the client machine does not work. Forget the

Re: How to protect Python source from modification

2005-09-12 Thread Robert Kern
Frank Millman wrote: > Steven D'Aprano wrote: > >>On Mon, 12 Sep 2005 08:33:10 -0700, Frank Millman wrote: >> >>>My problem is that, if someone has access to the network and to a >>>Python interpreter, they can get hold of a copy of my program and use >>>it to knock up their own client program tha

Re: Premature wakeup of time.sleep()

2005-09-12 Thread Nick Craig-Wood
Erich Schreiber <[EMAIL PROTECTED]> wrote: > In the Python Library Reference the explanation of the time.sleep() > function reads amongst others: > > > The actual suspension time may be less than that requested because > > any caught signal will terminate the sleep() following execution > > of

Re: How to protect Python source from modification

2005-09-12 Thread Frank Millman
Steven D'Aprano wrote: > On Mon, 12 Sep 2005 08:33:10 -0700, Frank Millman wrote: > > > My problem is that, if someone has access to the network and to a > > Python interpreter, they can get hold of a copy of my program and use > > it to knock up their own client program that makes a connection to

Re: Simplifying imports?

2005-09-12 Thread Terry Hancock
On Monday 12 September 2005 10:09 pm, [EMAIL PROTECTED] wrote: > I like to keep my classes each in a separate file with the same name of > the class. The problem with that is that I end up with multiple imports > in the beginning of each file, like this: > > from foo.Bar import Bar > from foo.Blah

Re: Simplifying imports?

2005-09-12 Thread Neal Norwitz
[EMAIL PROTECTED] wrote: > I like to keep my classes each in a separate file with the same name of > the class. The problem with that is that I end up with multiple imports > in the beginning of each file, like this: > > from foo.Bar import Bar > from foo.Blah import Blah > from foo.Zzz import Zzz

PyGTK or wXPython?

2005-09-12 Thread Rod W
I'm just starting out on Python but my primary goal is to provide applications with some user interface (GUI). Can someone point me to a good comparison of whether I should use wxPython (with wxGlade I assume) or PyGTK (with Glade I assume)? I'd prefer open source (not necessarily GPL though) t

Re: py2app without a mac?

2005-09-12 Thread Robert Kern
Gregory Piñero wrote: > Hey guys, > > I want to make my python program be installable on a mac, however I have > no access to a mac myself. Is there any way I can still use py2app to > create the app? I don't think it's possible out-of-box. You would have to have the Python.framework unpacked o

py2app without a mac?

2005-09-12 Thread Gregory Piñero
Hey guys, I want to make my python program be installable on a mac, however I have no access to a mac myself.  Is there any way I can still use py2app to create the app?  Otherwise what other options do I have?  (google turned up nothing for me) I don't want to require the users to have python in

Re: make sure entire string was parsed

2005-09-12 Thread Paul McGuire
Steve - Wow, this is a pretty dense pyparsing program. You are really pushing the envelope in your use of ParseResults, dicts, etc., but pretty much everything seems to be working. I still don't know the BNF you are working from, but here are some other "shots in the dark": 1. I'm surprised fun

Re: Detailed traceback

2005-09-12 Thread Aldo Cortesi
Thus spake Echo ([EMAIL PROTECTED]): > I have been working on handling unhanded exceptions and making a > detailed print out of the traceback after the exception. I found that > traceback.extract_tb worked nice and was quite simple. > > During my searching around I found out that it might be poss

Simplifying imports?

2005-09-12 Thread chapolim-colorado
I like to keep my classes each in a separate file with the same name of the class. The problem with that is that I end up with multiple imports in the beginning of each file, like this: from foo.Bar import Bar from foo.Blah import Blah from foo.Zzz import Zzz What I'd like to do would be to repla

Re: Unfortunate newbie questions!

2005-09-12 Thread aleaxit
Alessandro Bottoni wrote: ... > > - In college, I came to admire the Schaum's Outline book > >approach--again heavy on problems and solutions! What's > >the closest Python equivalent? > > Maybe this: > > Python Cookbook > Alex Martelli, David Ascher > O'Reilly I'd rather s

Re: which is more 'pythonic' / 'better' ?

2005-09-12 Thread Terry Reedy
"Will McGugan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > You may be right. I always use plural nouns for collections. ditto > To me 'line' would suggest there was just one of them, > so I assumed it was string. I did too. for line in file('skljflask.txt',r): # or similar i

Re: How to upgrade to 2.4.1 on Mac OS X tiger

2005-09-12 Thread Robert Kern
Mike Meyer wrote: > Robert Kern <[EMAIL PROTECTED]> writes: > >>>Come to think of it, what's installed by Apple may count as a >>>different distribution as well. It certainly includes more than just >>>the official distribution. >> >>It's also old and probably won't be the same version in 10.5. If

plwm and python-xlib on OS X

2005-09-12 Thread Mike Meyer
Has anyone had any luck getting plwm (the X window manager framework written in Python) working on OS X? How about python-xlib, which plwm depends on? Thanks, http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more informati

Re: How to upgrade to 2.4.1 on Mac OS X tiger

2005-09-12 Thread Mike Meyer
Robert Kern <[EMAIL PROTECTED]> writes: >> Come to think of it, what's installed by Apple may count as a >> different distribution as well. It certainly includes more than just >> the official distribution. > It's also old and probably won't be the same version in 10.5. If you > want any control ov

Re: packaging python for install.

2005-09-12 Thread J
Hi Miki Thx for you reply. I have tried the procedure but I am stuck with python setup.py py2exe --includes mymodule. I get the following error: "ImportError: No module named mymodule" I don't know what mymodule should contain. Basically I want all of python and numarray to be part of the distr

Re: Premature wakeup of time.sleep()

2005-09-12 Thread Peter Hansen
Steve Horsley wrote: > I think the sleep times are quantised to the granularity of the system > clock, shich varies from os to os. From memory, windows 95 has a 55mS > timer, NT is less (19mS?), Linux and solaris 1mS. All this is from For the record, the correct value for NT/XP family is about

Re: improvements for the logging package

2005-09-12 Thread Vinay Sajip
[EMAIL PROTECTED] wrote: > Since the logging package currently uses mixedCase it would appear it > shouldn't revert to lower_case. I'm thinking it should have probably used > lower_case from the start though. I see no real reason to have maintained > compatibility with log4j. Similarly, I think

Re: How to protect Python source from modification

2005-09-12 Thread Steven D'Aprano
On Mon, 12 Sep 2005 08:33:10 -0700, Frank Millman wrote: > My problem is that, if someone has access to the network and to a > Python interpreter, they can get hold of a copy of my program and use > it to knock up their own client program that makes a connection to the > database. They can then ex

Re: improvements for the logging package

2005-09-12 Thread Vinay Sajip
Trent Mick wrote: > Yah. It was added before Guido more clearly stated that he thought > modules should have a successful life outside the core before being > accepted in the stdlib. Perhaps so, but Guido was also quite keen to get PEP-282 implemented for inclusion in 2.3, and pronounced on the c

Re: How to protect Python source from modification

2005-09-12 Thread Philippe C. Martin
Hi, Why not just releasing the *.pyc ? Regards, Philippe Frank Millman wrote: > Hi all > > I am writing a multi-user accounting/business system. Data is stored in > a database (PostgreSQL on Linux, SQL Server on Windows). I have written > a Python program to run on the client, which uses w

Re: OCR librarys

2005-09-12 Thread Timothy Smith
Larry Bates wrote: >You need to specify a "platform" you will be running on. I've had >good experience with ExperVision's RTK toolkit on Windows. It is not >free, but it is very, very good. Sometimes software is actually >worth paying for ;-). > >Larry Bates > > >Timothy Smith wrote: > > >>i'

Re: How to protect Python source from modification

2005-09-12 Thread Steven D'Aprano
On Mon, 12 Sep 2005 06:34:45 -0700, Frank Millman wrote: > The client program contains all the authentication and business logic. > It has dawned on me that anyone can bypass this by modifying the > program. As it is written in Python, with source available, this would > be quite easy. My target m

Re: improvements for the logging package

2005-09-12 Thread Vinay Sajip
[EMAIL PROTECTED] wrote: > >> - It's a package, but contrary to any other package I've ever seen, > >> most of its functionality is implemented in __init__.py. > > Trent> I'm not defending the implementation, but does this cause any > Trent> particular problems? > > No, it just seems

Re: improvements for the logging package

2005-09-12 Thread Vinay Sajip
[EMAIL PROTECTED] wrote: > Perhaps so, but the logging module seems like such an unpythonic beast to > me. How about cleaning it up (*) before we add more to it? Stuff like > colorizing seems like it belongs in its own module (presuming a reasonably > general markup scheme can be agreed upon) so

Re: Python and SMB, again...

2005-09-12 Thread Atila Olah
Oops, I forgot to look at my old topic. Some of you mentioned CIFS. I was away from home for a while and now I'm on my job, again. Soth the Network Neighborhood thing isn't a problem. Now I know, that probably it would be better to use CIFS rather than a virtual filesystem. I just need to read thro

Re: Inconsistent reaction to extend

2005-09-12 Thread Bruno Desthuilliers
Jerzy Karczmarczuk a écrit : > Gurus, No guru answered, so you'll have to bear with me... > before I am tempted to signal this as a bug, perhaps > you might convince me that it should be so. If I type > > l=range(4) > l.extend([1,2]) > > l gives [0,1,2,3,1,2], what else... > > On the other h

Re: Premature wakeup of time.sleep()

2005-09-12 Thread Steve Horsley
Erich Schreiber wrote: > In the Python Library Reference the explanation of the time.sleep() > function reads amongst others: > > >>The actual suspension time may be less than that requested because >>any caught signal will terminate the sleep() following execution >>of that signal's catching r

Python and SMB, again...

2005-09-12 Thread Atila Olah
On 1997/06/05 Peter Henning wrote: >SMB, ldap, imap4rev1 > >Is there an SMB library? I want to be able to access SMB shares >from python, or publish shares onto a network neighbourhood from >a python server. If anyone has implemented SMB in python, could >you point me to the code? Otherwise, would

Re: How to protect Python source from modification

2005-09-12 Thread Bruno Desthuilliers
Frank Millman a écrit : > bruno modulix wrote: > >>Frank Millman wrote: >> >>>Hi all >>> >>>I am writing a multi-user accounting/business system. Data is stored in >>>a database (PostgreSQL on Linux, SQL Server on Windows). I have written >>>a Python program to run on the client, which uses wxPyth

First release of Shed Skin, a Python-to-C++ compiler.

2005-09-12 Thread Mark Dufour
>I am reluctant to attempt an arduous installation on Windows, but if >Mr. Dufour or someone else could create a web site that would let you >paste in Python code and see a C++ translation, I think this would >expand the user base. Alternatively, a Windows executable would be >nice. The web site i

Detailed traceback

2005-09-12 Thread Echo
I have been working on handling unhanded exceptions and making a detailed print out of the traceback after the exception. I found that traceback.extract_tb worked nice and was quite simple. During my searching around I found out that it might be possible to get the variables and their respective v

Re: pretty windows installer for py scripts

2005-09-12 Thread Fredrik Lundh
Gregory Piñero wrote: > How do you do this with the disutils module? I'm looking > to make an installer that will install a python library. start here: http://docs.python.org/dist/dist.html if you need more help, grab some libraries from PyPI and look at their setup files. -- http:/

Re: pretty windows installer for py scripts

2005-09-12 Thread Gregory Piñero
How do you do this with the disutils module?  I'm looking to make an installer that will install a python library. Isn't that already available in the distutils module ?-- http://mail.python.org/mailman/listinfo/python-list-- Gregory PiñeroChief Innovation OfficerBlended Technologies( www.blendedte

Re: How to protect Python source from modification

2005-09-12 Thread Michael Ekstrand
On Sep 12, 2005, at 11:26 AM, Frank Millman wrote: > If I move all the authentication and business logic to a program which > runs on the server, it is up to the system administrator to ensure that > only authorised people have read/write/execute privileges on that > program. Clients will have no p

Re: First release of Shed Skin, a Python-to-C++ compiler.

2005-09-12 Thread beliavsky
A.B., Khalid wrote: > Mark Dufour wrote: > > After nine months of hard work, I am proud to introduce my baby to the > > world: an experimental Python-to-C++ compiler. > > Good work. > > I have good news and bad news. > > First the good news: ShedSkin (SS) more or less works on Windows. After > patc

Re: pretty windows installer for py scripts

2005-09-12 Thread Steve Christensen
On 2005-09-08, Adriaan Renting <[EMAIL PROTECTED]> wrote: > The elegant way to do installs on Windows would be by creating an MSI. > Microsoft provides (IIRC) a simple tool to create those (Orca), that's > free. Without the Installshield or Wise tools I think it would take > quite some effort thoug

Re: defining __repr__

2005-09-12 Thread Steve Holden
sven wrote: > hi list, > i'd like to define __repr__ in a class to return the standardrepr > a la "<__main__.A instance at 0x015B3DA0>" > plus additional information. > how would i have to do that? > how to get the standardrepr after i've defined __repr__? > > sven. > It's relatively easy for new

Re: Unfortunate newbie questions!

2005-09-12 Thread Alessandro Bottoni
> - What book or doc would you recommend for a thorough >thrashing of object oriented programming (from a Python >perspective) for someone who is weak in OO? In other >words, how can someone learn to think in an OO sense, >rather than the old linear code sense?

Re: Unfortunate newbie questions!

2005-09-12 Thread Colin J. Williams
CPIM Ronin wrote: > Hi Folks, > > I'm brand spanking new to Python, busy reading docs and going through > two of the ubiquitous O'Reilly books--"Learning Python" by Lutz/Ascher > and "Python Programming on Win32" by Hammond/Robinson. > > Still I have a just few newbie questions: > >-In

Re: Python Database Scripts

2005-09-12 Thread jegenye2001
Well, for a single connection object you could use several cursor objects and juggle with all of them in your program. This can come in handy if it's not about a simple script like I put in here. You can reuse the results from the cursors, etc. without issuing more, potentially resource-hungry,

Re: OCR librarys

2005-09-12 Thread Josef Meile
Hi Timothy, first at all, sorry if you receive this message twice, but I sent a message five hours ago and I don't see it on mail.python.org/python-list. Now at least the OP will receive it since I included it in a CC. This thread may give you an start: http://groups.google.ch/group/comp.lang.py

Re: wxPython MainLoop exception handling problem

2005-09-12 Thread Kreedz
Well, it worked :) Thanks a lot! - Kreedz -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Database Scripts

2005-09-12 Thread ncf
Hmm...sorry to go a little off topic here, but I, also, have been striving to learn Python/MySQL for a while using MySQL's official thing. Can you please explain to me why one must use a cursor and can't just do an execute on the connction? :confused about the subject: -- http://mail.python.org/m

Re: wxPython MainLoop exception handling problem

2005-09-12 Thread ncf
Errm, maybe you could use the sys.excepthook function to catch the error and then print the details yourself from the traceback object. import sys def _exceptionhook(type, value, traceback): ''' your code here ''' sys.excepthook = _exceptionhook ((untested)) -- http://mail.python.org/mailma

First release of Shed Skin, a Python-to-C++ compiler.

2005-09-12 Thread Mark Dufour
>In general it's considered quite pythonic to catch exceptions :-) >It's a particularly useful way of implementing duck typing for example. >I'm not sure if I've got *any* code that doesn't use exceptions >somewhere Hehe. Okay. It will probably always be the case that you have to lose some Pyt

Re: How to protect Python source from modification

2005-09-12 Thread Steve M
This is a heck of a can of worms. I've been thinking about these sorts of things for awhile now. I can't write out a broad, well-structured advice at the moment, but here are some things that come to mind. 1. Based on your description, don't trust the client. Therefore, "security", whatever that a

defining __repr__

2005-09-12 Thread sven
hi list, i'd like to define __repr__ in a class to return the standardrepr a la "<__main__.A instance at 0x015B3DA0>" plus additional information. how would i have to do that? how to get the standardrepr after i've defined __repr__? sven. -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating BibTex files with XdkBibTeX

2005-09-12 Thread Fernando Perez
Rob Cowie wrote: > I'm looking for a module that is able to create valid BibTex documents. > I'm currently using string substitution to create the content, but it > is not validated in any way. > > The only BibTex creation module available in Python (that I can find) > is XdkBibTeX > (http://arti

wxPython MainLoop exception handling problem

2005-09-12 Thread Kreedz
Hi, I'm making some intelligent logging module that redirects stdout and stderr of a wxPython GUI. I am logging the exceptions in a wx TreeCtrl. My problem is that when an exception is thrown, there are many calls to stderr that are made which gives this kind of result: Traceback (most recent cal

Unfortunate newbie questions!

2005-09-12 Thread CPIM Ronin
Hi Folks, I'm brand spanking new to Python, busy reading docs and going through two of the ubiquitous O'Reilly books--"Learning Python" by Lutz/Ascher and "Python Programming on Win32" by Hammond/Robinson. Still I have a just few newbie questions: -In the Windows Python version, how c

Re: Is it possible to detect if files on a drive were changed without scanning the drive?

2005-09-12 Thread Grant Edwards
On 2005-09-12, Oren Tirosh <[EMAIL PROTECTED]> wrote: > Whenever a file is modified the last modification time of the directory > containing it is also set. Nope. $ ls -ld --time-style=full-iso . drwxr-xr-x 2 grante grante 4096 2005-09-12 12:38:04.749815352 -0500 ./ $ touch asdf

Re: Is it possible to detect if files on a drive were changed without scanning the drive?

2005-09-12 Thread Oren Tirosh
> After connecting a drive to the system (via USB > or IDE) I would like to be able to see within seconds > if there were changes in the file system of that drive > since last check (250 GB drive with about four million > files on it). Whenever a file is modified the last modification time of the

Re: Grouping lists

2005-09-12 Thread Kay Schluehr
PyPK wrote: > If I have a list say > > lst = [1,1,1,1,3,5,1,1,1,1,7,7,7] > I want to group the list so that it returns groups such as > [(0,3),4,5,(6,9),(10,12)]. which defines the regions which are similar. > > Thanks, Hi, I got a solution without iterators and without comparing adjecent elemen

Re: OCR librarys

2005-09-12 Thread Larry Bates
You need to specify a "platform" you will be running on. I've had good experience with ExperVision's RTK toolkit on Windows. It is not free, but it is very, very good. Sometimes software is actually worth paying for ;-). Larry Bates Timothy Smith wrote: > i'm looking for ocr librarys with rea

Software bugs aren't inevitable

2005-09-12 Thread Paddy
A work colleague circulated this interesting article about reducing software bugs by orders of magnitude: http://www.spectrum.ieee.org/WEBONLY/publicfeature/sep05/0905ext.html Some methods they talk about include removing error prone and ambiguous expressions from their ADA based language Sparc

Re: fully-qualified namespaces?

2005-09-12 Thread Michael Hoffman
Lenny G. wrote: > It sounds like you are saying that there either isn't a way to make the > interpreter utilize this type of namespace difference, or that doing so > is so convoluted that it is certainly worse than just living with > Hippo.HippoCrypto. I can live with these facts (with a little b

ANN: Leo 4.3.2 beta 1

2005-09-12 Thread Edward K. Ream
Leo 4.3.2 beta 1 is now available at: http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106 To learn about Leo, see: http://webpages.charter.net/edreamleo/intro.html The highlights of 4.3.2: --- - Improved Leo's documentation: - A tutorial introduc

Re: How to handle very large MIME Messages with the email package?

2005-09-12 Thread Larry Bates
I have found that the SmtpWriter class "hides" all the complexity in creating emails like you want to send. It accepts a list of filenames that will be attachments to the email you generate. Check it out here: http://motion.sourceforge.net/related/send_jpg.py As an aside. Email was not really d

Re: fully-qualified namespaces?

2005-09-12 Thread Lenny G.
Thanks Michael. That's actually what I already have, e.g., Hippo/ __init__.py HippoCrypto.py Potamus.py Of course, this has the disadvantage of not really taking advantage of the Hippo namespace -- I might as well have: HippoCrypto.py Hippo/ __init__.py Potamus.py or even get rid of

Re: First release of Shed Skin, a Python-to-C++ compiler.

2005-09-12 Thread Mark Dufour
On 9/12/05, Brian Quinlan <[EMAIL PROTECTED]> wrote: > Mark Dufour wrote: > > The latter is certainly my goal. I just haven't looked into supporting > > exceptions yet, because I personally never use them. I feel they > > should only occur in very bad situations, or they become goto-like > > constr

Re: fully-qualified namespaces?

2005-09-12 Thread Michael Hoffman
Lenny G. wrote: > Hippo/ > __init__.py > Crypto.py > Potamus.py > > And inside Crypto.py, I need to access python-crypto's Crypto.Hash > package. Inside Potamus.py, I need to access Hippo.Crypto, e.g., > > Hippo/ > __init__.py > Crypto.py# wants to import python-crypto's Crypt

Re: How to protect Python source from modification

2005-09-12 Thread Bugs
As a side question Frank, how was your experiences using wxPython for your GUI? Any regrets choosing wxPyton over another toolkit? Was it very buggy? How was it to work with in general? Any other real-world wxPython feedback you have is appreciated. Frank Millman wrote: > I am writing a multi-use

Re: Is it possible to detect if files on a drive were changed without scanning the drive?

2005-09-12 Thread Claudio Grondi
"Alessandro Bottoni" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > Claudio Grondi wrote: > > After connecting a drive to the system (via USB > > or IDE) I would like to be able to see within seconds > > if there were changes in the file system of that drive > > since last che

Re: Ctypes Install in Linux

2005-09-12 Thread jegenye2001
Uh, I suppose you need a bit of reading up on Linux. ;) http://www.northernjourney.com/opensource/newbies/ http://www.linuxhelp.net/ etc. > How do I make myself a "root-user"? To become root, use the "su" command. Obviously you'll need the root password which you do know, don't you? >how do I a

Re: How to protect Python source from modification

2005-09-12 Thread Frank Millman
bruno modulix wrote: > Frank Millman wrote: > > Hi all > > > > I am writing a multi-user accounting/business system. Data is stored in > > a database (PostgreSQL on Linux, SQL Server on Windows). I have written > > a Python program to run on the client, which uses wxPython as a gui, > > and connec

Re: fully-qualified namespaces?

2005-09-12 Thread Lenny G.
Thanks George. But I have to apologize -- I think I used the wrong term in my question. Hippo is actually a package, not a module. So I have: Hippo/ __init__.py Crypto.py Potamus.py And inside Crypto.py, I need to access python-crypto's Crypto.Hash package. Inside Potamus.py, I need to

Re: Why do Pythoneers reinvent the wheel?

2005-09-12 Thread Claudio Grondi
Here some of my thougts on this subject: I think that this question adresses only a tiny aspect of a much more general problem the entire human race has in any area. Reinventing the wheel begins when the grandpa starts to teach his grandchild remembering well that he has done it already many times

Re: How to protect Python source from modification

2005-09-12 Thread bruno modulix
Frank Millman wrote: > Peter Hansen wrote: > >>Frank Millman wrote: >> (snip) >>>The only truly secure solution I can think of would involve a radical >>>reorganisation of my program >> >>Please define what "truly secure" means to you. >> > > > Fair question. I am not expecting 'truly' to mean 1

Re: Is it possible to detect if files on a drive were changed without scanning the drive?

2005-09-12 Thread Alessandro Bottoni
Claudio Grondi wrote: > After connecting a drive to the system (via USB > or IDE) I would like to be able to see within seconds > if there were changes in the file system of that drive > since last check (250 GB drive with about four million > files on it). > > How to accomplish this? (best if pro

Re: How to protect Python source from modification

2005-09-12 Thread Frank Millman
Peter Hansen wrote: > Frank Millman wrote: > > I am writing a multi-user accounting/business system. Data is stored in > > a database (PostgreSQL on Linux, SQL Server on Windows). I have written > > a Python program to run on the client, which uses wxPython as a gui, > > and connects to the databa

Re: Ctypes Install in Linux

2005-09-12 Thread Ernesto
Thanks for the help. I'm kind of new to Linux, but I am the only user of this machine (just installed Red Hat). How do I make myself a "root-user"? For the second method you mentioned, how do I add access the PYTHONPATH environment variable? Thanks again! -- http://mail.python.org/mailman/li

Re: Socket options

2005-09-12 Thread billiejoex
If you are intrested in speed my personal advice is to use UDP insted of TCP. The great majority of network games use it. Here's a simple UDP implementation: http://www.evolt.org/article/Socket_Programming_in_Python/17/60276/ > For an online game I'm developing I need some advice concerning > tc

Re: How to protect Python source from modification

2005-09-12 Thread bruno modulix
Frank Millman wrote: > Hi all > > I am writing a multi-user accounting/business system. Data is stored in > a database (PostgreSQL on Linux, SQL Server on Windows). I have written > a Python program to run on the client, which uses wxPython as a gui, > and connects to the database via TCP/IP. > >

Re: Ctypes Install in Linux

2005-09-12 Thread jegenye2001
Most likely you're trying to do this as a non-root user and /usr/local/lib/python2.4/site-packages must be writable only with root privileges. If you cannot go root on that machine then you could just install the package in some directory you can write to and add the directory name to your PYTHON

Re: ZPT and "incompatible version None" error :(

2005-09-12 Thread bruno modulix
Jaroslaw Zabiello wrote: > I got strange errors in Zope 2.7. 2.7.? > > METALError > macro 'context/base' has incompatible version None, at line 1, column 1 > (snip) > > When I try to open it, I get the error mentioned above. Any idea? > yes : try posting on a Zope/Plone related mailin

Ctypes Install in Linux

2005-09-12 Thread Ernesto
I'm trying to install ctypes for Python in Linux. Linux won't let me create /usr/local/lib/python2.4/site-packages/ctypes ... "Permission denied" ... Anyone know how I could get it to work? It's probably something I need to chmod or change permissions on... Thanks! -- http://mail.python.org/mai

Re: make sure entire string was parsed

2005-09-12 Thread Steven Bethard
Steven Bethard wrote: > Paul McGuire wrote: > I have to differentiate between: (NP -x-y) and: (NP-x -y) I'm doing this now using Combine. Does that seem right? >> >> >> If your word char set is just alphanums+"-", then this will work >> without doing anything unnatural

Re: Python Database Scripts

2005-09-12 Thread jegenye2001
import MySQLdb # Create a connection object and create a cursor conn = MySQLdb.Connect(host="localhost", port=3306, user="mysql", passwd="pwd123", db="mytest") c = conn.cursor() # execute some SQL c.execute("SELECT * FROM mystuff") # Fetch all results from the cursor into a sequence results = c

Re: Is it possible to detect if files on a drive were changed without scanning the drive?

2005-09-12 Thread Tom Anderson
On Mon, 12 Sep 2005, Claudio Grondi wrote: > It is maybe not a pure Python question, but I think it is the right > newsgroup to ask for help, anyway. You might try comp.arch.storage or comp.sys.ibm.pc.hardware.storage, or a newsgroup specific to the operating system you're working on. > After

Re: Python Database Scripts

2005-09-12 Thread Peter Decker
On 12 Sep 2005 08:28:39 -0700, Chuck > Can anyone provide any kind of python database (mysql) code or point me > to a link that has this? Just simple things as maybe using a driver, > opening up a db, an insert and select. Any help would be greatly > appreciated! It might be more than you're l

Re: which is more 'pythonic' / 'better' ?

2005-09-12 Thread Will McGugan
Steve Holden wrote: > I'd say it's much more likely that line is a list of lines, since it > seems improbable that absence of a character should cause a value of > "nothing" to be required. You may be right. I always use plural nouns for collections. To me 'line' would suggest there was just o

Re: fully-qualified namespaces?

2005-09-12 Thread George Sakkis
"Lenny G." <[EMAIL PROTECTED]> wrote: > Suppose I have a python module named Hippo. In the Hippo module is a > class named Crypto. The Crypto class wants to 'from Crypto.Hash import > SHA' which refers to the module/classes in python-crypto. Other > classes in the Hippo module want to 'import C

Re: Launching Python programs from Linux shell script

2005-09-12 Thread Steve Holden
Ernesto wrote: > Thanks! How do you add Python in Linux to the path? Similar to > setting environment variables in Windows. I want to be able to type > "python" when I'm in any directory to launch the interpreter. Thanks! > You will (or should) have a shell intialisation file variously called

Re: which is more 'pythonic' / 'better' ?

2005-09-12 Thread Michael Hoffman
Steven Bethard wrote: > Exceptions are for > "exceptional" conditions, that is, things that you expect to happen > infrequently[1]. So if I think the code is going to fail frequently, I > test the condition, but if I think it won't, I use exceptions. I think there exceptions (no pun intended)

Re: How to protect Python source from modification

2005-09-12 Thread Frank Millman
Gerhard Häring wrote: > Frank Millman wrote: > > Hi all > > > > I am writing a multi-user accounting/business system. Data is stored in > > a database (PostgreSQL on Linux, SQL Server on Windows). I have written > > a Python program to run on the client, which uses wxPython as a gui, > > and conne

Re: which is more 'pythonic' / 'better' ?

2005-09-12 Thread Steve Holden
Will McGugan wrote: > Pierre Barbier de Reuille wrote: > > >>>I would actualy use the following for this particular case.. >>> >>>text = line[n:n+1] or 'nothing' >> >> >>... and you would get either a list of one element or a string ... >>I think you wanted to write : >> >>text = (line[n:n+1] or

fully-qualified namespaces?

2005-09-12 Thread Lenny G.
Suppose I have a python module named Hippo. In the Hippo module is a class named Crypto. The Crypto class wants to 'from Crypto.Hash import SHA' which refers to the module/classes in python-crypto. Other classes in the Hippo module want to 'import Crypto' referring to Hippo.Crypto. How do I do

Python Database Scripts

2005-09-12 Thread Chuck
Hello, Can anyone provide any kind of python database (mysql) code or point me to a link that has this? Just simple things as maybe using a driver, opening up a db, an insert and select. Any help would be greatly appreciated! Thanks, --Chuck -- http://mail.python.org/mailman/listinfo/python-l

Re: ANNOUNCEMENT: The ring of the friendly serpent in business suite: Python, Zope, Plone

2005-09-12 Thread jegenye2001
Oops, "suit" indeed. Though it might be considered as a pun if you really want to. :-) Anyway, thanks, I will correct it. Cheers, Miklos -- http://mail.python.org/mailman/listinfo/python-list

Re: which is more 'pythonic' / 'better' ?

2005-09-12 Thread Steven Bethard
Steven D'Aprano wrote: > try...except... blocks are quick to set up, but slow to catch the > exception. If you expect that most of your attempts will succeed, then the > try block will usually be faster than testing the length of the list > each time. > > But if you expect that the attempts to wri

Re: Grouping lists

2005-09-12 Thread PyPK
hmm thanks for that..but kind of not sure how this groupby works.. also if I want to group elements with one value apart how would this change.Should this change in groupby part or in the loop? something like... lst = [1,1,2,1,3,5,1,1,1,1,2,7,7] returns (0,3),4,5,(6,10),(11,12) so its something lik

Socket options

2005-09-12 Thread Tor Erik Sønvisen
Hi For an online game I'm developing I need some advice concerning tcp-sockets, and especially which socket options to set and not. What I want is a connection where nothing is buffered (but are sent immediatly), and I also want to keep the connections persistent until explicitly closed. The se

Is it possible to detect if files on a drive were changed without scanning the drive?

2005-09-12 Thread Claudio Grondi
It is maybe not a pure Python question, but I think it is the right newsgroup to ask for help, anyway. After connecting a drive to the system (via USB or IDE) I would like to be able to see within seconds if there were changes in the file system of that drive since last check (250 GB drive with ab

Re: make sure entire string was parsed

2005-09-12 Thread Steven Bethard
Paul McGuire wrote: >>>I have to differentiate between: >>> (NP -x-y) >>>and: >>> (NP-x -y) >>>I'm doing this now using Combine. Does that seem right? > > If your word char set is just alphanums+"-", then this will work > without doing anything unnatural with leaveWhitespace: > > from pyparsin

Re: First release of Shed Skin, a Python-to-C++ compiler.

2005-09-12 Thread Brian Quinlan
Mark Dufour wrote: > The latter is certainly my goal. I just haven't looked into supporting > exceptions yet, because I personally never use them. I feel they > should only occur in very bad situations, or they become goto-like > constructs that intuitively feel very ugly. In the 5500 lines of the

pcapy listen on multiple devices

2005-09-12 Thread billiejoex
Hi all. I noticed that with the original pcap sniffing library it is possible to listen on multiple devices by using "select()" or "poll()" function. These function aren't present in pcapy module. Do you got any suggestion to avoid this problem? -- http://mail.python.org/mailman/listinfo/pyth

Re: ANNOUNCEMENT: The ring of the friendly serpent in business suite: Python, Zope, Plone

2005-09-12 Thread Richie Hindle
[Miklos] > The ring of the friendly serpent in business suite: Python, Zope, Plone > http://www.jegenye.com/ Did you mean "business suit"? -- Richie Hindle [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >