Re: [Newbie] Tkinter Question

2016-02-23 Thread Christian Gollwitzer
Am 23.02.16 um 23:19 schrieb Wildman: I am familiar with OO programming but I am new to Python and Tkinter. I am working on a gui program that creates a couple of temporary files. As part of the Exit button command they are deleted. If the program is shut down using the window close button

Re: exit from Tkinter mainloop Python 2.7

2016-02-23 Thread Christian Gollwitzer
Am 23.02.16 um 22:39 schrieb kevind0...@gmail.com: lblTop = Label(root1, text= ' Enter Values Below', font="Helvetica 14").grid(row=0, column=0, columnspan=2 , pady=5) ##lblTop.pack(side = TOP) lblDB = Label(root1,text= 'Weight').grid(row=1, column=0 ) lblPWord = Label(root1,

Re: exit from Tkinter mainloop Python 2.7

2016-02-23 Thread Christian Gollwitzer
Am 23.02.16 um 22:39 schrieb kevind0...@gmail.com: from Tkinter import * def butContinue(): root1.destroy() [...] entryName = Entry(root1).grid(row=1, column=1, pady=5) [...] butGo = Button(root1, text=" Continue " , command=butContinue ).grid(row=3, column=1, sticky=W, pady=10)

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-21 Thread Christian Gollwitzer
Am 21.02.16 um 14:16 schrieb BartC: Even accepting that syntax limitations might require this to be written as: readline(f, a, b, c) I can't see a straightforward way of making this possible while still keeping a, b and c simple integer, float or string types (because Python's reference

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-20 Thread Christian Gollwitzer
Am 20.02.16 um 19:45 schrieb wrong.addres...@gmail.com: On Saturday, 20 February 2016 09:54:15 UTC+2, Steven D'Aprano wrote: To answer your question "Do I need something fancy...?", no, of course not, reading a line of numbers from a text file is easy. with open("numbers.txt", "r") as f:

Re: How the heck does async/await work in Python 3.5

2016-02-19 Thread Christian Gollwitzer
Am 20.02.16 um 03:36 schrieb Steven D'Aprano: On Thu, 18 Feb 2016 09:08 am, Mark Lawrence wrote: Seeing there is a lot of interest in asyncio recently I figured people might be interested in this http://www.snarky.ca/how-the-heck-does-async-await-work-in-python-3-5 Thanks for the link, but

Re: [STORY-TIME] THE BDFL AND HIS PYTHON PETTING ZOO

2016-02-18 Thread Christian Gollwitzer
Am 16.02.16 um 03:02 schrieb Rick Johnson: On Friday, February 12, 2016 at 1:51:35 AM UTC-6, John Ladasky wrote: I like lazy evaluation. Well, it is a "Pythonic feature" no doubt. ?? I'm confused. Does Python have lazy evaluation? I thought that Python does eager evaluation. At least this

Re: [Glitch?] Python has just stopped working

2016-02-16 Thread Christian Gollwitzer
Am 16.02.16 um 17:19 schrieb Theo Hamilton: I woke up two days ago to find out that python literally won't work any more. I have looked everywhere, asked multiple Stack Overflow questions, and am ready to give up. Whenever I run python (3.5), I get the following message: Fatal Python error:

Re: [newbie] problem with geometry setting in Tkinter

2016-02-08 Thread Christian Gollwitzer
Am 08.02.16 um 15:34 schrieb jenswaelk...@gmail.com: Op maandag 8 februari 2016 13:26:56 UTC+1 schreef Peter Otten: jenswaelk...@gmail.com wrote: I'm trying to set the geometry of my top window, but the size is unaffected. This is the code: top.geometry('900x460') thanks a lot for

Re: [STORY-TIME] THE BDFL AND HIS PYTHON PETTING ZOO

2016-02-06 Thread Christian Gollwitzer
Am 07.02.16 um 08:04 schrieb Paul Rubin: Steven D'Aprano writes: According to TIOBE, Python's popularity continues to grow: http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html I wonder how much of that growth is Python 3 and how much is

Re: Mimick tac with python.

2016-01-30 Thread Christian Gollwitzer
Am 30.01.16 um 08:56 schrieb Jussi Piitulainen: Christian Gollwitzer writes: Am 30.01.16 um 05:58 schrieb Random832: On Fri, Jan 29, 2016, at 23:46, Hongyi Zhao wrote: awk '{a[NR]=$0} END {while (NR) print a[NR--]}' input_file perl -e 'print reverse<>' input_file Well, both of thos

Re: Mimick tac with python.

2016-01-29 Thread Christian Gollwitzer
Am 30.01.16 um 05:58 schrieb Random832: On Fri, Jan 29, 2016, at 23:46, Hongyi Zhao wrote: awk '{a[NR]=$0} END {while (NR) print a[NR--]}' input_file perl -e 'print reverse<>' input_file Well, both of those read the whole file into memory - tac is sometimes smarter than that, but that makes

