Re: Data Model:

2009-04-13 Thread Anthony
On Apr 12, 9:36 pm, Aaron Brady wrote: > On Apr 12, 10:33 pm, Anthony wrote: > > > > > On Apr 12, 8:10 pm, Aaron Brady wrote: > > > > On Apr 12, 9:14 pm, Anthony wrote: > > > > > I'm struggling on whether or not to implement GroupItem (below) with > > > > two separate models, or with one model

Re: ANN: PyGUI 2.0.1

2009-04-13 Thread roee shlomo
I can't run any of the tests on windows (pywin32-213, XP SP3, Python 2.6.1). 1. Had to change the first line in Applications.py to : > import win32con as wc, win32ui as ui, win32clipboard as wcb, win32api as > api Otherwise it gives me a DLL Import error. I have no idea why. 2. Import fails in C

how to fit a gamma distribution

2009-04-13 Thread ning luwen
hi, i need to fit a gamma distribution, is there any module can do the job? luwen -- http://mail.python.org/mailman/listinfo/python-list

Re: Data Model:

2009-04-13 Thread Aaron Brady
On Apr 13, 2:29 am, Anthony wrote: > On Apr 12, 9:36 pm, Aaron Brady wrote: > > > > > On Apr 12, 10:33 pm, Anthony wrote: > > > > On Apr 12, 8:10 pm, Aaron Brady wrote: > > > > > On Apr 12, 9:14 pm, Anthony wrote: > > > > > > I'm struggling on whether or not to implement GroupItem (below) with

Re: Data Model:

2009-04-13 Thread Peter Otten
Anthony wrote: > On Apr 12, 7:46 pm, Aaron Watters wrote: >> On Apr 12, 10:14 pm, Anthony wrote: >> >> >> >> > I'm struggling on whether or not to implement GroupItem (below) with >> > two separate models, or with one model that has a distinguishing key: >> >> > Given: >> > class ParentGroup: >>

Re: GUI Programming

2009-04-13 Thread Gabriel
Gabriel wrote: Hello, I'm python newbie and i need to write gui for my school work in python. I need to write it really quick, because i haven't much time .) So question is, which of gui toolkits should i pick and learn? I heard PyGTK and Glade are best for quick gui programming? Is it good for

Re: Definition of Pythonic?

2009-04-13 Thread Francesco Bochicchio
John Yeung ha scritto: On Apr 11, 10:08 am, Emmanuel Surleau wrote: Having written a few trivial scripts in Python, I'm curious as to how you would sum up the Pythonic philosophy of development. A couple of others have already mentioned the Zen of Python, available at the Python command promp

Using a decorator to *remove* parameters from a call

2009-04-13 Thread Michel Albert
A small foreword: This might look like a cherrypy-oriented post, and should therefore go to the cherrypy group, but if you read to the end, you'll see it's a more basic python problem, with cherrypy only as an example. ;) >From the decorator PEP (318) I get it that you can /add/ parameters to a ca

Re: [ANN] Falcon - powering innovation

2009-04-13 Thread Gerhard Häring
Kless wrote: > If anybody is interesed in new technologies, you'll love this new > language called Falcon [1], which has been open sourced ago little > time. > > Falcon is a scripting engine ready to empower mission-critical > multithreaded applications. "Mission-critical" and "empower" sound li

Re: video capture in Python ?

2009-04-13 Thread Stef Mientki
Tim Roberts wrote: Stef Mientki wrote: has anyone got video capturing (from a webcam) successful running in a wxPython application under winXP ? I got some links, but it seems quit complicated to get everything installed, and all the packages you need don't describe which versions of the

Re: Using a decorator to *remove* parameters from a call

2009-04-13 Thread Aaron Brady
On Apr 13, 5:11 am, Michel Albert wrote: > A small foreword: This might look like a cherrypy-oriented post, and > should therefore go to the cherrypy group, but if you read to the end, > you'll see it's a more basic python problem, with cherrypy only as an > example. ;) > > From the decorator PEP

Re: numpy permutations with replacement

2009-04-13 Thread Chris Rebert
On Mon, Apr 13, 2009 at 4:05 AM, skorpi...@gmail.com wrote: > I am trying to generate all possible permutations of length three from > elements of [0,1]. i.e in this scenario there are a total of 8 > distinct permutations: > > [0,0,0] > [0,0,1] > [0,1,0] >    . >    . >    . > [1,1,1] > > > Does n

Re: regex for multiple whitespace-only lines

