PIL: check if image is animated

2013-05-06 Thread Sven
the above get deprecated/change in a version at some point? Perhaps there's something I missed during install (using PIP). Are there any other ways to accomplish what I am trying to do, with or without PIL? Python 2.7, linux -- ./Sven -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode humor

2013-05-08 Thread Sven
://mail.python.org/mailman/listinfo/python-list > -- ./Sven -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL: check if image is animated

2013-05-09 Thread Sven
Figured out my issue. I did called the check_animated function more than once and the second call causes the exception unless I seek back to 0 On 6 May 2013 21:57, Sven wrote: > Hello, > > I am trying to check if an image is animated. I can't rely on the > extension as it ma

defining __repr__

2005-09-12 Thread sven
hi list, i'd like to define __repr__ in a class to return the standardrepr a la "<__main__.A instance at 0x015B3DA0>" plus additional information. how would i have to do that? how to get the standardrepr after i've defined __repr__? sven. -- http://mail.python.org/mailman/listinfo/python-list

Re: Synchronous/Asynchrnous Audio play with pymedia

2005-09-19 Thread sven
ith pymedia on >XP. there's a pymedia mailing list at: https://lists.sourceforge.net/lists/listinfo/pymedia-users better ask there, the author of pymedia is generally very helpful in answering question. sven. -- http://mail.python.org/mailman/listinfo/python-list

Re: Question About Logic In Python

2005-09-19 Thread sven
len__(self): return 1 ... >>> foo = Foo() >>> bar = Bar() >>> foo or bar <__main__.Bar instance at 0x7D289940> sven. -- http://mail.python.org/mailman/listinfo/python-list

Re: subclassable types

2013-02-22 Thread Sven
an you base your classes on int or set, > but not on bool or range? > Also: can you use introspection to find out whether a type is valid as a > base type? > Thanks for your help! > > > -- > http://mail.python.org/mailman/listinfo/python-list > -- ./Sven -- http://mail.python.org/mailman/listinfo/python-list

Re: nested loops

2013-02-26 Thread Sven
?: 5 > 5 > 4 > 3 > 2 > 1 > blast off! > > how can i have it print a row of stars beside each number, like this?: > > how many seconds?: 5 > 5 * * * * * > 4 * * * * > 3 * * * > 2 * * > 1 * > blast off! > > > -- > http://mail.python.org/**mailman/listinfo/python-list<http://mail.python.org/mailman/listinfo/python-list> > -- ./Sven -- http://mail.python.org/mailman/listinfo/python-list

What are the Dos and Don'ts

2013-02-27 Thread Sven
where the point is to talk about python, help people rather than anything else. TIA -- ./Sven -- http://mail.python.org/mailman/listinfo/python-list

Re: "Daemonizing" an application.

2013-02-27 Thread Sven
the daemon process without restarting it. If you want to be hardcore you can use sockets. There are other networking libs like Twisted and RabbitMQ, but they might be a bit overkill for your purpose. But whether any of this is ok depends on your use case. The signals Chris mentioned will a

Re: Twisted or Tornado?

2013-03-01 Thread Sven
t; Your opinions will be valuable, if possible cite examples or URL > references, Pls! > > I prefer opinion from those who have programmed real projects in it - not > just read some blog or Slashdot :P > -- > http://mail.python.org/mailman/listinfo/python-list > -- ./Sven -- http://mail.python.org/mailman/listinfo/python-list

iterating over a list as if it were a circular list

2013-03-07 Thread Sven
restart from N[0] and carry on until all the points have been populated. So far I've got for point in points: -- ./Sven -- http://mail.python.org/mailman/listinfo/python-list

iterating over a list as if it were a circular list

2013-03-07 Thread Sven
empty, re-copying it. But that seems a little "wrong" if you know what I mean. -- ./Sven -- http://mail.python.org/mailman/listinfo/python-list

Re: Unable to connect to internet URL behind firewall

2013-03-07 Thread Sven
407 error. > I have also set the HTTP_PROXY environment variables as > http://proxy-example.com:3128 > >From experience the environment variable name is in lowercase. Try http_proxy instead. Don't ask me why this environment variable is lowercase when most others aren't.

