Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-25 Thread Juan Christian
So guys, I had to change to approach, I read that using Qt I can't do multiple inheritance. So my Outpost class can't be like 'Outpost(QObject, QThred)'. I had to change the code a bit: from PySide.QtCore import QObject, QThread, Signal import requests import bs4 class Worker(QThread): def __ini

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-26 Thread Juan Christian
On Wed Nov 26 2014 at 1:16:11 AM Michael Torrie wrote: You're going to have to post a complete, but small, code example, I think. Working with fragments of code is very difficult if not impossible to assist with, resulting in obtuse, obvious replies from folks. As asked, here is all the code: ou

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-27 Thread Juan Christian
On Thu Nov 27 2014 at 2:12:40 AM Michael Torrie wrote: Hmm, I hit a wall. There's no main.ui file. Can you rework your code so that you have a single file (plus a separate ui file that's okay), that simulates the url request, that I can execute easily. As you asked, here it's, everything on one m

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-27 Thread Juan Christian
On Thu Nov 27 2014 at 8:53:16 PM Michael Torrie wrote: Hope this helps. Here's complete working code, minus the .ui file: http://pastebin.com/VhmSFX2t Thanks, I'll just repost the code on pastebin with a NEVER expire time and UNLISTED, so that it can be of some help for others here in the mailist

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-27 Thread Juan Christian
On Thu Nov 27 2014 at 9:16:38 PM Juan Christian wrote: I'll read the code thoroughly and reply to you if I find something strange, many thanks! So, instantly I found one issue, you said that this code won't block the GUI, only the thread event loop, but if we keep moving the window

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-28 Thread Juan Christian
On Fri Nov 28 2014 at 2:07:32 AM Michael Torrie wrote: Okay, here's a reworking of the code that invokes a new QThread instance each time. Note the QThread instance has to be bound to the MainWindow so that it won't be destroyed when it goes out of scope. Also the Worker thread sends a signal with

Re: Python, C++ interaction

2014-12-04 Thread Christian Gollwitzer
What specifically did you try, and what failed? Concerning the callbacks, I don't know about these, but hopefully you are aware that you can easily loose the C++ speed advantage by using Python lambdas, since those have to go through the Python interpreter. Christian -- https://mail.

Re: list comprehension return a list and sum over in loop

2014-12-12 Thread Christian Gollwitzer
nsional matrix, and in general NumPy stores the elements in native doubles instead of Python lists, which improves both performance and memory usage Christian -- https://mail.python.org/mailman/listinfo/python-list

Is there a way to schedule my script?

2014-12-17 Thread Juan Christian
I know about the schedule modules and such but they work in situations like 'run this in a X hours/minutes/seconds interval', I already have my code in a while loop with sleep (it's a bit ugly, I'l change to a scheduler soon). What I really want is, for example: 24/7/365 9:00 AM -> Start 11:59 PM

Re: Is there a way to schedule my script?

2014-12-17 Thread Juan Christian
On Wed Dec 17 2014 at 5:45:31 PM John Gordon wrote: You could write a separate program whose only job is to send a STOP or CONTINUE signal to your main program, and then run that program from a scheduler. The standard system "kill" command would probably work for this purpose, assuming you have a

Re: Is there a way to schedule my script?

2014-12-17 Thread Juan Christian
Ops, sorry. It's: 9:00 AM ~ 11:59 PM -> Running ... and not 9:00 AM ~ 11:50 PM -> Running -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to schedule my script?

