Re: Play Ogg Files

2013-07-19 Thread David Hutto
Just get a good dictionary, and distutils I believe, someone a little bit more experienced in these should be along soon, or use the manual, and docs. On Sat, Jul 20, 2013 at 12:52 AM, David Hutto wrote: > This is using 3.2, which shouldn't be far off, the latest I could get on > ubuntu. > > da

Re: Play Ogg Files

2013-07-19 Thread David Hutto
This is using 3.2, which shouldn't be far off, the latest I could get on ubuntu. david@david:~$ python3.2 Python 3.2.3 (default, Apr 10 2013, 05:29:11) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import subprocess >>> subprocess.call(['espeak',

Re: Play Ogg Files

2013-07-19 Thread David Hutto
you could use , and I think its david@david:~$ python Python 2.7.3 (default, Aug 1 2012, 05:16:07) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import subprocess >>> subprocess.call(['espeak', 'word_spoken'], stdin=None, stdout=None, stderr=None

Re: Share Code Tips

2013-07-19 Thread David Hutto
32 if you count black, and white. On Sat, Jul 20, 2013 at 12:26 AM, David Hutto wrote: > I didn't see that this was for a chess game. That seems more point and > click. Everyone can recognize a bishop from a queen, or a rook from a pawn. > So why would case sensitivity matter other than the 16 p

Re: Share Code Tips

2013-07-19 Thread David Hutto
I didn't see that this was for a chess game. That seems more point and click. Everyone can recognize a bishop from a queen, or a rook from a pawn. So why would case sensitivity matter other than the 16 pieces on the board? Or am I misunderstanding the question? On Sat, Jul 20, 2013 at 12:22 AM,

Re: Share Code Tips

2013-07-19 Thread David Hutto
It seems that you could use import re, in my mind's pseudo code, to compile a translational usage of usernames/passwords that could remain case sensitive by using just the translational dictionaries, and refining with data input tests/unit tests. On Sat, Jul 20, 2013 at 12:15 AM, David Hutto wrot

Re: Play Ogg Files

2013-07-19 Thread Stefan Behnel
Devyn Collier Johnson, 20.07.2013 03:06: > I am making a chatbot that I host on Launchpad.net/neobot. I am currently > converting the engine from BASH code to Python3. I need to convert this for > cross-platform compatibility. I do not need to use Mplayer; I just show the > below code to give other

Re: Share Code Tips

2013-07-19 Thread David Hutto
It seems, without utilizing this, or googling, that a case sensitive library is either developed, or could be implemented by utilizing case sensitive translation through a google translation page using an urlopener, and placing in the data to be processed back to the boolean value. Never attempted,

Re: Share Code Tips

2013-07-19 Thread Steven D'Aprano
On Fri, 19 Jul 2013 21:04:55 -0400, Devyn Collier Johnson wrote: > In the future, I want to > make the perfect international-case-insensitive if-statement. For now, > my code only supports a limited range of characters. Even with casefold, > I will have some issues as Chris Angelico mentioned. Th

Re: Share Code Tips

2013-07-19 Thread David Hutto
And also don't forget special char, or that it can bbe var char, or char in the DB lookup in boolean with the username. On Fri, Jul 19, 2013 at 11:43 PM, David Hutto wrote: > Just use an explanatory user tip that states it should be case sensitive, > just like with most sites, or apps. > > > On

Re: Share Code Tips

2013-07-19 Thread David Hutto
Just use an explanatory user tip that states it should be case sensitive, just like with most sites, or apps. On Fri, Jul 19, 2013 at 10:21 AM, Joel Goldstick wrote: > > > > On Fri, Jul 19, 2013 at 9:51 AM, Devyn Collier Johnson < > devyncjohn...@gmail.com> wrote: > >> Aloha Python Users! >> >>

Re: Share Code Tips

2013-07-19 Thread David Hutto
Just use an explanatory user tip that states it should be case sensitive, just like with most sites, or apps. On Fri, Jul 19, 2013 at 9:13 PM, Chris Angelico wrote: > On Sat, Jul 20, 2013 at 11:04 AM, Devyn Collier Johnson > wrote: > > > > On 07/19/2013 07:09 PM, Dave Angel wrote: > >> > >> On

Re: Share Code Tips

2013-07-19 Thread Steven D'Aprano
On Fri, 19 Jul 2013 18:08:43 -0400, Devyn Collier Johnson wrote: > As for the case-insensitive if-statements, most code uses Latin letters. > Making a case-insensitive-international if-statement would be > interesting. I can tackle that later. For now, I only wanted to take > care of Latin letters

Re: Understanding other people's code

2013-07-19 Thread David Hutto
I forgot to mention idle. It can step through another's code and show you a step-by-step insructional, of what the code does. On Tue, Jul 16, 2013 at 8:05 PM, David Hutto wrote: > Any program, to me, is just like speaking english. The class, or function > name might not fully mesh with w

Re: Share Code Tips

2013-07-19 Thread Dave Angel
On 07/19/2013 09:04 PM, Devyn Collier Johnson wrote: Chris Angelico said that casefold is not perfect. In the future, I want to make the perfect international-case-insensitive if-statement. For now, my code only supports a limited range of characters. Even with casefold, I will have s

Play Ogg Files

2013-07-19 Thread Devyn Collier Johnson
Aloha Python programmers! I am making a chatbot that I host on Launchpad.net/neobot. I am currently converting the engine from BASH code to Python3. I need to convert this for cross-platform compatibility. I do not need to use Mplayer; I just show the below code to give others a better idea wh

Re: how: embed + extend to control my running app?

2013-07-19 Thread Chris Angelico
On Sat, Jul 20, 2013 at 9:52 AM, David M. Cotter wrote: > i'd like my app to be "available" to python while it's running. > > for example, say my app is "FooBar.app". > > when my FooBar.app is running, now there is a python interface available to > python, and the user can write python scripts to

Re: Share Code Tips

2013-07-19 Thread Chris Angelico
On Sat, Jul 20, 2013 at 11:04 AM, Devyn Collier Johnson wrote: > > On 07/19/2013 07:09 PM, Dave Angel wrote: >> >> On 07/19/2013 06:08 PM, Devyn Collier Johnson wrote: >>> >>> >>> On 07/19/2013 01:59 PM, Steven D'Aprano wrote: >> >> >> >>> >>> >>> As for the case-insensitive if-statements, m

Re: Share Code Tips

2013-07-19 Thread Devyn Collier Johnson
On 07/19/2013 07:09 PM, Dave Angel wrote: On 07/19/2013 06:08 PM, Devyn Collier Johnson wrote: On 07/19/2013 01:59 PM, Steven D'Aprano wrote: As for the case-insensitive if-statements, most code uses Latin letters. Making a case-insensitive-international if-statement would be interes

Re: Stack Overflow moderator “animuson”

2013-07-19 Thread Kevin Walzer
On 7/10/13 3:55 AM, Mats Peterson wrote: A moderator who calls himself “animuson� on Stack Overflow doesn’t want to face the truth. He has deleted all my postings regarding Python regular expression matching being extremely slow compared to Perl. Additionally my account has been suspended f

how: embed + extend to control my running app?

2013-07-19 Thread David M. Cotter
i'd like my app to be "available" to python while it's running. for example, say my app is "FooBar.app". when my FooBar.app is running, now there is a python interface available to python, and the user can write python scripts to make use of it. with their scripts, they can control my running a

Python testing tools

2013-07-19 Thread cutems93
I am currently doing some research on testing software for Python. I found that there are many different types of testing tools. These are what I've found. 1.Unit test 2.Mock test 3.Fuzz test 4.Web test 5.Acceptance/business logic test 6.GUI test 7.Source code checking 8.Code coverage 9.Cont

Re: Find and Replace Simplification

2013-07-19 Thread Dave Angel
On 07/19/2013 05:44 PM, Devyn Collier Johnson wrote: On 07/19/2013 12:22 PM, Steven D'Aprano wrote: On Fri, 19 Jul 2013 09:22:48 -0400, Devyn Collier Johnson wrote: I have some code that I want to simplify. I know that a for-loop would work well, but can I make re.sub perform all of the below

Re: Share Code Tips

2013-07-19 Thread Chris Angelico
On Sat, Jul 20, 2013 at 8:08 AM, Devyn Collier Johnson wrote: > As for the case-insensitive if-statements, most code uses Latin letters. > Making a case-insensitive-international if-statement would be interesting. I > can tackle that later. For now, I only wanted to take care of Latin letters. > I

Re: Share Code Tips

2013-07-19 Thread Chris Angelico
On Sat, Jul 20, 2013 at 8:10 AM, Devyn Collier Johnson wrote: > > On 07/19/2013 12:19 PM, Steven D'Aprano wrote: >> >> On Fri, 19 Jul 2013 10:21:10 -0400, Joel Goldstick wrote: >> >>> >> class="gmail_quote"> >> >> [snip 70-odd lines of HTML...] >> >>> I'm guessing you may be posting with html. So

Re: Share Code Tips

2013-07-19 Thread Dave Angel
On 07/19/2013 06:08 PM, Devyn Collier Johnson wrote: On 07/19/2013 01:59 PM, Steven D'Aprano wrote: As for the case-insensitive if-statements, most code uses Latin letters. Making a case-insensitive-international if-statement would be interesting. I can tackle that later. For now, I on

Re: Stack Overflow moderator “animuson”

2013-07-19 Thread Dave Angel
On 07/19/2013 06:35 PM, Chris Angelico wrote: On Sat, Jul 20, 2013 at 4:54 AM, wrote: And do not forget memory. The €uro just become expensive. sys.getsizeof(' ) 26 sys.getsizeof('€') 40 I do not know. When an €uro char need 14 bytes more that a dollar, I belong to those who thing there

Re: Stack Overflow moderator “animuson”

2013-07-19 Thread Chris Angelico
On Sat, Jul 20, 2013 at 4:54 AM, wrote: > And do not forget memory. The €uro just become expensive. > sys.getsizeof(' > ) > 26 sys.getsizeof('€') > 40 > > I do not know. When an €uro char need 14 bytes more that > a dollar, I belong to those who thing there is a problem > somewhere. Oh

Re: Share Code Tips

2013-07-19 Thread Devyn Collier Johnson
On 07/19/2013 01:59 PM, Steven D'Aprano wrote: On Fri, 19 Jul 2013 09:51:23 -0400, Devyn Collier Johnson wrote: def KDE_VERSION(): print(subprocess.getoutput('kded4 --version | awk -F: \'NR == 2 {print $2}\'').strip()) ##Get KDE version## I run KDE 3, and the above does not work for

Re: Find and Replace Simplification

2013-07-19 Thread Devyn Collier Johnson
On 07/19/2013 12:22 PM, Steven D'Aprano wrote: On Fri, 19 Jul 2013 09:22:48 -0400, Devyn Collier Johnson wrote: I have some code that I want to simplify. I know that a for-loop would work well, but can I make re.sub perform all of the below tasks at once, or can I write this in a way that is m

Re: Share Code Tips

2013-07-19 Thread Devyn Collier Johnson
On 07/19/2013 12:19 PM, Steven D'Aprano wrote: On Fri, 19 Jul 2013 10:21:10 -0400, Joel Goldstick wrote: [snip 70-odd lines of HTML...] I'm guessing you may be posting with html. So all your code runs together. -- Joel Goldstickhttp://joelgoldstick.com My irony meter didn't merely ex

Topic Modeling LDA Gensim

2013-07-19 Thread subhabangalore
Dear Group, I am trying to use Gensim for Topic Modeling with LDA. I have trained LDA but now I want to test it with new documents. Should I use doc_lda = lda[doc_bow] or is it something else? If any one of the esteemed members of the group can kindly suggest? Thanking in Advance, Regards,

Re: Stack Overflow moderator “animuson”

2013-07-19 Thread wxjmfauth
Le mercredi 10 juillet 2013 11:00:23 UTC+2, Steven D'Aprano a écrit : > On Wed, 10 Jul 2013 07:55:05 +, Mats Peterson wrote: > > > > > A moderator who calls himself “animuson” on Stack Overflow doesn’t want > > > to face the truth. He has deleted all my postings regarding Python > > > regu

Re: Share Code Tips

2013-07-19 Thread Steven D'Aprano
On Fri, 19 Jul 2013 09:51:23 -0400, Devyn Collier Johnson wrote: > def KDE_VERSION(): > print(subprocess.getoutput('kded4 --version | awk -F: > \'NR == 2 {print $2}\'').strip()) ##Get KDE version## I run KDE 3, and the above does not work for me. *half a wink* By the way, a comment that

Re: Find and Replace Simplification

2013-07-19 Thread Skip Montanaro
Serhiy> The string replace() method is fastest (at least in Python 3.3+). See Serhiy> implementation of html.escape() etc. I trust everybody knows by now that when you want to use regular expressions you should shell out to Perl for the best performance. :-) Skip -- http://mail.python.org/mailma

