Problem using compileall

2009-02-02 Thread Stephen Hansen
I'm having a slight problem with pre-compiling some files for distribution that I'm not sure where to even look for. An excerpt from an output: C:\mother\Python24\core\application\sysconfig>python -m compileall . Listing . ... Compiling .\BulkListClass.py ... Sorry: TypeError: ('c

Extracting file from zip archive in Python 2.6.1

2009-02-02 Thread Brandon Taylor
Hello everyone, I'm having an issue specifying the path for extracting files from a .zip archive. In my method, I have: zip_file.extract(zip_name + '/' + thumbnail_image, thumbnail_path) What is happening is that the extract method is creating a folder with the name of 'zip_name' and extracting

MySQLdb and MySQL stored functions

2009-02-02 Thread kurt . forrester . fec
Hello All, I am running - Ubuntu 8.10 - Python 2.5.2 - MySQLdb (1, 2, 2, 'final', 0) - MySQL Server/Client 5.0.67 I am trying to write an authentication script for a python application that connects to a MySQL database. The database has a table named `user` which has the fields `id`, `alias` and

Re: is python Object oriented??

2009-02-02 Thread David Cournapeau
On Tue, Feb 3, 2009 at 2:37 PM, Russ P. wrote: > On Feb 2, 7:48 pm, "Rhodri James" wrote: >> On Tue, 03 Feb 2009 02:16:01 -, Russ P. wrote: >> > Here we go again. If you have access to the source code (as you nearly >> > always do with Python code), then "breaking the language-enforced data

Re: rfi : bestpractises for implementing secure policies in python

2009-02-02 Thread Stephen Hansen
> Wondering if it is at-all possible to implement "secure" (s.a. not viewable > / tunable / tweakable) "Policies" in python ? > Use-cases: > 1) License enforcement -- Same application, licensed at differential price > levels, based on various feature-sets. > 2) "Parental-Control" enforcement. Appli

Re: Varibles -- copies and references

2009-02-02 Thread Chris Rebert
On Mon, Feb 2, 2009 at 10:02 PM, Ferdinand Sousa wrote: > Hi > > Some weeks back I had been following the thread "Why can't assign to > function call". Today, I saw the "function scope" thread, and decided I > should ask about the behaviour below: >

Re: Reading text file with wierd file extension?

2009-02-02 Thread john
On Feb 2, 7:57 pm, Mike Driscoll wrote: > On Feb 2, 8:08 pm, Lionel wrote: > > > > > On Feb 2, 5:40 pm, "Rhodri James" wrote: > > > > [Quoting restored for reduced > > > > On Mon, 02 Feb 2009 22:33:50 -, Lionel wrote: > > > > On Feb 2, 2:01 pm, Mike Driscoll wrote: > > > >> On Feb 2, 3:43 

Re: Varibles -- copies and references

2009-02-02 Thread Stephen Hansen
> > Guess the simple types show the expected behaviour (even though they are > technically instances of existing classes). The user defined classes seem to > be references/shallow copies. I prefer to avoid the term "reference" when talking about Python semantics, because it tends to make a lot of

Re: global variable confusion

2009-02-02 Thread Chris Rebert
On Mon, Feb 2, 2009 at 10:25 PM, Robert D.M. Smith wrote: > I have a question on global variables and how to use them. I have 2 files; > a.py & b.py > > # a.py - > > myvar = { 'test' : '123' } > > # --- > # b.py - > > from a import myvar > > def test(): > a.myvar = { 'blah' : '45

global variable confusion

2009-02-02 Thread Robert D.M. Smith
I have a question on global variables and how to use them. I have 2 files; a.py & b.py # a.py - myvar = { 'test' : '123' } # --- # b.py - from a import myvar def test(): a.myvar = { 'blah' : '456' } # - If I *'import a*' & type *'a.myvar'* it prints 'test' & '123'. Now

rfi : bestpractises for implementing secure policies in python

2009-02-02 Thread Banibrata Dutta
Hi, Wondering if it is at-all possible to implement "secure" (s.a. not viewable / tunable / tweakable) "Policies" in python ? Use-cases: 1) License enforcement -- Same application, licensed at differential price levels, based on various feature-sets. 2) "Parental-Control" enforcement. Application u

Re: socket.unbind or socket.unlisten? - socket.error: (48, 'Address already in use')

2009-02-02 Thread Aahz
In article , Grant Edwards wrote: >On 2009-02-01, Steve Holden wrote: > >> I believe this is because Microsoft failed to understand the >> original meaning of ___, and persisted with >> this ghastly error in the name of backwards compatibility, >> justifying it by suggesting that

Re: what IDE is the best to write python?