2014-12-17 Thread Juan Christian
On Wed Dec 17 2014 at 6:25:39 PM John Gordon wrote: If you want to solve your problem entirely within Python, look at the "scheduler" module. (Although even this isn't a complete solution, as you still have to make sure the program is running in the first place...) My script is running fine, Win

Re: Is there a way to schedule my script?

2014-12-17 Thread Juan Christian
On Wed Dec 17 2014 at 7:35:10 PM Chris Angelico wrote: time.time() % 86400 That's number of seconds since midnight UTC, ranging from 0 up to 86399. (I've no idea what 64562 would mean. That's an awfully big number for a single day.) If you offset that before calculating, you can get that in

Re: Is there a way to schedule my script?

2014-12-17 Thread Juan Christian
On Wed Dec 17 2014 at 9:40:52 PM Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote: > Juan Christian wrote: > > > I know about the schedule modules and such but they work in situations > > like 'run this in a X hours/minutes/seconds interval'

Re: Is there a way to schedule my script?

2014-12-18 Thread Juan Christian
On Wed Dec 17 2014 at 11:04:16 PM Juan Christian wrote: Thanks. That was a great answer. I'll redo my code. It's running and will only run in my Docker container (Ubuntu Server 14.04.1) so I'll use cron. Indeed, currently I'm using something like that: while True: if 9 &

Re: Is there a way to schedule my script?

2014-12-18 Thread Juan Christian
Thanks, using cron here. -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to schedule my script?

2014-12-18 Thread Juan Christian
On Thu Dec 18 2014 at 2:24:46 PM Ian Kelly wrote: What kind of random distribution of the time between executions are you looking for? A random sleep lends itself easily to a uniform distribution. The latter approach that you describe would result in a geometric distribution. I'm looking for a ra

Re: Is there a way to schedule my script?

2014-12-18 Thread Juan Christian
On Thu Dec 18 2014 at 11:35:11 PM Chris Angelico wrote: Why does this matter to you? Why am I getting the feeling that I should not be helping you? Because that's what my project is all about, I need to fake some 'human actions' inside the network to do some benchmarks and test internal stuffs. T

smtplib not working as expected

2014-12-26 Thread Juan Christian
I have the following test code: import smtplib fromaddr = 'mksfjnsfji4433j4...@bk.ru' toaddrs = ['mksfjnsfji4433j4...@bk.ru'] msg = ("From: %s\r\nTo: %s\r\n\r\n" % (fromaddr, ", ".join(toaddrs))) msg = msg + 'test' print("Message length is " + repr(len(msg))) server = smtplib.SMTP('sm

Re: smtplib not working as expected

2014-12-26 Thread Juan Christian
On Fri Dec 26 2014 at 11:07:30 PM MRAB wrote: According to the docs, if you let the port parameter default to 0, it'll use port 465. I tested with my ISP. Using port 465, it failed. Using the default, it succeeded. So, I changed the code how you said, but still not working. Code: import smt

Re: smtplib not working as expected

2014-12-27 Thread Juan Christian
On Sat Dec 27 2014 at 1:23:12 AM Vincent Vande Vyvre < vincent.vande.vy...@telenet.be> wrote: Try with the TLS: Many thanks, working like a charm, code: server = smtplib.SMTP('smtp.mail.ru') server.starttls() server.ehlo() server.login('SENDER EMAIL GOES HERE', 'PASSWD GOES HERE') server.sendmail

Re: smtplib not working as expected

2014-12-27 Thread Juan Christian
Denis it was already resolved, check my message above. ^^ -- https://mail.python.org/mailman/listinfo/python-list

Re: Moving 1 Picture in a Programm - How to?

2015-01-01 Thread Christian Gollwitzer
happy face shows up. Have a look at the canvasplot.py demo of the Tk canvas. It shows how to do basic drag'n'drop with items on a canvas. Can be downloaded from here: http://tkinter.unpythonic.net/wiki/A_tour_of_Tkinter_widgets Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Looking for sample python script using Tkinter

2015-01-02 Thread Christian Gollwitzer
n red. All of this can be done in a couple of lines easily, but is lots of work to do completely right and capture every possible case. Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Tk Tix GUI documentation & builder overview and tips

2015-01-04 Thread Christian Gollwitzer
get demo Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: list comparison vs integer comparison, which is more efficient?

2015-01-04 Thread Christian Gollwitzer
millisecond resolution. You need to run a benchmark at least for a second to get reliable information about timing. INstead of 24 times, call your function 2 times in loop. Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Announce: PyPrimes 0.2.1a

2015-01-07 Thread Christian Gollwitzer
ut the AKS test, which is O(P) and deterministic for all primes, what about elliptic curve factorization or a quadratic sieve? I'm sure that other people with better knowledge of number theory could propose some more generally useful algorithms. Christian -- https://mail.pyt

Re: List of "python -m" tools

2015-01-11 Thread Christian Heimes
ython -me", https://pypi.python.org/pypi/e. It's a small yet elegant tool for the command line. Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: apostrophe not considered with tkinter's wordstart and wordend

2015-01-22 Thread Christian Gollwitzer
ars {\s}'); (untested in Python, only tested directly from a wish shell) Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Sanity Proposal: Type Hinting Solution

2015-01-24 Thread Christian Gollwitzer
basis. This permits more freedom in code layout, for example it allows reasonable one-line ifs. Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: [OT] fortran lib which provide python like data type

2015-01-29 Thread Christian Gollwitzer
ot;); result.push_back(entry); } return result; } There is also Boost::Python which does the same, I think, and much more, but only supports Python, whereas I use SWIG to interface these dicts/lists to both CPython and Tcl. You cannot, however, resolve certain cyclic dependencies with pure reference counting. Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: [OT] fortran lib which provide python like data type