Re: iterating over a list as if it were a circular list

2013-03-07 Thread Sven
On 7 March 2013 09:31, Chris Rebert wrote: > On Mar 7, 2013 1:24 AM, "Sven" wrote: > > > > I was wondering what the best approach for the following might be. > > > > Say you have a list P of points and another list N of other items. You > can al

Re: Why is Ruby on Rails more popular than Django?

2013-03-07 Thread Sven
dge) need to learn a language, then a framework. That's quite a time consuming task. Personally I've opted for Django because I've used Python for years. I've written some Ruby in the past, but I not enough to make me choose RoR over Django to get stuff done. -- ./Sven -- http://mail.python.org/mailman/listinfo/python-list

Re: working with dict : incrementing dict dynamically

2013-03-11 Thread Sven
aultdict(int) if region_num == region_num: segments[region_num] += 1 But as John mentioned, your comparison here will always be true, so you will need to fix this to test for your case. -- ./Sven -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem this random seed()

2013-03-19 Thread Sven
ing out at the bottom seem to be related to the timing, specifically now(), which would give you a different result each time. If you print out or inspect the result of expovariate, it should be the same each time you run main. -- ./Sven -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem this random seed()

2013-03-19 Thread Sven
before, where you seeded G.Rnd in the main was fine. I also suggest you change one thing at a time, rather than reworking large parts each iteration. All I was suggesting was a simple print statement in the Run method like you had it before -- ./Sven -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem this random seed()

2013-03-19 Thread Sven
e. Yes, initialise sets it to 0.0, but on execution now will change to the time since initialise(), so you will get varying values. That's my best guess -- ./Sven -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem this random seed()

2013-03-19 Thread Sven
are activated." > > That has nothing to do with the random numbers generated by expovariate(). > > No, but in early versions he was printing out the time (or a time related term) and was wondering why that is different too. -- ./Sven -- http://mail.python.org/mailman/listinfo/python-list

Processing user input as it's entered

2013-03-26 Thread Sven
has finished typing. This is a gui-less CLI tool for python 2.7 I've seen some information on tty.setraw but I'm not sure how you'd go about wiring that up. Thanks -- ./Sven -- http://mail.python.org/mailman/listinfo/python-list

Re: Processing user input as it's entered

2013-03-26 Thread Sven
On 26 March 2013 14:41, Arnaud Delobelle wrote: > On 26 March 2013 10:07, Sven wrote: > > Hello, > > > > Is there a way (ideally cross platform but a *nix OS solution would be > > great) to process user input as they type? > > What I aim to achieve is to coun

Getting USB volume serial number from inserted device on OSX

2013-04-02 Thread Sven
it to work reliably on OS X and installing it wasn't as straightforward as I hoped. I have no requirement to use pyobjc so other suggestions welcome as long as it's straightforward to install and without too many other dependencies. I'd like to keep installation straightforward fo

Re: Getting USB volume serial number from inserted device on OSX

2013-04-03 Thread Sven
Apologies. The main app is in python, and I would like to know any alternative methods to do this in Python on OS X. Doesn't have to use the OS X APIs. I'll try elsewhere too though. Thanks On 3 April 2013 00:37, Ned Deily wrote: > In article > , > Sven wrote: > > I

Re: Getting USB volume serial number from inserted device on OSX

2013-04-05 Thread Sven
ice or use a file system, you aren't supposed to KNOW that there is a > USB device behind it > Indeed. Which means I have a working solution under Linux, but I am struggling to find one under OS X. Looks like I might have to resort to just parsing the USB tree until I find the device t

USBLock : lock/unlock your computer with a USB key

2013-04-08 Thread Sven
nts. Especially OS X and Win support. Repo: https://github.com/Svenito/usblock Thanks for your time. -- ./Sven -- http://mail.python.org/mailman/listinfo/python-list

Re: USBLock : lock/unlock your computer with a USB key

2013-04-11 Thread Sven
t; > On Tue, Apr 9, 2013 at 1:21 AM, Sven wrote: > >> I've been working on a little project and have a working Linux >> implementation so far. Basically it allows a user to use any USB stick as a >> key to lock and unlock their computer. More info in the repo