2009-04-13 Thread MRAB
Phil Mayes wrote: I am trying to search for 1 or more empty or white-space-only lines. Empty lines work: >>> re.compile('(?m)(^$){1,2}') <_sre.SRE_Pattern object at 0x010F9218> One line with possible whitespace works: >>> re.compile('(?m)(^\s*$)') <_sre.SRE_Pattern object at 0x010F7860> Multi

Re: [ANN] Falcon - powering innovation

2009-04-13 Thread Tim Chase
Gerhard Häring wrote: Kless wrote: If anybody is interesed in new technologies, you'll love this new language called Falcon [1], which has been open sourced ago little time. Falcon is a scripting engine ready to empower mission-critical multithreaded applications. "Mission-critical" and "emp

Re: numpy permutations with replacement

2009-04-13 Thread skorpi...@gmail.com
On Apr 13, 7:13 am, Chris Rebert wrote: > On Mon, Apr 13, 2009 at 4:05 AM, skorpi...@gmail.com > > wrote: > > I am trying to generate all possible permutations of length three from > > elements of [0,1]. i.e in this scenario there are a total of 8 > > distinct permutations: > > > [0,0,0] > > [0,0

Re: Using a decorator to *remove* parameters from a call

2009-04-13 Thread Jon Clements
On 13 Apr, 11:11, Michel Albert wrote: > A small foreword: This might look like a cherrypy-oriented post, and > should therefore go to the cherrypy group, but if you read to the end, > you'll see it's a more basic python problem, with cherrypy only as an > example. ;) > > From the decorator PEP (3

numpy permutations with replacement

2009-04-13 Thread skorpi...@gmail.com
I am trying to generate all possible permutations of length three from elements of [0,1]. i.e in this scenario there are a total of 8 distinct permutations: [0,0,0] [0,0,1] [0,1,0] . . . [1,1,1] Does numpy define a function to achieve this ? Thanks in advance -- http://mail.python.o

Re: Generators/iterators, Pythonicity, and primes

2009-04-13 Thread Aaron Brady
On Apr 13, 1:39 am, Arnaud Delobelle wrote: > Duncan Booth writes: > > Duncan Booth wrote: > > >> John Posner wrote: > > >>> Do know what in the itertools implementation causes adding a 'if p <= > >>> sqrt(n)' clause to *decrease* performance, while adding a > >>> 'takewhile()' clause *increase

Re: [ANN] Falcon - powering innovation

2009-04-13 Thread Andrii V. Mishkovskyi
On Sat, Apr 11, 2009 at 4:11 PM, Kless wrote: [skipped buzzwords] > > > [1] http://www.falconpl.org/ > [2] > http://www.computerworld.com.au/article/298655/-z_programming_languages_falcon?fp=2&fpid= And this table should make you even more interested in Falcon (also called THE BEST PROGRAMMING L

Re: Using a decorator to *remove* parameters from a call

2009-04-13 Thread Michel Albert
On Apr 13, 12:52 pm, Jon Clements wrote: > On 13 Apr, 11:11, Michel Albert wrote: > > > > > A small foreword: This might look like a cherrypy-oriented post, and > > should therefore go to the cherrypy group, but if you read to the end, > > you'll see it's a more basic python problem, with cherryp

Re: Using a decorator to *remove* parameters from a call

2009-04-13 Thread Michel Albert
On Apr 13, 12:45 pm, Aaron Brady wrote: > On Apr 13, 5:11 am, Michel Albert wrote: > > > A small foreword: This might look like a cherrypy-oriented post, and > > should therefore go to the cherrypy group, but if you read to the end, > > you'll see it's a more basic python problem, with cherrypy o

Re: download robot

2009-04-13 Thread Kushal Kumaran
On Mon, Apr 13, 2009 at 11:13 AM, larryzhang wrote: > Hi, > Being a newbie for Python, I am trying to write a code that can act as > a downloading robot. > This might be useful: http://wwwsearch.sourceforge.net/mechanize/. I've only casually gone through the page, not actually used it. If you fe

Re: video capture in Python ?

2009-04-13 Thread Tino Wildenhain
Hi Stef, Stef Mientki wrote: ... videocapture webcamwatcher opencv libvidcap hdpvrassistent they didn't run at all or they crashed within 10 seconds :-( The most promissing looks videocapture, but that also crashes within 10 seconds. Video capture is not a trivial task. to be more exactly, I

Re: HTML Conversion in python

2009-04-13 Thread Aaron Watters
On Apr 13, 1:47 am, "venutaurus...@gmail.com" wrote: > Hello All, > Is there any library defined in Python which can convert a > given text file into a html page. Basically, I require functions for > creating tables or filling background colours for the html pages etc > instead of writ

Re: how to fit a gamma distribution

2009-04-13 Thread Kushal Kumaran
On Mon, Apr 13, 2009 at 1:40 PM, ning luwen wrote: > hi, >  i need to fit a gamma distribution, is there any module can do the job? > Did you try google? Searching for python curve fitting returns some promising results. -- kushal -- http://mail.python.org/mailman/listinfo/python-list

Re: Using a decorator to *remove* parameters from a call

2009-04-13 Thread azeem
On Apr 13, 3:45 pm, Aaron Brady wrote: > On Apr 13, 5:11 am, Michel Albert wrote: > > > A small foreword: This might look like a cherrypy-oriented post, and > > should therefore go to the cherrypy group, but if you read to the end, > > you'll see it's a more basic python problem, with cherrypy on

Python inside C++

2009-04-13 Thread AJ Mayorga
Hello all, I am looking for a way to statically compile pythonxx.dll into my C++ application, so that I can use It as an internal scripting language and either run the native python code or take an ELF from py2exe/pyinstaller and run that. The machines that will have my C++ app running on the

Re: Python inside C++

2009-04-13 Thread Kushal Kumaran
On Wed, Apr 15, 2009 at 8:56 AM, AJ Mayorga wrote: > Hello all, > > > > I am looking for a way  to statically compile pythonxx.dll into my C++ > application, so that I can use It as an internal scripting language and > either run the native python code or take an ELF from py2exe/pyinstaller and >

Re: ANN: PyGUI 2.0.1

2009-04-13 Thread user
Greg Ewing wrote: PyGUI 2.0.1 is available: http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ Fixes some problems in setup.py affecting installation on Linux and Windows. What is PyGUI? -- PyGUI is a cross-platform GUI toolkit designed to be lightweight and have a highly

Re: Using a decorator to *remove* parameters from a call

2009-04-13 Thread Aaron Brady
On Apr 13, 8:25 am, azeem wrote: > On Apr 13, 3:45 pm, Aaron Brady wrote: snip > > @take_ab > > def f( c= 42, d= 'some' ): > >     print( 'in f, c= %r, d= %r'% ( c, d ) ) > > > f( a= 'paramA', b= 'paramB', c= 'other number' ) > > > /Output: > > > aval 'paramA' and bval 'paramB' popped > > in f, c

Re: Python inside C++

2009-04-13 Thread Aaron Brady
On Apr 13, 8:41 am, Kushal Kumaran wrote: > On Wed, Apr 15, 2009 at 8:56 AM, AJ Mayorga wrote: > > Hello all, > > > I am looking for a way  to statically compile pythonxx.dll into my C++ > > application, so that I can use It as an internal scripting language and > > either run the native python c

Can I replace this for loop with a join?

2009-04-13 Thread WP
Hello, I have dictionary {1:"astring", 2:"anotherstring", etc} I now want to print: "Press 1 for astring" "Press 2 for anotherstring" etc I could do it like this: dict = {1:'astring', 2:'anotherstring'} for key in dict.keys(): print 'Press %i for %s' % (key, dict[key]) Press 1 for astring P

Re: sharing/swapping items between lists

2009-04-13 Thread Ross
On Apr 11, 1:10 pm, a...@pythoncraft.com (Aahz) wrote: > In article > <4fd78ac3-ba83-456b-b768-3a0043548...@f19g2000vbf.googlegroups.com>, > > Ross   wrote: > > >I'm trying to design an iterator that produces two lists. The first > >list will be a list of unique pairings and the second will be a l

Re: Can I replace this for loop with a join?

2009-04-13 Thread Kushal Kumaran
On Mon, Apr 13, 2009 at 8:33 PM, WP wrote: > Hello, I have dictionary {1:"astring", 2:"anotherstring", etc} > > I now want to print: > "Press 1 for astring" > "Press 2 for anotherstring" etc > > I could do it like this: > dict = {1:'astring', 2:'anotherstring'} > for key in dict.keys(): >    print

Re: Can I replace this for loop with a join?

2009-04-13 Thread Tim Chase
WP wrote: Hello, I have dictionary {1:"astring", 2:"anotherstring", etc} I now want to print: "Press 1 for astring" "Press 2 for anotherstring" etc I could do it like this: dict = {1:'astring', 2:'anotherstring'} for key in dict.keys(): print 'Press %i for %s' % (key, dict[key]) Press 1 f

Re: Can I replace this for loop with a join?

2009-04-13 Thread Nicolas Dandrimont
* WP [2009-04-13 17:03:17 +0200]: > Hello, I have dictionary {1:"astring", 2:"anotherstring", etc} > > I now want to print: > "Press 1 for astring" > "Press 2 for anotherstring" etc > > I could do it like this: > dict = {1:'astring', 2:'anotherstring'} > for key in dict.keys(): > print 'Press

wxpython question

2009-04-13 Thread isam uraiqat
hello fellow geeks i am trying to run the demo for wxpython, and once i click on it i get the sand clock coming up for a second and then that's it, it is not running no matter what i do. i tried it on another computer and im getting the same thing! it used to work earlier i dont know what happened

Imports in python are static, any solution?

2009-04-13 Thread Ravi
foo.py : i = 10 def fi(): global i i = 99 bar.py : import foo from foo import i print i, foo.i foo.fi() print i, foo.i This is problematic. Well I want i to change with foo.fi() . -- http://mail.python.org/mailman/listinfo/python-list

RE:wxpython question

2009-04-13 Thread isam uraiqat
I HATE VISTA!! it just needed to be installed on the site packages library, because it was installed by default on program files, hope this might help another poor vista user cheers -- http://mail.python.org/mailman/listinfo/python-list

Re: sharing/swapping items between lists

2009-04-13 Thread Aahz
In article , Ross wrote: > >I'm sorry...my example was probably a bad one. A better example of >output I would like would be something like [[1,2],[3,4],[5,6]] and >then for the leftovers list [7,8,9,10 etc]. What I'm trying to do is >produce some sort of round robin algorithm for tennis that is

Re: possible pairings in a set

2009-04-13 Thread Przemyslaw Kaminski
Ross wrote: > I'm new to python and I'm trying to come up with a function that takes > a given number of players in a game and returns all possible unique > pairings. Here's the code I've come up with so far, but I'm not > getting the output I'd like to: > > def all_pairings(players): > cleanlist

Re: Imports in python are static, any solution?

2009-04-13 Thread Luis Alberto Zarrabeitia Gomez
Quoting Ravi : > > This is problematic. Well I want i to change with foo.fi() . You can't. i and foo.i are _different_ variables that just happen to share the same value initially. What you are observing is no different than i = 10 j = i i = 99 print i # prints 99 print j # print 10 May I

Re: Imports in python are static, any solution?

2009-04-13 Thread David Stanek
On Mon, Apr 13, 2009 at 11:59 AM, Ravi wrote: > foo.py : > >    i = 10 > >   def fi(): >      global i >      i = 99 > > bar.py : > >    import foo >    from foo import i > >    print i, foo.i >    foo.fi() >    print i, foo.i > > This is problematic. Well I want i to change with foo.fi() . Why n

RE: Imports in python are static, any solution?

2009-04-13 Thread AJ Mayorga
For something like this I generally create a superclass to hold configuration variables that will change overtime, doing that will save you from insanity. Class configVar: #set initial values Def __init__(self): Self.A = 5 Self.B = 10

tkFileDialog -> ImportError: No module named shell

2009-04-13 Thread Alan G Isaac
Why do I get the ImportError below? What is the right way to do this? Thanks, Alan Isaac Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import Tkinter as tk >>> root=tk.Tk() >>> im

sending and receiving ipv6 multicasts

2009-04-13 Thread Kai Timmer
I am trying to send and receive packages via an ipv6 multicast. But I can't get it working. What I thought was, that on the listener site, I just need to bind my socket to the interfaces ipv6 local link address and on the sender site, to the multicast address (in my case ff02::). That doesn't work

Who is your daddy: Can I find what object instantiates another object?

2009-04-13 Thread hubritic
I want to build a parser object that handles two different log file formats. I have an object that handles Connection logs and an object for Filter logs. Each will instantiate a Parser object, passing in the path to individual log files. There are a number of ways I could figure out whether I am

Re: Who is your daddy: Can I find what object instantiates another object?

2009-04-13 Thread Jean-Paul Calderone
On Mon, 13 Apr 2009 09:53:04 -0700 (PDT), hubritic wrote: I want to build a parser object that handles two different log file formats. I have an object that handles Connection logs and an object for Filter logs. Each will instantiate a Parser object, passing in the path to individual log file

Re: Who is your daddy: Can I find what object instantiates another object?

2009-04-13 Thread Diez B. Roggisch
hubritic schrieb: I want to build a parser object that handles two different log file formats. I have an object that handles Connection logs and an object for Filter logs. Each will instantiate a Parser object, passing in the path to individual log files. There are a number of ways I could fig

Re: numpy permutations with replacement

2009-04-13 Thread Mensanator
On Apr 13, 6:36 am, "skorpi...@gmail.com" wrote: > On Apr 13, 7:13 am, Chris Rebert wrote: > > > > > > > On Mon, Apr 13, 2009 at 4:05 AM, skorpi...@gmail.com > > > wrote: > > > I am trying to generate all possible permutations of length three from > > > elements of [0,1]. i.e in this scenario th

Re: sending and receiving ipv6 multicasts

2009-04-13 Thread Martin v. Löwis
Kai Timmer wrote: > I am trying to send and receive packages via an ipv6 multicast. But I > can't get it working. What I thought was, that on the listener site, I > just need to bind my socket to the interfaces ipv6 local link address > and on the sender site, to the multicast address (in my case f

Re: Data Model:

2009-04-13 Thread Anthony
On Apr 13, 1:26 am, Peter Otten <__pete...@web.de> wrote: > Anthony wrote: > > On Apr 12, 7:46 pm, Aaron Watters wrote: > >> On Apr 12, 10:14 pm, Anthony wrote: > > >> > I'm struggling on whether or not to implement GroupItem (below) with > >> > two separate models, or with one model that has a d

Re: Who is your daddy: Can I find what object instantiates another object?

2009-04-13 Thread Aahz
In article <74ha3lf10bj9...@mid.uni-berlin.de>, Diez B. Roggisch wrote: >hubritic schrieb: >> >> Can the Parser object know who its Daddy is? > >Yes, by Daddy telling him so. That's how nature does it, and how you >should do it. Or do you think that because DNA-tests are available to us >we sho

cx_Oracle - DLL load failed

2009-04-13 Thread cwurld
Hi, I am having some trouble getting cx_Oracle to work. When I try to import cx_Oracle, I get the following error message: ImportError: DLL load failed: %1 is not a valid Win32 application. I am using Python 2.6 on WIndows. Oracle Client 10g. Any ideas? Thanks -- http://mail.python.org/mailman

Re: numpy permutations with replacement

2009-04-13 Thread skorpi...@gmail.com
On Apr 13, 1:17 pm, Mensanator wrote: > On Apr 13, 6:36 am, "skorpi...@gmail.com" wrote: > > > > > On Apr 13, 7:13 am, Chris Rebert wrote: > > > > On Mon, Apr 13, 2009 at 4:05 AM, skorpi...@gmail.com > > > > wrote: > > > > I am trying to generate all possible permutations of length three from >

Re: zProblem

2009-04-13 Thread norseman
Gabriel Genellina wrote: En Fri, 10 Apr 2009 21:14:01 -0300, norseman escribió: norseman wrote: Gabriel Genellina wrote: En Fri, 10 Apr 2009 14:50:57 -0300, norseman escribió: ...(snip) I didn't understand what your problem is actually. UUHHDid you read the pdf? Yes (and

Re: zProblem

2009-04-13 Thread norseman
Steven D'Aprano wrote: On Fri, 10 Apr 2009 10:50:57 -0700, norseman wrote: Moderator: I apologize for attaching anything. This newsgroup has no moderator. However, in order to explain my problem, I need to control the font since text graphics only work for a given font. Use the least c

Re: tkFileDialog -> ImportError: No module named shell

2009-04-13 Thread Mike Driscoll
On Apr 13, 11:26 am, Alan G Isaac wrote: > Why do I get the ImportError below? > What is the right way to do this? > Thanks, > Alan Isaac > > Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] > on win32 > Type "help", "copyright", "credits" or "license" for more informa