Re: Find and Replace Simplification

2013-07-19 Thread Serhiy Storchaka
19.07.13 19:22, Steven D'Aprano написав(ла): I also expect that the string replace() method will be second fastest, and re.sub will be the slowest, by a very long way. The string replace() method is fastest (at least in Python 3.3+). See implementation of html.escape() etc. -- http://mail.p

Re: Messages to Python-List aren't posting

2013-07-19 Thread Chris Angelico
On Sat, Jul 20, 2013 at 2:31 AM, Steven D'Aprano wrote: > Admittedly, this was a few years back that we ran into this problem, and > since then we've just routinely whitelisted email from Optus and Bigpond, > curse their black souls for making spam prevention just that little bit > harder. So I su

Re: Messages to Python-List aren't posting

2013-07-19 Thread Matthew Lefavor
Well, it seems like the last message I posted did post in time. I'll keep tabs on the issue and email the postmaster if it persists. Matthew Lefavor On Fri, Jul 19, 2013 at 11:00 AM, Chris Angelico wrote: > On Sat, Jul 20, 2013 at 12:57 AM, Skip Montanaro wrote: > >> One relevant piece of inf

Re: Messages to Python-List aren't posting

2013-07-19 Thread Steven D'Aprano
On Fri, 19 Jul 2013 09:57:47 -0500, Skip Montanaro wrote: >> Is it possible that the name "Matthew Lefavor" has been added to a >> greylist or something? > > That's not how greylisting works. Greylisting is a scheme used to > eliminate spam. The server knows what email addresses it's received >

