Re: nltk related issue

2018-06-25 Thread Glenn Hutchings
To: Sharan Basappa From: Glenn Hutchings On 21/06/18 04:40, Sharan Basappa wrote: > Folks, > > I am trying to run a simple example associated with nltk. > I get some error and I don't know what the issue is. > I need some guidance please. >

Re: nltk related issue

2018-06-24 Thread Glenn Hutchings
On 21/06/18 04:40, Sharan Basappa wrote: > Folks, > > I am trying to run a simple example associated with nltk. > I get some error and I don't know what the issue is. > I need some guidance please. > [...] > LookupError: > ** >

Re: print without ()

2017-09-06 Thread Glenn Hutchings
On Thursday, 7 September 2017 07:14:57 UTC+1, Andrej Viktorovich wrote: > Sometimes I find code with strange print function usage. String is passed > without brackets. > > #!/usr/bin/python > list = ['physics', 'chemistry', 1997, 2000]; > print "Value available at index 2 : " > print list[2] > l

Re: How to package my project and make it ready to be installed by using pip

2017-03-21 Thread Glenn Hutchings
On Monday, 20 March 2017 17:21:04 UTC, Daiyue Weng wrote: > If I tried > > pip3 install git+https://user_n...@bitbucket.org/user_name/project_name.git > > the package would get installed, but there are no python files that have > been installed in /usr/local/lib/python3.5/dist-packages/project_n

Re: How to package my project and make it ready to be installed by using pip

2017-03-20 Thread Glenn Hutchings
On Monday, 20 March 2017 11:36:34 UTC, Daiyue Weng wrote: > Hi, I using Python 3.5.2 on Linux Mint 18.1, and I am wondering how to > package my PyCharm Python project as a module so that it can installed by > someone else by using pip. Like what tools and script I need to use or > write in order t

Re: Unable to use python 3.5

2015-12-23 Thread Glenn Hutchings
On Wednesday, 23 December 2015 12:46:43 UTC, Ankit Deshmukh wrote: > I am maters student in India, I have installed python 3.5 in my windows 10 > 64bit machine. Everything works fine except package installing. When in use > "pip install numpy" is shows unable to find *'vcvarsall.bat'* I don't know

Re: Code Review for Paper, Rock, Scissors

2014-10-14 Thread Glenn Hutchings
Hi there! Welcome to Python. On Tuesday, 14 October 2014 09:04:51 UTC+1, Revenant wrote: > I am new to Python and would also like to see if any of you programming > gurus have some suggestions about how I can simplify code, and also if > there are any other good starter programs to work on to i

Re: Python code in presentations

2014-10-01 Thread Glenn Hutchings
On Tuesday, 30 September 2014 12:51:00 UTC+1, Jean-Michel Pichavant wrote: > I'm currently writing a presentation to help my co-workers ramp up on new > features of our tool (written in python (2.7)). > > I have some difficulties presenting code in an efficient way (with some basic > syntax hig

Re: Using virtualenv to bypass sudoer issues

2014-02-08 Thread Glenn Hutchings
On 06/02/14 17:32, Jean-Michel Pichavant wrote: > Assuming I have a debian workstation for which I don't have any sudo > rights, in order to be able to install / remove python packages, should > I be using virtualenv ? Is it a suited solution ? It depends on whether you need to share the install

Re: Pep8 in SetupTools

2013-12-12 Thread Glenn Hutchings
On Thursday, 12 December 2013 11:13:51 UTC, Chandru Rajendran wrote: > Please help me with running Pep8  using setuptools. Also help me how to Pep8 > for files in a folder. The tool you're looking for is flake8. It integrates with setuptools, so that you can run 'python setup.py flake8'. Mor

Re: python install on locked down windows box?