Re: Tkinter spacing

2016-01-26 Thread Christian Gollwitzer
Am 26.01.16 um 23:48 schrieb high5stor...@gmail.com: On Monday, January 25, 2016 at 7:41:57 PM UTC-8, KP wrote: > [fullquote snipped] Ah - that clears it up. Thanks for your help! It is totally unclear what you reply to. PLease cite what you refer to, and shorten your citation for clarity.

Re: Tkinter spacing

2016-01-26 Thread Christian Gollwitzer
Am 26.01.16 um 04:41 schrieb KP: If I want to have some space between, say, btn_last & btn_new, will I have to use a dummy label in between these two or is there a better way? If you just want to put space there, you can use the pad options of grid, just like you do for lbl_Recs.

Re: Using 'Or'

2016-01-16 Thread Christian Gollwitzer
Am 15.01.16 um 21:24 schrieb Kitten Corner: Hi, I have python version 3.5.1 and I am working on a project, I'm trying to make it by using the 'or' sequence, I'm trying to make it do 1 thing or the other, here's an example: print('i like pie' or 'i like donuts') it only does the thing

Re: use Python and an outlook: protocol URL to bring up a specific email

2016-01-12 Thread Christian Gollwitzer
Am 12.01.16 um 18:52 schrieb Chris Angelico: On Wed, Jan 13, 2016 at 4:37 AM, eryk sun wrote: start is a shell command. It also has a quirk that the first quoted argument is the window title. Here's the correct call: subprocess.check_call('start "title" "%s"' % url,

Re: GitHub's ³pull request² is proprietary lock-in

2016-01-03 Thread Christian Gollwitzer
Am 04.01.16 um 06:29 schrieb Paul Rubin: Chris Angelico writes: On Sun, Jan 3, 2016 at 9:42 PM, Paul Rubin wrote: Chris Angelico writes: If you're not using a GitHub PR, then what you're doing is using GH to host your

Re: raise None

2016-01-03 Thread Christian Gollwitzer
Am 31.12.15 um 16:35 schrieb Steven D'Aprano: But I think it is a real issue. I believe in beautiful tracebacks that give you just the right amount of information, neither too little nor two much. Debugging is hard enough with being given more information than you need and having to decide what

Re: GitHub's ³pull request² is proprietary lock-in

2016-01-03 Thread Christian Gollwitzer
Am 03.01.16 um 09:03 schrieb Ben Finney: Christian Gollwitzer <aurio...@gmx.de> writes: Arguably, the most valuable outcome of the pull request in the end is the patch, which is of course contained in the git repository. Arguably, the most valuable outcome of a database system is the

Re: GitHub's ³pull request² is proprietary lock-in

2016-01-02 Thread Christian Gollwitzer
Am 03.01.16 um 08:04 schrieb Random832: Michael Vilain writes: We used stash/bitbucket at my last contract. It's the second site I've come across that used Atlasian's toolset. Yes, I know it's not statistically significant. Anyway, the pull/merge request workflow is

Re: Catogorising strings into random versus non-random

2015-12-21 Thread Christian Gollwitzer
Am 21.12.15 um 09:24 schrieb Peter Otten: Steven D'Aprano wrote: I have a large number of strings (originally file names) which tend to fall into two groups. Some are human-meaningful, but not necessarily dictionary words e.g.: baby lions at play saturday_morning12 Fukushima ImpossibleFork

Re: Catogorising strings into random versus non-random

2015-12-21 Thread Christian Gollwitzer
Am 21.12.15 um 11:36 schrieb Steven D'Aprano: On Mon, 21 Dec 2015 08:56 pm, Christian Gollwitzer wrote: Apfelkiste:Tests chris$ python score_my.py -8.74 baby lions at play -7.63 saturday_morning12 -6.38 Fukushima -5.72 ImpossibleFork -10.6 xy39mGWbosjY -12.9 9sjz7s8198ghwt -12.1 rz4sdko

Re: Catogorising strings into random versus non-random

2015-12-21 Thread Christian Gollwitzer
Am 21.12.15 um 11:53 schrieb Christian Gollwitzer: So for the spaces, either use a proper trainig material (some long corpus from Wikipedia or such), with punctuation removed. Then it will catch the correct probabilities at word boundaries. Or preprocess by removing the spaces. Christian

Re: Tk alternative to askopenfilename and askdirectory?

2015-12-18 Thread Christian Gollwitzer
Am 16.12.15 um 14:18 schrieb Ulli Horlacher: Is there an alternative to Tk's askopenfilename() and askdirectory()? I want to select a files and directories within one widget, but askopenfilename() let me only select files and askdirectory() let me only select directories. Tk calls out into

Re: How does one distribute Tkinter or Qt GUI apps Developed in Python

2015-12-16 Thread Christian Gollwitzer
Am 17.12.15 um 01:03 schrieb Bruce Whealton: I watched one training video that discussed Python and Tkinter. Like many similar tutorials from online training sites, I was left scratching my head. What seems to be blatantly missing is how this would be distributed. In the first mentioned