Re: The node.js Community is Quietly Changing the Face of Open Source

2013-04-16 Thread Sven
plenty of packages in the stdlib that started as outside > "competition". > Even looking at the last year/month might be give skewed results. If a technology is new, there's a lot more packages that need writing than if it's been around for 22 years, thus I'd expect to see the first year or second year as a good comparison point. -- ./Sven -- http://mail.python.org/mailman/listinfo/python-list

urlretrieve get file name

2006-11-09 Thread Sven
. Some hints to point me in the right direction are greatly appreciated. Sven -- http://mail.python.org/mailman/listinfo/python-list

Re: urlretrieve get file name

2006-11-09 Thread Sven
Hello Gabriel, Thanks for your help, but I'm a guy with no luck. :-) I can't get the file name from response header... On Nov 10, 12:39 am, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > At Thursday 9/11/2006 19:11, Sven wrote: > > >I'm wrestling with the u

Re: urlretrieve get file name

2006-11-10 Thread Sven
Thursday 9/11/2006 20:52, Sven wrote: > > >Thanks for your help, but I'm a guy with no luck. :-) I can't get the > >file name from response header...Try using a browser and "Save as..."; if it > >suggests a file name, it > *must* be in the headers - so l

Re: urlretrieve get file name

2006-11-11 Thread Sven
> You can use the geturl() method to obtain the true URL used (that > would behttp://page.com/filename.zip) and then rename the file. Thanks mate, this was exactly what I needed. A realy clean and simple solution to my problem. :-) -- http://mail.python.org/mailman/listinfo/python-list

sending keystrokes to gtk window

2006-01-25 Thread sven
hi list, i'd like to send keystrokes to a (terminal) window. the windowmanager is gnome (ubuntu). what i want to do is to control dvgrab which can be started in interactive mode. thx in advance, sven. -- http://mail.python.org/mailman/listinfo/python-list

subprocess.Popen() output to logging.StreamHandler()

2008-04-10 Thread sven _
solution would be to make a named pipe (os.mkfifo()), have Popen() write to that, and then have some horrendous hack run select() or similar on the fifo to read from it and finally pass it to StreamHandler. Are there better solutions? sven -- http://mail.python.org/mailman/listinfo/python-list

Working around buffering issues when writing to pipes

2008-04-22 Thread sven _
Keywords: subprocess stdout stderr unbuffered pty tty pexpect flush setvbuf I'm trying to find a solution to http://bugs.python.org/issue1241>. In short: unless specifically told not to, normal C stdio will use full output buffering when connected to a pipe. It will use default (typically unbuffer

Difference between mutex.mutex and threading.Lock

2009-12-04 Thread sven
hould also say what to use instead (probably threading.Lock?). Also the "version The" part seems a bit strange. Greetings, Sven -- http://mail.python.org/mailman/listinfo/python-list

Re: Cancelling a python thread (revisited...)

2009-11-08 Thread sven
#x27;t complain too much. At least some volunteers created that great language and gave it away for free :) Thanks again for your suggestion. Cheers, Sven -- http://mail.python.org/mailman/listinfo/python-list

Re: Cancelling a python thread (revisited...)

2009-11-08 Thread sven
or pthread_kill directly from the library. (Most certainly I also have to use ctypes to create my threads to be able to do this.) Cheers, Sven -- http://mail.python.org/mailman/listinfo/python-list

Re: argparse subparser problem

2010-11-18 Thread Sven
arser_stop.add_argument ('stop', action='store_true') parser_stop.set_defaults (func=stop) opt = parser.parse_args (['--version']) -- -- ./Sven -- http://mail.python.org/mailman/listinfo/python-list

Re: Remove whitespaces and line breaks in a XML file

2011-02-11 Thread Sven
according to this http://codespeak.net/lxml/tutorial.html which would do the same, would it not? -- ./Sven-- http://mail.python.org/mailman/listinfo/python-list

Re: How to run another python script?

2011-02-14 Thread Sven
stead of the os module. http://docs.python.org/library/subprocess.html -- ./Sven -- http://mail.python.org/mailman/listinfo/python-list

Development Vs Release

2010-11-10 Thread Sven
ways of doing this? I don't like the idea of flags inside the code as they can often get missed when developers release their code, ending up with released versions that import modules from the developer's working directory. Thanks -- ./Sven -- http://mail.python.org/mailman/listinfo/python-list

Re: Am I The Only One Who Keeps Reading ?Numpy? as ?Numpty??

2010-11-10 Thread Sven
On 2010-11-10 01:53:58 -0500, Lawrence D'Oliveiro said: Sorry... no. -- ./Sven -- http://mail.python.org/mailman/listinfo/python-list

wxPython ListCtrl_edit and TextEditMixin on mac OS X 10.4

2005-08-04 Thread Sven Tissot
following * download and install http://pythonmac.org/packages/TigerPython23Compat.pkg.zip * used multiversion install via adding o import wxversion o wxversion.select("2.6") kind regards, Sven -- http://mail.python.org/mailman/listinfo/python-list

Tiny fonts in wxPython app

2005-04-18 Thread Sven Kobow
Hello, I'm not yet a python programmer but a python user. I faced a problem with tiny fonts in a wxPython app on a GNU/Debian system. Under Gentoo Linux the fonts are displayed in a normal readable size. Only on that Debian system fonts in the whole app are rather tiny. I spend quite a long time g

Re: Tiny fonts in wxPython app

2005-04-18 Thread Sven Kobow
Jeff Reavis wrote: > Sven, > It may be the default gtk font settings. This can be changed in the > .gtkrc file. > > -jjr > I'm not sure but the gnome font in general looks okay? Could be something about proportional fonts? Or maybe a Unicode issue? I read something abo

-2146826246 in win32com.client for empty #N/A cell in Excel

2015-08-16 Thread Sven Boden
depend on that value to decide if a cell is empty. Looked around the net for a solution, but nothing came up so far. Anyone knows how to handle a "#N/A" cell in Excel in the proper way? Regards, Sven -- https://mail.python.org/mailman/listinfo/python-list

Re: -2146826246 in win32com.client for empty #N/A cell in Excel

2015-08-17 Thread Sven Boden
6. Chances are small just > this number will appear in Excel, but it looks dirty to depend on that > value to decide if a cell is empty. Looked around the net for a solution, > but nothing came up so far. > > > > Anyone knows how to handle a "#N/A" cell in Excel in th

Iterating generator from C

2006-06-17 Thread sven . suursoho
Does messing with signal handlers and longjmp affect Python interpreter? I'm trying to find solution for problem, described in http://groups.google.com/group/comp.lang.python/browse_thread/thread/98cbae94ca4beefb/9d4d96fd0dd9fbc3 and came up with test application. It works well but i'm not sure it

Newbie question: PyQt & Form::init()

2006-09-25 Thread Sven Ehret
Hello List, I am trying to learn Python and followed the tutorial at http://www.cs.usfca.edu/~afedosov/qttut/. Being happy that it works, I am now trying to do my own project, but I am having problems with initialization of my form. I want to automatically fill a couple of comboboxes upon startin

Re: Newbie question: PyQt & Form::init()

2006-09-25 Thread Sven Ehret
Diez B. Roggisch wrote: > Sven Ehret wrote: > >> Hello List, >> >> I am trying to learn Python and followed the tutorial at >> http://www.cs.usfca.edu/~afedosov/qttut/. Being happy that it works, I am >> now trying to do my own project, but I am having proble

Re: Newbie question: PyQt & Form::init() SOLVED

2006-09-25 Thread Sven Ehret
Diez B. Roggisch wrote: > Sven Ehret wrote: > >> Diez B. Roggisch wrote: >> >>> Sven Ehret wrote: >>> >>>> Hello List, >>>> >>>> I am trying to learn Python and followed the tutorial at >>>> http://www.cs.usfc

Re: calling ksh script from python

2005-06-04 Thread Sven Mascheck
(fup'2 set) In comp.unix.shell Donn Cave wrote: > Portability [ksh] > "echo" seems to mimic the behavior of sh on its host platform. Rather: both usually mimic echo(1) - some shells even inspect PATH (e.g. /usr/ucb/, /usr/5bin/ vs. /usr/bin/) and act accordingly. -- http://mail.python.org/mailma

find out all threads?

2007-05-11 Thread Sven Rech
Hi, I have a written a C program which makes use of python embedding. I want to find out all threads that a loaded module has started. But I can't find anything about this in the docs. Is it possible? -- http://mail.python.org/mailman/listinfo/python-list

Problems with thread safety

2007-05-12 Thread Sven Rech
Hi, In my C program, I want to use python scripts. This scripts should also have the ability to start threads. So at the initilisation phase I do: PyEval_InitThreads(); PyEval_ReleaseLock(); With the second call I want to release lock, for that the python threads can also do their work. But the

python embedding and threads

2007-01-18 Thread Sven Rech
Hi, I'm the author of an application written in C, which should now be extended with a python plugin system. It already works very good, but I now have a problem: Threading functionality within the python modules, that my C app loads and calls, doesn't work. This means, the threads do not run (t

2.5a1 import of .dlls

2006-04-18 Thread sven . nystrom
I've re-built an extension module (as a .dll) using the 2.5a1 release. Unexpectedly, I'm not able to simply import it (not the way I can when building it for 2.3). Using imp.load_dynamic() the import succeeds. >>> import minx # Implemented in a .dll - fails Traceback (most recent call last):

pythoncode in matlab

2006-05-11 Thread Sven Jerzembeck
Hello guys, is there any possibiliy using Phython code in Matlab. I couldnt find any helpful stuff. Its not graphical stuff I am doing just calculations with arrays and strings. Thanks for answering in advance Sven -- http://mail.python.org/mailman/listinfo/python-list

Iterating generator from C

2006-05-13 Thread Sven Suursoho
, PyInt_AsLong(item)); Py_DECREF(item); } Py_DECREF(gen); Py_DECREF(code); Py_DECREF(globals); Py_Finalize(); return 0; } Br, -- Sven Suursoho -- http://mail.python.org/mailman/listinfo/python-list