Re: GUI Programming

2009-04-13 Thread norseman
Gabriel wrote: r wrote: On Apr 12, 8:07 am, Gabriel wrote: Hello, I'm python newbie and i need to write gui for my school work in python. I need to write it really quick, [snip] Tkinter is built-in, why not start there? from Tkinter import * root = Tk() root.mainloop() -- http:

Re: Python and XML Help

2009-04-13 Thread Scott David Daniels
ookrin wrote: I'm in the process of learning python and PyQt4. I had decided to make myself a simple app and soon discovered that I needed to crash into xml to use some of the data I was going to be getting off of the server. I picked up enough xml to use the sax parser to get the data out of th

REG: python c++ bindings

2009-04-13 Thread ext-golla.anil-ku...@nokia.com
Hi I need some material or link contain examples on python C++ bindings( calling C++ methods in python) Can any body share the information. Thanks, Anil kumar. -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: PyGUI 2.0.1

2009-04-13 Thread Andrew MacKeith
Greg Ewing wrote: PyGUI 2.0.1 is available: http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ Fixes some problems in setup.py affecting installation on Linux and Windows. What is PyGUI? -- PyGUI is a cross-platform GUI toolkit designed to be lightweight and have a highly

Re: Detecting -i in a script

2009-04-13 Thread Marek Szuba
On 2009-04-13, Chris Rebert wrote: > The sys.flags.interactive bool. > > Details: http://docs.python.org/library/sys.html#sys.flags Hmm, "New in version 2.6"... Are you aware of any way of extracting this information in older versions of Python? My code needs to be 2.3-compatible. -- MS -- http