Re: non-blocking getkey?

2015-12-10 Thread Christian Gollwitzer
Am 10.12.15 um 09:28 schrieb Ulli Horlacher: Ulli Horlacher wrote: Found it: from Tkinter import Tk from tkFileDialog import askopenfilename Tk().withdraw() file = askopenfilename() My users do not like it :-( They want to

Re: non-blocking getkey?

2015-12-10 Thread Christian Gollwitzer
Am 10.12.15 um 09:28 schrieb Ulli Horlacher: Ulli Horlacher wrote: My users do not like it :-( They want to drag files. Another cheap solution comes to mind: On windows, dropping files onto an icon on the desktop is interpreted as "launch the program with

Re: Getting data out of Mozilla Thunderbird with Python?

2015-12-09 Thread Christian Gollwitzer
Am 08.12.15 um 19:21 schrieb Anthony Papillion: I have a TON of email (years) stored in my Thunderbird. My backup strategy for the last few years has been to periodically dump it all in a tar file, encrypt that tar file, and move it up to the cloud. That way, if my machine ever crashes, I don't

Re: msvcr100.dll missing ... error started after Windows 10 update to 10586.17

2015-12-05 Thread Christian Gollwitzer
Am 05.12.15 um 00:26 schrieb Glenn Linderman: My wife's 64-bit Win8 home machine has 32-bit Python 3.3 installed. Then it upgraded to Win 8.1. Then I upgraded it to Win 10. Then I upgraded it to Threshold 2. It gets regular automatic updates also, like the one last night to build 10586.17.

Re: askopenfilename()

2015-11-28 Thread Christian Gollwitzer
Am 28.11.15 um 11:29 schrieb Ulli Horlacher: One of my Windows test users reports, that the file dialog window of askopenfilename() starts behind the console window and has no focus. On Linux (XFCE) I do not have this problem. I start it with: Tk().withdraw() file =

Re: askopenfilename()

2015-11-28 Thread Christian Gollwitzer
Am 28.11.15 um 13:48 schrieb Ulli Horlacher: Christian Gollwitzer <aurio...@gmx.de> wrote: Many problems would simply go away if you wrote the whole thing as a GUI program. Too much hassle. The predecessor was a Perl/Tk program and I have had to invest 90% of the programming work into t

Re: handling of non-ASCII filenames?

2015-11-19 Thread Christian Gollwitzer
Am 19.11.15 um 08:54 schrieb Ulli Horlacher: Christian Gollwitzer <aurio...@gmx.de> wrote: Am 18.11.15 um 17:45 schrieb Ulli Horlacher: This is my encoding function: def url_encode(s): u = '' for c in list(s): if match(r'[_=:,;<>()+.\w\-]',c): u +=

Re: handling of non-ASCII filenames?

2015-11-18 Thread Christian Gollwitzer
Am 18.11.15 um 17:45 schrieb Ulli Horlacher: This is my encoding function: def url_encode(s): u = '' for c in list(s): if match(r'[_=:,;<>()+.\w\-]',c): u += c else: u += '%' + c.encode("hex").upper() return u The quoting is applied to a UTF8 string. But I

Re: non-blocking getkey?

2015-11-18 Thread Christian Gollwitzer
Am 18.11.15 um 12:01 schrieb Ulli Horlacher: Ulli Horlacher wrote: it is too complicated to rewrite my application from CLI to GUI. But... is there a windows program with which one can select files and the result is written to STDOUT? Found it: from

Re: non-blocking getkey?

2015-11-18 Thread Christian Gollwitzer
Am 18.11.15 um 09:39 schrieb Ulli Horlacher: In my program (for python 2.7) the user must enter file names with mouse copy+paste. I use: while True: file = raw_input(prompt) if file == '': break files.append(file) How can I implement such a get_paste() function? I need a non-blocking

Re: pyinstaller and Python 3.5 on Windows?

2015-11-18 Thread Christian Gollwitzer
Am 18.11.15 um 23:46 schrieb Ulli Horlacher: To run my Python programs on other Windows systems without a Python installation I must create standalone Windows executables. pyinstaller runs without any problems with Python 2.7.10 on Windows 7, but with Python 3.5 I get: [stack trace] Are you

Re: Jython standalone

2015-11-15 Thread Christian Gollwitzer
Am 15.11.15 um 01:35 schrieb vjp2...@at.biostrategist.dot.dot.com: Jython is python in java at jython.org. I tried clicking and double clicking. I does a wait cycle (rotating arrow) then returns to attention. I think you are describing the Windows mouse cursor that displays a rotating wheel

Re: More tkinter Madness

2015-11-14 Thread Christian Gollwitzer
Am 13.11.15 um 23:10 schrieb Tim Daneliuk: On 11/13/2015 03:30 PM, Christian Gollwitzer wrote: Am 13.11.15 um 20:14 schrieb Tim Daneliuk: On 11/13/2015 12:32 AM, Christian Gollwitzer wrote: Apfelkiste:Sources chris$ Well, I get window and when I do this: pack [button .b -text Hello

Re: What is the right way to import a package?

2015-11-14 Thread Christian Gollwitzer
Am 14.11.15 um 21:00 schrieb fl: from numpy import * dt = 0.1 # Initialization of state matrices X = array([[0.0], [0.0], [0.1], [0.1]]) # Measurement matrices Y = array([[X[0,0] + abs(randn(1)[0])], [X[1,0] + abs(randn(1)[0])]]) When the above content is inside a .py document and running,

Re: More tkinter Madness

2015-11-13 Thread Christian Gollwitzer
Am 13.11.15 um 20:14 schrieb Tim Daneliuk: On 11/13/2015 12:32 AM, Christian Gollwitzer wrote: Apfelkiste:Sources chris$ Well, I get window and when I do this: pack [button .b -text Hello -command exit] Nothing appears. No error, nothing? Just to be sure, you haven't closed the empty

Re: Swig + Numpy.i with a const int16_t pointer

2015-11-12 Thread Christian Gollwitzer
Am 11.11.15 um 02:09 schrieb shripha...@gmail.com: I am trying to wrap the following function with SWIG so I can call it from Python. The signature is: ``` int WebRtcVad_Process(VadInst* handle, int fs, const int16_t* audio_frame, size_t frame_length); ``` This is thing is an array of 16

Re: Swig + Numpy.i with a const int16_t pointer

2015-11-12 Thread Christian Gollwitzer
Am 12.11.15 um 09:46 schrieb Christian Gollwitzer: Am 11.11.15 um 02:09 schrieb shripha...@gmail.com: I am trying to wrap the following function with SWIG so I can call it from Python. The signature is: ``` int WebRtcVad_Process(VadInst* handle, int fs, const int16_t* audio_frame, size_t

Re: Swig + Numpy.i with a const int16_t pointer

2015-11-12 Thread Christian Gollwitzer
Am 12.11.15 um 10:16 schrieb Christian Gollwitzer: Am 12.11.15 um 09:46 schrieb Christian Gollwitzer: Am 11.11.15 um 02:09 schrieb shripha...@gmail.com: I am trying to wrap the following function with SWIG so I can call it from Python. The signature is: ``` int WebRtcVad_Process(VadInst

Re: More tkinter Madness

2015-11-12 Thread Christian Gollwitzer
Am 13.11.15 um 06:42 schrieb Tim Daneliuk: Curioser and curioser. Yes, xterm works fine. Dunno about any other tk apps. Hello world Tk is like this: Apfelkiste:Sources chris$ wish % pack [button .b -text Hello -command exit] % Apfelkiste:Sources chris$ Upon starting wish, an empty window

Re: cross platform alternative for signal.SIGALRM?

2015-11-11 Thread Christian Gollwitzer
Am 12.11.15 um 07:14 schrieb Marko Rauhamaa: Terry Reedy : The cross-platform 3.4 asyncio module has some functions with timeouts. Even that doesn't forcefully interrupt an obnoxious blocking function call like time.sleep(1) A blocking call - granted. But what

Re: using binary in python

2015-11-11 Thread Christian Gollwitzer
Am 10.11.15 um 22:29 schrieb kent nyberg: On Mon, Nov 09, 2015 at 10:20:25PM -0800, Larry Hudson via Python-list wrote: Your questions are somewhat difficult to answer because you misunderstand binary. The key is that EVERYTHING in a computer is binary. There are NO EXCEPTIONS, it's all

Re: Question about math.pi is mutable

2015-11-08 Thread Christian Gollwitzer
Am 08.11.15 um 08:45 schrieb Marko Rauhamaa: Grant Edwards : On 2015-11-07, Marko Rauhamaa wrote: "const" is a very ineffective tool that clutters the code and forces you to sprinkle type casts around your code. But it allows the compiler to warn

Re: Scipy odeint (LSODA) gives inaccurate results; same code fine in MATLAB ode15s/ode23s

2015-11-06 Thread Christian Gollwitzer
Am 06.11.15 um 23:01 schrieb Abhishek: I have code that runs perfectly well in MATLAB (using ode15s or ode23s) but falters with Scipy odeint. The MATLAB code is for a specific case of the generalized Python code. Here I have tried to reproduce the specific case in Python. The logic in the code

Re: Regular expressions

2015-11-06 Thread Christian Gollwitzer
Am 06.11.15 um 20:52 schrieb ru...@yahoo.com: I have always thought lexing and parsing solutions for Python were a weak spot in the Python eco- system and I was about to write that I would love to see a PEG parser for python when I saw this: http://fdik.org/pyPEG/ Unfortunately it suffers from

Re: Question about math.pi is mutable

2015-11-06 Thread Christian Gollwitzer
Am 06.11.15 um 20:40 schrieb Chris Angelico: On Sat, Nov 7, 2015 at 6:30 AM, Bartc wrote: Is there no way then in Python to declare: pi = 3.141519 # etc and make it impossible to override? Nope. Even in C++, where classes can define certain things as const,

Re: Regular expressions

2015-11-05 Thread Christian Gollwitzer
Am 05.11.15 um 06:59 schrieb ru...@yahoo.com: Can you call yourself a well-rounded programmer without at least a basic understanding of some regex library? Well, probably not. But that's part of the problem with regexes. They have, to some degree, driven out potentially better -- or at least

Re: Snake Error 

2015-11-05 Thread Christian Gollwitzer
Am 05.11.15 um 15:18 schrieb Chris Angelico: On Fri, Nov 6, 2015 at 1:08 AM, Mahan Marwat wrote: When I am trying to paste this  in Python 3.5.0 IDLE. It crashes. Found it on this page: http://www.fileformat.info/info/unicode/char/1f40d/index.htm Does Python have any

Re: What does “grep” stand for?

2015-11-04 Thread Christian Gollwitzer
Am 05.11.15 um 01:42 schrieb Chris Angelico: On Thu, Nov 5, 2015 at 6:38 AM, Christian Gollwitzer <aurio...@gmx.de> wrote: As someone who grew up on MS-DOS, I'd like to mention that EDLIN's value wasn't in the obvious places. There were two features it had that most other editors didn't: f

Re: What does “grep” stand for?

2015-11-04 Thread Christian Gollwitzer
Am 04.11.15 um 19:24 schrieb Ben Finney: The name is a mnemonic for a compound command in ‘ed’ [0], a text editor that pre-dates extravagant luxuries like “presenting a full screen of text at one time”. [... lots of fun facts ...] Here is another fun fact: The convincing UI of ed was

Re: Regular expressions

2015-11-03 Thread Christian Gollwitzer
Am 04.11.15 um 04:48 schrieb Steven D'Aprano: On Wednesday 04 November 2015 11:33, ru...@yahoo.com wrote: Not quite. Core language concepts like ifs, loops, functions, variables, slicing, etc are the socket wrenches of the programmer's toolbox. Regexs are like an electric impact socket

Re: Problem in implementing Romania Map using Paython Script

2015-11-01 Thread Christian Gollwitzer
Am 02.11.15 um 06:30 schrieb amn...@gmail.com: Dear all; I want to code algorithm in Python for driving from Arad to Bucharest as quickly as possible. It sounds a lot like a homework problem. If so, look into your notes for "Dijkstra algorithm", or "A* algorithm". If not, look for a

Re: Python 3.5.0 Feedback

2015-10-18 Thread Christian Gollwitzer
Am 17.10.15 um 15:23 schrieb Nils-Hero Lindemann: Hallo, Zuerst mal, ein dickes Danke an alle, die an Python mitarbeiten! This is an English speaking newsgroup. If you want discussion in German, post to de.comp.lang.python I'm not on Windows myself, so I can't comment on many of your

Re: PyInstaller+ Python3.5 (h5py import error)

2015-09-23 Thread Christian Gollwitzer
Am 23.09.15 um 18:20 schrieb Heli Nix: Dear all, Thanks a lot for your replies. Very helpful. I have already done some trials with Virtualenv, but PyInstaller is much closer to the idea of an installer you can pass to someone. I have been using development version of PyInstaller in order

Re: A little test for you Guys

2015-09-23 Thread Christian Gollwitzer
You've got a lot of sensible answers, but let me add to this one: Am 22.09.15 um 20:43 schrieb Python_Teacher: input = { 'foo1': 'bar1', 'chose': 'truc', 'foo2': 'bar2', } output = { 'bar1': 'foo1', 'truc': 'chose', 'bar2': 'foo2' } This one can be done as a dict

Re: Postscript to pdf

2015-09-23 Thread Christian Gollwitzer
Am 21.09.15 um 17:20 schrieb Baladjy KICHENASSAMY: Hello, This is my programe : on mac i was able to output ps file but i didn't got the pdf file :/ Maybe ps2pdf is not installed? I think it doesn't come with the Mac. You need to get it via fink, homebrew, macports or an official ghostscript

Re: Postscript to pdf

2015-09-21 Thread Christian Gollwitzer
Am 20.09.15 um 20:27 schrieb Baladjy KICHENASSAMY: Hello, I'm using macosx, ps2pdf version i don't know :/ sorry ok actually i found what is the problem... There is no problem with the ps file every thing is fine =) You could try ps2pdf -dEPSCrop input.ps output.pdf that should create

Re: A photo/image/video sharing app in Python

2015-09-21 Thread Christian Gollwitzer
Am 21.09.15 um 17:16 schrieb Cai Gengyang: 2) A system where where the users can then edit these photos/images/videos into short , funny cartoons/videos This one's a bit open-ended, but more importantly, it needs a lot of front-end work. Editing images in Python code won't be particularly hard;

Re: .bat file trouble.

2015-09-18 Thread Christian Gollwitzer
Am 18.09.15 um 11:06 schrieb bobert...@googlemail.com: Hi, I have two files called module_scripts.py and build_q_scripts.bat. The problem being that when I go to run the bat file it produces a few errors which neither myself or the original owner of the files could understand. Errors:

Re: Packaging and deployment of standalone Python applications?

2015-09-17 Thread Christian Gollwitzer
Am 16.09.15 um 21:29 schrieb Kristian Rink: Thanks, this already is pretty close to what I need. Playing with this and virtualenv, I figured out that this way it's pretty easily possible to have isolated Python environments _locally_. However I failed to package one of these environments and

Re: Packaging and deployment of standalone Python applications?

2015-09-15 Thread Christian Gollwitzer
Am 14.09.15 um 08:58 schrieb Kristian Rink: Folks; coming from a server-sided Java background, I'm recently exploring frameworks such as cherrypy or webpy for building RESTful services, which is quite a breeze and a pretty pleasant experience; however one thing so far bugs me: Using Java

Re: textfile: copy between 2 keywords

2015-09-10 Thread Christian Gollwitzer
Am 10.09.15 um 13:18 schrieb Gerald: Hey, is there a easy way to copy the content between 2 unique keywords in a .txt file? example.txt 1, 2, 3, 4 #keyword1 3, 4, 5, 6 2, 3, 4, 5 #keyword2 4, 5, 6 ,7 If "copying" does mean copy it to another file, and you are not obliged to use Python,

Re: Python handles globals badly.

2015-09-09 Thread Christian Gollwitzer
Am 09.09.15 um 05:23 schrieb Steven D'Aprano: And yes, the fellow Joe who completely missed the point of the blog post, and made the comment "You don’t think you’re wrong and that’s part of a much larger problem, but you’re still wrong" completely deserved to be called out on his lack of reading

Re: Trying pmw with python3: Lots of crashes!

2015-09-06 Thread Christian Gollwitzer
Am 07.09.15 um 03:40 schrieb Paulo da Silva: Às 20:20 de 06-09-2015, Michael Torrie escreveu: On 09/06/2015 12:47 PM, Paulo da Silva wrote: Do I need to go to more complex system like wxwidgets or pyside (QT)? I looked at the last one but, from the 1st steps, it seems too complex. Before

Re: Porting Python Application to a new linux machine

2015-09-03 Thread Christian Gollwitzer
Am 03.09.15 um 16:32 schrieb Heli Nix: I have my python scripts that use several python libraries such as h5py, pyside, numpy In Windows I have an installer that will install python locally on user machine and so my program gets access to this local python and runs successfully. How can I

Re: Linux users: please run gui tests

2015-08-28 Thread Christian Gollwitzer
Am 27.08.15 um 20:32 schrieb Terry Reedy: On 8/27/2015 4:56 AM, Petr Viktorin wrote: 1321, in _configure self.tk.call(_flatten((self._w, cmd)) + self._options(cnf)) _tkinter.TclError: expected integer but got Very puzzling. The only obviously even possibly relevant change from 3.4 to

Re: Linux users: please run gui tests

2015-08-28 Thread Christian Gollwitzer
Am 28.08.15 um 08:46 schrieb Terry Reedy: On 8/28/2015 1:56 AM, Christian Gollwitzer wrote: Am 27.08.15 um 20:32 schrieb Terry Reedy: On 8/27/2015 4:56 AM, Petr Viktorin wrote: 1321, in _configure self.tk.call(_flatten((self._w, cmd)) + self._options(cnf)) _tkinter.TclError: expected

Re: Sometimes bottle takes a lot of time

2015-08-22 Thread Christian Gollwitzer
Am 22.08.15 um 15:51 schrieb Johannes Bauer: On 22.08.2015 15:09, Cecil Westerhof wrote: So let me get your story straight: I wish you really meant that. I really do, did I get it wrong at all? I really don't think that I did. Probably yes. You should take a look at the OP again and

Re: Sandboxing Python

2015-08-22 Thread Christian Gollwitzer
Am 23.08.15 um 02:04 schrieb Chris Angelico: code import os eval(os.system('rm -rf /'), {__builtins__:None}) Traceback (most recent call last): File pyshell#8, line 1, in module eval(os.system('rm -rf /'), {__builtins__:None}) File string, line 1, in module TypeError: 'NoneType'

Re: Python speed

2015-08-07 Thread Christian Gollwitzer
Am 07.08.2015 um 19:17 schrieb Laura Creighton: you really only are doing crunching, and your crunching is done in loops which run for a significant amount of time -- then PyPy is generally faster than Fortran. PyPy faster than Fortran in a tight number-crunching loop? Sorry I find this very

Re: Can I copy/paste Python code?

2015-07-22 Thread Christian Gollwitzer
On 22.07.2015 16:53, Grant Edwards wrote: It's not Adobe's fault. PDF isn't _supposed_ to allow the reader to change the format. It's the fault of people who are chosing to generate PDF documents when they should be using something else. Classic PDF, yes. It is essentially a vector drawing

Re: Can I copy/paste Python code?

2015-07-21 Thread Christian Gollwitzer
On 21.07.2015 04:55, Chris Angelico wrote: On Tue, Jul 21, 2015 at 12:49 PM, ryguy7272 ryanshu...@gmail.com wrote: I'm trying to copy some Python code from a PDF book that I'm reading. I want to test out the code, and I can copy it, but when I paste it into the Shell, everything is all

Re: beginners choice: wx or tk?

2015-07-12 Thread Christian Gollwitzer
Am 12.07.15 um 09:55 schrieb Ulli Horlacher: wxjmfa...@gmail.com wrote: On Windows, there are no more usable, working GUI toolkits (wrappers). What is the problem with tkinter? A first hello world program worked. Don't listen. jmf is a troll, who always complains about Unicode support,

Re: beginners choice: wx or tk?

2015-07-11 Thread Christian Gollwitzer
Am 11.07.15 um 11:28 schrieb Ulli Horlacher: I want to start a project with python. The program must have a (simple) GUI and must run on Linux and Windows. The last one as standalone executable, created with pyinstaller. I have already an implementation in perl/tk :

Re: beginners choice: wx or tk?

2015-07-11 Thread Christian Gollwitzer
Am 11.07.15 um 13:27 schrieb Laura Creighton: Also, if you need your app to work with MacOS, be warned that you will need an older version of tk than the most recent one. This information is current: https://www.python.org/download/mac/tcltk/ Don't use 8.6 I'm not sure how recent this really

Re: calculating entropy of image or alternative?

2015-07-04 Thread Christian Gollwitzer
Am 04.07.15 um 03:17 schrieb telmo bacile: Hi list, I found a code that calculates entropy of images with python that can be used for classifying interesting images from uninteresting ones. Interesting images has more structured patterns while uninsteresting are more noisy or completely

Re: Linear time baseconversion

2015-06-30 Thread Christian Gollwitzer
Am 30.06.15 um 10:52 schrieb jonas.thornv...@gmail.com: It still bug out on very big numbers if base outside integer scope. I am very keen on suggestions regarding the logic to make it faster. Concerning the algorithmic complexity, it can't be faster than square time in the number of digits

Re: Linear time baseconversion

2015-06-30 Thread Christian Gollwitzer
Am 30.06.15 um 18:34 schrieb Ian Kelly: On Tue, Jun 30, 2015 at 10:10 AM, Chris Angelico ros...@gmail.com wrote: When there's a simple ratio between the bases, it's fairly straight-forward to convert a few digits at a time. Converting base 256 into base 64, for instance, can be done by taking

Re: Linear time baseconversion

2015-06-30 Thread Christian Gollwitzer
Am 30.06.15 um 17:40 schrieb Ian Kelly: On Tue, Jun 30, 2015 at 3:07 AM, Christian Gollwitzer aurio...@gmx.de wrote: Concerning the algorithmic complexity, it can't be faster than square time in the number of digits N. Baseconversion needs to do a sequence of division operations, where every

Re: Keypress Input

2015-06-18 Thread Christian Gollwitzer
Am 15.06.15 um 07:15 schrieb John McKenzie: from Tkinter import * from blinkstick import blinkstick led = blinkstick.find_first() timered = 0 timeyellow = 0 timeblue = 0 colour = None root = Tk() root.title('eFlag 1') def red1(event): colour = 1 def yellow1(event): colour = 2

Re: Testing random

2015-06-17 Thread Christian Gollwitzer
Am 17.06.15 um 08:53 schrieb Thomas 'PointedEars' Lahn: 3. http://www.teacherlink.org/content/math/interactive/probability/interactivequiz/home.html (Whereas I predict that the ignorant will see the correct answer to question 3 as proof of the correctness of their misconception.) I'v

Re: Testing random

2015-06-07 Thread Christian Gollwitzer
Am 07.06.15 um 08:27 schrieb Cecil Westerhof: I wrote a very simple function to test random: def test_random(length, multiplier = 1): number_list = length * [0] for i in range(length * multiplier): number_list[random.randint(0, length - 1)] += 1

Re: Python.exe has stopped working

2015-06-05 Thread Christian Gollwitzer
Am 05.06.15 um 11:03 schrieb Alexis Dubois: Anyone else for an idea on that? Well, it is a crash on exit. Looks like a memory error inside of PyQT. If you've got the time, you could run it inside of a debugger, or better, a memory checker like AppVerifier to find the culprit. These things

Re: a more precise distance algorithm

2015-05-25 Thread Christian Gollwitzer
Am 25.05.15 um 21:21 schrieb ravas: I read an interesting comment: The coolest thing I've ever discovered about Pythagorean's Theorem is an alternate way to calculate it. If you write a program that uses the distance form c = sqrt(a^2 + b^2) you will suffer from the lose of half of your

Re: a more precise distance algorithm

2015-05-25 Thread Christian Gollwitzer
Am 26.05.15 um 05:11 schrieb Steven D'Aprano: mismatch after 3 trials naive: 767.3916150255787 alternate: 767.3916150255789 hypot: 767.3916150255787 which shows that: (1) It's not hard to find mismatches; (2) It's not obvious which of the three methods is more accurate. The main problem is

Re: Camelot a good tool for me OT beauty of Tk

2015-05-22 Thread Christian Gollwitzer
Am 22.05.15 um 15:03 schrieb Laura Creighton: I don't know anything about Camelot. Tkinter produces widgets that are in no way as pretty graphically as is expected nowadays -- or indeed for at least 15 years. If this matters to you -- or if you are building for customers if it matters to them,

Re: Help for a newbie regarding code physical switches

2015-05-20 Thread Christian Gollwitzer
Am 20.05.15 um 08:49 schrieb Howard Spink: I have a Pi + SD card with Pi OS + PiTfT screen I am trying to display specific JPEGs when certain combination of GP10 inputs are HIGH. I would like to use Python, I have no background in programming. Can someone point me on the right tracks? No

Re: Slices time complexity

2015-05-20 Thread Christian Gollwitzer
Am 19.05.15 um 15:44 schrieb Steven D'Aprano: Variables are not first class values in C. (I assume you meant *values* rather than objects, on account of C not being an OOP language.) There is no way, for example, to set x to *the variable y* in either C or Python. If you could, that would imply

Re: Feature Request: Reposition Execution

2015-05-15 Thread Christian Gollwitzer
Am 15.05.15 um 05:58 schrieb Skybuck Flying: Thanks for the ideas, I haven't tried them yet. I wonder if they will work in a multi-threaded fashion. I doubt it. The run_script runs in it's own thread. It would be of enormous help if you would create a minimal script just like the above for

Re: Building CPython

2015-05-15 Thread Christian Gollwitzer
Am 14.05.15 um 20:50 schrieb Terry Reedy: On 5/14/2015 1:11 PM, Chris Angelico wrote: 2) make test - run the entire test suite. Takes just as long every time, but most of it won't have changed. The test runner has an option, -jn, to run tests in n processes instead of just 1. On my 6 core

Re: Feature Request: Reposition Execution

2015-05-13 Thread Christian Gollwitzer
Am 12.05.15 um 22:18 schrieb Skybuck Flying: Thanks for suggestion, but I need a solution which can work in SikuliX as well. What the hell is that? Especially inside an observer handler that would be ideal. So far os.kill() is not supported in SikuliX as far as I can tell. OK a quick look

Re: Calling a function is faster than not calling it?

2015-05-10 Thread Christian Gollwitzer
Am 10.05.15 um 11:58 schrieb Steven D'Aprano: Why is calling a function faster than bypassing the function object and evaluating the code object itself? And not by a little, but by a lot? Here I have a file, eval_test.py: # === cut === from timeit import Timer def func(): a = 2 b =

Re: Python is not bad ;-)

