Re: The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-19 Thread Chris Angelico
On Fri, Apr 19, 2013 at 1:35 PM, rusi wrote: > If I have a loop: > > while i < len(a) and a[i] != x: >i++ > > I need to understand that at the end of the loop: > i >= len(a) or a[i] == x > and not > i >= len(a) and a[i] == x > nor > i == len(a) or a[i] == x # What if I forgot to initialize i

Re: [TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-19 Thread Uday S Reddy
Mark Janssen writes: > The main thing that I notice is that there is a heavy "bias" in > academia towards mathematical models. I understand that Turing > Machines, for example, were originally abstract computational concepts > before there was an implementation in hardware, so I have some > sympa

Re: [TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-19 Thread Claus Reinke
The main thing that I notice is that there is a heavy "bias" in academia towards mathematical models. I understand that Turing Machines, for example, were originally abstract computational concepts before there was an implementation in hardware, so I have some sympathies with that view, yet, shou

Re: How to set my gui?

2013-04-19 Thread Alister
On Thu, 18 Apr 2013 23:24:29 +0200, Tracubik wrote: > Hi all! > I'm trying to make a simple program that essentially do this: > > 1) open a html file (extracted epub file) > 2) search for occurrences like "ita-ly" > 3) put them on a simple GUI: 1 text field and two buttons: keepy it and > correct

Re: How to set my gui?

2013-04-19 Thread Roland Koebler
Hi, > These days, GUI programming is to me just > programming and calling on certain libraries/modules. +1 > One thing you may want to consider is using your main thread for the > UI, and spinning off another thread to do your search. But do that > ONLY if you know you understand threads, and thr

RE: subprocess.call

2013-04-19 Thread Ombongi Moraa Fe
Hi Team, In my python script, I have this: command="lynx -dump 'phpscript?param1=%s¶m2=%s¶m3=%s¶m4=%s¶m5=%s'"%(value1,value2,value3,value4) result=subprocess.call(command,shell=True) print 'xml message' However, the response from running the php script is also printed on output screen. I don't

Re: subprocess.call

2013-04-19 Thread Mau C
Il 19/04/2013 11:56, Ombongi Moraa Fe ha scritto: > Hi Team, > > In my python script, I have this: > > command="lynx -dump > 'phpscript?param1=%s¶m2=%s¶m3=%s¶m4=%s¶m5=%s'"%(value1,value2,value3,value4) http://docs.python.org/2/library/subprocess.html#module-subprocess You should set the properl

Re: [TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-19 Thread Steven D'Aprano
On Thu, 18 Apr 2013 17:14:13 -0400, Robert Harper wrote: > In short, there is no such thing as a "paradigm". Of course there is. A paradigm is a distinct way of thinking, a philosophy if you will. To say that there is no such thing as a paradigm is to say that all ways of thinking about a top

Re: dynamic forms generation

2013-04-19 Thread andrea crotti
Well I think since we are using django anyway (and bottle on the API side) I'm not sure why we would use flask forms for this.. Anyway the main question is probably, is it worth to try to define a DSL or not? The problem I see is that we have a lot and very complex requirements, trying to define a

Re: [TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-19 Thread Roy Smith
In article <517131cd$0$29977$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > On Thu, 18 Apr 2013 17:14:13 -0400, Robert Harper wrote: > > > In short, there is no such thing as a "paradigm". > > Of course there is. A paradigm is a distinct way of thinking, a > philosophy if you

Re: [TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-19 Thread Chris Angelico
On Fri, Apr 19, 2013 at 11:07 PM, Roy Smith wrote: > I was indeed talking about the ways people think about programming. For > example, OOP in C++ is very much about encapsulation. People declare > all data private, and writing setter/getter functions which carefully > control what access outsid

Request

2013-04-19 Thread usman mjoda
Good day, I need help on how to upgradean SAES to AES 128 bits. thank you -- *Usman M. Joda (zhoda), * * * * * *Master Student of Computer Science & Technology,* * * * * * * *Liaoning University Of Technology (LUT), * * * * * * * *+8613840619645* * * * usmanjo...@yahoo.com * * * * Zhinzou- China*

Feature Request: `operator.not_in`

2013-04-19 Thread Matthew Gilson
I believe that I read somewhere that this is the place to start discussions on feature requests, etc. Please let me know if this isn't the appropriate venue (and what the appropriate venue would be if you know). This request has 2 related parts, but I think they can be considered seperately:

Re: How to set my gui?

2013-04-19 Thread Tracubik
On 19/04/2013 10:42, Alister wrote: On Thu, 18 Apr 2013 23:24:29 +0200, Tracubik wrote: Hi all! I'm trying to make a simple program that essentially do this: 1) open a html file (extracted epub file) 2) search for occurrences like "ita-ly" 3) put them on a simple GUI: 1 text field and two butt

Re: subprocess.call

2013-04-19 Thread Jens Thoms Toerring
Ombongi Moraa Fe wrote: > [-- text/plain, encoding 7bit, charset: ISO-8859-1, 19 lines --] > In my python script, I have this: > command="lynx -dump > 'phpscript?param1=%s¶m2=%s¶m3=%s¶m4=%s¶m5=%s'"%(value1,value2,value3,value4) > result=subprocess.call(command,shell=True) > print 'xml message'

Re: Encoding NaN in JSON

2013-04-19 Thread Grant Edwards
On 2013-04-18, Wayne Werner wrote: > On Wed, 17 Apr 2013, Miki Tebeka wrote: > I'm trying to find a way to have json emit float('NaN') as 'N/A'. >>> No. There is no way to represent NaN in JSON. It's simply not part of the >>> specification. >> I know that. I'm trying to emit the *string* '

Re: howto remove the thousand separator

2013-04-19 Thread Duncan Booth
"pyth0n3r" wrote: > I came across a problem that when i deal with int data with ',' as > thousand separator, such as 12,916, i can not change it into int() or > float(). How can i remove the comma in int data? > Any reply will be appreciated!! > Parse it using the locale module, just be sure to

Re: [TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-19 Thread Roy Smith
In article , Chris Angelico wrote: > On Fri, Apr 19, 2013 at 11:07 PM, Roy Smith wrote: > > I was indeed talking about the ways people think about programming. For > > example, OOP in C++ is very much about encapsulation. People declare > > all data private, and writing setter/getter function

Re: [TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-19 Thread Chris Angelico
On Sat, Apr 20, 2013 at 1:31 AM, Roy Smith wrote: > #define private public > #define protected public > #include And: #define class struct But what I mean is that, _in my design_, I make everything public. No getters/setters, just direct member access. The theory behind getters and setters is t

python : how to Opens folder with specified items selected on Windows

2013-04-19 Thread iMath
I want to Opens folder with specified items selected on Windows ,I looked up the The Windows Shell Reference found a function fit for this job SHOpenFolderAndSelectItems http://msdn.microsoft.com/en-us/library/windows/desktop/bb762232(v=vs.85).aspx but I cannot find an example on how to use

Re: [TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-19 Thread Roy Smith
In article , Chris Angelico wrote: > On Sat, Apr 20, 2013 at 1:31 AM, Roy Smith wrote: > > #define private public > > #define protected public > > #include > > And: > #define class struct I suppose, while we're at it: # define const "" (I think that works, not sure). PS: a great C++ inter

Re: python : how to Opens folder with specified items selected on Windows

2013-04-19 Thread Tim Golden
On 19/04/2013 16:54, iMath wrote: > I want to Opens folder with specified items selected on Windows ,I > looked up the The Windows Shell Reference found a function fit for this job > > SHOpenFolderAndSelectItems > > http://msdn.microsoft.com/en-us/library/windows/desktop/bb762232(v=vs.85).aspx >

Re: [TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-19 Thread Steven D'Aprano
On Fri, 19 Apr 2013 12:02:00 -0400, Roy Smith wrote: > PS: a great C++ interview question is, "What's the difference between a > class and a struct?" Amazing how few self-professed C++ experts have no > clue. I'm not a C++ expert, but I am an inquiring mind, and I want to know the answer! --

New release 0.19 of the Cython compiler

2013-04-19 Thread Stefan Behnel
I'm happy to announce that Cython 0.19 has been released. This is a feature release of the Cython compiler that adds some major usability improvements especially for code that needs to run in both Py2 and Py3, as well as better Python compatibility and optimisations. http://cython.org/ You can g

Re: Preparing sqlite, dl and tkinter for Python installation (no admin rights)

2013-04-19 Thread Serhiy Storchaka
18.04.13 19:24, James Jong написав(ла): The file libtk8.6.so has 1.5M and is definitely there. So why did that compilation fail? LD_LIBRARY_PATH=/path_to_libtk However be careful. For now Python doesn't support Tk 8.6 (results of some functions changed in 8.6), this is

Re: [TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-19 Thread Steven D'Aprano
On Fri, 19 Apr 2013 09:07:15 -0400, Roy Smith wrote: > Often, when you talk to C++ people, they will tell you that > encapsulation is what OOP is all about. What they are doing is saying, > C++ isa OOPL, and C++ has encapsulation, therefore OOPL implies > encapsulation. When they look at somethi

Re: [TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-19 Thread Ned Batchelder
On 4/19/2013 12:16 PM, Steven D'Aprano wrote: On Fri, 19 Apr 2013 12:02:00 -0400, Roy Smith wrote: PS: a great C++ interview question is, "What's the difference between a class and a struct?" Amazing how few self-professed C++ experts have no clue. I'm not a C++ expert, but I am an inquiring

Re: [TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-19 Thread Ian Kelly
On Fri, Apr 19, 2013 at 4:16 PM, Steven D'Aprano wrote: > On Fri, 19 Apr 2013 12:02:00 -0400, Roy Smith wrote: > >> PS: a great C++ interview question is, "What's the difference between a >> class and a struct?" Amazing how few self-professed C++ experts have no >> clue. > > I'm not a C++ expert,

Ubuntu package "python3" does not include tkinter

2013-04-19 Thread lcrocker
Am I mistaken in my belief that tkinter is a non-optional part of the Python language? I installed the "python3" package on Ubuntu, and tkinter is not included--it's an optional package "python3-tk" that has to be installed separately. I reported this as a bug as was summarily slapped down. Can we

Re: Ubuntu package "python3" does not include tkinter

2013-04-19 Thread Joel Goldstick
On Fri, Apr 19, 2013 at 1:17 PM, lcrocker wrote: > Am I mistaken in my belief that tkinter is a non-optional part of the > Python language? I installed the "python3" package on Ubuntu, and > tkinter is not included--it's an optional package "python3-tk" that > has to be installed separately. I re

Re: Ubuntu package "python3" does not include tkinter

2013-04-19 Thread lcrocker
Thanks, but I'm not having any trouble running tkinter, it works just fine. I have an issue with the fact that it's optional. It reflects badly on the language and community if we allow just anyone to call something "Python" that doesn't meet some minimum standard of quality. Java has its complianc

Re: Ubuntu package "python3" does not include tkinter

2013-04-19 Thread Andrew Berg
On 2013.04.19 12:17, lcrocker wrote: > Am I mistaken in my belief that tkinter is a non-optional part of the > Python language? I installed the "python3" package on Ubuntu, and > tkinter is not included--it's an optional package "python3-tk" that > has to be installed separately. I reported this as

Re: Ubuntu package "python3" does not include tkinter

2013-04-19 Thread lcrocker
On Apr 19, 10:35 am, Andrew Berg wrote: > On 2013.04.19 12:17, lcrocker wrote:> Am I mistaken in my belief that tkinter > is a non-optional part of the > > Python language? I installed the "python3" package on Ubuntu, and > > tkinter is not included--it's an optional package "python3-tk" that > >

Re: Ubuntu package "python3" does not include tkinter

2013-04-19 Thread Peter Otten
lcrocker wrote: > Am I mistaken in my belief that tkinter is a non-optional part of the > Python language? I installed the "python3" package on Ubuntu, and > tkinter is not included--it's an optional package "python3-tk" that > has to be installed separately. I reported this as a bug as was > summ

Re: Ubuntu package "python3" does not include tkinter

2013-04-19 Thread rusi
On Apr 19, 10:42 pm, lcrocker wrote: > On Apr 19, 10:35 am, Andrew Berg wrote: > > > On 2013.04.19 12:17, lcrocker wrote:> Am I mistaken in my belief that > > tkinter is a non-optional part of the > > > Python language? I installed the "python3" package on Ubuntu, and > > > tkinter is not includ

unzipping a zipx file

2013-04-19 Thread b_erickson1
I have python 2.6.2 and I trying to get it to unzip a file made with winzip pro. The file extension is zipx. This is on a windows machine where I have to send them all that files necessary to run. I am packaging this with py2exe. I can open the file with zFile = zipfile.ZipFile(fullPathName

Re: Ubuntu package "python3" does not include tkinter

2013-04-19 Thread Andrew Berg
On 2013.04.19 12:42, lcrocker wrote: > I understand that for something like a server distribution, but Ubuntu > is a user-focused desktop distribution. It has a GUI, always. That is incorrect. http://www.ubuntu.com/server -- CPython 3.3.0 | Windows NT 6.2.9200 / FreeBSD 9.1 -- http://mail.python

Re: Encoding NaN in JSON

2013-04-19 Thread Chris “Kwpolska” Warrick
On Fri, Apr 19, 2013 at 4:54 PM, Grant Edwards wrote: > On 2013-04-18, Wayne Werner wrote: >> On Wed, 17 Apr 2013, Miki Tebeka wrote: >> > I'm trying to find a way to have json emit float('NaN') as 'N/A'. No. There is no way to represent NaN in JSON. It's simply not part of the sp

Re: Feature Request: `operator.not_in`

2013-04-19 Thread Terry Jan Reedy
On 4/19/2013 10:27 AM, Matthew Gilson wrote: ) It seems to me that the operator module should have a `not_in` or `not_contains` function. It seems asymmetric that there exists a `is_not` function which implements `x is not y` but there isn't a function to represent `x not in y`. There is also

Re: unzipping a zipx file

2013-04-19 Thread John Gordon
In "b_erickson1" writes: > ozFile = open(filename,'w') > ozFile.write(zFile.read(filename)) > ozFile.close() Perhaps you want to use zFile.extract() instead of zFile.read()? -- John Gordon A is for Amy, who fell down the stairs gor...@pan

Re: Ubuntu package "python3" does not include tkinter

2013-04-19 Thread Terry Jan Reedy
On 4/19/2013 1:17 PM, lcrocker wrote: Am I mistaken in my belief that tkinter is a non-optional part of the Python language? Yes. The PSF CPython Windows installer makes installation of tcl/tk/tkinter optional. The build files will compile and build Python without tkinter and without other mo

Re: unzipping a zipx file

2013-04-19 Thread John Gordon
In John Gordon writes: > In "b_erickson1" > writes: > > ozFile = open(filename,'w') > > ozFile.write(zFile.read(filename)) > > ozFile.close() > Perhaps you want to use zFile.extract() instead of zFile.read()? No, that's not it. Your code should work. Y

Toolbar and PyQT

2013-04-19 Thread lionelgreenstreet
Hi, i'm new with python, so i need an help about this problem. I've implemented a toolbar in a QDialog box: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as NavigationToolbar . self.toolbar = NavigationToolbar(self.canvas, self) I've found this code on internet. I

Re: Unicode issue with Python v3.3

2013-04-19 Thread Νίκος Γκρ33κ
Hello Cameron, Did you received my yesterday's mail? -- http://mail.python.org/mailman/listinfo/python-list

Re: Feature Request: `operator.not_in`

2013-04-19 Thread Matthew Gilson
On 4/19/13 2:27 PM, Terry Jan Reedy wrote: On 4/19/2013 10:27 AM, Matthew Gilson wrote: ) It seems to me that the operator module should have a `not_in` or `not_contains` function. It seems asymmetric that there exists a `is_not` function which implements `x is not y` but there isn't a functio

Re: Encoding NaN in JSON

2013-04-19 Thread Grant Edwards
On 2013-04-19, Chris ???Kwpolska??? Warrick wrote: > On Fri, Apr 19, 2013 at 4:54 PM, Grant Edwards > wrote: >> On 2013-04-18, Wayne Werner wrote: >>> On Wed, 17 Apr 2013, Miki Tebeka wrote: >>> >> I'm trying to find a way to have json emit float('NaN') as 'N/A'. > No. There is no way

Re: Encoding NaN in JSON

2013-04-19 Thread Miki Tebeka
> > You understand that this will result in a chunk of text that is not JSON? > I think he means something like this: > >>> json.dumps([float('nan')]) > '["N/A"]' That's exactly what I mean :) -- http://mail.python.org/mailman/listinfo/python-list

Re: unzipping a zipx file

2013-04-19 Thread Dave Angel
On 04/19/2013 01:59 PM, b_erickson1 wrote: I have python 2.6.2 and I trying to get it to unzip a file made with winzip pro. The file extension is zipx. This is on a windows machine where I have to send them all that files necessary to run. I am packaging this with py2exe. I can open the fi

Re: unzipping a zipx file

2013-04-19 Thread Tim Chase
On 2013-04-19 16:29, Dave Angel wrote: > > zFile = zipfile.ZipFile(fullPathName,'r') > > The second parameter to ZipFile() probably should be 'rb' not 'r' Just for the record, the zipfile.ZipFile.__init__ maps "r" to open the file with "rb", so that's not the issue. Your suggestion about opening

Re: [TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-19 Thread Roy Smith
I wrote: > > I suppose people who grew up learning Python as their first language > > look at something like C++ and say, "That's not OOP because classes > > aren't objects", or something equally silly. > In article <517172e7$0$29977$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: >

Re: [TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-19 Thread Roy Smith
In article , Dennis Lee Bieber wrote: > On Fri, 19 Apr 2013 12:02:00 -0400, Roy Smith declaimed > the following in gmane.comp.python.general: > > > PS: a great C++ interview question is, "What's the difference between a > > class and a struct?" Amazing how few self-professed C++ experts have

Re: [TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-19 Thread Steven D'Aprano
On Fri, 19 Apr 2013 19:37:38 -0400, Roy Smith wrote: > There aren't many schools who teach Python as a first (and only > language), but I suppose it's starting to catch on. 5 years from now, > we may see waves of kids graduating from college knowing nothing but > Python, with a similarly narrow v

Re: Ubuntu package "python3" does not include tkinter

2013-04-19 Thread Steven D'Aprano
On Fri, 19 Apr 2013 10:17:58 -0700, lcrocker wrote: > Am I mistaken in my belief that tkinter is a non-optional part of the > Python language? I installed the "python3" package on Ubuntu, and > tkinter is not included--it's an optional package "python3-tk" that has > to be installed separately. I

Re: unzipping a zipx file

2013-04-19 Thread Steven D'Aprano
On Fri, 19 Apr 2013 17:59:26 +, b_erickson1 wrote: > I have python 2.6.2 and I trying to get it to unzip a file made with > winzip pro. The file extension is zipx. This is on a windows machine > where I have to send them all that files necessary to run. I am > packaging this with py2exe. I

Re: unzipping a zipx file

2013-04-19 Thread Dave Angel
On 04/19/2013 08:24 PM, Steven D'Aprano wrote: You are missing that zipx is not the same as zip, and Python very likely does not support the zipx compression algorithm. http://kb.winzip.com/kb/entry/7/ My guess is that the zipx header is similar enough to zip that Python can retrieve

Re: How to set my gui?

2013-04-19 Thread Chris Angelico
On Sat, Apr 20, 2013 at 9:10 AM, Dennis Lee Bieber wrote: > On Fri, 19 Apr 2013 09:24:36 +1000, Chris Angelico > declaimed the following in gmane.comp.python.general: > >> On Fri, Apr 19, 2013 at 8:57 AM, Walter Hurry >> wrote: >> > On Fri, 19 Apr 2013 08:00:11 +1000, Chris Angelico wrote: >> >

Different cache filename

2013-04-19 Thread Fabian PyDEV
Hi, when load a module "mymodule.py" with importlib.machinery.SourceFileLoader a bytecode file is created as mymodule.cpython-33.pyc. If I load a module "mymodule.ext.py" the same way the same bytecode file is created as mymodule.cpython-33.pyc. Is there any way I could tell python to generate

Re: [TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-19 Thread Mark Janssen
On Thu, Apr 18, 2013 at 11:31 PM, Jason Wilkins wrote: > I don't quite think I understand what you are saying. Are you saying that > mathematical models are not a good foundation for computer science because > computers are really made out of electronic gates? No, I'm really trying to point out

Free book, "Hacking Secret Ciphers with Python"

2013-04-19 Thread asweigart
I've released my third book, "Hacking Secret Ciphers with Python" for free under a Creative Commons license. This book is aimed at people who have no experience programming or with cryptography. The book goes through writing Python programs that not only implement several ciphers but also can ha

Re: [TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-19 Thread Mark Janssen
> I think there is some misunderstanding here. Being "mathematical" in > academic work is a way of making our ideas rigorous and precise, instead of > trying to peddle wooly nonsense. I'm sorry. I am responsible for the misunderstanding. I used the word "math" when I really mean symbolic logic