Re: Set type for datetime intervals

2016-04-05 Thread Nagy László Zsolt
> Sorry to be late to the party--I applaud that you have already > crafted something to attack your problem. When you first posted, > there was a library that was tickling my memory, but I could not > remember its (simple) name. It occurred to me this morning, after > you posted your new lib

Re: Label behavior's difference between tkinter and ttk

2016-04-05 Thread ast
"Kevin Walzer" a écrit dans le message de news:ne1qin$7po$1...@dont-email.me... In general, the "img.config" syntax is suitable for the classic Tk widgets, not the themed ttk widgets. They have a very different (and very gnarly) syntax for indicating changed state. I am not inclined to see a

Re: Install request

2016-04-05 Thread Rustom Mody
On Wednesday, April 6, 2016 at 4:34:11 AM UTC+5:30, Steven D'Aprano wrote: > On Wed, 6 Apr 2016 02:52 am, Rustom Mody wrote: > > > On Tuesday, April 5, 2016 at 9:49:58 PM UTC+5:30, Oscar Benjamin wrote: > >> Another possibility to improve this situation would be to make a page > >> on the wiki tha

Re: Untrusted code execution

2016-04-05 Thread Chris Angelico
On Wed, Apr 6, 2016 at 11:43 AM, Steven D'Aprano wrote: > Look at what you've done: you've restricted the entire world of Python down > to, effectively, a calculator and a few string methods. That's not to say > that a calculator and a few string methods won't be useful to someone, but > the next

Re: Import graphics error

2016-04-05 Thread Steven D'Aprano
Since Dennis has X-No-Archive set on his posts, his very useful answer to Nicolae will be lost in a matter of days. So I'm going to repeat it. Nicolae, Dennis found the fix is to change the example code. Read the documentation here: http://mcsp.wartburg.edu/zelle/python/graphics/graphics.pdf

Re: Best Practices for Internal Package Structure

2016-04-05 Thread Steven D'Aprano
On Wed, 6 Apr 2016 09:54 am, Ethan Furman wrote: > On 04/05/2016 04:38 PM, Steven D'Aprano wrote: >> On Wed, 6 Apr 2016 04:40 am, Ethan Furman wrote: >> >>> Well, there should be one more module: >>> >>> test.py >>> >>> So in total, two files >>> >>> bidict/ >>> |-- __init__.py >>> |-- test.py

Re: Label behavior's difference between tkinter and ttk

2016-04-05 Thread Kevin Walzer
In general, the "img.config" syntax is suitable for the classic Tk widgets, not the themed ttk widgets. They have a very different (and very gnarly) syntax for indicating changed state. I am not inclined to see a bug here. -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykev

Re: Best Practices for Internal Package Structure

2016-04-05 Thread Steven D'Aprano
On Wed, 6 Apr 2016 05:56 am, Michael Selik wrote: [Sven R. Kunze] >> If you work like in the 80's, maybe. Instead of scrolling, (un)setting >> jumppoints, or use splitview of the same file, it's just faster/easier to >> jump between separate files in todays IDEs if you need to jump between 4 >> pl

Re: Untrusted code execution

2016-04-05 Thread Steven D'Aprano
On Wed, 6 Apr 2016 03:48 am, Chris Angelico wrote: > On Wed, Apr 6, 2016 at 3:26 AM, Jon Ribbens > wrote: >> The received wisdom is that restricted code execution in Python is >> an insolubly hard problem, but it looks a bit like my 7-line example >> above disproves this theory, Jon's 7-line ex

Re: Can't load Tkinter in embedded Python interpreter on Windows

2016-04-05 Thread Kevin Walzer
Adding PySys_SetArgv(argc, argv); did the trick. -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Import graphics error

2016-04-05 Thread Steven D'Aprano
On Wed, 6 Apr 2016 06:05 am, Thomas 'PointedEars' Lahn wrote: > | >>> from email import ID10T > | Traceback (most recent call last): > | File "", line 1, in > | ImportError: cannot import name 'ID10T' > > Why oh why can't somebody write "H

Re: python script for .dat file

2016-04-05 Thread Steven D'Aprano
On Wed, 6 Apr 2016 07:49 am, Muhammad Ali wrote: > Would any one paste here some reference/sample python code for such > extraction of data into text file? column1 = ['aa', 'bb', 'cc', 'dd', 'ee', 'ff'] # strings column2 = [97, 105, 16, 4, 48, 274] # ints column3 = [12.345, 7.821, -4.034, 19.03

Re: Best Practices for Internal Package Structure