Re: cx_Oracle - DLL load failed

2009-04-13 Thread Martin P. Hellwig
cwurld wrote: Hi, I am having some trouble getting cx_Oracle to work. When I try to import cx_Oracle, I get the following error message: ImportError: DLL load failed: %1 is not a valid Win32 application. I am using Python 2.6 on WIndows. Oracle Client 10g. Any ideas? Thanks Hmm some time a

Re: tkFileDialog -> ImportError: No module named shell

2009-04-13 Thread Alan G Isaac
On Apr 13, 11:26 am, Alan G Isaac wrote: Why do I get the ImportError below? What is the right way to do this? Thanks, Alan Isaac Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.

Re: Detecting -i in a script

2009-04-13 Thread Chris Rebert
On Mon, Apr 13, 2009 at 12:09 PM, Marek Szuba wrote: > Hello there, > > Is there any way of detecting in a script whether the interpreter > session running it has been launched with the -i option? My Google fu > has failed me on this subject... Thanks in advance. The sys.flags.interactive bool.

Re: REG: python c++ bindings

2009-04-13 Thread Diez B. Roggisch
ext-golla.anil-ku...@nokia.com schrieb: Hi Please don't reply to existing posts. People read news and mails threaded, and this makes a post appear below other, non-related posts & causes confusion. Create a new thread instead, by directly posting to the group or ML. I need some materia