Re: Find and Replace Simplification

2013-07-19 Thread Steven D'Aprano
On Fri, 19 Jul 2013 09:22:48 -0400, Devyn Collier Johnson wrote: > I have some code that I want to simplify. I know that a for-loop would > work well, but can I make re.sub perform all of the below tasks at once, > or can I write this in a way that is more efficient than using a > for-loop? > > D

Re: Designing a Pythonic search DSL for SQL and NoSQL databases

2013-07-19 Thread Alec Taylor
Hmm, looking at the capabilities of Redis; you're likely right. Would welcome discussion on the implementability and usefulness of a central search abstraction to the other stores mentioned. One thing could be that using the paradigm the database was made for is better than any advantages abstrac

Re: Share Code Tips

2013-07-19 Thread Steven D'Aprano
On Fri, 19 Jul 2013 10:21:10 -0400, Joel Goldstick wrote: > class="gmail_quote"> [snip 70-odd lines of HTML...] > I'm guessing you may be posting with html.  So all your code runs > together. > -- dir="ltr"> Joel Goldstickhttp://joelgoldstick.com > My irony meter didn't merely explode, it a

Re: Messages to Python-List aren't posting

2013-07-19 Thread Skip Montanaro
> Is it possible that the name "Matthew > Lefavor" has been added to a greylist or something? That's not how greylisting works. Greylisting is a scheme used to eliminate spam. The server knows what email addresses it's received mail from in the last little while (say, the last month). When it g