2016-04-05 Thread Ethan Furman
On 04/05/2016 04:38 PM, Steven D'Aprano wrote: On Wed, 6 Apr 2016 04:40 am, Ethan Furman wrote: Well, there should be one more module: test.py So in total, two files bidict/ |-- __init__.py |-- test.py Your test code shouldn't necessarily be part of the package though. If I already ha

Re: Best Practices for Internal Package Structure

2016-04-05 Thread Chris Angelico
On Wed, Apr 6, 2016 at 9:29 AM, Steven D'Aprano wrote: > As we speak, I have 28 text editor windows open. Not all of them are Python > code, but among those which are, I have: > [chomp line number counts] I was about to say "Wow, I don't have anything LIKE that many text editor windows open"... b

Re: Best Practices for Internal Package Structure

2016-04-05 Thread Steven D'Aprano
On Wed, 6 Apr 2016 04:40 am, Ethan Furman wrote: > Well, there should be one more module: > >test.py > > So in total, two files > > bidict/ > |-- __init__.py > |-- test.py Your test code shouldn't necessarily be part of the package though. If I already have a package, then I will usually

Re: Import graphics error

2016-04-05 Thread Ned Batchelder
On Tuesday, April 5, 2016 at 4:06:02 PM UTC-4, Thomas 'PointedEars' Lahn wrote: > | >>> from email import ID10T > | Traceback (most recent call last): > | File "", line 1, in > | ImportError: cannot import name 'ID10T' This is uncalled for. You don't have to participate in this thread if you d

Re: Best Practices for Internal Package Structure

2016-04-05 Thread Steven D'Aprano
On Wed, 6 Apr 2016 03:38 am, Sven R. Kunze wrote: > On 05.04.2016 03:43, Steven D'Aprano wrote: >> The purpose of packages isn't enable Java-style "one class per file" >> coding, especially since *everything* in the package except the top level >> "bidict" module itself is private. bidict.compat a

Re: python script for .dat file

2016-04-05 Thread Ben Finney
Muhammad Ali writes: > Would any one paste here some reference/sample python code for such > extraction of data into text file? We're not going to write it for you. Please show what code you have written so far; a small, self-contained code example. Explain what you expect that code to do, and

Re: Install request

2016-04-05 Thread Steven D'Aprano
On Wed, 6 Apr 2016 02:52 am, Rustom Mody wrote: > On Tuesday, April 5, 2016 at 9:49:58 PM UTC+5:30, Oscar Benjamin wrote: >> Another possibility to improve this situation would be to make a page >> on the wiki that actually explains the known problems (and fixes) for >> 3.5 on Windows. > > +10 on

Re: python script for .dat file

2016-04-05 Thread Erik
Hi Muhammad, On 05/04/16 22:49, Muhammad Ali wrote: Would any one paste here some reference/sample python code for such extraction of data into text file? You haven't really explained what you want to achieve. What is the input format, what is the output format, what constraints are there on

Re: Request to mailing list Python-list rejected

2016-04-05 Thread Thud Foo
On Tue, Apr 5, 2016 at 12:59 PM, Ethan Furman wrote: > If it's not a PEP, or obviously non-quoted anywhere-close-to-on-topic > content, I bounce. > ​++good​ -- I have seen the future and I'm not in it! -- https://mail.python.org/mailman/listinfo/python-list

Re: python script for .dat file

2016-04-05 Thread Muhammad Ali
On Tuesday, April 5, 2016 at 2:24:02 PM UTC-7, Joel Goldstick wrote: > On Tue, Apr 5, 2016 at 4:47 PM, Mark Lawrence via Python-list > wrote: > > On 05/04/2016 21:35, Michael Selik wrote: > >> > >> What code have you written so far? > >> > > > > Would you please not top post on this list, it drive

Re: ANN: intervalset Was: Set type for datetime intervals

2016-04-05 Thread Nagy László Zsolt
>> How about creating two classes for this? One that supports zero sized >> intervals, and another that doesn't? > If you don't want zero sized intervals, just don't put any in it. You > don't have a separate list type to support even integers vs one that > supports all floats. What operations are

Re: ANN: intervalset Was: Set type for datetime intervals

2016-04-05 Thread Nagy László Zsolt
>> It is blurred by design. There is an interpretation where an interval >> between [0..4] equals to a set of intervals ([0..2],[2..4]). > No, because 2.5 is in one and not the other. My notation was: 0..4 for any number between 0 and 4. And 2..4 for any number between 2 and 4. So yes, 2.5 is in

Re: Label behavior's difference between tkinter and ttk

2016-04-05 Thread Terry Reedy
On 4/5/2016 2:57 AM, ast wrote: Hello I currently migrate a GUI from tkinter to ttk and I found a problem Here is a piece of code, with comments which explain what is wrong. Here is a complete program that eliminates manual entry and uses .mainloop and .after for the delays. import tkinter