2009-02-02 Thread Russ P.
On Feb 2, 9:09 pm, a...@pythoncraft.com (Aahz) wrote: > You favor bleeding eyes? If I am going to bleed anywhere, I'd actually prefer it be somewhere other than the eyes. Well, maybe not the gonads either. That's a tough call. In any case, I use xemacs, and I've always liked color highlighting. N

Varibles -- copies and references

2009-02-02 Thread Ferdinand Sousa
Hi Some weeks back I had been following the thread "Why can't assign to function call". Today, I saw the "function scope" thread, and decided I should ask about the behaviour below: >>> # Simple variables >>>p=55 >>> q=p >>> q

Re: what IDE is the best to write python?

2009-02-02 Thread Peter Anderson
I have a "thing" about editors; a good editor is my tool of trade! I have tried many editors over the years mainly in the MS Windows, Linux and IBM mainframe environments. After all this I really like EditPlus (and the a slightly lesser extent Textpad). What both have in common is their "Clip L

Re: is python Object oriented??

2009-02-02 Thread Russ P.
On Feb 2, 7:48 pm, "Rhodri James" wrote: > On Tue, 03 Feb 2009 02:16:01 -, Russ P. wrote: > > Here we go again. If you have access to the source code (as you nearly > > always do with Python code), then "breaking the language-enforced data > > hiding" is a trivial matter of deleting the word

Re: what IDE is the best to write python?

2009-02-02 Thread Aahz
In article <87y6woz659@benfinney.id.au>, Ben Finney wrote: >a...@pythoncraft.com (Aahz) writes: >> In article <874ozd3cr3@benfinney.id.au>, >> Ben Finney wrote: >>>a...@pythoncraft.com (Aahz) writes: Just to register a contrary opinion: I *hate* syntax highlighting >>> >>>On w

Re: Using lxml to screen scrap a site, problem with charset

2009-02-02 Thread Tim Arnold
"?? ???" wrote in message news:ciqh56-ses@archaeopteryx.softver.org.mk... > So, I'm using lxml to screen scrap a site that uses the cyrillic > alphabet (windows-1251 encoding). The sites HTML doesn't have the ..content-type.. charset=..> header, but does have a HTTP header that >

Re: is python Object oriented??

2009-02-02 Thread Luis Zarrabeitia
Quoting "Russ P." : > I know ... changing one word constitutes a "fork." Yeah, right. Yeah, right. > You can't be bothered to change one word, but the library developer should > be required to litter his code with leading underscores everywhere, No, instead they will have to litter his code wi

Re: function scope

2009-02-02 Thread Tim Roberts
Mike Kent wrote: > >On Feb 2, 6:40 pm, Baris Demir wrote: > >> def simpleCut(d=dict()): >>        temp=d >>        for i in temp.keys(): >>            if    (temp[i] == ...) : >>               temp[i]=new_value >> return temp > >You have been bitten by the shared default parameter noobie trap

Re: Source code for csv module

2009-02-02 Thread Tim Roberts
vsoler wrote: > >I'm still interested in learning python techniques. Are there any >other modules (standard or complementary) that I can use in my >education? Are you serious about this? Are you not aware that virtually ALL of the Python standard modules are written in Python, and are included i

Re: function scope

2009-02-02 Thread Steven D'Aprano
On Mon, 02 Feb 2009 16:37:07 -0800, Mike Kent wrote: > On Feb 2, 6:40 pm, Baris Demir wrote: > >> def simpleCut(d=dict()): >>        temp=d >>        for i in temp.keys(): >>            if    (temp[i] == ...) : >>               temp[i]=new_value >> return temp > > You have been bitten by th

Re: Reading text file with wierd file extension?