2015-05-02 Thread Christian Gollwitzer
Am 02.05.15 um 11:58 schrieb Marko Rauhamaa: Chris Angelico ros...@gmail.com: Guido is against anything that disrupts tracebacks, and optimizing tail recursion while maintaining traceback integrity is rather harder. Tail recursion could be suppressed during debugging. Optimized code can play

Re: Python is not bad ;-)

2015-05-02 Thread Christian Gollwitzer
Am 02.05.15 um 13:21 schrieb Chris Angelico: On Sat, May 2, 2015 at 9:07 PM, Christian Gollwitzer aurio...@gmx.de wrote: I need to add, I grew up with imperative programming, and as such got recursion as the solution to problems that are too complex for iteration, i.e. tree traversal

Re: Python is not bad ;-)

2015-05-01 Thread Christian Gollwitzer
Am 01.05.15 um 09:03 schrieb Steven D'Aprano: On Thu, 30 Apr 2015 09:30 pm, Cecil Westerhof wrote: Tail recursion would nice to have also. People coming from functional languages like Lisp and Haskell often say that, but how many recursive algorithms naturally take a tail-call form? Not that

Re: Python is not bad ;-)

2015-04-30 Thread Christian Gollwitzer
Am 30.04.15 um 18:11 schrieb Cecil Westerhof: Op Thursday 30 Apr 2015 16:03 CEST schreef Michael Torrie: On 04/30/2015 01:07 AM, Cecil Westerhof wrote: When I do that the computer is freezed a few times. That is a little less nice. Does not happen with Clojure when it gets an out of memory.

<    1   2   3   4   5   6   >