Re: python script for .dat file

2016-04-05 Thread Joel Goldstick
On Tue, Apr 5, 2016 at 4:47 PM, Mark Lawrence via Python-list wrote: > On 05/04/2016 21:35, Michael Selik wrote: >> >> What code have you written so far? >> > > Would you please not top post on this list, it drives me nuts!!! > > A short drive? ;) -- Joel Goldstick http://joelgoldstick.com/blog

Re: Untrusted code execution

2016-04-05 Thread Jon Ribbens
On 2016-04-05, Paul Rubin wrote: > Jon Ribbens writes: >>> isinstance(node, ast.Attribute) and node.attr.startswith("_")): >>> raise ValueError("Access to private values is not allowed.") >>> namespace = {"__builtins__": {"int": int, "str": str, "len": len}} > >> N

Re: good way to avoid recomputations?

2016-04-05 Thread Erik
Hi Maurice, On 05/04/16 21:54, Maurice wrote: Hi. I working on a project where I have 5 scripts loading the same file at the very beginning so I would like to know the best way I can get this file without having to compute it 5 times. I also perform, in all the scripts, a list comprehension usi

good way to avoid recomputations?

2016-04-05 Thread Maurice
Hi. I working on a project where I have 5 scripts loading the same file at the very beginning so I would like to know the best way I can get this file without having to compute it 5 times. I also perform, in all the scripts, a list comprehension using this file that takes 30s to run. Would be c

Re: python script for .dat file

2016-04-05 Thread Mark Lawrence via Python-list
On 05/04/2016 21:35, Michael Selik wrote: What code have you written so far? Would you please not top post on this list, it drives me nuts!!! -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/ma

Re: Label behavior's difference between tkinter and ttk

2016-04-05 Thread Terry Reedy
On 4/5/2016 11:10 AM, Mark Lawrence via Python-list wrote: On 05/04/2016 07:57, ast wrote: [snip code] # Enter these commands by hand, in a shell img.config(foreground='red') img.config(foreground='lime') img.config(foreground='yellow') It looks like a ttk bug, isn't it ? I am using python

Re: python script for .dat file

2016-04-05 Thread Michael Selik
What code have you written so far? > On Apr 5, 2016, at 5:27 PM, Muhammad Ali wrote: > >> On Tuesday, April 5, 2016 at 9:07:54 AM UTC-7, Oscar Benjamin wrote: >>> On 5 April 2016 at 16:44, Muhammad Ali wrote: On Tuesday, April 5, 2016 at 8:30:27 AM UTC-7, Joel Goldstick wrote: On Tue,

Re: Untrusted code execution

2016-04-05 Thread Paul Rubin
Jon Ribbens writes: >> isinstance(node, ast.Attribute) and node.attr.startswith("_")): >> raise ValueError("Access to private values is not allowed.") >> namespace = {"__builtins__": {"int": int, "str": str, "len": len}} > Nobody has any thoughts on this at all? W

Re: ANN: intervalset Was: Set type for datetime intervals

2016-04-05 Thread Michael Selik
It seems coding a generic interval and intervalset will bring a variety of difficult design choices. If I were you, I'd forget making it generic and build one specifically for the application you have in mind. That way you can ignore most of these feature discussions. > On Apr 5, 2016, at 2:59

Re: Import graphics error

2016-04-05 Thread Michael Selik
> On Apr 5, 2016, at 5:17 PM, Nicolae Morkov wrote: > > I copied the code from Python from everyone page 67. > Following the instructions The graphic modules by John Zelle I copied into > the python lacation ,to be easier to find the path . Please be more specific. What is the python

Re: Best Practices for Internal Package Structure

2016-04-05 Thread Mark Lawrence via Python-list
On 05/04/2016 19:49, Sven R. Kunze wrote: It appears to me as if you like messy code then. ;) The messy code is with the person who needlessly splits a single module of a few thousand lines into several modules just for the sake of it. If you want to play yo-yo, leaping from source file to

Re: mod_wsgi not compatible with Wamp 2.4 and python 3.4.3