2015-01-31 Thread Christian Gollwitzer
Am 30.01.15 um 19:23 schrieb Paul Rubin: > Michael Torrie writes: >> Follow basic [C++] rules and 99% of segfaults will never happen and >> the majority of leaks will not happen either. > > That is a safe and simple approach, but it works by copying data all > over the place instead of passing po

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Christian Gollwitzer
t-project.org/doc/qt-4.8/templates.html for a reasoning of QT. In C++11 (supported by MSVC, g++, clang) there re also lambda expressions Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Explanation of list reference

2014-02-15 Thread Christian Gollwitzer
]) >>> a array([ 1, 123, 3, 4]) Lesson learned: Don't modify parameters you got passed, if possible. It is rarely what you want and can sometimes even happen, when you know you don't want it. Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Explanation of list reference

2014-02-15 Thread Christian Gollwitzer
So, a and b are different things, right? >>> b[1]=37 >>> b array([ 1, 37, 3, 4]) >>> a array([ 1, 37, 3, 4]) Still they are connected. I can imagin that id() is just a debugging tool for extensions. What useful applications does it have outside of this? Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Password validation security issue

2014-03-01 Thread Christian Heimes
s. In fact it's insecure on so many levels that I don't know where to start... A hash function and a fixed salt are always the wrong way to handle passwords. You must use a non-deterministic key stretching and key derivation function with a salt from a CPRNG. For example PBKDF2 (usually used with HMAC as PRF), bcrypt or scrypt are well studied and tune-able KDFs. You must also use a constant timing comparison function. You don't have to do all the hard stuff on your own. I highly recommend `passlib` to handle your passwords. It has a good API and is secure. Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Password validation security issue

2014-03-01 Thread Christian Heimes
On 01.03.2014 19:45, Chris Angelico wrote: > On Sun, Mar 2, 2014 at 5:31 AM, Christian Heimes wrote: >>>>>> encrypted = hashlib.sha256(login+'NaCl protects your >>>>>> passwords'+password).hexdigest() >>>>>> encrypted &g

Re: Password validation security issue

2014-03-01 Thread Christian Heimes
On 01.03.2014 21:25, Roy Smith wrote: > In article , > Christian Heimes wrote: > >> With software like [1] and a fast GPU >> it is possible to do more than 10*10^9 checks/second for SHA-256. > > Just out of curiosity, how does that differ from 10^10 checks/second?

Re: Password validation security issue

2014-03-02 Thread Christian Heimes
nd proven to be insecure for at least a decade, more like 15+ years. The concept of passwords itself is insecure. But we are stuck with passwords for authentication mechanism for the foreseeable future. 2FA is an attempt to increase the security of passwords-based authentication schemes. Christi

Re: 'complex' function with string argument.

2014-03-18 Thread Christian Gollwitzer
ression like 1+2i*3 is it "complex(1+2i) times 3" or is it sum of 1 and product of complex 2i and 3? The answer that python does it by parsing imaginary literals and then combining them back using peephole optimization was helpful, thanks for that! Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: 'complex' function with string argument.