Re: tkFileDialog -> ImportError: No module named shell

2009-04-13 Thread Mike Driscoll
On Apr 13, 2:29 pm, Alan G Isaac wrote: > > On Apr 13, 11:26 am, Alan G Isaac > > wrote: > >> Why do I get the ImportError below? > >> What is the right way to do this? > >> Thanks, > >> Alan Isaac > >> Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC > >> v.1310 32 bit (Intel)] on win32 Typ

Detecting -i in a script

2009-04-13 Thread Marek Szuba
Hello there, Is there any way of detecting in a script whether the interpreter session running it has been launched with the -i option? My Google fu has failed me on this subject... Thanks in advance. -- MS -- http://mail.python.org/mailman/listinfo/python-list

Re: binary file compare...

2009-04-13 Thread Przemyslaw Kaminski
SpreadTooThin wrote: > I want to compare two binary files and see if they are the same. > I see the filecmp.cmp function but I don't get a warm fuzzy feeling > that it is doing a byte by byte comparison of two files to see if they > are they same. > > What should I be using if not filecmp.cmp? W

Re: binary file compare...

2009-04-13 Thread SpreadTooThin
On Apr 13, 2:00 pm, Przemyslaw Kaminski wrote: > SpreadTooThin wrote: > > I want to compare two binary files and see if they are the same. > > I see the filecmp.cmp function but I don't get a warm fuzzy feeling > > that it is doing a byte by byte comparison of two files to see if they > > are they

