Re: how to pass "echo t | " input to subprocess.check_output() method

2012-11-28 Thread Miki Tebeka
On Wednesday, November 28, 2012 4:38:35 AM UTC-8, dach...@gmail.com wrote: > Thanks.. Creating two subprocesses worked for me. I did the code as below, Glad it worked. -- http://mail.python.org/mailman/listinfo/python-list

Re: "non central" package management

2012-11-28 Thread Miki Tebeka
On Tuesday, November 27, 2012 8:45:56 PM UTC-8, Roy Smith wrote: > In the future, the plan is to build a complete fresh virtualenv for > every deployment. But we're not there yet. Maybe a repository of virtualenvs, then when deploying you can see if there's one the matches what you need and use

Re: Python Cluster

2012-12-04 Thread Miki Tebeka
option is to use a scatter plot with different color per cluster. See the many examples in http://matplotlib.org/gallery.html. HTH, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: Help "joining" two files delimited with pipe character ("|")

2012-12-05 Thread Miki Tebeka
On Wednesday, December 5, 2012 9:57:31 AM UTC-8, Daniel Doo wrote: > I am new to Python.  Is there a method to “join” two pipe delimited files > using a unique key that appears in both files?  Have a look at Panda's concat (http://pandas.pydata.org/pandas-docs/dev/merging.html). It also have util

Re: Remote server: running a Python script and making *.csv files publicly available

2012-12-05 Thread Miki Tebeka
On Wednesday, December 5, 2012 11:14:42 AM UTC-8, Jason Hsu wrote: > make the *.csv files publicly available to read. > Can this be done on Heroku? I've gone through the tutorial, but it seems to > be geared towards people who want to create a whole web site. See one option - http://stackoverfl

Re: mini browser with python

2012-12-05 Thread Miki Tebeka
> In other words I need a mini, simple browser; > something I can build that will open, read and > display a saved html file. If you want to view the "raw" HTML, use any editor. If you want to view the rendered HTML (like in a browser), you can point your favorite browser to a local file or use

Re: Cosine Similarity

2012-12-06 Thread Miki Tebeka
import numpy as np def cos(v1, v2): return np.dot(v1, v2) / (np.sqrt(np.dot(v1, v1)) * np.sqrt(np.dot(v2, v2))) HTH, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: Running a Python app on a remote server and displaying the output files

2012-12-09 Thread Miki Tebeka
On Saturday, December 8, 2012 12:22:35 PM UTC-8, Jason Hsu wrote: > 1. How do I run my Python script in Google App Engine and make the output > results.csv file publicly available? Probably https://developers.google.com/appengine/docs/python/blobstore/, however https://developers.google.com/app

Re: Help with unittest2