2014-03-18 Thread Christian Gollwitzer
Hi Steven, Am 18.03.14 09:00, schrieb Steven D'Aprano: On Tue, 18 Mar 2014 08:04:44 +0100, Christian Gollwitzer wrote: Am 15.03.14 17:26, schrieb Jayanth Koushik: This is regarding the inbuilt 'complex' function. The python docs say: "Note: When converting from a string,

Re: Normal dict behavior?

2014-05-07 Thread Christian Heimes
On 07.05.2014 17:20, Ned Batchelder wrote: > Because 0 == 0.0 > hash(0) == hash(0.0) and 0 == 0.0 Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Using ssl.wrap_socket() in chroot jail

2014-05-07 Thread Christian Heimes
* use pyOpenSSL / cryptography als TLS library * don't do SSL in your daemon and let some proxy or load balancer do TLS offloading, e.g. NGinx or Apache + mod_proxy Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: confused about the different built-in functions in Python

2014-05-26 Thread Christian Heimes
object: >>> class Example(object): pass ... >>> e = Example() >>> e.__str__ is e.__str__ False Python creates a new bound method object every time. A bound method object is a callable object that keeps a strong reference to the function, class and object. The bound method ob

Re: Removing matching items from a list?

2013-08-03 Thread Christian Gollwitzer
the number, you could count the items in the original list and subtract the number of items in you final list. Christian -- http://mail.python.org/mailman/listinfo/python-list

SSL issues in Python stdlib and 3rd party code

2013-08-12 Thread Christian Heimes
Antoine Pitrou (Python core dev), Daniel Stenberg (curl), Günter Knauf (curl) and everybody else who was involved in reporting and fixing these issues. Regards, Christian -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with undefi

Re: Adding new lines to word document using zipfile module within python 2.7?

2013-08-27 Thread Christian Gollwitzer
diff tool over the output and the original file. If you want to go the specs route instead, you can start here: http://en.wikipedia.org/wiki/Office_Open_XML Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Applying 4x4 transformation to 3-element vector with numpy

2013-10-08 Thread Christian Gollwitzer
element before discarding it, if it is a 3D-point. For a 3D-vector (enhanced by a 0) you might still find a shortcut. Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: I am never going to complain about Python again

2013-10-09 Thread Christian Gollwitzer
Python again. More of this fun for polyglott programmers: https://www.destroyallsoftware.com/talks/wat Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Complex literals (was Re: I am never going to complain about Python again)

2013-10-10 Thread Christian Gollwitzer
nt, an imaginary number, and k? I don't know that EE's ever encounter hypercomplex numbers (I certainly never have) But they are very useful to represent 3D-rotation around an inclined axis (look up quaternion rotation). I don't know whether EEs work in aircraft navigation,

Re: Process pending Tk events from GObject main loop?

2013-10-11 Thread Christian Gollwitzer
ingle event, but how do I tell no more events are pending? To process all pending events in Tcl/Tk, you use update (Tcl function). So you just grab a Tkinter object and execute its .update() function, or you manually invoke something like root.tk.eval('update') Christ

Re: What version of glibc is Python using?

2013-10-11 Thread Christian Gollwitzer
usr/local/bin/python2.7 Then execute the reported libc.so, which gives you some information. Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: What version of glibc is Python using?

2013-10-12 Thread Christian Gollwitzer
uot;. It's not even done by reading the symbol table, it opens the binary and matches a RE *shocked* I would have expected such hacks in a shell script. glibc has a function for this: gnu_get_libc_version () which should be used. Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: What version of glibc is Python using?

2013-10-12 Thread Christian Gollwitzer
Am 12.10.13 09:53, schrieb Christian Gollwitzer: Am 12.10.13 09:20, schrieb Ned Deily: In article , John Nagle wrote: [...] Why is the info from "plaform.libc_ver()" so bogus? The code is here: http://hg.python.org/cpython/file/2.7/Lib/platform.py#l141 Perhaps you could open a

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-17 Thread Christian Gollwitzer
bly close to OO thanks to its structs. Most language constructs of C++ can be directly converted into C with just some more typing effort. You will have problems with exceptions (setjump?), templates (macros?) and RTTI. Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Maintaining a backported module