Re: Iterating generator from C

2006-05-15 Thread Sven Suursoho
x27;s command-line i.e. no Py_DEBUG and still active asserts(). See: http://archives.postgresql.org/pgsql-patches/2006-05/msg00042.php http://archives.postgresql.org/pgsql-patches/2006-05/msg00105.php -- Sven Suursoho -- http://mail.python.org/mailman/listinfo/python-list

using FFTW3 with Numeric on Windows

2006-05-28 Thread sven koenig
hi list, as the subject says, I'm trying to find a way to use FFTW3 with Numeric arrays. I'm not very familiar with C(++) - I think ctypes is the way to go, but I don't really have a clue how to do it. Has somebody already tried this? thx, sven. -- http://mail.python.org/mailman/

Re: Python surpasses Perl in popularity?

2008-11-30 Thread Sven Mascheck
In comp.unix.shell Stephane CHAZELAS wrote: > The Bourne shell, as can still be found on some systems either in some > non-standard place (/bin on Solaris, /usr/old/bin on HPUX) or named > differently [...] What do you mean with "non-standard place" here? -- http://mail.python.org/mailman/listinf

Python and Glade: window not showing

2009-05-30 Thread Sven Arduwie
): pass I ran this in a terminal on Ubuntu 9.04 like this: s...@dell:~$ cd ./gvfs/python\ on\ sven/ s...@dell:~/gvfs/python on sven$ python ./helloWorld.py s...@dell:~/gvfs/python on sven$ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and Glade: window not showing

