Skip to content
Advertisement

Non-blocking console input?

I am trying to make a simple IRC client in Python (as kind of a project while I learn the language). I have a loop that I use to receive and parse what the IRC server sends me, but if I use raw_input to input stuff, it stops the loop dead in its tracks until I input something (obviously). How

HTTPS post login form [closed]

It’s difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago. Trying to find a way to send a POST HTTPS request from Python

Do you know a Python module to read Universal File Format (UFF)? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 2 years ago. Improve this question Google wasn’t my friend this time. This is the closest to

How do I calculate percentiles with python/numpy?

Is there a convenient way to calculate percentiles for a sequence or single-dimensional numpy array? I am looking for something similar to Excel’s percentile function. I looked in NumPy’s statistics reference, and couldn’t find this. All I could find is the median (50th percentile), but not something more specific. Answer You might be interested in the SciPy Stats package. It

Can a decorator of an instance method access the class?

I have something roughly like the following. Basically I need to access the class of an instance method from a decorator used upon the instance method in its definition. The code as-is gives: AttributeError: ‘function’ object has no attribute ‘im_class’ I found similar question/answers – Python decorator makes function forget that it belongs to a class and Get class in

Matplotlib runs out of memory when plotting in a loop

I have a fairly simple plotting routine that looks like this: When I plot this in single iterations, it works fine. However, the moment I put it in a loop, matplotlib throws a hissy fit… This happens on iteration 2 (counting from 1), if that makes a difference. The code is running on Windows XP 32-bit with python 2.5 and

Get the first item from an iterable that matches a condition

I would like to get the first item from a list matching a condition. It’s important that the resulting method not process the entire list, which could be quite large. For example, the following function is adequate: This function could be used something like this: However, I can’t think of a good built-in / one-liner to let me do this.

Why does datetime.datetime.utcnow() not contain timezone information?

Why does this datetime not have any timezone info given that it is explicitly a UTC datetime? I would expect that this would contain tzinfo. Answer That means it is timezone naive, so you can’t use it with datetime.astimezone you can give it a timezone like this now you can change timezones To get the current time in a given

Advertisement