Re: binary file compare...

2009-04-13 Thread Grant Edwards
On 2009-04-13, SpreadTooThin wrote: > I want to compare two binary files and see if they are the same. > I see the filecmp.cmp function but I don't get a warm fuzzy feeling > that it is doing a byte by byte comparison of two files to see if they > are they same. Perhaps I'm being dim, but how el

Re: Overflow error (was Vol 67, Issue 192)

2009-04-13 Thread Scott David Daniels
Dave Angel wrote: Ryniek90 wrote: But i've still haven't got answer for question: "What's the max. length of string bytes which Python can hold?" sys.maxsize The largest positive integer supported by the platform’s Py_ssize_t type, and thus the maximum size lists, strings, dicts, and many

Re: binary file compare...

2009-04-13 Thread SpreadTooThin
On Apr 13, 2:03 pm, Grant Edwards wrote: > On 2009-04-13, SpreadTooThin wrote: > > > I want to compare two binary files and see if they are the same. > > I see the filecmp.cmp function but I don't get a warm fuzzy feeling > > that it is doing a byte by byte comparison of two files to see if they

Re: Imports in python are static, any solution?

2009-04-13 Thread norseman
AJ Mayorga wrote: For something like this I generally create a superclass to hold configuration variables that will change overtime, doing that will save you from insanity. Class configVar: #set initial values Def __init__(self): Self.A = 5 Self.B

