> Basically, I'd like to know how to create a proper setup.py script
http://docs.python.org/2/distutils/setupscript.html
--
http://mail.python.org/mailman/listinfo/python-list
> I already have the .so files compiled.
http://docs.python.org/2/distutils/setupscript.html#installing-package-data ?
--
http://mail.python.org/mailman/listinfo/python-list
> Now! I have written a python script . I want to call a golang script in
> python script.
> Who can give me some advices?
See http://gopy.qur.me/extensions/examples.html and
http://www.artima.com/weblogs/viewpost.jsp?thread=333589
--
http://mail.python.org/mailman/listinfo/python-list
On Wednesday, June 12, 2013 8:59:44 PM UTC-7, Ranjith Kumar wrote:
> I'm looking for speech to text conversation python library for linux and mac
Not a Python library, but maybe you can work with
http://cmusphinx.sourceforge.net/
--
http://mail.python.org/mailman/listinfo/python-list
> Is there an import / distutils tutorial out there? I'm looking for it, but
> perhaps one of you already knows where to find it. Thanks!
Did you have a look at http://docs.python.org/3.3/distutils/examples.html?
Another thing to do is to look at what other packages on PyPi are doing.
--
http
> Is there a way to do the same thing in Python?
Not without some clever tricks. Either you store data at the beginning of the
file or you have another file with the data.
If you really need one file and data at the end, you can roll your own.
Something like:
def data():
with open(__
> It works fine on my computer and some other computer don't have python
> interpreter(it's Windows 7).
> But the same file also do not work on another computer(it's Windows xp)
> why does it happen?
My *guess* is that you're missing some DLLs (probably some Visual Studio
runtime ones).
You can
> How do others handle simple beeps?
http://pymedia.org/ ?
I *think* the "big" UI frameworks (Qt, wx ...) have some sound support.
--
http://mail.python.org/mailman/listinfo/python-list
> Is there any software to help understand python code ?
For module dependency you can try http://furius.ca/snakefood/
--
http://mail.python.org/mailman/listinfo/python-list
> how can i made a notification for gnome-shell with a textbox input ??
> library: pynotify?
You can do it in many ways. You can use one of the Python GUI frameworks - Qt,
wx, GTK ...
You can use utilities like zenity
...
--
http://mail.python.org/mailman/listinfo/python-list
> imp.find_module(), but
> it didn't find any module name containing a '.'
The docs (http://docs.python.org/library/imp.html#imp.find_module) clearly say:
"This function does not handle hierarchical module names (names containing
dots). In order to find P.M, that is, submodule M of package P, use
> Can someone point me a good tutorial about making a Todo app or similar apps?
What do you mean by "app"?
For a web app - there are many frameworks out there. Django is the big kid in
the block but there are many others (flask, bottle, cherrypy, ...)
For GUI application, look at PyQt, wxPython,
Have a look at PyMedia.
--
http://mail.python.org/mailman/listinfo/python-list
> In plus I'm using perforce which doesn't have any svn:externals-like
You can probably use views to this
(http://www.perforce.com/perforce/r12.1/manuals/cmdref/o.views.html).
> Second problem is that one of the two projects has a quite insane
> requirement, which is to be able to re-run itself o
> You get the binary by doing bin(x), where x is an integer.
Note that Python also support binary number literals (prefixed with 0b):
In [1]: 0b101
Out[1]: 5
--
http://mail.python.org/mailman/listinfo/python-list
Greetings,
>>> class A:
... '''a doc string'''
...
>>> A.__doc__
'a doc string'
>>> class B:
... '''a {} string'''.format('doc')
...
>>> B.__doc__
>>>
Is there's a reason for this?
I know I can do:
>>> class B:
...__doc__ = '''a {} string'''.format('doc')
And it'll work, but I wo
Thanks!
> On 08/21/2012 12:44 PM, Miki Tebeka wrote:
>
> >
>
> >>> class B:
>
> > ... '''a {} string'''.format('doc')
>
> > ...
>
> >>>> B.__doc__
>
> >>>>
&
> I want to re run the script at that schedule time to send me a email.
Calculate how much time until the meeting. And spawn the script that will sleep
that amount of time and then send email.
--
http://mail.python.org/mailman/listinfo/python-list
I'd look also into dateutil.parser.parse and feedparser._parse_date
On Thursday, September 6, 2012 1:34:18 PM UTC-7, John Nagle wrote:
> On 9/6/2012 12:51 PM, Paul Rubin wrote:
>
> > John Nagle writes:
>
> >> There's an iso8601 module on PyPi, but it's abandoned; it hasn't been
>
> >> updated
> I have Python code that I would like to compile into a dll (I have to
See http://docs.python.org/extending/embedding.html. You can pack your code in
a zip file and load it from the DLL entry point (something like what py2exe
does).
See also the Freeze tool - http://wiki.python.org/moin/Freeze
Greetings,
I'm trying to write a reverse TCP proxy using epoll (just for learning).
I've started with the code at http://scotdoyle.com/python-epoll-howto.html and
got to https://gist.github.com/3707665.
However, I can't create a new connection. When reaching line 34
(backend.connect), I get th
> I've just noticed that the bisect module lacks of the key parameter.
> ...
> Is there some reason behind this lack?
See full discussion at http://bugs.python.org/issue4356. Guido said it's going
in, however there's no time frame for it.
--
http://mail.python.org/mailman/listinfo/python-list
> Correct me if I'm wrong, but the reason for this absence is that people could
> think that doing repeated bisects using keys would be fast, even though keys
> has to be recomputed?
I think the main point Raymond had was:
If we added key= to bisect, it would encourage bad design and steer
> You cannot synchronously set up a new TCP connection using a non-blocking >
> socket. Instead, you begin the connection attempt and it fails with
> EINPROGRESS and then you use epoll to find out when the attempt completes.
OK.
> I suggest reading the implementation of a Twisted reactor to see
> What do you think work best in general?
I find typing during class (other than small REPL examples) time consuming and
error prone.
What works well for me is to create a slidy HTML presentation with asciidoc,
then I can include code snippets that can be also run from the command line.
(Somethi
> sys.executable was printed out as ''C:\\Python25\\python.exe'', how
> can I make this work in executable package through py2exe?
Does http://www.py2exe.org/index.cgi/WhereAmI help?
--
http://mail.python.org/mailman/listinfo/python-list
> Is there a simple way to get the *ordered* list of instance
Here's one way to do it (weather doing it is a good idea or not is debatable):
from operator import attrgetter
def __init__(self, a, b, c, d):
self.a, self.b, self.c, self.d = a, b, c, d
get = attrgetter('a', 'b
> I want to fix an error in some code I have installed, ...
Apart from all the reasons why it's bad (see the Python Zen #10). One way to do
it is:
return [i or '' for i in a]
--
http://mail.python.org/mailman/listinfo/python-list
> ANNOUNCING
> Central Python Events Calendars
Thanks, a great idea.
--
http://mail.python.org/mailman/listinfo/python-list
According to the docs
(http://docs.python.org/library/socketserver.html#requesthandler-objects)
there's self.server available.
--
http://mail.python.org/mailman/listinfo/python-list
> If you're using Python 3.2+, then functools.lru_cache probably
> ...
And if you're on 2.X, you can grab lru_cache from
http://code.activestate.com/recipes/498245-lru-and-lfu-cache-decorators/
--
http://mail.python.org/mailman/listinfo/python-list
> local$ fab remote_info
> [remote] Executing task 'remote_info'
> [remote] run: uname -a
> [remote] out: remote@path$
What happens when you ssh to the machine and run 'uname -a'?
(The out: ... is the output)
--
http://mail.python.org/mailman/listinfo/python-list
> Is there a simpler way to modify all arguments in a function before using the
> arguments?
You can use a decorator:
from functools import wraps
def fix_args(fn):
@wraps(fn)
def wrapper(*args):
args = (arg.replace('_', '') for arg in args)
return fn(*args)
return wr
> But i dont know how to pass the "echo t | " in subprocess.check_output while
> calling a process.
You need to create two subprocess and connect the stdout of the first to the
stdin of the 2'nd.
See http://pythonwise.blogspot.com/2008/08/pipe.html for a possible solution.
--
http://mail.python
On Monday, November 26, 2012 8:34:22 AM UTC-8, Michael Torrie wrote:
> http://pypi.python.org/pypi/python-dateutil
> ...
> I don't believe the library is updated for Python 3 yet, sadly.
dateutil supports 3.x since version 2.0.
--
http://mail.python.org/mailman/listinfo/python-list
Greetings,
The usual package mangers (easy_install, pip ...) install packages in one
central location.
I'm looking for a solution that will allow every project (which run on the same
machine) use it's own packages and versions of packages. (Context - we're
running several applications on the s
On Tuesday, November 27, 2012 8:21:48 PM UTC-8, Roy Smith wrote:
> What we do is run "pip freeze > requirements.txt" and check that into
> version control.
That's the idea I was toying with, thanks for confirming.
> When we deploy, we create a new virtualenv, then do
> "pip install -r requirem
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
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
On Tuesday, December 4, 2012 11:04:15 AM UTC-8, subhaba...@gmail.com wrote:
> >>> cl = HierarchicalClustering(data, lambda x,y: abs(x-y))
> but now I want to visualize it if any one suggest how may I use
> visualization(like matplotlib or pyplot etc.) to see the data?
One option is to use a scatte
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
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
> 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
On Thursday, December 6, 2012 2:15:53 PM UTC-8, subhaba...@gmail.com wrote:
> I am looking for some example of implementing Cosine similarity in python. I
> searched for hours but could not help much. NLTK seems to have a module but
> did not find examples.
Should be easy with numpy:
import
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
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
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
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
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
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
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
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
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
IMO the code is good enough to submit a patch.
--
http://mail.python.org/mailman/listinfo/python-list
cheeseshop :)
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
> 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:
> 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
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
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
> 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
float('infinity') should be good enough.
--
http://mail.python.org/mailman/listinfo/python-list
Greetings,
> I am confused over following the steps
> explained in the Python website,
Are you talking about http://docs.python.org/devguide/?
> Kindly some one please tell me in a more
> practical and easy way.
Can you tell in more details what are the problems you face?
This will help us help y
Greetings,
I see several elasticsearch clients on PyPI, any recommendations?
Thanks,
--
Miki
--
http://mail.python.org/mailman/listinfo/python-list
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
> 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
> 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
> 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
> 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
> 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
> 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
> 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':
> > 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
> I'm looking for a fairly lightweight key/value store that works for
> this type of problem:
I'd start with a benchmark and try some of the things that are already in the
standard library:
- bsddb
- sqlite3 (table of key, value, index key)
- shelve (though I doubt this one)
You might find that f
> 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
> 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
* 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
--
Greetings,
I'd like to have an --edit option in my program. That if not specified will not
open editor. If specified without value will open default editor ($EDITOR) and
if specified with value, assume this value is the editor program to run.
The way I'm doing it currently is:
...
no_ed
> 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
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
--
> 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
> what is the gui designer that is most popular?
IIRC Qt designer can output Python code.
--
http://mail.python.org/mailman/listinfo/python-list
> 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
Greetings,
We develop on Ubuntu/Macs and deploy RPMs to CentOS (this is the settings,
can't be changed much).
The problem is that when installing from the rpm, the packages go to
/usr/local/lib/python2.7/dist-packages (which is the right location for
Ubuntu). However the default python path in
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
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
http://pypi.python.org/pypi/selenium ?
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
You might consider trying dateutil.parser.parse
(http://labix.org/python-dateutil#head-c0e81a473b647dfa787dc11e8c69557ec2c3ecd2)
--
http://mail.python.org/mailman/listinfo/python-list
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
> 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
Have you looked at
http://docs.python.org/library/collections.html#collections.deque ?
--
http://mail.python.org/mailman/listinfo/python-list
Greetings,
I'm trying to decode JSON output of a Java program (jackson) and having some
issues.
The cause of the problem is the following snippet:
{
"description": "... lives\uMOVE™ OFFERS ",
}
Which causes ValueError: Invalid \u escape.
Any ideas on how to fix this?
Thanks,
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
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
*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
1 - 100 of 358 matches
Mail list logo