2013-10-24 Thread Christian Heimes
es like assertIsInstance() and assertIn(). I highly recommand tox + py.test for testing. You can test your package with all versions of Python with just one command. We already have a namespace for backports that you can use: backports. :) Feel free to contact me via mail in #python-dev if y

Re: sorting german characters äöü...

2013-10-30 Thread Christian Heimes
e is to have a > case-insensitive ordering, which treates Do you know PyICU? PyICU provides an interface to ICU which offers more elaborate features like locale-specific collation, normalization and more. https://pypi.python.org/pypi/PyICU/1.5 Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Retrieving possible list for use in a subsequent INSERT

2013-10-31 Thread Christian Gollwitzer
Am 31.10.13 17:49, schrieb Nick the Gr33k: Στις 31/10/2013 1:19 μμ, ο/η Nick the Gr33k έγραψε: someone please that is aware of what's wrong? Your attitude. -- https://mail.python.org/mailman/listinfo/python-list

Re: Compiling Python 3.3.2 on CentOS 6.4 - unable to find compiled OpenSSL?

2013-11-05 Thread Christian Heimes
Am 05.11.2013 01:23, schrieb Victor Hooi: > Hi, > > We have a machine running CentOS 6.4, and we're attempting to compile Python > 3.3.2 on it: > > # cat /etc/redhat-release > CentOS release 6.4 (Final) > > We've compiled openssl 1.0.1e 11 by hand on this box, and installed it into

Re: Parallelization of Python on GPU?

2015-02-27 Thread Christian Gollwitzer
ve implementation: http://web.archive.org/web/20101217181349/http://developer.amd.com/zones/OpenCLZone/Events/assets/Optimizations-ImageConvolution1.pdf Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Worst Practices

2015-03-03 Thread Christian Gollwitzer
nd why anybody has problems with an arrow << that means "put into the left thing" instead of "shift the bits to the left". How often do you use bitshift operations in your programs as opposed to output? Ot would be equally silly to complain, that in Python you divide a strin

Re: Python Worst Practices

2015-03-03 Thread Christian Gollwitzer
Am 03.03.15 um 12:12 schrieb Chris Angelico: > On Tue, Mar 3, 2015 at 7:51 PM, Christian Gollwitzer wrote: > >> Are you trying to pick on C++ streams? I could never understand why >> anybody has problems with an arrow << that means "put into the left >> thing

Re: Python Worst Practices

2015-03-04 Thread Christian Gollwitzer
n that. Agreed. The operator method was necessary in C++ because there simply was no other way to create this interface. C++11 gained a lot more features, but iostreams is still the thing from the very first design of C++. Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Make standalone gui-enabled app for LINUX

2015-03-05 Thread Christian Gollwitzer
It creates a "portable app", i.e. either single file or directory which can be run on (nearly) any system. However the resulting files can be awfully big. I use it with a relatively small program that depends on numpy/matplolib, and that pulls in ~100 MB worth of libraries. Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Make standalone gui-enabled app for LINUX

2015-03-06 Thread Christian Gollwitzer
Am 06.03.15 um 09:14 schrieb Mehdi: > On Friday, March 6, 2015 at 12:58:11 AM UTC+3:30, Christian Gollwitzer wrote: >> Use pyinstaller. It creates a "portable app", i.e. either single file or >> directory which can be run on (nearly) any system. However the resulting >&

Re: (Still OT) Nationalism, language and monoculture [was Re: Python Worst Practices]

2015-03-06 Thread Christian Gollwitzer
Am 06.03.15 um 19:15 schrieb Marko Rauhamaa: > llanitedave : > >> It's obvious that's what's needed here is a PEP requiring that the >> International Phonetic Alphabet be used for all Python identifiers and >> keywords. > > You're onto something: ROFL!!! Though I'd prefer a few identifiers in a d

Re: Pexpect idea - but can I handle curses?

2015-03-13 Thread Christian Gollwitzer
e modern top anytime soon. Why? Do you not have a C compiler? Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Sudoku solver