2009-05-30 Thread Sven Arduwie
On 30 mei, 17:02, Sven Arduwie wrote: > Can anyone help a python newbie and tell me why the simple window I > created in Glade is not showing? > > This is the XML generated by Glade 3: > > >   >   >   >     True >     >     >       >     >  

Re: Python and Glade: window not showing

2009-05-30 Thread Sven Arduwie
On 30 mei, 21:02, Dave Angel wrote: > Sven Arduwie wrote: > > On 30 mei, 17:02, Sven Arduwie wrote: > > >> Can anyone help a python newbie and tell me why the simple window I > >> created in Glade is not showing? > > >

IDLE 3.0a5 has problems with Unicode

2008-05-11 Thread Sven Siegmund
Hello, I am testing Python 3.0a5's handling of unicode strings. Since SPE is not yet for Python 3.0, I have begun to write in IDLE 3.0a5. I have a source code which IDLE 3.0a5 cannot parse, but Python 3.0a5 can: #!/usr/bin/python # -*- coding: utf-8 -*- def načtiSlovník(zdroj='slovník.txt'):

Re: IDLE 3.0a5 has problems with Unicode

2008-05-11 Thread Sven Siegmund
> I have a source code which IDLE 3.0a5 cannot parse, but Python 3.0a5 > can: Oh I see the posts in this newsgroup do not yet support Unicode. Most of the special characters in my source code have been messed up. But anyway, those who know Czech can handle it. The error is replicable even with the