Re: GUI Programming

2009-04-13 Thread Lawson English
Gabriel wrote: Hello, I'm python newbie and i need to write gui for my school work in python. I need to write it really quick, because i haven't much time .) So question is, which of gui toolkits should i pick and learn? I heard PyGTK and Glade are best for quick gui programming? Is it good for

PIL, and Parts of tuples

2009-04-13 Thread Vistro
I have two problems, and I can't find anything about either of them. The first is that PIL does not seem to have any way to search each and every pixel for a value, like for pixel in img: if pixel = ((60, 30), (58, 23), (87 57)): # Get out of the for loop # Also, save the pixel

Re: binary file compare...

2009-04-13 Thread Grant Edwards
On 2009-04-13, Grant Edwards wrote: > On 2009-04-13, SpreadTooThin wrote: > >> I want to compare two binary files and see if they are the same. >> I see the filecmp.cmp function but I don't get a warm fuzzy feeling >> that it is doing a byte by byte comparison of two files to see if they >> are t

Re: PIL, and Parts of tuples

2009-04-13 Thread Chris Rebert
On Mon, Apr 13, 2009 at 1:34 PM, Vistro wrote: > I have two problems, and I can't find anything about either of them. > The first is that PIL does not seem to have any way to search each and every > pixel for a value, like > for pixel in img: >     if pixel = ((60, 30), (58, 23), (87 57)): > see

Re: PIL, and Parts of tuples

2009-04-13 Thread Vistro
Actually, I screwed up. See 60, 30? That's actually the range. The tuple to be checked will look like (40, 25, 51) So yeah. Sorry for the bad info. For a good time, go to Start:Run and type in format C On Mon, Apr 13, 2009 at 3:41 PM,

Re: binary file compare...

2009-04-13 Thread SpreadTooThin
On Apr 13, 2:37 pm, Grant Edwards wrote: > On 2009-04-13, Grant Edwards wrote: > > > > > On 2009-04-13, SpreadTooThin wrote: > > >> I want to compare two binary files and see if they are the same. > >> I see the filecmp.cmp function but I don't get a warm fuzzy feeling > >> that it is doing a by

How to run jython WSGI applications on Google AppEngine.

2009-04-13 Thread Alan Kennedy
Hi all, You can find instructions about how to run jython Web applications on Google AppEngine, using WSGI and modjy, here. http://jython.xhaus.com You can see the jython 2.5 Demo WSGI application running, here. http://jywsgi.appspot.com Regards, Alan Kennedy. -- http://mail.python.org/mailma

Re: binary file compare...

2009-04-13 Thread Peter Otten
Grant Edwards wrote: > On 2009-04-13, Grant Edwards wrote: >> On 2009-04-13, SpreadTooThin wrote: >> >>> I want to compare two binary files and see if they are the same. >>> I see the filecmp.cmp function but I don't get a warm fuzzy feeling >>> that it is doing a byte by byte comparison of two

How to convert \n and \t symbols to new lines and tabs?

2009-04-13 Thread DSblizzard
How to convert string with \n and \t symbols to natural string - with new lines and tabs? -- http://mail.python.org/mailman/listinfo/python-list

Re: ValueError: I/O operation on closed file

2009-04-13 Thread dj
On Apr 11, 12:30 am, Dennis Lee Bieber wrote: > On Fri, 10 Apr 2009 13:25:25 -0700 (PDT), dj > declaimed the following in gmane.comp.python.general: > > > > > I have a handler which I use with a set of log levels for the python > > logging module. > > > --- myhandl

Re: How to convert \n and \t symbols to new lines and tabs?

2009-04-13 Thread MRAB
DSblizzard wrote: How to convert string with \n and \t symbols to natural string - with new lines and tabs? You'll need to explain what you mean. A string literal represents newline and tab with \n and \t. Are you talking about that, or does the string actually contain the characters \n and \n

Re: Who is your daddy: Can I find what object instantiates another object?

2009-04-13 Thread Steven D'Aprano
On Mon, 13 Apr 2009 19:12:21 +0200, Diez B. Roggisch wrote: >> Can the Parser object know who its Daddy is? > > Yes, by Daddy telling him so. That's how nature does it, and how you > should do it. Or do you think that because DNA-tests are available to us > we should just put all kids into a big

Re: Who is your daddy: Can I find what object instantiates another object?

2009-04-13 Thread Aaron Brady
On Apr 13, 6:50 pm, Steven D'Aprano wrote: > On Mon, 13 Apr 2009 19:12:21 +0200, Diez B. Roggisch wrote: > >> Can the Parser object know who its Daddy is? > > > Yes, by Daddy telling him so. That's how nature does it, and how you > > should do it. Or do you think that because DNA-tests are availab