2016-04-05 Thread justin walters
On Apr 5, 2016 12:51 PM, "asimkon ." wrote: > > I am using Apache to develop Python Web applications via Django. As i am > new to python web development, i am having problem to find the right > version for mod_wsgi.so (compiled version for Apache 2.4.4 - WampServer 2.4 > - and python 3.4.3 latest

Re: Install request

2016-04-05 Thread Mark Lawrence via Python-list
On 05/04/2016 16:56, Igor Korot wrote: Hi, python community, Recently there was a huge number of e-mail stating that the python installer does not work. When asked about it, people reveal that they wee using Windows and they were getting errors about missing DLL. I know for a fact that in the

Re: Best practices for single file modules Inspired by: Best Practices for Internal Package Structure

2016-04-05 Thread Ethan Furman
On 04/05/2016 12:49 PM, Eric S. Johansson wrote: I was inspired by the thread on packaging practices discussion with bidict to ask a related question which is what are the best practices with packaging/releasing a single file Python module ? Back story: I'm always creating little bits of useful

Re: Import graphics error

2016-04-05 Thread Thomas 'PointedEars' Lahn
Nicolae Morkov wrote: > […] > *Following the instructions I copied The graphic modules by John Zelle in > Python folder in Lib folder * > **And when I installed graphic library the error was :* * > > Traceback (most recent call last): > File > "C:/Users/Nicolae/AppData/Local/Programs/Python/Pytho

Re: Best Practices for Internal Package Structure

2016-04-05 Thread Ethan Furman
On 04/05/2016 12:09 PM, Sven R. Kunze wrote: On 05.04.2016 20:40, Ethan Furman wrote: Steven D'Aprano wrote: Your package is currently under 500 lines. As it stands now, you could easily flatten it to a single module: bidict.py Yup... well, actually you could just stick it in __init__.py.

Re: Request to mailing list Python-list rejected

2016-04-05 Thread Ethan Furman
On 04/05/2016 12:12 PM, Tim Golden wrote: On 05/04/2016 08:34, Oscar Benjamin wrote: When did this start happening? The message in question includes a big block of code posted by someone else as context. My comment was that the code was incomplete so I felt it reasonable to include it as cont

Re: Untrusted code execution

2016-04-05 Thread Chris Angelico
On Wed, Apr 6, 2016 at 4:50 AM, Jon Ribbens wrote: > On 2016-04-05, Chris Angelico wrote: >> On Wed, Apr 6, 2016 at 3:26 AM, Jon Ribbens >> wrote: >>> The received wisdom is that restricted code execution in Python is >>> an insolubly hard problem, but it looks a bit like my 7-line example >>> ab

Re: Best Practices for Internal Package Structure

2016-04-05 Thread Michael Selik
> On Apr 5, 2016, at 7:49 PM, Sven R. Kunze wrote: > >> On 05.04.2016 19:59, Chris Angelico wrote: >> On Wed, Apr 6, 2016 at 3:38 AM, Sven R. Kunze wrote: Your package is currently under 500 lines. As it stands now, you could easily flatten it to a single module: bidict.py

Best practices for single file modules Inspired by: Best Practices for Internal Package Structure

2016-04-05 Thread Eric S. Johansson
I was inspired by the thread on packaging practices discussion with bidict to ask a related question which is what are the best practices with packaging/releasing a single file Python module ? Back story: I'm always creating little bits of useful code that I want to reuse (for example, recursi

Re: Best Practices for Internal Package Structure

2016-04-05 Thread Sven R. Kunze
On 05.04.2016 20:40, Ethan Furman wrote: (utils.py does export a couple of functions, but they should be in the main module, or possibly made into a method of BidirectionalMapping.) Your package is currently under 500 lines. As it stands now, you could easily flatten it to a single module: b

mod_wsgi not compatible with Wamp 2.4 and python 3.4.3

2016-04-05 Thread asimkon .
I am using Apache to develop Python Web applications via Django. As i am new to python web development, i am having problem to find the right version for mod_wsgi.so (compiled version for Apache 2.4.4 - WampServer 2.4 - and python 3.4.3 latest version from ActivePython on Windows x86) and i get a 5

Re: Promoting Python

2016-04-05 Thread alister
On Tue, 05 Apr 2016 19:47:00 +0100, BartC wrote: > On 05/04/2016 19:02, alister wrote: >> On Tue, 05 Apr 2016 08:06:02 -0400, Joel Goldstick wrote: > > REM BBC Basic FOR c = 1 TO 15 : COLOUR c >PRINT "Color ";c > NEXT c > > REM BBC Basic c = 0 FOR x = 80 TO 2000 STEP 96 >>

Re: Untrusted code execution

2016-04-05 Thread Jon Ribbens
On 2016-04-05, Jon Ribbens wrote: > On 2016-04-05, Chris Angelico wrote: >> Your code is a *lot* safer for using 'eval' rather than 'exec'. >> Otherwise, you'd be easily exploited using exceptions, which carry a >> ton of info. > > ... but all in attributes that don't start with "_", as far as I

Re: Untrusted code execution

2016-04-05 Thread Jon Ribbens
On 2016-04-05, Chris Angelico wrote: > You can also create objects of various types using literal/display > syntax, and that might let you craft some weird construct that > effectively access those attributes without actually having an > attribute that starts with an underscore. (Think of "getattr

Re: Request to mailing list Python-list rejected

2016-04-05 Thread Tim Golden
On 05/04/2016 08:34, Oscar Benjamin wrote: On 5 Apr 2016 03:50, wrote: Your request to the Python-list mailing list Posting of your message titled "Re: Plot/Graph" has been rejected by the list moderator. The moderator gave the following reason for rejecting your request: "Your messag

Re: Untrusted code execution

2016-04-05 Thread Jon Ribbens
On 2016-04-05, Chris Angelico wrote: > On Wed, Apr 6, 2016 at 3:26 AM, Jon Ribbens > wrote: >> The received wisdom is that restricted code execution in Python is >> an insolubly hard problem, but it looks a bit like my 7-line example >> above disproves this theory, provided you choose carefully wh

Re: Promoting Python

2016-04-05 Thread BartC
On 05/04/2016 19:02, alister wrote: On Tue, 05 Apr 2016 08:06:02 -0400, Joel Goldstick wrote: REM BBC Basic FOR c = 1 TO 15 : COLOUR c PRINT "Color ";c NEXT c REM BBC Basic c = 0 FOR x = 80 TO 2000 STEP 96 GCOL c: CIRCLE FILL x,500,50 : c = c + 1 NEXT x If you tell us some more of wha

Re: Best Practices for Internal Package Structure

2016-04-05 Thread Sven R. Kunze
On 05.04.2016 19:59, Chris Angelico wrote: On Wed, Apr 6, 2016 at 3:38 AM, Sven R. Kunze wrote: Your package is currently under 500 lines. As it stands now, you could easily flatten it to a single module: bidict.py I don't recommend this. The line is blurry but 500 is definitely too much. T

Re: Best Practices for Internal Package Structure

2016-04-05 Thread Ethan Furman
On 04/05/2016 10:38 AM, Sven R. Kunze wrote: On 05.04.2016 03:43, Steven D'Aprano wrote: The purpose of packages isn't enable Java-style "one class per file" coding, especially since *everything* in the package except the top level "bidict" module itself is private. bidict.compat and bidict.util

Re: Best Practices for Internal Package Structure

2016-04-05 Thread Ethan Furman
On 04/04/2016 06:43 PM, Steven D'Aprano wrote: On Tue, 5 Apr 2016 02:47 am, Josh B. wrote: My package, available at https://github.com/jab/bidict, is currently laid out like this: bidict/ ├── __init__.py ├── _bidict.py ├── _common.py ├── _frozen.py ├── _loose.py ├── _named.py ├── _ordered.py ├

Re: Untrusted code execution

2016-04-05 Thread Chris Angelico
On Wed, Apr 6, 2016 at 3:52 AM, Ian Kelly wrote: > On Tue, Apr 5, 2016 at 11:48 AM, Chris Angelico wrote: >> Your code is a *lot* safer for using 'eval' rather than 'exec'. >> Otherwise, you'd be easily exploited using exceptions, which carry a >> ton of info. But even so, I would not bet money (

Re: Promoting Python

2016-04-05 Thread alister
On Tue, 05 Apr 2016 08:06:02 -0400, Joel Goldstick wrote: > On Tue, Apr 5, 2016 at 3:31 AM, Rustom Mody > wrote: >> On Tuesday, April 5, 2016 at 12:53:13 PM UTC+5:30, Gordon( Hotmail ) >> wrote: >>> I am struggling to understand the basic principles of Python having >>> spent many years as a pure

Re: Best Practices for Internal Package Structure

2016-04-05 Thread Chris Angelico
On Wed, Apr 6, 2016 at 3:38 AM, Sven R. Kunze wrote: >> Your package is currently under 500 lines. As it stands now, you could >> easily flatten it to a single module: >> >> bidict.py > > > I don't recommend this. > > The line is blurry but 500 is definitely too much. Those will simply not fit > o

Re: Untrusted code execution

2016-04-05 Thread Ian Kelly
On Tue, Apr 5, 2016 at 11:48 AM, Chris Angelico wrote: > Your code is a *lot* safer for using 'eval' rather than 'exec'. > Otherwise, you'd be easily exploited using exceptions, which carry a > ton of info. But even so, I would not bet money (much less the > security of my systems) on this being s

Re: Untrusted code execution

2016-04-05 Thread Chris Angelico
On Wed, Apr 6, 2016 at 3:26 AM, Jon Ribbens wrote: > The received wisdom is that restricted code execution in Python is > an insolubly hard problem, but it looks a bit like my 7-line example > above disproves this theory, provided you choose carefully what you > provide in your restricted __builti

Re: Untrusted code execution

2016-04-05 Thread Jon Ribbens
On 2016-04-05, Chris Angelico wrote: > On Wed, Apr 6, 2016 at 12:50 AM, Ian Kelly wrote: >> Same here, although it looks to me like this approach could work. Or >> I'm just not clever enough to see how it could be exploited. > > Having been bitten in the past (our test box was compromised by > py

Re: Best Practices for Internal Package Structure

2016-04-05 Thread Sven R. Kunze
On 05.04.2016 03:43, Steven D'Aprano wrote: The purpose of packages isn't enable Java-style "one class per file" coding, especially since *everything* in the package except the top level "bidict" module itself is private. bidict.compat and bidict.util aren't flagged as private, but they should be

Re: Untrusted code execution

2016-04-05 Thread Jon Ribbens
On 2016-04-05, Rustom Mody wrote: > On Tuesday, April 5, 2016 at 7:19:39 PM UTC+5:30, Jon Ribbens wrote: >> On 2016-04-03, Jon Ribbens wrote: >> > I'd just like to say up front that this is more of a thought experiment >> > than anything else, I don't have any plans to use this idea on any >> > ge

Re: Untrusted code execution

2016-04-05 Thread Chris Angelico
On Wed, Apr 6, 2016 at 12:50 AM, Ian Kelly wrote: > Same here, although it looks to me like this approach could work. Or > I'm just not clever enough to see how it could be exploited. Having been bitten in the past (our test box was compromised by python-list white hats within 20 minutes of the i

Re: Install request

2016-04-05 Thread Rustom Mody
On Tuesday, April 5, 2016 at 9:49:58 PM UTC+5:30, Oscar Benjamin wrote: > Another possibility to improve this situation would be to make a page > on the wiki that actually explains the known problems (and fixes) for > 3.5 on Windows. +10 on that one ie When a question becomes a FAQ just put it the

Re: python script for .dat file

2016-04-05 Thread Muhammad Ali
On Tuesday, April 5, 2016 at 9:07:54 AM UTC-7, Oscar Benjamin wrote: > On 5 April 2016 at 16:44, Muhammad Ali wrote: > > On Tuesday, April 5, 2016 at 8:30:27 AM UTC-7, Joel Goldstick wrote: > >> On Tue, Apr 5, 2016 at 11:23 AM, Muhammad Ali > >> wrote: > >> > > >> > Could any body tell me a gener

Import graphics error

2016-04-05 Thread Nicolae Morkov
*Import graphics error* I copied the code below from Python for Everyone page 67. # This program creates a graphics window with a rectangle. It provides the 3 # template used with all of the graphical programs used in the book. 4 # 5 6 from graphics import GraphicsWindow 7 8 # Create the windo

Re: Import graphics error

2016-04-05 Thread Nicolae Morkov
I copied the code from Python from everyone page 67. Following the instructions The graphic modules by John Zelle I copied into the python lacation ,to be easier to find the path . On Tue, Apr 5, 2016 at 11:19 AM, Nicolae Morkov wrote: > # This program creates a graphics window with a

Re: Install request

2016-04-05 Thread Oscar Benjamin
On 5 April 2016 at 16:56, Igor Korot wrote: > > So, here is my request: if its not possible to include the DLL in > question in the installer, > can the installer check for the OS version and ask the user to go to > Microsoft.com, > download and install the library? That's a very reasonable reque

Re: python script for .dat file

2016-04-05 Thread Oscar Benjamin
On 5 April 2016 at 16:44, Muhammad Ali wrote: > On Tuesday, April 5, 2016 at 8:30:27 AM UTC-7, Joel Goldstick wrote: >> On Tue, Apr 5, 2016 at 11:23 AM, Muhammad Ali >> wrote: >> > >> > Could any body tell me a general python script to generate .dat file after >> > the extraction of data from mo

Re: python script for .dat file

2016-04-05 Thread Mark Lawrence via Python-list
On 05/04/2016 16:23, Muhammad Ali wrote: Hello, Could any body tell me a general python script to generate .dat file after the extraction of data from more than 2 files, say file A and file B? Or could any body tell me the python commands to generate .dat file after the extraction of data fr

Install request

2016-04-05 Thread Igor Korot
Hi, python community, Recently there was a huge number of e-mail stating that the python installer does not work. When asked about it, people reveal that they wee using Windows and they were getting errors about missing DLL. I know for a fact that in the InstallShield it is possible to detect th

Re: python script for .dat file

2016-04-05 Thread Muhammad Ali
On Tuesday, April 5, 2016 at 8:30:27 AM UTC-7, Joel Goldstick wrote: > On Tue, Apr 5, 2016 at 11:23 AM, Muhammad Ali > wrote: > > > > Hello, > > > > Could any body tell me a general python script to generate .dat file after > > the extraction of data from more than 2 files, say file A and file B?

Re: python script for .dat file

2016-04-05 Thread Joel Goldstick
On Tue, Apr 5, 2016 at 11:23 AM, Muhammad Ali wrote: > > Hello, > > Could any body tell me a general python script to generate .dat file after > the extraction of data from more than 2 files, say file A and file B? > > Or could any body tell me the python commands to generate .dat file after the

python script for .dat file

2016-04-05 Thread Muhammad Ali
Hello, Could any body tell me a general python script to generate .dat file after the extraction of data from more than 2 files, say file A and file B? Or could any body tell me the python commands to generate .dat file after the extraction of data from two or more than two files? I have to m

Re: tkinter Entry validation modes

2016-04-05 Thread Mark Lawrence via Python-list
On 02/04/2016 19:45, Terry Reedy wrote: On 4/2/2016 11:11 AM, Mark Lawrence via Python-list wrote: A typical call to create an Entry field would be:- e = Entry(master, validate='all', ...) Once this call has been made is it possible to change the validation mode at runtime? AFAIK, every keyw

Re: Label behavior's difference between tkinter and ttk

2016-04-05 Thread Mark Lawrence via Python-list
On 05/04/2016 07:57, ast wrote: Hello I currently migrate a GUI from tkinter to ttk and I found a problem Here is a piece of code, with comments which explain what is wrong. import tkinter as tk import tkinter.ttk as ttk root = tk.Tk() BITMAP0 = """ #define zero_width 24 #define zero_height

Re: ONE CLICK REST API

2016-04-05 Thread Roland Mueller via Python-list
You may have a look at Django-based REST framework - http://www.django-rest-framework.org/ or Flask-RESTful - https://pypi.python.org/pypi/Flask-RESTful - http://flask-restful-cn.readthedocs.org/en/0.3.4/ Last not least here is some article about implementing a REST API using Flask for

Re: Untrusted code execution

2016-04-05 Thread Ian Kelly
On Tue, Apr 5, 2016 at 8:17 AM, Rustom Mody wrote: > On Tuesday, April 5, 2016 at 7:19:39 PM UTC+5:30, Jon Ribbens wrote: >> On 2016-04-03, Jon Ribbens wrote: >> > I'd just like to say up front that this is more of a thought experiment >> > than anything else, I don't have any plans to use this id

Re: Untrusted code execution

2016-04-05 Thread Rustom Mody
On Tuesday, April 5, 2016 at 7:19:39 PM UTC+5:30, Jon Ribbens wrote: > On 2016-04-03, Jon Ribbens wrote: > > I'd just like to say up front that this is more of a thought experiment > > than anything else, I don't have any plans to use this idea on any > > genuinely untrusted code. Apart from anythi

Re: ANN: intervalset Was: Set type for datetime intervals

2016-04-05 Thread Random832
On Tue, Apr 5, 2016, at 04:11, Nagy László Zsolt wrote: > But there is still need to check begin <= end. But maybe > you are right: if we suppose that nobody will try to use an interval > where end < begin then we can use plain tuples. But then the user *must* > make sure not to use invalid interv

Re: Untrusted code execution

2016-04-05 Thread Jon Ribbens
On 2016-04-03, Jon Ribbens wrote: > I'd just like to say up front that this is more of a thought experiment > than anything else, I don't have any plans to use this idea on any > genuinely untrusted code. Apart from anything else, there's the > denial-of-service issue. > > That said, is there any

Re: ANN: intervalset Was: Set type for datetime intervals

2016-04-05 Thread Random832
On Tue, Apr 5, 2016, at 01:44, Nagy László Zsolt wrote: > If you want to manipulate an interval set, you cannot just "add another > interval" to it. Adding an interval may result in unifying thousands of > other intervals. It is possible that you add a wide interval to a set > with 1000 elements, a

Re: Promoting Python

2016-04-05 Thread Peter Otten
Gordon( Hotmail ) wrote: Welcome! > I am struggling to understand the basic principles of Python having spent > many years as a pure Amateur tinkering with a variety of BASIC as you can > see on my site at http://www.sigord.co.uk/ I think you will agree all > such versions of Basic I have used

Re: Promoting Python

2016-04-05 Thread Marko Rauhamaa
Joaquin Alzola : > Python is like shell scripting but with Steroids. For a SysAdmin is a must. > This email is confidential and may be subject to privilege. If you are > not the intended recipient, please do not copy or disclose its content > but contact the sender immediately upon receipt. Oh, I

Re: Promoting Python

2016-04-05 Thread Marko Rauhamaa
Dennis Lee Bieber : > For the OP: Very few languages have built-in graphics commands; > which is why porting BASIC programs was so difficult. This means you > have to import some graphical framework and use ITS command functions. The Racket dialect of the Scheme programming language has an i

RE: Promoting Python

2016-04-05 Thread Joaquin Alzola
>"Gordon( Hotmail )" writes: >> I am struggling to understand the basic principles of Python >Welcome! Congratulations for embarking on Python as a language to learn. >Since as you say you are trying to learn the very basics, please participate >in our collaborative tutoring forum >https://m

Re: Promoting Python

2016-04-05 Thread Joel Goldstick
On Tue, Apr 5, 2016 at 3:31 AM, Rustom Mody wrote: > On Tuesday, April 5, 2016 at 12:53:13 PM UTC+5:30, Gordon( Hotmail ) wrote: >> I am struggling to understand the basic principles of Python having spent >> many years as a pure Amateur tinkering with a variety of BASIC as you can >> see on my

Re: Promoting Python

2016-04-05 Thread Ben Finney
"Gordon( Hotmail )" writes: > I am struggling to understand the basic principles of Python Welcome! Congratulations for embarking on Python as a language to learn. Since as you say you are trying to learn the very basics, please participate in our collaborative tutoring forum https://mail.pytho

Can't load Tkinter in embedded Python interpreter on Windows

2016-04-05 Thread Kevin Walzer
I am trying to build a stub exe on Windows that embeds Python and launches my Tkinter app. I want a full-blown exe program starter because the various Python freezing tools (py2exe, pyinstaller) do not work to my satisfaction with Python 3.5. I am able to get the executable built but I cannot

Re: Import error

2016-04-05 Thread Tony van der Hoff
On 05/04/16 10:53, Nicolae Morkov wrote: What can I do I've tried everything Just hang your head and cry... -- Tony van der Hoff| mailto:t...@vanderhoff.org Buckinghamshire, England | -- https://mail.python.org/mailman/listinfo/python-list

Re: Import graphics error

2016-04-05 Thread Steven D'Aprano
On Tue, 5 Apr 2016 08:19 pm, Nicolae Morkov wrote: > # This program creates a graphics window with a rectangle. It provides the > 3 # template used with all of the graphical programs used in the book. What book? > *This is the error I get* > > Traceback (most recent call last): > File > "C

Import graphics error

2016-04-05 Thread Nicolae Morkov
# This program creates a graphics window with a rectangle. It provides the 3 # template used with all of the graphical programs used in the book. 4 # 5 6 from graphics import GraphicsWindow 7 8 # Create the window and access the canvas. 9 win = GraphicsWindow() 10 canvas = win.canvas() 11 12 # Dra

Re: Import error

2016-04-05 Thread Steven D'Aprano
On Tue, 5 Apr 2016 07:53 pm, Nicolae Morkov wrote: > What can I do I've tried everything You can start by telling us what you are trying to do, and what error you are getting. - What module are you trying to import? - Are you sure it is installed? How do you know? - What command do you g

Re: Import error

2016-04-05 Thread Tim Golden
On 05/04/2016 10:53, Nicolae Morkov wrote: > What can I do I've tried everything > You attached a screenshot, which won't make it through to this text-only mailing list. Can you copy the actual text of the error message from the IDLE session and paste it here, please? TJG -- https://mail.

Import error

2016-04-05 Thread Nicolae Morkov
What can I do I've tried everything -- https://mail.python.org/mailman/listinfo/python-list

Re: ANN: intervalset Was: Set type for datetime intervals

2016-04-05 Thread Nagy László Zsolt
> Yes, my question is why it's useful to have a single Interval as a > *distinct* type, separate from the interval set type, which supports a > sharply limited number of set-like operations (such as the union of two > overlapping intervals but NOT two non-overlapping ones). This doesn't > appear t

Re: module alias in import statement

2016-04-05 Thread Chris Angelico
On Tue, Apr 5, 2016 at 5:26 PM, Steven D'Aprano wrote: >>> sys.modules isn't really a cache in that sense, though. The "hard >>> problem" of cache invalidation comes from the fundamental assumption >>> that a cache hit should be semantically identical to a cache miss; >> >> Following looks like a

Re: Promoting Python

2016-04-05 Thread Rustom Mody
On Tuesday, April 5, 2016 at 12:53:13 PM UTC+5:30, Gordon( Hotmail ) wrote: > I am struggling to understand the basic principles of Python having spent > many years as a pure Amateur tinkering with a variety of BASIC as you can > see on my site at http://www.sigord.co.uk/ I think you will agree

  1   2   >