Re: IDLE 3.0a5 has problems with Unicode

2008-05-11 Thread Sven Siegmund
> No, it's now a known bug (at least I don't know it). Whether or not it > gets fixed might depend on whether or not it gets reported to > bugs.python.org. Ok, I'll repost it there. S. -- http://mail.python.org/mailman/listinfo/python-list

Cannot run Python 3.0a5 )-:

2008-05-12 Thread Sven Siegmund
Hi, I just tried to install Python 3.0a5 an another Windows PC. I did what I have done yesterday at home: 1. Downloaded the daily snapshot http://svn.python.org/snapshots/msi/python-3.0.14011.msi 2. Installed to C:\Python30 3. Added C:\Python30 to the Path environment for all users. when I run p

Re: Cannot run Python 3.0a5 )-:

2008-05-12 Thread Sven Siegmund
Ah, I solved it. I was wrong. I did not do the same as yesterday. Yesterday I downloaded Python 3.0a5 from http://www.python.org/ftp/python/3.0/python-3.0a5.msi and not the daily build. I can python again now (-: S. -- http://mail.python.org/mailman/listinfo/python-list

Cancelling a python thread (revisited...)

2009-11-07 Thread Sven Marnach
es. I would be grateful for any suggestions. Greetings from Germany and have a nice day, Sven -- http://mail.python.org/mailman/listinfo/python-list

argparse: delimiter for argparse list arguments

2021-08-02 Thread Sven R. Kunze
Hi everyone, maybe, I am missing something here but is it possible to specify a delimiter for list arguments in argparse: https://docs.python.org/3/library/argparse.html Usually, '--' is used to separate two lists (cf. git). Cheers, Sven -- https://mail.python.org/mailman/listi

Re: argparse: delimiter for argparse list arguments

2021-08-03 Thread Sven R. Kunze
ction='append') At least from my point of view, I don't any way to separate both lists on this command call: cool-script.py thing1 thing2 stuff1 stuff2 Do I miss something here? Best Sven On 03.08.21 01:49, Dan Stromberg wrote: Isn't -- usually used to signal the end o

Re: [Python-ideas] Inconsistencies

2016-09-11 Thread Sven R. Kunze
on. :) I could not agree more with what you said above, so I hope this will put the discussion in better perspective, especially when people here trying to be overly absolute in their views (which was the quote about). Cheers, Sven -- https://mail.python.org/mailman/listinfo/python-list

Re: Which are best, well-tested ways to create REST services, with Json, in Python?

2016-03-29 Thread Sven R. Kunze
Not heard of any but I can recommend django-restframework. We've got good experience with that. On 28.03.2016 23:06, David Shi via Python-list wrote: Has anyone done a recent reviews of creating REST services, in Python? Regards. David -- https://mail.python.org/mailman/listinfo/python-list

Re: Learning Python (or Haskell) makes you a worse programmer

2016-03-29 Thread Sven R. Kunze
On 29.03.2016 06:13, Michael Torrie wrote: On 03/28/2016 06:44 PM, Steven D'Aprano wrote: http://lukeplant.me.uk/blog/posts/why-learning-haskell-python-makes-you-a-worse-programmer/ I have the same problem as the writer. Working in Python makes me really dislike working in any other language