Re: binary file compare...

2009-04-13 Thread Steven D'Aprano
On Mon, 13 Apr 2009 15:03:32 -0500, Grant Edwards wrote: > On 2009-04-13, SpreadTooThin wrote: > >> I want to compare two binary files and see if they are the same. I see >> the filecmp.cmp function but I don't get a warm fuzzy feeling that it >> is doing a byte by byte comparison of two files t

Re: Detecting -i in a script

2009-04-13 Thread Static Vagabond
I think getopt will help you achieve what you need. http://docs.python.org/library/getopt.html Here's a quick example: import getopt import sys try: opts, args = getopt.getopt(sys.argv[1:], "-i:vo:vhb?") except getopt.GetoptError, err: helpCommand() # defined elsewhere. sys.exit()

Re: PEP 3143 and daemon process

2009-04-13 Thread Ben Finney
On 13-Apr-2009, Alfredo Deza wrote: > By "compliant", I do mean to reference PEP 3143 for building the app. I'm still not sure what you mean by this. I can only assume you mean that your program will assume the existence of a PEP 3143 implementation (like the ‘python-daemon’ library), and your pro

Re: Detecting -i in a script

2009-04-13 Thread Chris Rebert
> Marek Szuba wrote: >> >> On 2009-04-13, Chris Rebert wrote: >> >>> The sys.flags.interactive bool. >>> >>> Details: http://docs.python.org/library/sys.html#sys.flags >> >> Hmm, "New in version 2.6"... Are you aware of any way of extracting >> this information in older versions of Python? My code

Re: PEP 3143 and daemon process

2009-04-13 Thread Alfredo Deza
On Mon, Apr 13, 2009 at 8:33 PM, Ben Finney > wrote: > On 13-Apr-2009, Alfredo Deza wrote: > > By "compliant", I do mean to reference PEP 3143 for building the app. > > I'm still not sure what you mean by this. I can only assume you mean > that your program will assume the existence of a PEP 3143

Can I import from a directory that starts with a dot (.) ?

2009-04-13 Thread Matthew Wilson
I want to have .foo directory that contains some python code. I can't figure out how to import code from that .foo directory. Is this even possible? TIA Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: possible pairings in a set

2009-04-13 Thread Alan G Isaac
I cannot access this thread right now so my answer my be rednundant, but anyway: http://docs.python.org/library/itertools.html#itertools.combinations >>> from itertools import combinations >>> print(list(combinations(range(4),2))) [(0, 1), (0, 2), (0, 3), (1, 2), (1, 3), (2, 3)] hth,

Re: binary file compare...

2009-04-13 Thread Dave Angel
SpreadTooThin wrote: On Apr 13, 2:37 pm, Grant Edwards wrote: On 2009-04-13, Grant Edwards wrote: On 2009-04-13, SpreadTooThin wrote: I want to compare two binary files and see if they are the same. I see the filecmp.cmp function but I don't get a warm fuzzy feeling that i

Re: Detecting -i in a script

2009-04-13 Thread Static Vagabond
Chris Rebert wrote: Marek Szuba wrote: On 2009-04-13, Chris Rebert wrote: The sys.flags.interactive bool. Details: http://docs.python.org/library/sys.html#sys.flags Hmm, "New in version 2.6"... Are you aware of any way of extracting this information in older versions of Python? My code need

Re: Detecting -i in a script

2009-04-13 Thread Chris Rebert
On Mon, Apr 13, 2009 at 6:10 PM, Static Vagabond wrote: > Chris Rebert wrote: >>> >>> Marek Szuba wrote: On 2009-04-13, Chris Rebert wrote: > The sys.flags.interactive bool. > > Details: http://docs.python.org/library/sys.html#sys.flags Hmm, "New in version 2.

Re: Can I import from a directory that starts with a dot (.) ?

2009-04-13 Thread Ben Finney
Matthew Wilson writes: > I want to have .foo directory that contains some python code. I can't > figure out how to import code from that .foo directory. Is this even > possible? Packages and modules need to have names that are valid Python identifiers. That precludes the ‘.’ character (among man

Re: Detecting -i in a script

2009-04-13 Thread Christian Heimes
Marek Szuba wrote: > Is there any way of detecting in a script whether the interpreter > session running it has been launched with the -i option? My Google fu > has failed me on this subject... Thanks in advance. There is no direct way to detect the interactive flag. However sys.ps1 and sys.ps2 ar

  1   2   >