Re: system wide mutex

2014-02-10 Thread Miki Tebeka
IIRC creating a directory is atomic in most environments. On Sunday, February 9, 2014 2:39:51 AM UTC-8, Asaf Las wrote: > Hi > > > > Which one is most recommended to use for mutex alike locking to > > achieve atomic access to single resource: > > > > - fcntl.lockf > > - os.open() with O_

Re: Newbie XML problem

2015-12-21 Thread Miki Tebeka
g = root.find('config[@id="B"]') for panel in cfg.findall('panel'): panels.append([{elem.tag: elem.text} for elem in panel]) You'll need to do some parsing for the coordinates and handle canvas and comments separately. HTH, Miki -- https://mail.python.org/mailman/listinfo/python-list

Re: I can not install matplotlib, numpy, scipy, and pandas.

2016-01-06 Thread Miki Tebeka
> When I enter into the command window "pip install matplotlib", it reads this > below (this is not the full version of it): > ... Installing scientific packages can be a pain. I recommend you take a look at https://www.continuum.io/downloads -- https://mail.python.org/mailman/listinfo/python-l

[ANN] First PyCon Israel (May 2,3)

2016-03-09 Thread Miki Tebeka
/2016/ to see more details. See you there, -- Miki -- https://mail.python.org/mailman/listinfo/python-list

Re: Need Help

2014-12-02 Thread Miki Tebeka
le? We need more information. What is the test suite you're using? How are you running the tests? Example output ... All the best, -- Miki -- https://mail.python.org/mailman/listinfo/python-list

List of "python -m" tools

2015-01-11 Thread Miki Tebeka
Greetings, I've compiled a list of "python -m" tools at pythonwise.blogspot.com/2015/01/python-m.html. Did I miss something? What are your favorite "python -m" tools? Thanks, -- Miki -- https://mail.python.org/mailman/listinfo/python-list

Re: List of "python -m" tools

2015-01-16 Thread Miki Tebeka
Thanks for all the answers! -- https://mail.python.org/mailman/listinfo/python-list

Re: Python IM server