Re: [OT] C# -- sharp or carp? was Re: Learning Python (or Haskell) makes you a worse programmer

2016-03-29 Thread Sven R. Kunze
On 29.03.2016 11:39, Peter Otten wrote: My question to those who know a bit of C#: what is the state-of-the-art equivalent to "\n".join(foo.description() for foo in mylist if foo.description() != "") Using LINQ, I suppose: https://en.wikipedia.org/wiki/Language_Inte

Re: newbie question

2016-03-29 Thread Sven R. Kunze
On 28.03.2016 17:34, ast wrote: "Matt Wheeler" a écrit dans le message de news:mailman.92.1458825746.2244.python-l...@python.org... On Thu, 24 Mar 2016 11:10 Sven R. Kunze, wrote: On 24.03.2016 11:57, Matt Wheeler wrote: >>>> import ast >>>> s = "

Re: Threading is foobared?

2016-03-29 Thread Sven R. Kunze
't we both already have a conversation about this? I thought it is my thunderbird messing things up. Best, Sven -- https://mail.python.org/mailman/listinfo/python-list

Re: Exclude every nth element from list?

2016-03-29 Thread Sven R. Kunze
On 26.03.2016 18:06, Peter Otten wrote: beliavsky--- via Python-list wrote: I can use x[::n] to select every nth element of a list. Is there a one-liner to get a list that excludes every nth element? del x[::n] ;) Actually quite nice. -- https://mail.python.org/mailman/listinfo/python-list

Re: [OT] C# -- sharp or carp? was Re: Learning Python (or Haskell) makes you a worse programmer

2016-03-29 Thread Sven R. Kunze
On 29.03.2016 12:18, Sven R. Kunze wrote: On 29.03.2016 11:39, Peter Otten wrote: My question to those who know a bit of C#: what is the state-of-the-art equivalent to "\n".join(foo.description() for foo in mylist if foo.description() != "") U

Re: [OT] C# -- sharp or carp? was Re: Learning Python (or Haskell) makes you a worse programmer

2016-03-29 Thread Sven R. Kunze
a, sure. But don't get stuck there. Learn something new from time to time; even a new language. Best, Sven -- https://mail.python.org/mailman/listinfo/python-list

Re: Threading is foobared?

2016-03-30 Thread Sven R. Kunze
On 30.03.2016 01:43, Steven D'Aprano wrote: On Tue, 29 Mar 2016 09:26 pm, Sven R. Kunze wrote: On 27.03.2016 05:01, Steven D'Aprano wrote: Am I the only one who has noticed that threading of posts here is severely broken? It's always been the case that there have been a few

Re: Learning Python (or Haskell) makes you a worse programmer

2016-03-30 Thread Sven R. Kunze
On 30.03.2016 01:29, Eric S. Johansson wrote: On 3/29/2016 6:05 AM, Sven R. Kunze wrote: Python = English As someone who writes English text and code using speech recognition, I can assure you that Python is not English. :-) :D Interesting. Never thought of how Python sounds when spoken

Re: Learning Python (or Haskell) makes you a worse programmer

2016-03-30 Thread Sven R. Kunze
don't know how other English-speaking groups say the word, but in England the first syllable is stressed and the second is the conventional short "uh" sound). TJG I recognize this too. I also started with the England variant but now I am not so sure anymore. :D Sven -- https://mai

Re: Learning Python (or Haskell) makes you a worse programmer

2016-03-30 Thread Sven R. Kunze
On 30.03.2016 12:21, BartC wrote: On 30/03/2016 11:07, Sven R. Kunze wrote: On 30.03.2016 01:29, Eric S. Johansson wrote: On 3/29/2016 6:05 AM, Sven R. Kunze wrote: Python = English As someone who writes English text and code using speech recognition, I can assure you that Python is not

Re: Slice equivalent to dict.get

2016-03-31 Thread Sven R. Kunze
valent for sequences such as lists and tuples is a slice. If the slice is out of range, Python returns a empty sequence: I see what you are trying to achieve here. What do you think about this? [1, 2, 3].get(999, '?') Best, Sven -- https://mail.python.org/mailman/listinfo/python-list