2009-02-02 Thread Mike Driscoll
On Feb 2, 8:08 pm, Lionel wrote: > On Feb 2, 5:40 pm, "Rhodri James" wrote: > > > > > [Quoting restored for reduced > > > On Mon, 02 Feb 2009 22:33:50 -, Lionel wrote: > > > On Feb 2, 2:01 pm, Mike Driscoll wrote: > > >> On Feb 2, 3:43 pm, Lionel wrote: > > >> > On Feb 2, 1:07 pm, "Diez B.

Re: is python Object oriented??

2009-02-02 Thread Rhodri James
On Tue, 03 Feb 2009 02:16:01 -, Russ P. wrote: Here we go again. If you have access to the source code (as you nearly always do with Python code), then "breaking the language-enforced data hiding" is a trivial matter of deleting the word "private" (or equivalent). If it's that trivial to

Re: Reading text file with wierd file extension?

2009-02-02 Thread Grant Edwards
On 2009-02-03, Rhodri James wrote: > [Quoting restored for reduced > > On Mon, 02 Feb 2009 22:33:50 -, Lionel wrote: > >> On Feb 2, 2:01 pm, Mike Driscoll wrote: >>> On Feb 2, 3:43 pm, Lionel wrote: >>> > On Feb 2, 1:07 pm, "Diez B. Roggisch" wrote: >>> >>> >> This is written very slowly,

Re: is python Object oriented??

2009-02-02 Thread Grant Edwards
On 2009-02-02, Russ P. wrote: > I am not sure why people keep "mentioning" that "Python is not > Java." As a slogan, it is rather misleading. Because other people keep insisting that it ought to be. > Python is not C++, Ada, or Scala either. All of those > languages have enforced access restric

Re: Import without executing module

2009-02-02 Thread Ray
Hi all, On Feb 3, 1:11 am, John Machin wrote: > On Feb 2, 11:51 pm, pyt...@bdurham.com wrote: > > > If the output is coming from a print command, couldn't the OP > > temporarily redirect STDIO to a file to prevent the output from being > > displayed? > > He could, but that'd be a kludge on top

Code critique xmlrpclib

2009-02-02 Thread flagg
This xmlrpc server is designed to parse dns zone files and then perform various actions on said files. \ It uses dnspython, and xmlrpclib I'd like to know what some of the more experienced python users think. Where I could improve code, make it more efficient, whatever. All suggestions are welcome

Re: is python Object oriented??

2009-02-02 Thread Russ P.
On Feb 2, 4:35 pm, "Rhodri James" wrote: > This really, really, *really* isn't a tangent. It's the heart of > the matter. You are advocating a change that doesn't fit with > Python's "consenting adults" approach to programming. It's trivial > to enforce hiding using static checking tools if yo

Re: is python Object oriented??

2009-02-02 Thread Mark Wooding
"Russ P." writes: > I am not sure why people keep "mentioning" that "Python is not Java." > As a slogan, it is rather misleading. Python is not C++, Ada, or Scala > either. All of those languages have enforced access restriction. Why > only mention Java? Because Java is a well-known member of a

Re: Reading text file with wierd file extension?

2009-02-02 Thread Lionel
On Feb 2, 5:40 pm, "Rhodri James" wrote: > [Quoting restored for reduced > > On Mon, 02 Feb 2009 22:33:50 -, Lionel wrote: > > On Feb 2, 2:01 pm, Mike Driscoll wrote: > >> On Feb 2, 3:43 pm, Lionel wrote: > >> > On Feb 2, 1:07 pm, "Diez B. Roggisch" wrote: > > >> >> This is written very sl

Re: Searching a file for multiple strings (PS)

2009-02-02 Thread gotbyrd
On Jan 31, 11:39 pm, Shawn Milochik wrote: > On Sat, Jan 31, 2009 at 3:00 PM, Tim Chase > > wrote: > >>> I'm fairly new with python and am trying to build a fairly simple > >>> search script.  Ultimately, I'm wanting to search a directory of files > >>> for multiple user inputted keywords.  I've

Re: Searching a file for multiple strings

2009-02-02 Thread gotbyrd
On Jan 31, 2:45 pm, Tim Chase wrote: > > I'm fairly new with python and am trying to build a fairly simple > > search script.  Ultimately, I'm wanting to search a directory of files > > for multiple user inputted keywords.  I've already written a script > > that can search for a single string thro

Re: key capture

2009-02-02 Thread Rhodri James
On Mon, 02 Feb 2009 10:45:21 -, Tino Wildenhain wrote: Hi, swamynathan wrote: hello, im making a virtual piano in python where on key stroke a wav is played from a location now to implement a fully functional piano i need to have multiple key stroke captures ie if 2 or 3 keys pressed th

Re: Reading text file with wierd file extension?

2009-02-02 Thread Rhodri James
[Quoting restored for reduced On Mon, 02 Feb 2009 22:33:50 -, Lionel wrote: On Feb 2, 2:01 pm, Mike Driscoll wrote: On Feb 2, 3:43 pm, Lionel wrote: > On Feb 2, 1:07 pm, "Diez B. Roggisch" wrote: >> This is written very slowly, so you can read it better: > Please post without sarcasm

Re: what IDE is the best to write python?

2009-02-02 Thread Jervis Whitley
On Mon, Feb 2, 2009 at 2:46 PM, Chris Jones wrote: > On Sun, Feb 01, 2009 at 07:26:24PM EST, Ben Finney wrote: >> a...@pythoncraft.com (Aahz) writes: >> >> > Just to register a contrary opinion: I *hate* syntax highlighting >> >> On what basis? > > Real men hate syntax highlighting. > -- > http://

Re: Number of bits/sizeof int

2009-02-02 Thread Mark Wooding
John Machin writes: > 3 can be represented in 2 bits and at the same time -3 can be > represented in 2 bits?? But 2 bits can support only 2 ** 2 == 4 > different possibilities, and -3 .. 3 is 7 different integers. Yeah, I made some arbitrary choices about what to do with non-positive inputs. If

Re: ElementTree and clone element toot

2009-02-02 Thread Gabriel Genellina
En Mon, 02 Feb 2009 14:21:29 -0200, m.banaouas escribió: My python version is 2.4.4 def SubElement(parent, tag, attrib={}, **extra): Can you tell me how does "parent" issue could be solved by SubElement ? Simply because you *have* to pass a parent to the function... I'm looking for how t

Re: what IDE is the best to write python?

2009-02-02 Thread Patrick Steiger
2009/2/2 Joe Riopel > I typically use vim/vi, because it's usually already installed on the > OS's I work with and vim for Windows works the same. Also, using the > same editor across these different OS's, I don't have to worry too > much soft/hard tabs. You shouldn't even think about hard tab

Re: Reading text file with wierd file extension?

2009-02-02 Thread Lionel
On Feb 2, 4:50 pm, Denis Kasak wrote: > On Mon, Feb 2, 2009 at 10:43 PM, Lionel wrote: > > > > > >>> ResourcefilePath > > 'C:\\C8Example1.slc.rsc' > > > > > C:\C8Example1.slc.src > > The extension you used in the interactive shell differs from the one > you used in the class code (i.e. "rsc" vs

Re: what IDE is the best to write python?

2009-02-02 Thread Ben Finney
a...@pythoncraft.com (Aahz) writes: > In article <874ozd3cr3@benfinney.id.au>, > Ben Finney wrote: > >a...@pythoncraft.com (Aahz) writes: > >> > >> Just to register a contrary opinion: I *hate* syntax highlighting > > > >On what basis? > > It makes my eyes bleed Okay. I'll tick the “irrati

Re: Reading text file with wierd file extension?

2009-02-02 Thread Denis Kasak
On Mon, Feb 2, 2009 at 10:43 PM, Lionel wrote: > >>> ResourcefilePath > 'C:\\C8Example1.slc.rsc' > C:\C8Example1.slc.src The extension you used in the interactive shell differs from the one you used in the class code (i.e. "rsc" vs "src"). -- Denis Kasak -- http://mail.python.org/mailman/

Re: function scope

2009-02-02 Thread Mike Kent
On Feb 2, 6:40 pm, Baris Demir wrote: > def simpleCut(d=dict()): >        temp=d >        for i in temp.keys(): >            if    (temp[i] == ...) : >               temp[i]=new_value > return temp You have been bitten by the shared default parameter noobie trap: http://www.python.org/doc/fa

Re: is python Object oriented??

2009-02-02 Thread Rhodri James
On Mon, 02 Feb 2009 13:54:08 -, Hendrik van Rooyen wrote: wrote: PS: More accurately, Python _embodies_ a philosophy, and to advocate changes that go against that philosophy is to advocate changing Python into something that would no longer be Python. You can do that, but you aren't li

Re: is python Object oriented??

2009-02-02 Thread Tim Rowe
2009/2/2 Russ P. : > On Feb 2, 2:46 pm, Tim Rowe wrote: >> No, we're supposed to believe that the designers of C++, Java, Ada, >> and Scala are all designers of languages that are not Python. If all >> languages had the same philosophy what would be the point of different >> languages? Is it wort

Re: function scope

2009-02-02 Thread Stephen Hansen
> If you want a copy when you have > to do so explicitly with "temp=d.copy()". Or that! I forgot about that method. :) Curiously, in 160k lines of code, I haven't explicitly copied a dictionary once. I find that odd. --S -- http://mail.python.org/mailman/listinfo/python-list

Re: function scope

2009-02-02 Thread Stephen Hansen
On Mon, Feb 2, 2009 at 3:40 PM, Baris Demir wrote: > Hi everybody, > > I am quite new to python and using it for my thesis. Luckily I found out > some kind of behavior surprising to me and so unwanted in my code. I could > not find any explanation, so solution for the code. > It is simply like t

Re: function scope

2009-02-02 Thread MRAB
Baris Demir wrote: > Hi everybody, > > I am quite new to python and using it for my thesis. Luckily I found > out some kind of behavior surprising to me and so unwanted in my code. I > could not find any explanation, so solution for the code. > It is simply like this: > > /*li = another_module.gl

Re: Question about wx folder browser widget

2009-02-02 Thread Rhodri James
On Mon, 02 Feb 2009 02:58:07 -, Steve Holden wrote: Sam Price wrote: Is there any good wx widgets that provide the same feel as folder/file browser. I want to be notified when a user tries to drag and drop a file/folder on the widget, and then copy that file/folder to a new folder an do

Re: is python Object oriented??

2009-02-02 Thread Benjamin Kaplan
On Mon, Feb 2, 2009 at 4:51 PM, Russ P. wrote: > On Feb 2, 9:02 am, thmpsn@gmail.com wrote: > > On Feb 2, 2:55 am, Stephen Hansen wrote: > > > > > > This is proven > > > > by your statement above, whereby you are driving a user away, > > > > simply because the language, in one small aspect,

function scope

2009-02-02 Thread Baris Demir
Hi everybody, I am quite new to python and using it for my thesis. Luckily I found out some kind of behavior surprising to me and so unwanted in my code. I could not find any explanation, so solution for the code. It is simply like this: /*li = another_module.global_variable f=simpleCut(li)

handy way to spot-profile a python program (watch+pstat+tac)

2009-02-02 Thread Mike
Someone (forget who) mentioned recently that you could get some "poor man's" profiling info by attaching to a running python with gdb, and periodically grabbing a stack trace. I figured out that there's a handy way to do this with this command: watch -n 1 'pstack 30154 | tac' which will show

Re: Reading text file with wierd file extension?

2009-02-02 Thread MRAB
Lionel wrote: On Feb 2, 1:07 pm, "Diez B. Roggisch" wrote: This is written very slowly, so you can read it better: Please post without sarcasm. This is the output from my Python shell: DatafilePath = "C:\\C8Example1.slc" ResourcefilePath = DatafilePath + ".rsc" DatafileFH = open(DatafilePa

Re: is python Object oriented??

2009-02-02 Thread Russ P.
On Feb 2, 2:46 pm, Tim Rowe wrote: > 2009/2/2 Russ P. : > > > Are we supposed > > to believe that the designers of C++, Java, Ada, and Scala are all > > idiots? > > No, we're supposed to believe that the designers of C++, Java, Ada, > and Scala are all designers of languages that are not Python. I

Re: Python patch module

2009-02-02 Thread Robert Kern
On 2009-02-02 16:39, Minesh Patel wrote: Hi, I was wondering if there is any patch management module for Python. Basically I am looking to only apply a hunk from a patch if the file exists. Google's diff-match-patch library might be up your alley. http://code.google.com/p/google-diff-match-pat

Where & how to deallocate resources in Python C extension

2009-02-02 Thread fredbasset1000
Hi, I've written a C extension, see code below, to provide a Python interface to a hardware watchdog timer. As part of the initialization it makes some calls to mmap, I am wondering should I be making balanced calls to munmap in some kind of de-init function? Do Python extensions have d'tors? T

Re: Number of bits/sizeof int

2009-02-02 Thread casevh
On Jan 30, 11:03 pm, Jon Clements wrote: > Hi Group, > > This has a certain amount of irony (as this is what I'm pretty much > after):- > Fromhttp://docs.python.org/dev/3.0/whatsnew/3.1.html: > "The int() type gained a bit_length method that returns the number of > bits necessary to represent its

Re: is python Object oriented??

2009-02-02 Thread Luis Zarrabeitia
On Monday 02 February 2009 04:51:11 pm Russ P. wrote: > As I said before, as an aeronautical engineer I don't know if enforced > access restriction can be added to Python without compromising or > unduly complicating the language. Maybe it can't. If that's the case, > then people should make that a

Re: is python Object oriented??

2009-02-02 Thread Tim Rowe
2009/2/2 Russ P. : > Are we supposed > to believe that the designers of C++, Java, Ada, and Scala are all > idiots? No, we're supposed to believe that the designers of C++, Java, Ada, and Scala are all designers of languages that are not Python. If all languages had the same philosophy what would

Re: Membership of multiple items to a list

2009-02-02 Thread D'Arcy J.M. Cain
On Mon, 02 Feb 2009 17:34:51 -0500 Steve Holden wrote: > Or configure multiple personalities with the same email address but > different settings, so all you have to do is switch personalities > appropriately. They have pills for that now. -- D'Arcy J.M. Cain | Democracy is three wolv

Python patch module

2009-02-02 Thread Minesh Patel
Hi, I was wondering if there is any patch management module for Python. Basically I am looking to only apply a hunk from a patch if the file exists. -- Thanks, Minesh -- http://mail.python.org/mailman/listinfo/python-list

MySQLdb and MySQL stored functions

2009-02-02 Thread Kurt Forrester
Hello All, I am running - Ubuntu 8.10 - Python 2.5.2 - MySQLdb (1, 2, 2, 'final', 0) - MySQL Server/Client 5.0.67 I am trying to write an authentication script for a python application that connects to a MySQL database. The database has a table named `user` which has the fields `id`, `alias

Re: Reading text file with wierd file extension?

2009-02-02 Thread Lionel
On Feb 2, 2:01 pm, Mike Driscoll wrote: > On Feb 2, 3:43 pm, Lionel wrote: > > > > > > > On Feb 2, 1:07 pm, "Diez B. Roggisch" wrote: > > > This is written very slowly, so you can read it better: > > > Please post without sarcasm. > > > This is the output from my Python shell: > > > >>> Datafile

Re: Membership of multiple items to a list

2009-02-02 Thread Steve Holden
Stephen Hansen wrote: > On Sun, Feb 1, 2009 at 7:47 PM, Ben Finney > wrote: >> rdmur...@bitdance.com writes: >> >>> I don't even see Stephen Hansen's posts. My newsreader just shows >>> the header and says "[HTML part not displayed]". >> >> Likewise. > > Yeah, I know HTML is bad on newsgroups. I

Re: Import without executing module

2009-02-02 Thread Steve Holden
Taskinoor Hasan wrote: [...] > It make sense :-). So my reasoning..let A is imported in B, i.e. > name A is put in B's namespace. When we call something like A.a then the > interpreter first resolve A in B's namespace, then to get a, it need to > look up A's namespace. And there is no way to p

Re: Reading text file with wierd file extension?

2009-02-02 Thread Mike Driscoll
On Feb 2, 3:43 pm, Lionel wrote: > On Feb 2, 1:07 pm, "Diez B. Roggisch" wrote: > > This is written very slowly, so you can read it better: > > Please post without sarcasm. > > This is the output from my Python shell: > > >>> DatafilePath = "C:\\C8Example1.slc" > >>> ResourcefilePath = DatafilePa

Re: What is wrong in my list comprehension?

2009-02-02 Thread Peter Otten
Jason Scheirer wrote: > On Feb 1, 3:37 am, Peter Otten <__pete...@web.de> wrote: >> Hussein B wrote: >> > Hey, >> > I have a log file that doesn't contain the word "Haskell" at all, I'm >> > just trying to do a little performance comparison: >> > ++ >> > from datetime import time, time

Re: Where to put configuration/data files

2009-02-02 Thread Tim Chase
Is there a nice cross-platform way to figure out the Right (tm) place to store configuration files and other data? For what purpose? Global program config, user config, what? I've found three main categories of settings like Aahz describes (of which I've used all in a single application):

Re: is python Object oriented??

2009-02-02 Thread Russ P.
On Feb 2, 9:02 am, thmpsn@gmail.com wrote: > On Feb 2, 2:55 am, Stephen Hansen wrote: > > > > This is proven > > > by your statement above, whereby you are driving a user away, > > > simply because the language, in one small aspect, does not > > > give him what he wants, and the tenor of this

Re: the 'right way' to distribute and access data files in a packaged Python module

2009-02-02 Thread David Moss
> There is a zip-safe flag that you can specify that tells setuptools that > installing your egg only works if it is unarchived. However, there is also > the pkg_resources-package that allows you to access streams from within a > package, even if it is zipped. You should investigate these two opti

Re: Reading text file with wierd file extension?

2009-02-02 Thread Lionel
On Feb 2, 1:07 pm, "Diez B. Roggisch" wrote: This is written very slowly, so you can read it better: Please post without sarcasm. This is the output from my Python shell: >>> DatafilePath = "C:\\C8Example1.slc" >>> ResourcefilePath = DatafilePath + ".rsc" >>> DatafileFH = open(DatafilePath) >

Re: What is wrong in my list comprehension?

2009-02-02 Thread Jason Scheirer
On Feb 1, 3:37 am, Peter Otten <__pete...@web.de> wrote: > Hussein B wrote: > > Hey, > > I have a log file that doesn't contain the word "Haskell" at all, I'm > > just trying to do a little performance comparison: > > ++ > > from datetime import time, timedelta, datetime > > start = dat

Re: Number of bits/sizeof int

2009-02-02 Thread John Machin
On Feb 3, 6:50 am, Mark Wooding wrote: > Jon Clements writes: > > "The int() type gained a bit_length method that returns the number of > > bits necessary to represent its argument in binary:" > > > Any tips on how to get this in 2.5.2 as that's the production version > > I'm stuck with. > > def

Re: Reading text file with wierd file extension?

2009-02-02 Thread Stephen Hansen
> class MyUtilityClass: >def __init__(self, DataFilepath): >Resourcepath = DataFilepath + ".rsc" >DataFileH = open(DataFilepath) >ResourceFileH = open(Resourcepath) There's nothing wrong with this code. You have to look elsewhere in your program-- perhaps what cal

Re: Threading / Queue management

2009-02-02 Thread Steve Holden
Power Button wrote: > hi there, > > I wonder if anyone can help with the following. I have written a > script which polls a server and if it finds and pending orders, it > instantiates an new object (foo) - in a new thread and processes some > data. In the new object (foo), there are also some lon

Re: Reading text file with wierd file extension?

2009-02-02 Thread Diez B. Roggisch
Lionel schrieb: On Feb 2, 12:10 pm, Mike Driscoll wrote: On Feb 2, 1:20 pm, Lionel wrote: On Feb 2, 10:41 am, Mike Driscoll wrote: On Feb 2, 12:36 pm, Lionel wrote: Hi Folks, Python newbie here. I'm trying to open (for reading) a text file with the following filenaming convension: "M

Re: database wrapper ?

2009-02-02 Thread Martin
Hi, 2009/2/1 Stef Mientki : > Googling, I found SQLalchemy, > which looks quit good. sqlalchemy was always enough for my needs, I recently found elixir which is yet another wrapper around sqlalchemy. I haven't played too much with it but it seems there are a couple of nice things, that is elixir

Re: [2.5.1] Comparing dates?

2009-02-02 Thread Martin
Hi, 2009/2/2 Gilles Ganault : > Thanks guys. For those interested, here's how to perform the > conversion from DD/MM/ to -MM-DD: as suggested, the DBA should seriously think about defining the correct type of the column here, for intermediate use and getting stuff to work you could use a

Re: Python package Management GUI - New Project on Sourceforge

2009-02-02 Thread David Lyon
Hi Dave, > As of now, Enstaller 3.x is a command-line only tool but it does > provide a lot of benefits over standard setuptools -- uninstall, > update/upgrade command, found eggs aren't pre-pended to the full > sys.path but instead inserted before the containing directory, etc. Sounds extremely

Re: Source code for csv module

2009-02-02 Thread vsoler
On 2 feb, 21:51, Jon Clements wrote: > On 2 Feb, 20:46, vsoler wrote: > > > Hi you all, > > > I just discovered the csv module here in the comp.lang.python group. > > > I have found its manual, which is publicly available, but since I am > > still a newby, learning techniques, I was wondering if

Re: Number of bits/sizeof int

2009-02-02 Thread Mark Dickinson
On Jan 31, 7:03 am, Jon Clements wrote: > Any tips on how to get this in 2.5.2 as that's the production version > I'm stuck with. It's a bit cheeky, but: from decimal import _nbits as nbits should also work in 2.5.2 (but not in 2.5.1)! Mark -- http://mail.python.org/mailman/listinfo/python-l

Re: Source code for csv module

2009-02-02 Thread Tim Chase
I just discovered the csv module here in the comp.lang.python group. It certainly makes life easier. I have found its manual, which is publicly available, but since I am still a newby, learning techniques, I was wondering if the source code for this module is available. Is it possible to have

Re: Where to host a (Python) project?

2009-02-02 Thread andrew cooke
On Feb 1, 8:45 pm, a...@pythoncraft.com (Aahz) wrote: > [...] I for one won't participate in any list hosted on > Google because of the need for a Google login. hi, just fyi, i investigated this and you can join any publicly readable group by sending an email to the "-subscribe" address. you do

Re: Source code for csv module

2009-02-02 Thread Jon Clements
On 2 Feb, 20:46, vsoler wrote: > Hi you all, > > I just discovered the csv module here in the comp.lang.python group. > > I have found its manual, which is publicly available, but since I am > still a newby, learning techniques, I was wondering if the source code > for this module is available. >

Source code for csv module

2009-02-02 Thread vsoler
Hi you all, I just discovered the csv module here in the comp.lang.python group. I have found its manual, which is publicly available, but since I am still a newby, learning techniques, I was wondering if the source code for this module is available. Is it possible to have a look at it? Thanks

Re: Reading text file with wierd file extension?

2009-02-02 Thread Lionel
On Feb 2, 12:10 pm, Mike Driscoll wrote: > On Feb 2, 1:20 pm, Lionel wrote: > > > > > > > On Feb 2, 10:41 am, Mike Driscoll wrote: > > > > On Feb 2, 12:36 pm, Lionel wrote: > > > > > Hi Folks, Python newbie here. > > > > > I'm trying to open (for reading) a text file with the following > > > >

Re: Comparing dates?

2009-02-02 Thread Jervis Whitley
> Most > will have functions like str[pf]time that could be used to similar > effect. In mysql this is: str_to_date( '21/02/2008', '%d/%m/%Y') and oracle: to_date( '21/02/2008', 'dd-mm-') Cheers, -- http://mail.python.org/mailman/listinfo/python-list

Financial aid for PyCon 2009 is now available

2009-02-02 Thread Ted Pollari
I'm happy to announce that the Python Software Foundation has allocated some funds to help people attend PyCon 2009! If you would like to come to PyCon but can't afford it, the PSF may be able to help you pay for registration, lodging/hotel costs and transportation (flight etc.). Please see

Re: Does the Python community really follow the philospy of "Community Matters?"

2009-02-02 Thread Craig Allen
I think what you have found is a remarkable characteristic of this language. Somehow, perhaps something to do with guido or python itself, python has a very strong non-dogmatic streak. It's a relief really. If I were to pose a "is python or its community really xyz?" I would wonder about the "on

Combining several text files

2009-02-02 Thread rdmurray
Quoth Eric : > This is my first post, so please advise if I'm not using proper > etiquette. I've actually searched around a bit and while I think I can > do this, I can't think of a clean elegant way. I'm pretty new to > Python, but from what I've learned so far is that there is almost > always an

Re: Reading text file with wierd file extension?

2009-02-02 Thread Mike Driscoll
On Feb 2, 1:20 pm, Lionel wrote: > On Feb 2, 10:41 am, Mike Driscoll wrote: > > > > > On Feb 2, 12:36 pm, Lionel wrote: > > > > Hi Folks, Python newbie here. > > > > I'm trying to open (for reading) a text file with the following > > > filenaming convension: > > > > "MyTextFile.slc.rsc" > > > >

Re: Number of bits/sizeof int

2009-02-02 Thread Mark Wooding
Jon Clements writes: > "The int() type gained a bit_length method that returns the number of > bits necessary to represent its argument in binary:" > > Any tips on how to get this in 2.5.2 as that's the production version > I'm stuck with. def nbits(x): ## Special cases. if x == 0: return 0

Re: What is wrong in my list comprehension?

2009-02-02 Thread rdmurray
Quoth Stephen Hansen : > I just think at this point ".find" is just not the right method to use; > "substring" in "string" is the way to determine what he wants is all. > ".find" is useful for when you want the actual position, not when you just > want to determine if there's a match at all. The wa

Re: Combining several text files

2009-02-02 Thread Eric
On Feb 2, 12:17 pm, Chris Rebert wrote: > On Mon, Feb 2, 2009 at 9:48 AM, Eric wrote: > > This is my first post, so please advise if I'm not using proper > > etiquette. I've actually searched around a bit and while I think I can > > do this, I can't think of a clean elegant way. I'm pretty new to

Re: Where to put configuration/data files

2009-02-02 Thread Aahz
In article , Jay Bloodworth wrote: > >Is there a nice cross-platform way to figure out the Right (tm) place to >store configuration files and other data? For what purpose? Global program config, user config, what? -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/

Re: Reading text file with wierd file extension?

2009-02-02 Thread Diez B. Roggisch
Hi Mike, maybe it's not a "true" text file? Opening it in Microsoft Notepad gives an unformatted view of the file (text with no line wrapping, just the end-of-line square box character followed by more text, end- of-line character, etc). Wordpad opens it properly i.e. respects the end-of-line wra

Re: Python package Management GUI - New Project on Sourceforge

2009-02-02 Thread Dave Peterson
On Feb 1, 10:57 pm, David Lyon wrote: > > What's wrong with Enstaller from Enthought ? > > for a start > > onhttps://svn.enthought.com/enthought/wiki/Enstaller > > it claims to be depracated... Hello, Actually it was version 2.x and earlier that was deprecated and we just hadn't updated that

Re: Reading text file with wierd file extension?

2009-02-02 Thread Lionel
On Feb 2, 11:20 am, Lionel wrote: > On Feb 2, 10:41 am, Mike Driscoll wrote: > > > > > > > On Feb 2, 12:36 pm, Lionel wrote: > > > > Hi Folks, Python newbie here. > > > > I'm trying to open (for reading) a text file with the following > > > filenaming convension: > > > > "MyTextFile.slc.rsc" > >

Re: Reading text file with wierd file extension?

2009-02-02 Thread Lionel
On Feb 2, 10:41 am, Mike Driscoll wrote: > On Feb 2, 12:36 pm, Lionel wrote: > > > > > > > Hi Folks, Python newbie here. > > > I'm trying to open (for reading) a text file with the following > > filenaming convension: > > > "MyTextFile.slc.rsc" > > > My code is as follows: > > > Filepath = "C:\\M

Re: Python package Management GUI - New Project on Sourceforge

2009-02-02 Thread Scott David Daniels
Gabriel Rossetti wrote: ... Well, isn't tkinter being removed? (http://www.python.org/dev/peps/pep-3108/) To quote the referenced PEP: Rejected Ideas Modules that were originally suggested for removal ... * Tkinter o Would prevent IDLE from existing. o No GUI

  1   2   3   >