Re: Messages to Python-List aren't posting

2013-07-19 Thread Chris Angelico
On Sat, Jul 20, 2013 at 12:57 AM, Skip Montanaro wrote: >> One relevant piece of information: I have subscribed and unsubscribed to >> different combinations of these lists several times over the past year, and >> particularly over the past few months (as I was trying to manage the flow of >> emai

Re: Find and Replace Simplification

2013-07-19 Thread John Gordon
In Devyn Collier Johnson writes: > I have some code that I want to simplify. I know that a for-loop would > work well, but can I make re.sub perform all of the below tasks at once, > or can I write this in a way that is more efficient than using a for-loop? > DATA = re.sub(',', '', 'DATA') >

Re: Messages to Python-List aren't posting

2013-07-19 Thread Matthew Lefavor
(Sorry to reply-all, but in this case I think the direct messages will get to people on this thread 12 hours earlier than the others.) Well, I have had this problem with both my work email (matthew dot lefavor _at_ nasa dpt gov) and my Gmail account. Since this doesn't happen to all users (nor all

Re: Share Code Tips

2013-07-19 Thread Joel Goldstick
On Fri, Jul 19, 2013 at 9:51 AM, Devyn Collier Johnson < devyncjohn...@gmail.com> wrote: > Aloha Python Users! > > I have some coding tips and interesting functions that I want to share > with all of you. I want to give other programmers ideas and inspiration. It > is all Python3; most of it shoul

Play Ogg Files

2013-07-19 Thread Devyn Collier Johnson
Aloha Python programmers! I am making a chatbot that I host on Launchpad.net/neobot. I am currently converting the engine from BASH code to Python3. I need to convert this for cross-platform compatibility. I do not need to use Mplayer; I just show the below code to give others a better idea wh

Share Code Tips

2013-07-19 Thread Devyn Collier Johnson
Aloha Python Users! I have some coding tips and interesting functions that I want to share with all of you. I want to give other programmers ideas and inspiration. It is all Python3; most of it should work in Python2. I am a Unix/Linux person, so some of these will only work on Unix systems. S

Re: Find and Replace Simplification

2013-07-19 Thread Novocastrian_Nomad
On Friday, July 19, 2013 7:22:48 AM UTC-6, Devyn Collier Johnson wrote: > I have some code that I want to simplify. I know that a for-loop would > > work well, but can I make re.sub perform all of the below tasks at once, > or can I write this in a way that is more efficient than using a for-loo

Ouija board

2013-07-19 Thread MoneyMaker
ouija board the world's most dangerous game?? Buy your game here. good selection and the best price http://horrorhorrorhorror.webs.com/ouija-board -- http://mail.python.org/mailman/listinfo/python-list

Re: Messages to Python-List aren't posting

2013-07-19 Thread Skip Montanaro
> Date: Thu, 18 Jul 2013 16:30:51 -0400 - timestamp of your mail > Thu, 18 Jul 2013 13:30:51 -0700 (PDT) - you posted it via HTTP > Thu, 18 Jul 2013 22:31:39 +0200 (CEST) - it reached python.org > Fri, 19 Jul 2013 09:56:14 +0200 (CEST) - it began delivery to my address > Fri, 19 Jul 2013 00:56:15 -

Find and Replace Simplification

2013-07-19 Thread Devyn Collier Johnson
I have some code that I want to simplify. I know that a for-loop would work well, but can I make re.sub perform all of the below tasks at once, or can I write this in a way that is more efficient than using a for-loop? DATA = re.sub(',', '', 'DATA') DATA = re.sub('\'', '', 'DATA') DATA = re.sub

Re: Designing a Pythonic search DSL for SQL and NoSQL databases

2013-07-19 Thread Roy Smith
In article , Alec Taylor wrote: > Dear Python community, > > I am analysing designing an abstraction layer over a select few NoSQL > and SQL databases. > > Specifically: > > - Redis, Neo4j, MongoDB, CouchDB > - PostgreSQL This isn't really a Python question. Before you even begin to think a

Designing a Pythonic search DSL for SQL and NoSQL databases

2013-07-19 Thread Alec Taylor
Dear Python community, I am analysing designing an abstraction layer over a select few NoSQL and SQL databases. Specifically: - Redis, Neo4j, MongoDB, CouchDB - PostgreSQL Being inexperienced; it is hard to know a nice way of abstracting search. For conciseness in my explanation, think of `Tab

Re: What does it take to implement a chat system in Python (Not asking for code just advice before I start my little project)

2013-07-19 Thread Chris Angelico
On Fri, Jul 19, 2013 at 9:25 PM, Jorgen Grahn wrote: > On Thu, 2013-07-18, Chris Angelico wrote: > ... >> You can certainly do your server-side programming directly in Python; >> in fact, I recommend it for this task. There's no reason to use HTTP, >> much less a web framework (which usually consi

Re: What does it take to implement a chat system in Python (Not asking for code just advice before I start my little project)

2013-07-19 Thread Jorgen Grahn
On Thu, 2013-07-18, Chris Angelico wrote: ... > You can certainly do your server-side programming directly in Python; > in fact, I recommend it for this task. There's no reason to use HTTP, > much less a web framework (which usually consists of a structured way > to build HTML pages, plus a bunch o

Re: Messages to Python-List aren't posting

2013-07-19 Thread Chris Angelico
On Fri, Jul 19, 2013 at 6:30 AM, Matthew Lefavor wrote: > All: > > I've been having trouble with all three Python mailing lists (python-list, > python-dev, python-ideas). This has been going on for about a month. > Whenever I post, it takes hours for my messages to be posted on the list. I > first

Messages to Python-List aren't posting

2013-07-19 Thread Matthew Lefavor
All: I've been having trouble with all three Python mailing lists (python-list, python-dev, python-ideas). This has been going on for about a month. Whenever I post, it takes hours for my messages to be posted on the list. I first thought it was an issue with my work email server, but moving to gm

KeyboardInterrupt in Subproccesses

2013-07-19 Thread Matthew Lefavor
All: I am maintaining a program in Python 2 and need to send it a KeyboardInterrupt to close it. Unfortunately, the program is used as a subprocess in a wrapper subprocess, and so I cannot just directly press CTL-C; I have to use a signal. When I run the program "bare" (not in a subprocess), I ha

Re: Stack Overflow moderator “animuson”

2013-07-19 Thread Jake Angulo
On Wed, Jul 10, 2013 at 5:55 PM, Mats Peterson wrote: > A moderator who calls himself “animuson” on Stack Overflow doesn’t > want to face the truth. He has deleted all my postings regarding Python > regular expression matching being extremely slow compared to Perl. > Additionally my account has b

Re: What does it take to implement a chat system in Python (Not asking for code just advice before I start my little project)

2013-07-19 Thread Chris Angelico
On Fri, Jul 19, 2013 at 5:10 PM, Jake Angulo wrote: > On Thu, Jul 18, 2013 at 2:36 PM, Aseem Bansal wrote: >> >> I wanted to do a little project for learning Python. I thought a chat >> system will be good as it isn't something that I have ever done. >> ... >> >> I wanted to know what

Re: What does it take to implement a chat system in Python (Not asking for code just advice before I start my little project)

2013-07-19 Thread Jake Angulo
On Thu, Jul 18, 2013 at 2:36 PM, Aseem Bansal wrote: > I wanted to do a little project for learning Python. I thought a chat > system will be good as it isn't something that I have ever done. > ... > I wanted to know what will I need? > 1 learn network/socket programming I was actua