Re: Learning Python (or Haskell) makes you a worse programmer

2016-03-31 Thread Sven R. Kunze
On 31.03.2016 18:30, Travis Griggs wrote: British: http://www.oxforddictionaries.com/definition/english/python American: http://www.dictionary.com/browse/python?s=t That does it. If I ever make some sort of open source module for pythun/pythawn I’ll be sure to call it either tuhmayto/tomawto

Re: Best Practices for Internal Package Structure

2016-04-04 Thread Sven R. Kunze
g each other but have some internals that should not be used outside of them. The _ signifies that actually clearly but it looks weird within the package itself. We haven't found a solution so far. Maybe others do. Best, Sven -- https://mail.python.org/mailman/listinfo/python-list

Re: Best Practices for Internal Package Structure

2016-04-05 Thread Sven R. Kunze
ine to us and as PyCharm tried not to be overly clever when it comes to detecting names, we like the direct way. In case of our PyPI module, usability is really important for newbies and people not using sophisticated IDEs. So, making it really easy for them is a must. :) Best, Sven -- https://mail.python.org/mailman/listinfo/python-list

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

Re: Best Practices for Internal Package Structure

2016-04-05 Thread Sven R. Kunze
ho started it so I take it with a smile. But it's definitely a wart. So, we have a new guideline since then: "empty __init__.py" if possible of course; you sometimes need to collect/do magic imports but that's a separate matter. Best, Sven -- https://mail.python.org/mailman/listinfo/python-list

Re: Best Practices for Internal Package Structure

2016-04-06 Thread Sven R. Kunze
nze/xheap https://github.com/srkunze/fork https://github.com/srkunze/xcache They are small but deserve the same professionalism I daresay. How does PyCharm make the use of many files easier? I'll let Sven answer that one. I don't know, but I've noticed the correlation of habit to IDE. D

Re: Best Practices for Internal Package Structure

2016-04-06 Thread Sven R. Kunze
ll" "I could even squeeze those 14 lines to 10 using dict comprehensions" "that's even more readable; +1 line, that's okay" Life is full of compromises. This guideline is more about discussing, shaping existing code and extracting the essence (with yourself or with colleagues) to keep things on a usable level. Best, Sven -- https://mail.python.org/mailman/listinfo/python-list

How to remove item from heap efficiently?

2016-01-08 Thread Sven R. Kunze
need to remove the very same item from heapB, regardlessly where it is in heapB. And vice versa. Is there a datastructure or a simple trick to achieve that in an efficient matter? Best, Sven -- https://mail.python.org/mailman/listinfo/python-list

Re: How to remove item from heap efficiently?

2016-01-09 Thread Sven R. Kunze
thrown away once they are too long in the queue. On Fri, Jan 8, 2016 at 4:22 AM, Sven R. Kunze wrote: Hi everybody, suppose, I need items sorted by two criteria (say timestamp and priority). For that purpose, I use two heaps (heapq module): heapA # items sorted by timestamp heapB # items

Re: graphs

2016-01-09 Thread Sven R. Kunze
20and%20aggregate.ipynb Best, Sven On 07.01.2016 16:36, Saini, Sakshi wrote: I have a complex dataset and I wish to write a code to create different graphs from it. I was wondering if it is possible for Python/ matplotlib/ seaborn to return a cumulative or mean distribution bar graph based on values in

Re: How to remove item from heap efficiently?

2016-01-09 Thread Sven R. Kunze
Thanks for your reply. On 08.01.2016 14:26, Peter Otten wrote: Sven R. Kunze wrote: Hi everybody, suppose, I need items sorted by two criteria (say timestamp and priority). For that purpose, I use two heaps (heapq module): heapA # items sorted by timestamp heapB # items sorted by priority

Re: How to remove item from heap efficiently?

2016-01-10 Thread Sven R. Kunze
r email. I'm using minimum number has highest priority convention. I like Web technology, so no problem here. :) On Fri, Jan 8, 2016 at 10:15 PM, Sven R. Kunze wrote: Thanks for your suggestion. On 08.01.2016 14:21, srinivas devaki wrote: You can create a single heap with primary key as

  1   2   3   >