2011-09-22 Thread Glenn Hutchings
You could try Portable Python (http://www.portablepython.com). No need to install anything! -- http://mail.python.org/mailman/listinfo/python-list

Re: Overload print

2010-08-25 Thread Glenn Hutchings
On 25 Aug, 22:18, Ross Williamson wrote: > Is there anyway in a class to overload the print function? > > >> class foo_class(): > >>      pass > >> cc = foo_class() > >> print cc > > Gives: > > <__main__.foo_class instance at > > > Can I do something like: > > >> class foo_class(): > >>     de

Re: Query about doing fortran-esque repeat formatting

2009-11-09 Thread Glenn Hutchings
Rob Briggs mun.ca> writes: > Is there a way to do a repeat formatting command like in Fortran? Rather > that doing this: > > print "%s %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f %-5.3f" % > (parmName[i], tmp[i][1], tmp[i][2], tmp[i][4], tmp[i][6], tmp[i][7], > tmp[i][8], tmp[i][9]) There cert

Re: import overwrites __name__

2009-05-08 Thread Glenn Hutchings
On Fri, 08 May 2009 19:14:52 +0200, Marco wrote: > I import a module and then the name space of the importing module seems do > be overwritten. > > my_name = __name__ > print my_name > print len(dir()) > from x import y as z > print __name__ > print len(dir()) > print my_name > > -> > __main__

Re: free chart lib for Python?

2009-05-08 Thread Glenn Hutchings
On Fri, 08 May 2009 10:27:08 +0800, oyster wrote: > I mean chart, not plot. If you don't know the difference, you can > check www.advsofteng.com, which is a commercial program > > is there such a thing with many kinds of chart, i.e. pie-chart, > line-chart, ..? You could try matplotlib: http

Re: who to thank for the new RST doc format?

2008-11-18 Thread Glenn Hutchings
On 18 Nov, 08:46, [EMAIL PROTECTED] wrote: > I am really loving the output, and have started using RST for some > of my own docs as well. > > It's wonderful and I know it was a lot of work on somebody's part > to think it through and make the changes. > > If it was you, Many Thanks!!! It *is* good

How to create Pygments extension for Sphinx

2008-10-14 Thread Glenn Hutchings
Hi there Pythonistas... I'm writing documentation for a non-Python program using Sphinx (http://sphinx.pocoo.org), which is great. The program has an input file syntax suitable for highlighting using Pygments (http:// pygments.org), but, obviously, Pygments knows nothing about it. I've created a

Re: Process "Killed"

2008-08-29 Thread Glenn Hutchings
dieter <[EMAIL PROTECTED]> writes: > I'm doing some simple file manipulation work and the process gets > "Killed" everytime I run it. No traceback, no segfault... just the > word "Killed" in the bash shell and the process ends. The first few > batch runs would only succeed with one or two files be

Re: When to use try and except?

2008-08-29 Thread Glenn Hutchings
cnb <[EMAIL PROTECTED]> writes: > A ZeroDivisionError is better avoided wth an if-clause, don't you > think? It is a predictable exception... It depends. If zero-division is unlikely, then things would probably[*] run faster without checking. If speed is what you're interested in, that is... G

Re: calling source command within python

2008-07-25 Thread Glenn Hutchings
Jie <[EMAIL PROTECTED]> writes: > i'm having trouble executing os.system('source .bashrc') command > within python, it always says that source not found and stuff. Any > clue? There's no 'source' program; it's a shell builtin. Even if there was, it almost certainly wouldn't do what you want. The

[ANN] PyStar 0.1 -- A* graph search algorithm

2008-07-18 Thread Glenn Hutchings
Announcing PyStar, a python module implementing the A* graph search algorithm. Available under the GPL, you can find it at http://fluffybunny.memebot.com/pystar.html I tried to find a decent Python version of this on the Interweb, but the only one I found (http://arainyday.se/projects/python

Re: Graphics

2008-07-11 Thread Glenn Hutchings
vanam <[EMAIL PROTECTED]> writes: > hi all > i am new to python programming a beginner. I Came to know from the > groups that "How to think like a computer scientist" is preferable for > begineers. i just looking through that i came to one section where a > sample program for generation of graphic

Re: Numpy not found

2008-05-04 Thread Glenn Hutchings
adolfo <[EMAIL PROTECTED]> writes: > I downloaded and installed Phyton 2.52 (it works), numpy-1.0.4.win32- > py2.5, and scipy-0.6.0.win32-py2.5 > > I can´t get Numpy to show up at Python´s IDLE, or command line. If I > do: > > import Numeric > # I get > Traceback (most recent call last):

Re: Are rank noobs tolerated, here?

2008-05-04 Thread Glenn Hutchings
notbob <[EMAIL PROTECTED]> writes: > Am I likely to receive any help, here, or is there another irc, forum, etc, > that might better serve a complete amateur such as myself. Thnx. You're very likely to receive help here. Or at the very least, people will point you at the best place to get it. F

Re: GUI development with 3D view

2007-12-11 Thread Glenn Hutchings
On Dec 11, 1:58 am, gsal <[EMAIL PROTECTED]> wrote: > If all you need to do is display a bunch of arrows, as you mention, > the easiest thing to do might be to use Visual Python. It is > extremely easy to use. Another option, if your app is data-driven, is to check out the Visualization Toolkit (

Re: Distinguishing attributes and methods

2007-12-08 Thread Glenn Hutchings
On Dec 8, 7:44 pm, MonkeeSage <[EMAIL PROTECTED]> wrote: > I think it muddies the water to say that a.a() and a.a are the same > thing--obviously they are not. A thing is not what it is; A thing is what it does. This is the Way of the Duck. -- Basho (in his "3 extra syllables" phase) -- http

Re: Tkinter or wxpython?

2007-08-02 Thread Glenn Hutchings
On Aug 3, 1:00 am, "wang frank" <[EMAIL PROTECTED]> wrote: > I want to build a GUI to execut python script. I found TKinter and > wxpython. Which one is easier for a newbie? and which one is better? Well, Tkinter comes with Python, so newbies can get up and running straight away without having to

Re: Need a Little Help on Tkinter and Python

2007-06-06 Thread Glenn Hutchings
On 6 Jun, 00:58, "W. Watson" <[EMAIL PROTECTED]> wrote: > is there a Tkinter intro manual somewhere Take a look at http://www.pythonware.com/library/tkinter/introduction Glenn -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter - resize tkMessageBox

2007-06-05 Thread Glenn Hutchings
On 4 Jun, 21:29, [EMAIL PROTECTED] wrote: > Is there a way to resize the width of the "tkMessageBox.askyesno" > dialog box, so that the text does not wrap to the next line. You can use the Tk option database, either explicitly or from a file. For example, to set the wrap length of all dialogs to 1

Re: using tkinter to display html

2007-04-19 Thread Glenn Hutchings
On 20 Apr, 02:54, "Stephen M. Gava" <[EMAIL PROTECTED]> wrote: > yeah. i feel like i'm being forced to use wxwidgets/wxpython just because > i need pretty good html display though. You could always use a real web browser: import webbrowser webbrowser.open_new("index.html") Glenn -- htt

Re: tuple.index()

2006-12-14 Thread Glenn Hutchings
Nick Maclaren wrote: > I remain baffled. I accept the explanations, but what I am now > confused by is the reason for the explanations Maybe this archive posting, straight from the horse's mouth, will clear things up once and for all... http://www.python.org/search/hypermail/python-1992/028

Re: tuple.index()

2006-12-14 Thread Glenn Hutchings
Fredrik Lundh wrote: > if you don't want to understand the design, nobody can force you. but arguing > that the people behind the design "don't get it" isn't very practical. I'm not arguing that at all. What I'm saying is that from the perspective of someone not interested in design issues, it s

Re: tuple.index()

2006-12-14 Thread Glenn Hutchings
Fredrik Lundh wrote: > if you cannot trust your own code not to modify objects you pass to it, > I'm not sure Python's the right language for you. It's not my own code I'm worried about. :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple.index()

2006-12-14 Thread Glenn Hutchings
Roberto Bonvallet wrote: > list(my_arg).index(...) Absolutely -- you can work around the limitation without any problems. But the question is, why doesn't the list type share all its non-modifying methods with the tuple type? All the previous arguments about "homogenous" and "heterogenous" in thi

Re: tuple.index()

2006-12-14 Thread Glenn Hutchings
Simon Brunning wrote: > It's because, philosophically, a Python tuple isn't just a read-only list. But there are situations where you might want to treat it as a read-only list. E.g., an argument to a function, so that you can guarantee the function won't modify it. In that case, it makes sense

Re: tuple.index()

2006-12-14 Thread Glenn Hutchings
Nick Maclaren wrote: > Why doesn't the tuple type have an index method? It seems such a > bizarre restriction that there must be some reason for it. In fact, tuples have no non-__underscored__ methods at all. The list count() method would also be useful for tuples, since it doesn't modify anythi

Re: Python tools for managing static websites?

2006-11-02 Thread Glenn Hutchings
I haven't seen mention of HTMLgen, another python package. Check it out at: http://starship.python.net/crew/friedrich/HTMLgen/html/main.html Glenn -- http://mail.python.org/mailman/listinfo/python-list

Re: setup.py and file extensions like ".c++"

2006-08-24 Thread Glenn Hutchings
[EMAIL PROTECTED] wrote: > Is there any way to get setup.py to recognize file extensions like .c++ > in lieu of .cpp? I'd love to not have to rename the source files for > the library I'm trying to wrap in a python C extension. The python docs imply that the file extension is dealt with by the na

[ANN] PySuDoku version 0.2

2005-09-07 Thread Glenn Hutchings
Announcing PySuDoku version 0.2, yet another Sudoku program written in Python, featuring: * Cute interactive solving mode via Tkinter. * Puzzle generation option, for making your own puzzles. * Nicely packaged for installation via distutils. New in this release: * Now uses psyco module,

[ANNOUNCE] pysudoku 0.1

2005-07-08 Thread Glenn Hutchings
Announcing PySuDoku version 0.1, yet another Sudoku program written in Python. But this one has features that I don't see in any of the others: * Cute interactive solving mode via Tkinter. * Puzzle generation option, for making your own puzzles. * Nicely packaged for installation via distut