2015-03-26 Thread Christian Gollwitzer
Am 26.03.15 um 00:04 schrieb Mark Lawrence: On 25/03/2015 22:50, Steven D'Aprano wrote: On Wed, 25 Mar 2015 10:39 pm, Marko Rauhamaa wrote: I have yet to find practical use for fibonacci numbers. Many people have failed to find practical uses for many things from mathematics. Doesn't mean th

Re: test1

2015-03-27 Thread Christian Gollwitzer
Am 26.03.15 um 02:34 schrieb Tiglath Suriol: I may stay a while just to poke you in the eye a little longer. I am beginning to enjoy this. People entering a battle of wits unarmed. It's a joy to watch. Wow you must be really bored. Christian -- https://mail.python.org/ma

Re: Sudoku solver

2015-03-29 Thread Christian Gollwitzer
me nobody else has worked on, is 40% faster than optimized C, my first reaction is to expect that you've probably made a mistake I agree with Chris that this was a misunderstanding. Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Sudoku solver

2015-03-30 Thread Christian Gollwitzer
etition by sheer luck, i.e. choosing the right path immediately. Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Lockfile hanling

2015-03-31 Thread Christian Gollwitzer
ethod: [...] This works as well for me - about 3-4 weeks. After some weeks, I got this error: OSError: [Errno 24] Too many open files: '/var/spool/myapp/queue.lock' Can you try if fcntl.flock() does what you want? Should be better than inventing your own locking mechanism.

Re: Lockfile hanling

2015-03-31 Thread Christian Gollwitzer
Am 31.03.15 um 21:17 schrieb Ian Kelly: On Tue, Mar 31, 2015 at 12:58 PM, Christian Gollwitzer wrote: Am 31.03.15 um 16:50 schrieb Ervin Hegedüs: there is an app, written in Python, which stores few bytes of datas in a single file. The application uses threads. Every thread can modify the

Re: Best GUI for Python

2015-04-26 Thread Christian Gollwitzer
it. YMMV. Is non-BMP needed for any living non-esoteric language? I agree that it is a big flaw, but still is useful for very many projects. Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Best GUI for Python

2015-04-27 Thread Christian Gollwitzer
Am 27.04.15 um 09:15 schrieb Steven D'Aprano: On Monday 27 April 2015 16:55, Christian Gollwitzer wrote: YMMV. Is non-BMP needed for any living non-esoteric language? I agree that it is a big flaw, but still is useful for very many projects. Yes. The Unicode Supplementary Multili

Re: Best GUI for Python

2015-04-27 Thread Christian Gollwitzer
QT and GTK, but of course this introduces these dependencies and it might be simpler to just use QT or GTK natively. Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Best GUI for Python

2015-04-28 Thread Christian Gollwitzer
mage format can be worked around by converting your images. You can't just convert your UCS-4 data into UCS-2. Of course \u0079\x6f&75; can :-) Lossy data compression ;) Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Python is not bad ;-)

2015-04-30 Thread Christian Gollwitzer
illed before it can use up all the memory and introduce swapping. For a fair comparison, you should set both limits to the same value and see how far you can get. Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Python is not bad ;-)

2015-05-01 Thread Christian Gollwitzer
a vital feature. Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Python is not bad ;-)

2015-05-02 Thread Christian Gollwitzer
k of any. Or is it maybe one involving mutual recursion? 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 and such, and exactly these are never tail-recursive. Chr

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 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 and such, and exactly

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

2015-05-10 Thread Christian Gollwitzer
mpile the source code into byte code before it can evaluate it, but this is pre-compiled and shouldn't have that overhead. Does eval(code) lookup a,b and c in the scope of the eval, whereas in the func it is bound to locals and optimized out? I've got no idea of Python's interna

Re: Feature Request: Reposition Execution

2015-05-13 Thread Christian Gollwitzer
not possible to back and resume the execution. Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Feature Request: Reposition Execution

2015-05-14 Thread Christian Gollwitzer
from the beginning or B) continue the execution at the point where the exception was thrown? Because A) is/should be easy, B) could be impossible Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Building CPython