2012-12-13 Thread Miki Tebeka
On Thursday, December 13, 2012 7:03:27 AM UTC-8, Daniel Laird wrote: > I do am import unittest2 as unittest > NameError: global name 'assertListEqual' is not defined According to the docs (http://docs.python.org/2/library/unittest.html#unittest.TestCase.addTypeEqualityFunc) assertListEqual and f

Re: [newbie] plotting pairs of data

2012-12-19 Thread Miki Tebeka
On Wednesday, December 19, 2012 6:38:30 AM UTC-8, Thomas Bach wrote: > On Wed, Dec 19, 2012 at 05:47:30AM -0800, hugocoolens wrote: > > ['0.0364771 0.55569', '0.132688 0.808496', '0.232877 0.832833', > > '0.332702 0.849128', '0.432695 0.862158'] > xs = [ float(x) for x, _ in map(str.split, l) ] > y

Re: Build and runtime dependencies

2012-12-20 Thread Miki Tebeka
On Thursday, December 20, 2012 2:11:45 PM UTC-8, Jack Silver wrote: > I have two Linux From Scratch machine. > Hence, I do not need to install all those libraries on the client machine. > Right ? It depends on what the client needs. For example if you use zlib compression in the protocol, you'll

Re: compile python 3.3 with bz2 support

2012-12-22 Thread Miki Tebeka
On Thursday, December 20, 2012 10:27:54 PM UTC-8, Isml wrote: >     I want to compile python 3.3 with bz2 support on RedHat 5.5 but fail to > do that. Here is how I do it: >     1. download bzip2 and compile it(make、make -f Makefile_libbz2_so、make > install) Why can't you use yum? (yum install li

Re: Newbie problem with Python pandas

2013-01-06 Thread Miki Tebeka
On Sunday, January 6, 2013 5:57:17 AM UTC-8, RueTheDay wrote: > I am getting the following error when running on Python 2.7 on Ubuntu > 12.04: > >> > > AttributeError: 'Series' object has no attribute 'str' I would *guess* that you have an older version of pandas on your Linux machine. Try "p

Re: Newbee question about running a script

2013-01-06 Thread Miki Tebeka
On Sunday, January 6, 2013 8:03:43 AM UTC-8, marc.assin wrote: > I wonder how I could specify a parameter on the command line from > within the interpreter. Guido wrote some advice a while back - http://www.artima.com/weblogs/viewpost.jsp?thread=4829 Import your module and call its main. The oth

Re: How to get the selected text of the webpage in chrome through python ?

2013-01-08 Thread Miki Tebeka
On Monday, January 7, 2013 8:20:28 PM UTC-8, iMath wrote: > How to get the selected text of the webpage in chrome through python ? You can probably use selenium to do that. -- http://mail.python.org/mailman/listinfo/python-list

Re: The best, friendly and easy use Python Editor.

2013-01-25 Thread Miki Tebeka
On Thursday, January 24, 2013 2:34:45 AM UTC-8, mik...@gmail.com wrote: > On Thursday, January 24, 2013 9:43:31 AM UTC, Hazard Seventyfour wrote: > > for all senior can you suggest me the best, friendly and easy use with nice > > GUI editor for me, and have many a good features such as auto comple

Re: Patching CGIHTTPServer.py

2012-01-28 Thread Miki Tebeka
IMO the code is good enough to submit a patch. -- http://mail.python.org/mailman/listinfo/python-list

Re: PyPI - how do you pronounce it?

2012-01-28 Thread Miki Tebeka
cheeseshop :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Disable use of pyc file with no matching py file

2012-01-30 Thread Miki Tebeka
Not that I'm aware of. I have a script that run the test suite, one of the first commands (before calling nosetests) is: find . -name '*.py[co]' -exec rm {} \; This makes sure the tests run in a "clean" environment. -- http://mail.python.org/mailman/listinfo/python-list

Re: simple system for building packages for multiple platforms?

2012-02-02 Thread Miki Tebeka
IMO you can have different versions of Python on the same machine. So it's two windows machines. (Assuming you're going with *one* OS version :) Also note there is some legal mambo jumbo around distributing MSVC DLLs (unless you plan to use mingw). -- http://mail.python.org/mailman/listinfo/pyt

Re: undefined symbol: PyUnicodeUCS4_AsUTF8String

2012-02-06 Thread Miki Tebeka
IIRC it means that cairo was compiled against a Python compiled with --enable-unicode=ucs4. But the version of Python you have was not (default is ucs2). Maybe you can find a different version/packaging of cairo that matches this. -- http://mail.python.org/mailman/listinfo/python-list

Re: package extension problem

2012-02-13 Thread Miki Tebeka
> B[some_hash] still returns an instance of the old class A, while I want an instance of the new class A. I don't understand this sentence. How does B[some_hash] related to A? I've tried the below and it seems to work. Can you paste some code to help us understand more? -- old.py -- class A:

Re: package extension problem

2012-02-13 Thread Miki Tebeka
> import new_pandas as np > df = np.DataFrame({'A':[1,2,3],'B':[4,5,6]}) > col_A = df['A'] I'm not familiar with pandas, but my *guess* will be that you'll need to override __getitem__ in the new DataFrame. -- http://mail.python.org/mailman/listinfo/python-list