2014-03-31 Thread Miki Tebeka
> I want to develop a instant message server, simply has user and group > entity. > Is there any better existing open-source one? > Thus I can download and have a look. You can take a look at Twisted Words (https://twistedmatrix.com/trac/wiki/TwistedWords). -- https://mail.python.org/mailman/l

[ann] pypi2u - Get notified on new version of packages

2014-04-17 Thread Miki Tebeka
Greetings, http://pypi2u.appspot.com/ is a simple service that notifies you on new versions of packages you're interested in. You can view the code, fill bugs and suggest ideas at https://bitbucket.org/tebeka/pypi2u Hope you find it useful, -- Miki -- https://mail.python.org/mailman/lis

[OT] Testing and credentials best practices?

2014-04-20 Thread Miki Tebeka
control 3. Credentials service (such as ZooKeeper) accessed only from VPN 4. Credentials pre user encrypted (gpg) and stored in source control What method are you using? Are there any best practices in the subject? Thanks, -- Miki -- https://mail.python.org/mailman/listinfo/python-list

Re: [OT] Testing and credentials best practices?

2014-04-21 Thread Miki Tebeka
>> How do you deal with tests (both on dev machine and Jenkins) that need >> credentials (such as AWS keys)?. > I've done several of these. Another option that may work in some > contexts is to mock the test altogether; Thanks, but mocking is last resort for me, it reduces the value of testing gr

Re: Running programs on mobile phones

2014-04-22 Thread Miki Tebeka
> I have seen by chance a number of years ago a book on Python programming > for running on mobile phones (of a certain producer only). What is the > current state of the art in that? Could someone kindly give a few good > literature references? Thanks in advance. I'm not an expert, but take a look

Re: [RELEASED] Python 2.7.7 release candidate 1

2014-05-19 Thread Miki Tebeka
> (If you don't know what the strop > module is, go ahead and forget it now.) +1 QOTW :) -- https://mail.python.org/mailman/listinfo/python-list

Re: daemon thread cleanup approach

2014-05-28 Thread Miki Tebeka
Who is killing the daemon threads? > ... > It it possible that this will cause the program to hang in any case? If due to a bug in the cleanup thread it hangs - the program will hang as well. All the best, -- Miki -- https://mail.python.org/mailman/listinfo/python-list

Re: [argparse] mutually exclusive group with 2 sets of options

2013-08-05 Thread Miki Tebeka
> Is it possible with argparse to have this syntax for a script? > my-script (-a -b VALUE-B | -c -d VALUE-D) > > I would like to do this with the argparse module. You can probably do something similar using sub commands (http://docs.python.org/2/library/argparse.html#sub-commands). -- http://mai

Re: Which DLL did fail to load

2013-08-26 Thread Miki Tebeka
> Wouldn't it > better to add a feature to Python to write the name of DLL which load > has been failed? If you start Python with the -v (verbose) flag, you can see all the calls to dlopen. -- http://mail.python.org/mailman/listinfo/python-list

Re: RELEASED: Python 2.6.9 final

2013-10-29 Thread Miki Tebeka
On Tuesday, October 29, 2013 10:48:58 AM UTC-7, Barry Warsaw wrote: > So too has my latest stint as Python Release Manager. Over the 19 years I > have been involved with Python, Thanks Barry for all the hard work. -- https://mail.python.org/mailman/listinfo/python-list

Did https://pypi.python.org/pypi/ became huge and slow?

2015-03-10 Thread Miki Tebeka
python.org takes 0.209 total) and the size (Content-Length). Anything gone wrong or am I missing something? Thanks, -- Miki -- https://mail.python.org/mailman/listinfo/python-list

Re: Did https://pypi.python.org/pypi/ became huge and slow?

2015-03-10 Thread Miki Tebeka
Thanks Chris, I was hitting the wrong URL by mistake. Didn't think an extra / will make all that difference :) On Tuesday, March 10, 2015 at 2:12:13 PM UTC+2, Chris Angelico wrote: > On Tue, Mar 10, 2015 at 10:55 PM, Steven D'Aprano > wrote: > > Miki Tebeka wro

Re: Flask Post returning error

2015-05-18 Thread Miki Tebeka
> If anyone may kindly suggest what is the error I am doing. It's close to impossible to know without seeing the server side code. -- https://mail.python.org/mailman/listinfo/python-list

Problem with PyPI login

2015-06-17 Thread Miki Tebeka
is linked from "PyPI Support") seems pretty deserted. What is the right location for these kind of issues? Thanks, -- Miki -- https://mail.python.org/mailman/listinfo/python-list

Re: Problem with PyPI login

2015-06-17 Thread Miki Tebeka
> >The forums at https://sourceforge.net/p/pypi/support-requests/ (which is > >linked from "PyPI Support") seems pretty deserted. What is the right > >location for these kind of issues? > That is one place. > https://bitbucket.org/pypa/pypi/issues Thanks! -- https://mail.python.org/mailman/lis

Re: Time saving tips for Pythonists

2015-06-20 Thread Miki Tebeka
> What are your best time saving tips when programming Python? * Use the REPL. Write small chunks of code and test them as you go * Know what's available in the standard library (sets, Counter, deque ...) * Learn how to pick good packages from PyPI (community, last commit ...) * import this -- htt

Re: Who uses IDLE -- please answer if you ever do, know, or teach

2015-08-05 Thread Miki Tebeka
Greetings, > 0. Classes where Idle is used: > Where? At client site. Mostly big companies. > Level? >From beginner to advanced. > Idle users: > 1. Are you > grade school (1=12)? > undergraduate (Freshman-Senior)? > post-graduate (from whatever)? post-graduate > 2. Are you > beginner (1st class,

Re: numpy

2015-09-11 Thread Miki Tebeka
On Thursday, September 10, 2015 at 1:11:59 PM UTC+3, chen...@inhand.com.cn wrote: > hi: > I have to use numpy package. My python runs on my embedded arm > device. So, how do i cross compile numpy? conda has support for ARM - http://continuum.io/blog/new-arch BTW: I suggest you write a better

Re: compiling matplotlib in virtual env

2015-10-01 Thread Miki Tebeka
> I been trying to compile matplotlib in a python3.4 virtual env using > pip version 1.7 on Fedora 22. I am in about 3 weeks learning python > and Django so I am not clear on the error response to: > ... > File "/usr/lib64/python3.4/distutils/version.py", line 343, in _cmp > if self

Re: pyflakes best practices?

2014-06-04 Thread Miki Tebeka
lake8. flake8 supports ignoring certain lines by appending a comment starting with # NOQA HTH, -- Miki -- https://mail.python.org/mailman/listinfo/python-list

Re: Create flowcharts from Python

2014-06-17 Thread Miki Tebeka
> Is there a library for Python that can easily create flowcharts using a > simple API? Maybe https://code.google.com/p/pydot/ ? -- https://mail.python.org/mailman/listinfo/python-list

Re: Installing Python 2.6.2 on Ubuntu 12.1

2014-07-21 Thread Miki Tebeka
he developer libraries for that (including the C header files). IIRC "sudo apt-get build-dep python" should install all the required packages. HTH, -- Miki -- https://mail.python.org/mailman/listinfo/python-list

Re: How to install data analysis pandas toolkit?

2014-07-23 Thread Miki Tebeka
Greetings, > >>> import pandas as pd > > No module named numpy I find the most painless way of installing the Python scientific stack is using Anaconda http://continuum.io/downloads HTH, -- Miki -- https://mail.python.org/mailman/listinfo/python-list

Re: NameError: name 'requests' is not defined ?

2014-07-27 Thread Miki Tebeka
sts' is not defined You need to call mydown.requests, but I think you're missing the point of modules and imports. I suggest you go over https://docs.python.org/3.4/tutorial/ HTH, -- Miki -- https://mail.python.org/mailman/listinfo/python-list

Re: Load a CSV with different row lengths

2014-07-29 Thread Miki Tebeka
ow + ([None] * (max_length - len(line)) max_length = 10 with open('data.csv') as fo: df = pd.DataFrame.from_records(gen_rows(fo, max_length)) HTH, Miki -- https://mail.python.org/mailman/listinfo/python-list

"Fuzzy" Counter?

2014-09-23 Thread Miki Tebeka
Greetings, Before I start writing my own. Is there something like collections.Counter (fore frequencies) that does "fuzzy" matching? Meaning x is considered equal to y if abs(x - y) < epsilon. (x, y and my case will be numpy.array). Thanks, -- Miki -- https://mail.python.org/mai

Re: "Fuzzy" Counter?

2014-09-23 Thread Miki Tebeka
On Tuesday, September 23, 2014 4:37:10 PM UTC+3, Peter Otten wrote: > x eq y > y eq z > not (x eq z) > > where eq is the test given above -- should x, y, and z land in the same bin? Yeah, I know the counting depends on the order of items. But I'm OK with that. -- https://mail.python.org/mailman/

Re: "Fuzzy" Counter?

2014-09-23 Thread Miki Tebeka
On Tuesday, September 23, 2014 7:33:06 PM UTC+3, Rob Gaddi wrote: > While you're at it, think > long and hard about that definition of fuzziness. If you can make it > closer to the concept of histogram "bins" you'll get much better > performance. The problem for me here is that I can't determin

Re: "Fuzzy" Counter?

2014-09-26 Thread Miki Tebeka
Greetings, On Wednesday, September 24, 2014 5:57:15 PM UTC+3, Ian wrote: > Then your result depends on the order of your input, which is usually > not a good thing. As stated in previous reply - I'm OK with that. > Why would you need to determine the *number* of bins in advance? You > just need t

Re: Error from pandas.io.data import DataReader

2014-10-02 Thread Miki Tebeka
io.data import DataReader > > ImportError: No module named pandas.io.data * Do you have pandas installed? (Does "import pandas" work?) * If it is installed, what version do you have? ( "print(pandas.__version__") HTH, -- Miki -- https://mail.python.org/mailman/listinfo/python-list

Re: Recommended hosting

2014-10-03 Thread Miki Tebeka
free for small-ish sites and removes a lot of operations headache. All the best, -- Miki -- https://mail.python.org/mailman/listinfo/python-list

Re: can't generate iterator from list

2011-09-09 Thread Miki Tebeka
1. Can you post the code somewhere where it's indented properly? (http://paste.pocoo.org/) 2. In the list example you call balls_in_numbered_boxes(2, [3,3,3]) but in the interactive example you call balls_in_numbered_boxes(3,[3,3,3]) -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I automate the removal of all non-ascii characters from my code?

2011-09-12 Thread Miki Tebeka
You can add "# coding=UTF8" to the top of your file (see http://www.python.org/dev/peps/pep-0263/). Of you want to remove unicode, there are several options, one of them is passing the file through "iconv --to ascii". -- http://mail.python.org/mailman/listinfo/python-list

Re: Easiest framework to develop simple interactive web site in python?

2011-09-12 Thread Miki Tebeka
I personally like CherryPy. But it all depends on your needs and style. I suggest you play with some of the packages and select one that you feel best with. -- http://mail.python.org/mailman/listinfo/python-list

Re: problem:import csv data

2011-09-13 Thread Miki Tebeka
.separator (and .import) are not SQL commands but "sqlite3" commands. You can get the same effect with the following code: with open('/tmp/data.csv') as fo: reader = csv.reader(fo) cur.executemany('INSERT INTO quote VALUES (?, ?, ?, ?, ?, ?, ?)')

Re: cause __init__ to return a different class?

2011-09-15 Thread Miki Tebeka
I'd go for a factory function (http://en.wikipedia.org/wiki/Factory_method_pattern): def create(foo): return Child(foo) if foo else Parent() -- http://mail.python.org/mailman/listinfo/python-list

Re: parse html:what is the meaning of "//"?

2011-09-16 Thread Miki Tebeka
As a side note, it's way easier to get this data using YQL. See for example: http://developer.yahoo.com/yql/console/?q=show%20tables&env=store://datatables.org/alltableswithkeys#h=SELECT%20*%20FROM%20yahoo.finance.options%20WHERE%20symbol%3D%27C%27%20AND%20expiration%3D%272011-09%27 Which gives y

Re: Strange Python internal error

2011-09-16 Thread Miki Tebeka
Try to narrow it down: from extension import Template from extension import Syntax from extension import processcmd Which one fails? What is this "extension" package? -- http://mail.python.org/mailman/listinfo/python-list

Re: [ANNC] pynguin-0.12 (fixes problems running on Windows)

2011-09-22 Thread Miki Tebeka
Thank you! My kids *love* it. -- http://mail.python.org/mailman/listinfo/python-list

Re: options for plotting points on geographic map

2011-09-29 Thread Miki Tebeka
Probably the google maps routes will be faster (maybe using embedded webkit window). However it requires internet connection. See also http://www.scipy.org/Cookbook/Matplotlib/Maps HTH -- Miki Tebeka http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: eggbasket

2011-10-04 Thread Miki Tebeka
> How is it possible that the module exists and it's actually imported, > and not found when I actually try to import something from it? Do you have a local file/directory that is called sqlalchemy? -- http://mail.python.org/mailman/listinfo/python-list

L.A. user group?

2011-10-06 Thread Miki Tebeka
Greetings, Is there an L.A. Python user group out there? Thanks, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: passing multiple string to a command line option

2011-10-06 Thread Miki Tebeka
As far as I see, the problem is not in the command line but in system.cpu[i].workload = process[i] call tree. Without seeing the code of SimObject and params I can't tell much more. -- http://mail.python.org/mailman/listinfo/python-list

Re: L.A. user group?

2011-10-06 Thread Miki Tebeka
Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: passing multiple string to a command line option

2011-10-07 Thread Miki Tebeka
Seems like self.ptype is a type that has __init__ with no arguments (other than self). You can add "print type(self.ptype)" as first line of "convert" to see what type it is (or place a breakpoint there). -- http://mail.python.org/mailman/listinfo/python-list

Re: PDB command <-> variable clashes

2011-10-08 Thread Miki Tebeka
If you want to view the variable, use the "p" (print) command. Then there is no name clash. -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for browser emulator

2011-10-13 Thread Miki Tebeka
IIRC mechanize can do that. -- http://mail.python.org/mailman/listinfo/python-list

Re: Something works in Python but not in cgi.

2011-10-14 Thread Miki Tebeka
The working directory of the webserver is probably not the one of the script. You should specify full path to the file. One way to do it is: from os.path import dirname, join filename = join(dirname(__file__), 'gri30.cti') HTH -- Miki Tebeka http://pythonwise.blogspot.com

Re: How to generate error when argument are not supplied and there is no explicit defults (in optparse)?

2011-10-14 Thread Miki Tebeka
Don't specify it as an option, but as an argument. If you're on a new version of python, you should probably use argparse. -- http://mail.python.org/mailman/listinfo/python-list

Re: python.org appears to be down

2011-10-17 Thread Miki Tebeka
http://www.isup.me/python.org ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: spawnl issues with Win 7 access rights

2011-10-24 Thread Miki Tebeka
Please use the subprocess module, it's the one who's actively maintained. http://docs.python.org/library/subprocess.html#replacing-the-os-spawn-family -- http://mail.python.org/mailman/listinfo/python-list

Re: sending more then 2 messages at a time to a SocketServer fails

2011-11-01 Thread Miki Tebeka
MKTest.getObj(data[0]) will return the same object on every call(with the same data that was initialized 1'st time). Any Daten parameter after the 1'st call is ignored. -- http://mail.python.org/mailman/listinfo/python-list

Re: Sort items in wxListCtrl

2011-11-01 Thread Miki Tebeka
Why not use the build in wx.FileDialog? Also, have a look at the demo that comes with wxPython. It has an example with a sortable list control. -- http://mail.python.org/mailman/listinfo/python-list

Re: parsing text from "ethtool" command

2011-11-01 Thread Miki Tebeka
In my box, there are some spaces (tabs?) before "Speed". IMO re.search("Speed", line) will be a more robust. -- http://mail.python.org/mailman/listinfo/python-list

Re: Sort items in wxListCtrl

2011-11-02 Thread Miki Tebeka
wx.FileDialog shows files and directories. If you need the user to pick one, this is the standard way. Otherwise, if you need custom view on the file system then probably list control is the right way to go. Again, the demo has a working example with sortable list control. -- http://mail.python

Re: Sort items in wxListCtrl

2011-11-02 Thread Miki Tebeka
You probably want wx.EVT_LEFT_DCLICK, see the ListCtrl demo in the wx demo. -- http://mail.python.org/mailman/listinfo/python-list

Re: SMS api for python

2011-11-11 Thread Miki Tebeka
You can use services like https://www.tropo.com/home.jsp or http://www.twilio.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: my new project, is this the right way?

2011-11-14 Thread Miki Tebeka
> since i'm mostly a new-bye for as regard databases, my idea is to use > sqlite at the beginning. > > Is that ok? I think sqlite3 makes sense since it's already there and has SQL interface. > is there any general tutorial of how to start developing a database? i > mean a general guide to data

Re: Multiple threads

2011-11-16 Thread Miki Tebeka
You can see an example on how to use multiprocessing.Pool at http://pythonwise.blogspot.com/2011/03/convert-oggs-to-mp3-fast-way.html This is ogg -> mp3 but the same idea. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there any way to unimport a library

2011-11-20 Thread Miki Tebeka
del sys.modules['my-module'] However if your module imported other modules, they'll still be there. If there are references to objects your module created, they'll still be there. A better option IMO is to use imp.find_module and then import. -- http://mail.python.org/mailman/listinfo/python-lis

Re: String splitting by spaces question

2011-11-23 Thread Miki Tebeka
http://docs.python.org/library/shlex.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Tree data structure with: single, double and triple children option along with AVM data at each node

2011-11-24 Thread Miki Tebeka
There a many ways to do this, here's one: from collections import namedtuple Tree = namedtuple('Tree', ['feature', 'children']) t = Tree(1, [Tree('hello', []), Tree(3, [])]) -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get path to Python standard library directory?

2011-11-25 Thread Miki Tebeka
You can try PYLIB = $(shell python -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib()') (or pack the long command line in a script). -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting MS Access DB to Postgres or MySQL for ORM support with SQLalchemy

2011-11-30 Thread Miki Tebeka
You can read data using win32com (ADODB?) and then write it to the desired database using the right package (psycopg2 ...). See example for reading data at http://mail.python.org/pipermail/python-win32/2006-March/004420.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Need some IPC pointers

2011-11-30 Thread Miki Tebeka
There are two different problems. One is the medium to pass messages, sockets are good but there are other options and depends on your requirement you need to pick the best one. The other is serialization format, here you have marshal, pickle, JSON, XML and more. For me JSON over sockets works

Re: Passing along cmd.Cmd completion to contained class

2011-12-02 Thread Miki Tebeka
This is not tested, but maybe it'll work :) def complete(self, text, state): if text.startswith('config): return self.config.complete(text, state) return Cmd.complete(self, text, state) -- http://mail.python.org/mailman/listinfo/python-list

[OT] Book authoring

2011-12-08 Thread Miki Tebeka
Greetings, Any recommendations for a book authoring system that supports the following: 1. Code examples (with syntax highlighting and line numbers) 2. Output HTML, PDF, ePub ... 3. Automatic TOC and index 4. Search (in HTML) - this is a "nice to have" Can I somehow use Sphinx? Thank

Re: replacing timestamps in file [newbie]

2011-12-14 Thread Miki Tebeka
You can either work with datetime module (see datetime.datetime.strptime) or with the time module (see time.strptime and time.mktime) -- http://mail.python.org/mailman/listinfo/python-list

Re: test for list equality

2011-12-15 Thread Miki Tebeka
> My sort issue... as in this doesn't work > >>> if x.sort == y.sort: You're missing the () to make it a function call. Also list.sort() returns none, it mutates the original list. You can either sorted(x) == sorted(y) or set(x) == set(y) -- http://mail.python.org/mailman/listinfo/python-l

Re: test for list equality

2011-12-15 Thread Miki Tebeka
> > set(x) == set(y) > > Duplicates cause issues in the set() version: You're right, I stand corrected. -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing stream of JSON objects incrementally

2011-12-19 Thread Miki Tebeka
You probably need to accumulate a buffer and try to decode it, when succeeded return the object and read more. See example below (note that for sockets select might be a better option for reading data). import json from time import sleep def json_decoder(fo): buff = '' decode = json.JSO

Re: Python education survey

2011-12-20 Thread Miki Tebeka
I've tried several things. So far vim (with line numbers) to show the code and then ipython to run it works great. Another option I tried once was Aptana, since most people in my company know eclipse this was good for them. It has most (all?) of the features you mentioned above. -- http://mail

Re: Need advice on the design of my application

2011-12-21 Thread Miki Tebeka
I'd say go with option 1. Pass the window handler (or DC) to the rendered thread. To overcome the GIL problem, you can use Py_BEGIN_ALLOW_THREADS (see http://docs.python.org/release/1.5.2/api/threads.html) -- http://mail.python.org/mailman/listinfo/python-list

Re: Daemon management

2011-12-27 Thread Miki Tebeka
What was the term you used to search? Since http://pypi.python.org/pypi/ingress/0.1.1 seems to fit your description. -- http://mail.python.org/mailman/listinfo/python-list

Re: .format vs. %

2012-01-01 Thread Miki Tebeka
> >>> s = "{0} {1} {2} {3}" > >>> s.format(1, 2, 3, 4) > '1 2 3 4' Or even In [4]: fmt = '{0} {1} {2} {3}'.format In [5]: print(fmt(1, 2, 3, 4)) 1 2 3 4 -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with python-list archives

2012-01-05 Thread Miki Tebeka
Is there Google groups search not good enough? (groups.google.com/group/comp.lang.python) Also, can you give an example of the code and an input file? -- http://mail.python.org/mailman/listinfo/python-list

Re: codecs in a chroot / without fs access

2012-01-10 Thread Miki Tebeka
Another option is to copy the data to the a location under the new chroot and register a new lookup functions (http://docs.python.org/library/codecs.html#codecs.register). This way you can save some memory. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a graphical GUI builder?

2013-02-19 Thread Miki Tebeka
> I'm wondering if there's a utility for Python to build GUIs. IIRC the Qt builder can generate Python code. -- http://mail.python.org/mailman/listinfo/python-list

Re: itertools.filterfalse - what is it good for

2013-03-09 Thread Miki Tebeka
> can anybody point out a situation where you really need > itertools.filterfalse() ? Sometimes you get the predicate as a parameter to another function. This way if you want to filter out things you can easily do it. Other language (such as Clojure) have a "complement" function that removes th

Re: Top 10 python features

2013-03-17 Thread Miki Tebeka
> I would like to know what are the top 10 most important features (on your > opinion) in python. You're in luck :) Raymond Hettinger just gave "Python is Awesome" keynote at PyCon. You can view the slides at https://speakerdeck.com/pyconslides/pycon-keynote-python-is-awesome, video will follow

Re: Binary for numpy 1.7.0 with Python 2.7.3

2013-03-21 Thread Miki Tebeka
> I'm trying to update to both 2.7.3 and Numpy 1.7.0. Updating Python is from python.org If you're on 64bit windows, see http://www.lfd.uci.edu/~gohlke/pythonlibs/ -- http://mail.python.org/mailman/listinfo/python-list

Re: No errors displayed but i blank scren nstead.

2013-03-28 Thread Miki Tebeka
> Fianlly my cgi .py script doesnt produce any more errors, i think i ahve > correct them but it present a blank screen > Any idea why? Please post the code to the script, otherwise we can't help you. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to find bad row with db api executemany()?

2013-03-30 Thread Miki Tebeka
> I can catch the exception, but don't see any way to tell which row caused the > problem. Is this information obtainable, short of retrying each row one by > one? One way to debug this is to wrap the iterable passed to executemany with one that remembers the last line. Something like: cla

Re: Newbie to python. Very newbie question

2013-04-07 Thread Miki Tebeka
error. Why do you need the 2'nd part. In general, we're moving to list/generator comperhension over map/filter. Something like: print(sum(x*x for x in xrange(10**6) if (x*x)%2)) HTH, Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie to python. Very newbie question

2013-04-07 Thread Miki Tebeka
> I can't even read that mess... three nested lambda? I have to say this and other answers in this thread seem not that friendly to me. The OP said it's a newbie question, we should be more welcoming to newcomers. -- http://mail.python.org/mailman/listinfo/python-list

Re: CSV to matrix array

2013-04-12 Thread Miki Tebeka
> I have a CSV file with 20 rows and 12 columns and I need to store it as a > matrix. If you can use pandas, the pandas.read_csv is what you want. -- http://mail.python.org/mailman/listinfo/python-list

Re: [ANNC] pynguin-0.14 python turtle graphics application

2013-04-13 Thread Miki Tebeka
> Pynguin is a python-based turtle graphics application. I wonder why Pynguin does not get more traction in the teaching sector. Looks ideal for teaching kids. -- http://mail.python.org/mailman/listinfo/python-list

Encoding NaN in JSON

2013-04-16 Thread Miki Tebeka
Greetings, I'm trying to find a way to have json emit float('NaN') as 'N/A'. I can't seem to find a way since NaN is a float, which means overriding "default" won't help. Any simple way to do this? Thanks, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: Encoding NaN in JSON

2013-04-17 Thread Miki Tebeka
>> I'm trying to find a way to have json emit float('NaN') as 'N/A'. > No. There is no way to represent NaN in JSON. It's simply not part of the > specification. I know that. I'm trying to emit the *string* 'N/A' for every NaN. -- http://mail.python.org/mailman/listinfo/python-list

Re: Encoding NaN in JSON

2013-04-17 Thread Miki Tebeka
> >>> I'm trying to find a way to have json emit float('NaN') as 'N/A'. > Easiest way is probably to transform your object before you try to write Yeah, that's what I ended up doing. Wondered if there's a better way ... Thanks, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: Encoding NaN in JSON

2013-04-17 Thread Miki Tebeka
[Roland] > yes, there is: subclass+extend the JSON-encoder, see pydoc json. Please read the original post before answering. What you suggested does not work since NaN is of float type. -- http://mail.python.org/mailman/listinfo/python-list

Re: Encoding NaN in JSON

2013-04-19 Thread Miki Tebeka
> > You understand that this will result in a chunk of text that is not JSON? > I think he means something like this: > >>> json.dumps([float('nan')]) > '["N/A"]' That's exactly what I mean :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Using SciPy in application

2013-04-24 Thread Miki Tebeka
> I want to use spline interpolation function from SciPy in an application and > at the same time, I don't want the end user to have to install SciPy > separately. You can pack you application with py2exe, pyinstaller ... and then they won't even need to install Python. Another option (which is

<    1   2   3   4   5   6   >