2015-05-15 Thread Christian Gollwitzer
ult in the same output. You can also set an environment variable to enable this permanently (until you log out) like export MAKEFLAGS=-j5 Put this into your .bashrc or .profile, and it'll become permanent. Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Help for a newbie regarding code & physical switches

2015-05-20 Thread Christian Gollwitzer
ation with keywords like RasPI, GP, GP programming etc. Finally you can wire this all up. An experienced programmer with no previous knowledge of RasPI can do this within half an hour by reading these guides. Your biggest task is to understand programming. Have fun! Christian --

Re: Slices time complexity

2015-05-20 Thread Christian Gollwitzer
nother name for x In C++, this is possible: int y=42; int &x = y; assert(x==y); x=23; assert(x==y); but, admittedly, you can't reassign x. Christian -- https://mail.python.org/mailman/listinfo/python-list

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

2015-05-22 Thread Christian Gollwitzer
a decent designer - where to place which widgets, how to set the resizing options, that takes some experience to get it right. Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: a more precise distance algorithm

2015-05-25 Thread Christian Gollwitzer
, infinity etc. in the best possible way. Apfelkiste:~ chris$ python Python 2.7.2 (default, Oct 11 2012, 20:14:37) [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin Type "help", "copyright", "credits" or "license" for more

Re: a more precise distance algorithm

2015-05-25 Thread Christian Gollwitzer
; b=4e160 >>> math.sqrt(a**2+b**2) Traceback (most recent call last): File "", line 1, in OverflowError: (34, 'Result too large') >>> math.hypot(a,b) 5e+160 Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Python.exe has stopped working

2015-06-05 Thread Christian Gollwitzer
tool: https://technet.microsoft.com/sysinternals/bb896653.aspx Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Testing random

2015-06-07 Thread Christian Gollwitzer
irnov. Then there are tables which relate the deviations to significance. Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: Testing random

2015-06-17 Thread Christian Gollwitzer
Am 17.06.15 um 08:53 schrieb Thomas 'PointedEars' Lahn: 3. (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: Keypress Input

2015-06-18 Thread Christian Gollwitzer
.e. you have to reformulate your task (waiting for red, then blue...) as a state machine. Alternatively you can circumvent to redo the logic in a state machine by using a coroutine. You should read a text about GUI programming, or more specifically event based programming, to understand

Re: Linear time baseconversion

2015-06-30 Thread Christian Gollwitzer
its N. Baseconversion needs to do a sequence of division operations, where every operation gves you one digit in the new base. The number of digits in the new base is proportional to the number of digits in the old base (the ratio is log b1/log b2). Therefore it will be O(N^2). Chri

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 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 operation

Re: Linear time baseconversion

2015-06-30 Thread Christian Gollwitzer
least that is my feeling. Fun fact, though: you can convert pi to hexadeicmal base without computing the preceding digits: https://en.wikipedia.org/wiki/Bailey%E2%80%93Borwein%E2%80%93Plouffe_formula Christian -- https://mail.python.org/mailman/listinfo/python-list

Re: calculating entropy of image or alternative?

2015-07-04 Thread Christian Gollwitzer
another method for doing this? In principle yes Christian thanks in advance T. here is the code: import math from PIL import Image imageFile = 'int2.jpg' print imageFile im = Image.open(imageFile) rgbHistogram = im.histogram() print 'Snannon Entropy for Red, Gr

Re: beginners choice: wx or tk?

2015-07-11 Thread Christian Gollwitzer
-stuttgart.de/fop/ZAcXSugp/schwuppdiwupp.png http://fex.belwue.de/download/schwuppdiwupp.pl May I ask what is the reason to port this over to Python? Is it to learn Python, or do you want to use packages that are not available for Perl? Christian -- https://mail.python.org/mailman/listinfo/python

Re: beginners choice: wx or tk?

2015-07-11 Thread Christian Gollwitzer
his really is. Kevin Walzer has done a lot of work to get recent Tcl/Tk (i.e. 8.6) running on OSX. The most recent ActiveTcl release is 8.6.4.1. I'm using exclusively Tk 8.6 on the Mac without problems. Christian -- https://mail.python.org/mailman/listinfo/python-list

<    3   4   5   6   7   8   9   10   11   12   >