Re: TEST AN EXECUTABLE PYTHON SCRIPT SPEED UNDER A PYTHON SHELL

2012-02-15 Thread Miki Tebeka
It depends on the overall runtime of the script vs start time of the vm. But yes in most benchmarks the script start time will bias against scripted languages. On a site note: ALL CAPS is considered shouting, please don't use that in news groups. -- http://mail.python.org/mailman/listinfo/pyth

Re: atexit.register in case of errors

2012-02-15 Thread Miki Tebeka
Another option is to use a global error flag and set it in sys.excepthook (see http://docs.python.org/library/sys.html#sys.excepthook). goodbye will check the error flag and skip execution if error flag is set. -- http://mail.python.org/mailman/listinfo/python-list

Re: generate Windows exe on Linux

2012-02-22 Thread Miki Tebeka
> Having said that, Wine is actually surprisingly capable these days. It > won't always run the latest release of our all-time favourite WYGIWYD > character pushing or number layouting programs from MS-Office fame, but at > least older versions of many a program tend to work rather nicely. Even new

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-24 Thread Miki Tebeka
float('infinity') should be good enough. -- http://mail.python.org/mailman/listinfo/python-list

Re: steps to solve bugs

2012-03-10 Thread Miki Tebeka
help us help you more. All the best, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

elasticsearch client

2012-03-17 Thread Miki Tebeka
Greetings, I see several elasticsearch clients on PyPI, any recommendations? Thanks, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

Python Gotcha's?

2012-04-04 Thread Miki Tebeka
Greetings, I'm going to give a "Python Gotcha's" talk at work. If you have an interesting/common "Gotcha" (warts/dark corners ...) please share. (Note that I want over http://wiki.python.org/moin/PythonWarts already). Thanks, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Gotcha's?

2012-04-05 Thread Miki Tebeka
> Now, if you wish to boggle your mind about something pythonic, how about > mutexes not being thread safe (http://bugs.python.org/issue1746071)? This is and old and deprecated module, you should not use it. Use http://docs.python.org/library/threading.html#threading.Lock and friends instead. I

Re: Python Gotcha's?

2012-04-08 Thread Miki Tebeka
> 8. Opening a URL can result in an unexpected prompt on > standard input if the URL has authentication. This can > stall servers. Can you give an example? I don't think anything in the standard library does that. -- http://mail.python.org/mailman/listinfo/python-list

Re: Question on Python 3 shell restarting

2012-04-09 Thread Miki Tebeka
> How may I get a fresh Python shell with Idle 3.2 ? Open the configuration panel (Options -> Configure IDLE). Look in the "Keys" tab for the shortcut to "restart-shell" HTH -- Miki Tebeka http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Library or Module for clipping audio files

2012-04-11 Thread Miki Tebeka
> I'm trying to find a good python library/module that will allow me to > clip audio files, preferably mp3/ogg format. Does anyone have any good > suggestions? I never used it, but I think pymedia might fit the bill. -- http://mail.python.org/mailman/listinfo/python-list

Re: python module development workflow

2012-04-11 Thread Miki Tebeka
> Could any expert suggest an authoritative and complete guide for > developing python modules? Thanks! I'd start with http://docs.python.org/distutils/index.html -- http://mail.python.org/mailman/listinfo/python-list

Re: system call that is killed after n seconds if not finished

2012-04-18 Thread Miki Tebeka
> I would like to execute shell commands, but only if their execution > time is not longer than n seconds. Like so: See example at http://docs.python.org/library/signal.html#example -- http://mail.python.org/mailman/listinfo/python-list

Re: Suggest design to accomodate non-unix platforms ?

2012-04-18 Thread Miki Tebeka
> So I'm interested in suggestions/examples where a user can update a > config file to specify by which means they want (in this case) the ssh > functionality to be supplied. You can do something like that (it's called a factory): COMMANDS = { 'win32': 'win32 command goes here', 'linux2':

Re: Communication between C++ server and Python app

2012-04-30 Thread Miki Tebeka
> > I've got a server process written in C++ running on Unix machine. > > On the same box I'd like to run multiple Python scripts that will > > communicate with this server. > > > > Can you please suggest what would be best was to achieve this ? As said before, there are many options. Here are som

Re: key/value store optimized for disk storage

2012-05-03 Thread Miki Tebeka
might find that for a little effort you get enough out of one of these. Another module which is not in the standard library is hdf5/PyTables and in my experience very fast. HTH, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: which book?

2012-05-14 Thread Miki Tebeka
> I am going to learn python for some plot issues. which book or sources, do > you recommend please? The tutorial is pretty good if you already know how to program. I also heard a lot of good things on "Python Essential Reference". -- http://mail.python.org/mailman/listinfo/python-list

Re: Sharing Data in Python

2012-05-14 Thread Miki Tebeka
> How can I make it so, all new python process share this data, so it is only > loaded a single time into memory? You can have one process as server and client ask for parts of data. You might be able to do something smart with mmap but I can't think of a way. I Linux systems, if you first load t

Re: ucs2 and ucs4 python

2012-05-15 Thread Miki Tebeka
* Run the following commands in the Terminal window - sudo apt-get build-dep python - tar -xjf Python-2.7.3.tar.bz2 - cd Python-2.7.3 - ./configure --prefix=/opt --enable-unicode=ucs2 && make - sudo make install * Now you should have /opt/bin/python with ucs2 HTH --

argparse - option with optional value

2012-05-17 Thread Miki Tebeka
;vim') However I get a feeling there's a better way to do that. Any ideas? Thanks, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: argparse - option with optional value

2012-05-18 Thread Miki Tebeka
> There is a built-in “no value specified” value in Python: the None > singleton. The ‘argparse’ library uses this for the argument default > already, so you don't need to fuss with your own special handling > http://docs.python.org/library/argparse.html#default>. The problem with this approach is

Re: Plot a function with matplotlib?

2012-05-19 Thread Miki Tebeka
from some default, or better still, > automatically calculated so one point is calculated per pixel. > > Is there a way to do this in iPython or matplotlib? I don't think there is, but using range and list comprehension you can write a little utility function that does that: HTH --

Re: getting started

2012-05-25 Thread Miki Tebeka
> s.name = ["a","b"] > s.value = [3,5] > > I get error that s is not defined. How do I define s and proceed to > give its attributes? Either you create a class and use __init__: class S: def __init__(self, name, value): self.name = name self.value = value or create a generic

Re: what gui designer is everyone using

2012-06-07 Thread Miki Tebeka
> what is the gui designer that is most popular? IIRC Qt designer can output Python code. -- http://mail.python.org/mailman/listinfo/python-list

Re: Installing numpy over an older numpy

2012-06-15 Thread Miki Tebeka
> Any ideas on how to install a newer version over an older version? pip uninstall numpy pip install numpy -- http://mail.python.org/mailman/listinfo/python-list

bdist_rpm from Ubuntu to CentOS

2011-06-02 Thread Miki Tebeka
path in CentOS is looking at /usr/local/lib/python2.7/site-packages. Is there a way to tell bdist_rpm where to install the files to? Thanks, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe: executable is slower than code run from the interpreter

2011-06-04 Thread Miki Tebeka
One thing that comes to mind is importing. py2exe packs libraries in a zip file so importing might be a bit slower. But this should slow only at the beginning until everything is loaded to memory. The other usual suspect is the anti virus :) -- http://mail.python.org/mailman/listinfo/python-lis

Re: regarding session in python

2011-06-07 Thread Miki Tebeka
Can you give us more context? Which web framework are you working with? You can have a look at http://pythonwise.blogspot.com/2007/05/websession.html ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: simple web/html testing

2011-06-07 Thread Miki Tebeka
http://pypi.python.org/pypi/selenium ? -- http://mail.python.org/mailman/listinfo/python-list

Re: parallel computations: subprocess.Popen(...).communicate()[0] does not work with multiprocessing.Pool

2011-06-11 Thread Miki Tebeka
m"] ...) If you can switch to 2.7, you'll be to use check_output (http://docs.python.org/library/subprocess.html#subprocess.check_output) HTH -- Miki Tebeka http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: How to form a dict out of a string by doing regex ?

2011-06-15 Thread Miki Tebeka
One solution is https://gist.github.com/1027445. Note that you have a stray , in your last POINT. I recommend however using some kind of parser framework (PLY?). -- http://mail.python.org/mailman/listinfo/python-list

Re: Missing python27.dll on Win 7 64-bit

2011-06-17 Thread Miki Tebeka
I don't have Windows at hand, by I *guess* that the Python DLL is somewhere near the python executable. You need to make sure the Python DLL is in PATH, either copy it next to your executable or edit the PATH environment variable. -- http://mail.python.org/mailman/listinfo/python-list

Re: parse date string having "EDT"

2011-06-21 Thread Miki Tebeka
You might consider trying dateutil.parser.parse (http://labix.org/python-dateutil#head-c0e81a473b647dfa787dc11e8c69557ec2c3ecd2) -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get return values of a forked process

2011-06-21 Thread Miki Tebeka
One way is to use pipes, have a look at http://code.activestate.com/recipes/576709/ for example. -- http://mail.python.org/mailman/listinfo/python-list

Re: Handling import errors

2011-06-21 Thread Miki Tebeka
> try: > import foo > except ImportError: > logging.error('could not import foo') > sys.exit(1) Why not just let the exception terminate the program? It will have even more information about the problem that caused foo not to load. -- http://mail.python.org/mailman/listinfo/python-lis

Re: blist question

2011-07-07 Thread Miki Tebeka
Have you looked at http://docs.python.org/library/collections.html#collections.deque ? -- http://mail.python.org/mailman/listinfo/python-list

json decode issue

2011-07-14 Thread Miki Tebeka
how to fix this? Thanks, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: Questions about os.waitpid(pid, options) on windows

2011-07-15 Thread Miki Tebeka
If you are spawning the process yourself, you can use subprocess.Popen and then call p.wait() which is cross platform. -- http://mail.python.org/mailman/listinfo/python-list

Re: Signal only works in main thread

2011-07-25 Thread Miki Tebeka
Seems like pyssh (which is very old AFAIK) uses signal. Looks like you're creating the SSHController instance (which uses pyssh) not in the main thread, and Python won't allow you to place signal handlers outside the main thread. You can probably move the SSHContorller creation to the main threa

Re: Only Bytecode, No .py Files

2011-07-26 Thread Miki Tebeka
*Maybe* you can cook something with import hooks (see PEP 302). However I think the easier option will be to distribute the .py files as well. -- http://mail.python.org/mailman/listinfo/python-list

Re: problem installing psyco on windows (Unable to find vcvarsall.bat)

2011-08-10 Thread Miki Tebeka
You can download the sources tarball and when building specify the compiler. See http://docs.python.org/install/index.html#gnu-c-cygwin-mingw -- http://mail.python.org/mailman/listinfo/python-list

Re: Searching for Lottery drawing list of ticket match...

2011-08-10 Thread Miki Tebeka
Python built in types are enough for this problem IMO. You can use sets of tuples to specify ticket and drawings and then just do set intersection. Say the drawing is set([(5, 'wb'), (1, 'wb'), (45, 'wb'), (23, 'wb'), (27, 'wb')]) (keeping black ball out). The you can create a score function: S

Re: Java is killing me! (AKA: Java for Pythonheads?)

2011-08-12 Thread Miki Tebeka
You can probably do that with varargs. -- http://mail.python.org/mailman/listinfo/python-list

Re: Searching for Lottery drawing list of ticket match...

2011-08-12 Thread Miki Tebeka
It's the builtin "set", see http://docs.python.org/library/stdtypes.html#set-types-set-frozenset -- http://mail.python.org/mailman/listinfo/python-list

Re: Application monitoring

2011-08-16 Thread Miki Tebeka
http://www.nagios.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Replacement for the shelve module?

2011-08-19 Thread Miki Tebeka
You might check one of many binary encoders (like Avro, Thrift ...). The other option is to use a database, sqlite3 is pretty fast (if you schema is fixed). Otherwise you can look at some NoSQL ones (like MongoDB). -- http://mail.python.org/mailman/listinfo/python-list

Re: CGI input: Filter dict.update() unwanted variables

2011-08-22 Thread Miki Tebeka
gt; And in addition, maybe return an error so the attacker can be blocked? You can check if there is a "non-allowed variable" and then return HTTP error. if set(form) - set(allowedVariables): print('Status: 406\n\n') raise SystemExit() HTH -- Miki Tebeka http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: slightly OT -- LaTeX

2011-09-01 Thread Miki Tebeka
I found http://tobi.oetiker.ch/lshort/lshort.pdf very useful. -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to check that you are at the beginning (the end) of an iterable?

2011-09-07 Thread Miki Tebeka
I guess enumerate is the best way to check for first argument. Note that if someone passes you the iterator as argument you have now way of checking if the consumed items from it. istail can be implemented using itertools.chain, see https://gist.github.com/1202260 -- http://mail.python.org/mai

Re: Executing js/ajax in a sandboxed environment

2011-02-28 Thread Miki Tebeka
using Selenium. HTH -- Miki Tebeka http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: A Short Question on list

2011-03-03 Thread Miki Tebeka
Have a look at reduce (http://docs.python.org/library/functions.html#reduce) -- http://mail.python.org/mailman/listinfo/python-list

Re: questions about multiprocessing

2011-03-04 Thread Miki Tebeka
> otasks = [ > ... > print pool.map(f, tasks) You are running the maps on "tasks" while the list of URLs is called otasks (unless there's any error in the cut&paste). HTH, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: my computer is allergic to pickles

2011-03-04 Thread Miki Tebeka
an in-memory pickle objects. HTH, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: Cluto like library for Python

2011-03-06 Thread Miki Tebeka
You have several option for interfacing with C libraries: Cython, swig, boost-python, ctypes ... You can find several machine learning packages mentioned at http://web.media.mit.edu/~stefie10/technical/pythonml.html, I have no experience with any of them so I can't recommend any. HTH --

Re: my computer is allergic to pickles

2011-03-06 Thread Miki Tebeka
> Or, which situations does shelve suit better and which does > marshal suit better? shelve ease of use and the fact it uses the disk to store objects makes it a good choice if you have a lot of object, each with a unique string key (and a tuple of strings can be converted to and from a string).

Re: python data types in c++ code

2011-03-06 Thread Miki Tebeka
object.html?highlight=pyobject#PyObject_GetItem to get items (from dictionaries and maps). HTH -- Miki Tebeka http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: attach to process by pid?

2011-03-09 Thread Miki Tebeka
> Is there any way to attach to an already running process by pid? I want to > send > commands from python to an application that is already running. I don't want > to > give the command name to subprocess.Popen. We probably need more information. What do you mean by "send commands"? (What was

Re: my computer is allergic to pickles

2011-03-09 Thread Miki Tebeka
> >From looking at the shelve info in the library reference, I get > the impression it's tricky to change the values in the dict for > existing keys and be sure they get changed on disk. You can use writeback=True or call sync at the right places. > How can you convert a tuple of strings to a str

Re: Two random lists from one list

2011-03-11 Thread Miki Tebeka
You can use sets: teamA = set(random.sample(players, 4)) teamB = set(players) - teamA HTH -- Miki Tebeka http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: What do you use with Python for GUI programming and why?

2011-03-11 Thread Miki Tebeka
I used wxPython in several occasion, was very happy with it. Free, great docs, great community. -- http://mail.python.org/mailman/listinfo/python-list

Re: Bounds checking

2011-03-18 Thread Miki Tebeka
(attr) > sys.exit() Not that related to the question. But it's usually better to raise an exception. Exiting in the middle of a function usually make debugging later more "interesting". You might find Traits interesting for validation, see http://code.enthought.com/pro

Re: Use cookies from a script in a browser

2011-03-18 Thread Miki Tebeka
You can use mechanize, which holds a cookie jar and can user the browser cookies as well. -- http://mail.python.org/mailman/listinfo/python-list

"in house" pypi?

2011-03-23 Thread Miki Tebeka
hanks, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: "in house" pypi?

2011-03-24 Thread Miki Tebeka
> The easiest solution is to use a plain file system. Make a directory per > project, and put all distributions of the project into the directory. > Then have Apache serve the parent directory, with DirectoryIndex turned > on. Great, thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get a PID of a child process from a process openden with Popen()

2011-04-08 Thread Miki Tebeka
> p = subprocess.Popen(shlex.split("kdesu -u test program")) > > How can I aquire the PID of the program which kdesu starts? You can run "ps --ppid " and get the line containing test program. The first field there should be the child process

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-10 Thread Miki Tebeka
27;re on a *nix machine). See http://pythonwise.blogspot.com/2009/04/pmap.html for example ;) HTH -- Miki Tebeka http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: How to use optparse without the command line?

2011-04-13 Thread Miki Tebeka
coding the option dictionary. You can merge the options from the command line though. options = {"a" : 1, "b" : 2} opts, args = parser.parse_args() options.update(opts.__dict__) HTH -- Miki Tebeka http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: An unusual question...

2011-04-17 Thread Miki Tebeka
outside of the current Python process. I don't think it'll do what you want (different memory segments). I'd start with either using ctypes/libffi or writing my own C extension wrapper around your good. HTH -- Miki Tebeka http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Installing programs that depend on, or are, python extensions.

2011-04-30 Thread Miki Tebeka
I used py2exe and InnoSetup in the past for various Python project, always with great success. What is the process that you are following? -- http://mail.python.org/mailman/listinfo/python-list

Re: Aborting Python from C code

2011-04-30 Thread Miki Tebeka
> In our sandboxed Python environment, I would like to be able to > trigger an abort of the currently-running Python script (from a signal > handler or another thread). There's os.abort -- http://mail.python.org/mailman/listinfo/python-list

Re: Installing programs that depend on, or are, python extensions.

2011-05-03 Thread Miki Tebeka
> py2exe would work, but a correct installer would install Python if not > present, then install the program. py2exe packs everything you need, including Python. A program created with py2exe does not depend on installed Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: Need to solve the "Stateless HTTP" problem

2011-05-05 Thread Miki Tebeka
> Essentially I want > certain objects to be a "constantly running process" that may timeout > after some disuse. memcached? -- http://mail.python.org/mailman/listinfo/python-list

avro slow?

2011-05-05 Thread Miki Tebeka
Greetings, I'm reading some data from avro file using the avro library. It takes about a minute to load 33K objects from the file. This seem very slow to me, specially with the Java version reading the same file in about 1sec. Here is the code, am I doing something wrong? import avro.dataf

Re: Embedding Python's library as zip file

2011-05-05 Thread Miki Tebeka
I used py2exe in the past for that, see http://www.py2exe.org/index.cgi/ShippingEmbedded -- http://mail.python.org/mailman/listinfo/python-list

Re: Merge multiple source directories into one package with distutils?

2011-05-11 Thread Miki Tebeka
to write some code in setup.py before calling "setup" to do the merge. HTH -- Miki Tebeka http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: connect SIGINT to custom interrupt handler

2011-05-15 Thread Miki Tebeka
Greetings, > I am trying to connect SIGINT (^c) to a custom interrupt handler like > this (no threading, just straightforward): Why not just catch KeyboardInterrupt? All the best, -- Miki -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to extract sentence from txt file

2011-05-17 Thread Miki Tebeka
http://nltk.googlecode.com/svn/trunk/doc/api/nltk.tokenize-module.html ? -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   >