Aloha! Check out the Betabots!

2013-10-01 Thread Devyn Collier Johnson
. Mahalo, Devyn Collier Johnson devyncjohn...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Am I not seeing the Error?

2013-08-13 Thread Devyn Collier Johnson
that uses trolling is called a troll. A troll can also refer to such a line of code itself. My scripts contain a lot of trolls. It is easier for me to read trolls than "typical" coding styles. Please tell me this is all just an elaborate joke. That was the OP (Devyn Collier Johnson, ) and I, to

Re: Am I not seeing the Error?

2013-08-12 Thread Devyn Collier Johnson
On 08/12/2013 12:56 PM, Joel Goldstick wrote: On Mon, Aug 12, 2013 at 11:47 AM, Roy Smith wrote: I can't quite sort out the multiple quoting levels, but somebody said: Programming like that is called trolling. A programmer that uses trolling is called a troll. A troll can also refer to such

Re: Am I not seeing the Error?

2013-08-12 Thread Devyn Collier Johnson
On 08/12/2013 09:20 AM, Zachary Ware wrote: On Mon, Aug 12, 2013 at 7:33 AM, Devyn Collier Johnson wrote: On 08/10/2013 10:47 PM, Chris Angelico wrote: On Sun, Aug 11, 2013 at 3:43 AM, Roy Smith wrote: In article , Chris Angelico wrote: When you get a syntax error you can&#

Re: Am I not seeing the Error?

2013-08-12 Thread Devyn Collier Johnson
On 08/10/2013 10:47 PM, Chris Angelico wrote: On Sun, Aug 11, 2013 at 3:43 AM, Roy Smith wrote: In article , Chris Angelico wrote: When you get a syntax error you can't understand, look at the previous line of code. Perhaps something there is incomplete; maybe you have mismatched parenthe

Am I not seeing the Error?

2013-08-10 Thread Devyn Collier Johnson
I am checking my 1292-line script for syntax errors. I ran the following commands in a terminal to check for errors, but I do not see the error. collier@Nacho-Laptop:/media/collier/AI/Pysh$ python3 -m py_compile ./beta_engine File "./beta_engine", line 344 JOB_WRITEURGFILES = multiproce

Re: Python3 Multiprocessing

2013-08-09 Thread Devyn Collier Johnson
On 08/09/2013 03:44 PM, MRAB wrote: On 09/08/2013 20:30, Devyn Collier Johnson wrote: Aloha! I need a command that will make threads created by "multiprocessing.Process()" wait for each other to complete. For instance, I want to do something like this: job1 = multiprocessi

Python3 Multiprocessing

2013-08-09 Thread Devyn Collier Johnson
Aloha! I need a command that will make threads created by "multiprocessing.Process()" wait for each other to complete. For instance, I want to do something like this: job1 = multiprocessing.Process(CMD1()) job2 = multiprocessing.Process(CMD2()) jobs1.start(); jobs2.start() PY_FUNC() The

Re: Sort lines in a plain text file alphanumerically

2013-08-06 Thread Devyn Collier Johnson
On 08/06/2013 06:52 AM, Chris Angelico wrote: On Tue, Aug 6, 2013 at 11:38 AM, Devyn Collier Johnson wrote: with open('/home/collier/pytest/sort.TXT') as file: sorted(file, key=str.casefold, reverse=True) Thanks for the advice Joshua. I find these tips very usefu

Re: Sort lines in a plain text file alphanumerically

2013-08-06 Thread Devyn Collier Johnson
On 08/05/2013 11:12 PM, Joshua Landau wrote: On 6 August 2013 03:00, Devyn Collier Johnson <mailto:devyncjohn...@gmail.com>> wrote: I am wanting to sort a plain text file alphanumerically by the lines. I have tried this code, but I get an error. I assume this command

Re: Sort lines in a plain text file alphanumerically

2013-08-06 Thread Devyn Collier Johnson
On 08/05/2013 11:49 PM, alex23 wrote: On 6/08/2013 1:12 PM, Joshua Landau wrote: Because it's bad to open files without a with unless you know what you're doing, use a with: with open('/home/collier/pytest/__sort.TXT') as file: sorted(file, key=str.casefold, reverse=True) Shoul

Re: Sort lines in a plain text file alphanumerically

2013-08-06 Thread Devyn Collier Johnson
On 08/05/2013 10:19 PM, MRAB wrote: On 06/08/2013 03:00, Devyn Collier Johnson wrote: I am wanting to sort a plain text file alphanumerically by the lines. I have tried this code, but I get an error. I assume this command does not accept newline characters. >>> file = open('

Re: Sort lines in a plain text file alphanumerically

2013-08-06 Thread Devyn Collier Johnson
On 08/05/2013 10:19 PM, MRAB wrote: On 06/08/2013 03:00, Devyn Collier Johnson wrote: I am wanting to sort a plain text file alphanumerically by the lines. I have tried this code, but I get an error. I assume this command does not accept newline characters. >>> file = open('

Sort lines in a plain text file alphanumerically

2013-08-05 Thread Devyn Collier Johnson
I am wanting to sort a plain text file alphanumerically by the lines. I have tried this code, but I get an error. I assume this command does not accept newline characters. >>> file = open('/home/collier/pytest/sort.TXT', 'r').read() >>> print(file) z c w r h s d >>> file.sort() #The first bl

Re: Share Code: Laptop Lid State

2013-07-30 Thread Devyn Collier Johnson
On 07/30/2013 12:00 PM, Chris Angelico wrote: On Tue, Jul 30, 2013 at 3:06 PM, Devyn Collier Johnson wrote: Aloha everyone! I attached a script that I thought I could share with everyone for your help. This Python3 script only works on Unix systems. It prints the current state of the lid

Share Code: Laptop Lid State

2013-07-30 Thread Devyn Collier Johnson
licensed under LGPLv3 and I will soon upload it to my Launchpad account. Enjoy! Mahalo, devyncjohn...@gmail.com #!/usr/bin/env python3 #Made by Devyn Collier Johnson, NCLA, Linux+, LPIC-1, DCTS # LGPLv3 - 2013. (Devyn Collier Johnson, NCLA, Linux+, LPIC-1, DCTS)© #This program is free

Re: Bitwise Operations

2013-07-29 Thread Devyn Collier Johnson
On 07/29/2013 07:41 PM, Ethan Furman wrote: On 07/29/2013 04:34 PM, Devyn Collier Johnson wrote: On 07/29/2013 05:53 PM, Grant Edwards wrote: On 2013-07-29, Devyn Collier Johnson wrote: On Python3, how can I perform bitwise operations? For instance, I want something that will 'and&

Re: Has anyone gotten Pyglet to work

2013-07-29 Thread Devyn Collier Johnson
Thanks everyone for your help. I installed AVbin v10. I no longer get Python errors, but no sound is produced. This is now an AVbin problem that I must figure out. At least I am done with the Python issues. For those of you that need AVbin: http://avbin.github.io/AVbin/Home/Home.html Mahal

Re: Bitwise Operations

2013-07-29 Thread Devyn Collier Johnson
On 07/29/2013 05:53 PM, Grant Edwards wrote: On 2013-07-29, Devyn Collier Johnson wrote: On Python3, how can I perform bitwise operations? For instance, I want something that will 'and', 'or', and 'xor' a binary integer. http://www.google.com/search?q=python+bi

Re: import syntax

2013-07-29 Thread Devyn Collier Johnson
On 07/29/2013 06:37 PM, Joshua Landau wrote: On 29 July 2013 21:23, Devyn Collier Johnson <mailto:devyncjohn...@gmail.com>> wrote: On 07/29/2013 04:20 PM, Tim Chase wrote: On 2013-07-29 16:09, Dave Angel wrote: On 07/29/2013 03:48 PM, Devyn Collier John

Re: PEP8 79 char max

2013-07-29 Thread Devyn Collier Johnson
On 07/29/2013 05:42 PM, Steven D'Aprano wrote: On Mon, 29 Jul 2013 16:24:51 -0400, Devyn Collier Johnson wrote: So, I can have a script with large lines and not negatively influence performance on systems that do not use punch cards? You'll negatively influence anyone who has t

Re: Has anyone gotten Pyglet to work

2013-07-29 Thread Devyn Collier Johnson
On 07/29/2013 05:08 PM, Gary Herron wrote: On 07/29/2013 01:56 PM, Devyn Collier Johnson wrote: I tried Pyglet in a Python3 and a Python2 script, but both fail. The error code is below and the script is attached. The 'boot.ogg' file is Ubuntu's default bootup sound. I got my

Bitwise Operations

2013-07-29 Thread Devyn Collier Johnson
On Python3, how can I perform bitwise operations? For instance, I want something that will 'and', 'or', and 'xor' a binary integer. Mahalo, devyncjohn...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Has anyone gotten Pyglet to work

2013-07-29 Thread Devyn Collier Johnson
I tried Pyglet in a Python3 and a Python2 script, but both fail. The error code is below and the script is attached. The 'boot.ogg' file is Ubuntu's default bootup sound. I got my code from this link (http://guzalexander.com/2012/08/17/playing-a-sound-with-python.html). collier@Nacho-Laptop:~$

Re: PEP8 79 char max

2013-07-29 Thread Devyn Collier Johnson
On 07/29/2013 04:08 PM, Joel Goldstick wrote: On Mon, Jul 29, 2013 at 3:43 PM, Devyn Collier Johnson wrote: In Python programming, the PEP8 recommends limiting lines to a maximum of 79 characters because "There are still many devices around that are limited to 80 character lines&q

Re: import syntax

2013-07-29 Thread Devyn Collier Johnson
On 07/29/2013 04:20 PM, Tim Chase wrote: On 2013-07-29 16:09, Dave Angel wrote: On 07/29/2013 03:48 PM, Devyn Collier Johnson wrote: The PEP8 recommends importing like this: import os import re not like this: import os, re I got a bit further, and if I'm only using a couple of func

import syntax

2013-07-29 Thread Devyn Collier Johnson
The PEP8 recommends importing like this: import os import re not like this: import os, re Why is that? Is there a performance advantage to one of the styles? Mahalo, Devyn Collier Johnson devyncjohn...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

PEP8 79 char max

2013-07-29 Thread Devyn Collier Johnson
on a line? Would following this recommendation improve script performance? Mahalo, Devyn Collier Johnson devyncjohn...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Critic my module

2013-07-29 Thread Devyn Collier Johnson
On 07/29/2013 02:36 PM, Lele Gaifax wrote: This thread did not mention alternative and existing modules with (almost) the same goal, two come to mind: * https://pypi.python.org/pypi/sh * https://pypi.python.org/pypi/sarge bye, lele. Thanks everyone for the feedback. Clearly, I should stop my p

Re: FSR and unicode compliance - was Re: RE Module Performance

2013-07-29 Thread Devyn Collier Johnson
On 07/29/2013 08:06 AM, Heiko Wundram wrote: Am 29.07.2013 13:43, schrieb wxjmfa...@gmail.com: 3.2 timeit.timeit("r = dir(list)") 22.300465007102908 3.3 timeit.timeit("r = dir(list)") 27.13981129541519 For the record, I do not put your example to contradict you. I was expecting such a res

Re: Critic my module

2013-07-29 Thread Devyn Collier Johnson
(mostly) by ensuring that the right program (in the example /bin/ls) is called, and not only ls. bg, Johannes On 07/26/2013 12:39 PM, Devyn Collier Johnson wrote: On 07/25/2013 09:58 AM, Schneider wrote: Hi, nice idea. mybe - for security reasons - you should ensure, that the right tool

Re: Cross-Platform Python3 Equivalent to notify-send

2013-07-27 Thread Devyn Collier Johnson
On 07/27/2013 11:59 AM, Steven D'Aprano wrote: On Sat, 27 Jul 2013 08:22:00 -0400, Devyn Collier Johnson wrote: On 07/27/2013 07:30 AM, Chris “Kwpolska” Warrick wrote: On Sat, Jul 27, 2013 at 12:58 PM, Devyn Collier Johnson wrote: Linux systems with the proper software can use the &q

Re: Critic my module

2013-07-27 Thread Devyn Collier Johnson
On 07/27/2013 11:14 AM, Jason Swails wrote: You've gotten plenty of good advice from people discussing the coding and coding style itself, I'll provide some feedback from the vantage point of a perspective user. On Thu, Jul 25, 2013 at 9:24 AM, Devyn Collier Johnson mailto:

Re: Cross-Platform Python3 Equivalent to notify-send

2013-07-27 Thread Devyn Collier Johnson
On 07/27/2013 12:06 PM, Chris Angelico wrote: On Sat, Jul 27, 2013 at 4:59 PM, Steven D'Aprano wrote: On Sat, 27 Jul 2013 08:22:00 -0400, Devyn Collier Johnson wrote: That really sucks. I was hoping Python had some way of doing that. All that it needs to do is display a little box at o

Re: Critic my module

2013-07-27 Thread Devyn Collier Johnson
On 07/27/2013 10:33 AM, Dave Angel wrote: On 07/27/2013 08:56 AM, Devyn Collier Johnson wrote: Somehow during this thread, you have changed your purpose for this library. It used to be a library that Python programmers could import and use. And now, it's a shell replacement?

Re: Critic my module

2013-07-27 Thread Devyn Collier Johnson
On 07/27/2013 09:35 AM, Dave Angel wrote: On 07/27/2013 09:19 AM, Devyn Collier Johnson wrote: About the aliases, I have tried setting pwd() as an alias for "os.getcwd()", but I cannot type "pwd()" and get the desired output. Instead, I must type "pwd".

Re: Critic my module

2013-07-27 Thread Devyn Collier Johnson
On 07/26/2013 10:48 PM, Steven D'Aprano wrote: As requested, some constructive criticism of your module. On Thu, 25 Jul 2013 09:24:30 -0400, Devyn Collier Johnson wrote: #!/usr/bin/python3 #Made by Devyn Collier Johnson, NCLA, Linux+, LPIC-1, DCTS What's NCLA, Linux+, LPIC-1, DCTS

Re: Critic my module

2013-07-27 Thread Devyn Collier Johnson
On 07/26/2013 10:48 PM, Steven D'Aprano wrote: As requested, some constructive criticism of your module. On Thu, 25 Jul 2013 09:24:30 -0400, Devyn Collier Johnson wrote: #!/usr/bin/python3 #Made by Devyn Collier Johnson, NCLA, Linux+, LPIC-1, DCTS What's NCLA, Linux+, LPIC-1, DCTS

Re: Cross-Platform Python3 Equivalent to notify-send

2013-07-27 Thread Devyn Collier Johnson
On 07/27/2013 07:30 AM, Chris “Kwpolska” Warrick wrote: On Sat, Jul 27, 2013 at 12:58 PM, Devyn Collier Johnson wrote: Linux systems with the proper software can use the "notify-send" command. Is there a cross-platform Python3 equivalent? Mahalo, Devyn Collier Johnson

Cross-Platform Python3 Equivalent to notify-send

2013-07-27 Thread Devyn Collier Johnson
Linux systems with the proper software can use the "notify-send" command. Is there a cross-platform Python3 equivalent? Mahalo, Devyn Collier Johnson devyncjohn...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Script Hashplings

2013-07-26 Thread Devyn Collier Johnson
On 07/26/2013 10:14 AM, Chris Angelico wrote: On Fri, Jul 26, 2013 at 2:53 PM, MRAB wrote: If you want to test what would happen if that version wasn't installed, set the shebang line to a future version, such as Python 3.4. I doubt you have that installed! :-) Be careful, some people DO have

Re: Critic my module

2013-07-26 Thread Devyn Collier Johnson
On 07/25/2013 10:09 AM, Alain Ketterlin wrote: Devyn Collier Johnson writes: I made a Python3 module that allows users to use certain Linux shell commands from Python3 more easily than using os.system(), subprocess.Popen(), or subprocess.getoutput(). This module (once placed with the

Re: Python Script Hashplings

2013-07-26 Thread Devyn Collier Johnson
ett.plus.com>> wrote: On 25/07/2013 14:42, Devyn Collier Johnson wrote: If I execute a Python3 script with this haspling (#!/usr/bin/python3.3) and Python3.3 is not installed, but Python3.2 is installed, would the script still work? Would it fall ba

Re: Critic my module

2013-07-26 Thread Devyn Collier Johnson
On 07/25/2013 09:58 AM, Schneider wrote: Hi, nice idea. mybe - for security reasons - you should ensure, that the right tool is called and not some tool put the path with the same name. bg, Johannes On Thu 25 Jul 2013 03:24:30 PM CEST, Devyn Collier Johnson wrote: Aloha Python Users

Re: Python Script Hashplings

2013-07-26 Thread Devyn Collier Johnson
On 07/25/2013 09:54 AM, MRAB wrote: On 25/07/2013 14:42, Devyn Collier Johnson wrote: If I execute a Python3 script with this haspling (#!/usr/bin/python3.3) and Python3.3 is not installed, but Python3.2 is installed, would the script still work? Would it fall back to Python3.2? Why don&#

Re: RE Module Performance

2013-07-25 Thread Devyn Collier Johnson
icode codepoint, but Emacs extends UTF-8 to represent the additional codepoints it uses for raw 8- bit bytes and characters not unified with Unicode. " Jeremy Wow! The thread that I started has changed a lot and lived a long time. I look forward to its first birthday (^u^). Devyn Colli

Cross-Platform Python3 Equivalent to notify-send

2013-07-25 Thread Devyn Collier Johnson
Linux systems with the proper software can use the "notify-send" command. Is there a cross-platform Python3 equivalent? Mahalo, Devyn Collier Johnson devyncjohn...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Python Script Hashplings

2013-07-25 Thread Devyn Collier Johnson
If I execute a Python3 script with this haspling (#!/usr/bin/python3.3) and Python3.3 is not installed, but Python3.2 is installed, would the script still work? Would it fall back to Python3.2? I hope Dihedral is listening. I would like to see another response from HIM. Mahalo, DCJ -- http://

Re: PyGLet on Python 3

2013-07-25 Thread Devyn Collier Johnson
On 07/23/2013 02:24 AM, John Ladasky wrote: On 07/21/2013 08:10 PM, Joseph Clark wrote: John, have you taken a look at pyglet? It's an alternative to pygame and I found it pretty slick once I got the hang of it. There is a development version that's compatible with python 3 and I've never h

Critic my module

2013-07-25 Thread Devyn Collier Johnson
ll. The Boa is a constrictor snake. This module makes Unix shells easier to use via Python3. This brings the system shell closer to the Python shell. Mahalo, Devyn Collier Johnson devyncjohn...@gmail.com #!/usr/bin/python3 #Made by Devyn Collier Johnson, NCLA, Linux+, LPIC-1, DCTS #Made using t

Re: Play Ogg Files

2013-07-23 Thread Devyn Collier Johnson
, alex23 <mailto:wuwe...@gmail.com>> wrote: On 20/07/2013 10:25 PM, Devyn Collier Johnson wrote: I have not heard of Pyaudio; I will look into that. As for Pygame, I have not been able to find any good documentation for playing audio files. Plus, I recentl

Re: Play Ogg Files

2013-07-22 Thread Devyn Collier Johnson
On 07/21/2013 01:50 AM, Chris Angelico wrote: On Sun, Jul 21, 2013 at 3:39 PM, David Hutto wrote: With linux you can have your package listed in synaptic, and can use with a sudo apt-get install whatever ogg player like ogg123, and windows I don't work with that much, but I'm pretty sure I've

Re: Play Ogg Files

2013-07-22 Thread Devyn Collier Johnson
On 07/21/2013 10:10 AM, Stefan Behnel wrote: Devyn Collier Johnson, 20.07.2013 14:25: On 07/20/2013 12:21 AM, Stefan Behnel wrote: 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

Re: Find and Replace Simplification

2013-07-20 Thread Devyn Collier Johnson
On 07/20/2013 07:48 AM, Serhiy Storchaka wrote: 19.07.13 21:08, 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 yo

List as Contributor

2013-07-20 Thread Devyn Collier Johnson
you want. Once I release version 0.8, I will inform this mailing list. Moderators: Would you like me to list the email address of this mailing list as a contributor? Mahalo, Devyn Collier Johnson devyncjohn...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Play Ogg Files

2013-07-20 Thread Devyn Collier Johnson
t; import subprocess >>> subprocess.call(['espeak', 'word_spoken'], stdin=None, stdout=None, stderr=None, shell=False) This is on ubuntu linux, using espeak. this is on ubun On Sat, Jul 20, 2013 at 12:21 AM, Stefan Behnel <mailto:stefan...@behnel.de>> wrote:

Re: Find and Replace Simplification

2013-07-20 Thread Devyn Collier Johnson
On 07/20/2013 07:16 AM, Joshua Landau wrote: On 19 July 2013 18:29, Serhiy Storchaka wrote: 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

Re: Share Code Tips

2013-07-20 Thread Devyn Collier Johnson
On 07/20/2013 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 pieces on the board? Or am I misunderstanding the

Re: Play Ogg Files

2013-07-20 Thread Devyn Collier Johnson
On 07/20/2013 12:21 AM, Stefan Behnel wrote: 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

Re: Share Code Tips

2013-07-20 Thread Devyn Collier Johnson
On 07/19/2013 09: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 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-insens

Re: Share Code Tips

2013-07-20 Thread Devyn Collier Johnson
On 07/19/2013 11:18 PM, Steven D'Aprano wrote: 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. Fo

Re: Share Code Tips

2013-07-20 Thread Devyn Collier Johnson
On 07/19/2013 11:44 PM, Steven D'Aprano wrote: 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

Re: Share Code Tips

2013-07-20 Thread Devyn Collier Johnson
On 07/19/2013 09:51 PM, Dave Angel wrote: 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

Play Ogg Files

2013-07-19 Thread Devyn Collier Johnson
nice. I also need the code to execute while the rest of the script continues running. jobs = multiprocessing.Process(SEND = subprocess.getoutput('mplayer -nogui -nolirc -noar -quiet ./conf/boot.ogg')) #Boot sound# Mahalo, Devyn Collier Johnson devyncjohn...@gmail.c

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 wou

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, an

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 th

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

Play Ogg Files

2013-07-19 Thread Devyn Collier Johnson
nice. I also need the code to execute while the rest of the script continues running. jobs = multiprocessing.Process(SEND = subprocess.getoutput('mplayer -nogui -nolirc -noar -quiet ./conf/boot.ogg')) #Boot sound# Mahalo, Devyn Collier Johnson devyncjohn...@gmail.c

Share Code Tips

2013-07-19 Thread Devyn Collier Johnson
DATA = re.sub('', '♜', DATA, flags=re.I); DATA = re.sub('', '♝', DATA, flags=re.I); DATA = re.sub('', '♞', DATA, flags=re.I); PTRNPRS = re.sub('', '♟', DATA, flags=re.I) For those of you making scripts to be run in a terminal, try this for a fancy terminal prompt: INPUTTEMP = input('User ≻≻≻') I may share more code later. Tell me what you think of my coding style and tips. Mahalo, Devyn Collier Johnson devyncjohn...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

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: RE Module Performance

2013-07-16 Thread Devyn Collier Johnson
Am 07/12/2013 07:16 PM, schrieb MRAB: On 12/07/2013 23:16, Tim Delaney wrote: On 13 July 2013 03:58, Devyn Collier Johnson mailto:devyncjohn...@gmail.com>> wrote: Thanks for the thorough response. I learned a lot. You should write articles on Python. I plan to spend som

Dihedral

2013-07-15 Thread Devyn Collier Johnson
On 07/15/2013 08:36 AM, Steven D'Aprano wrote: On Mon, 15 Jul 2013 06:06:06 -0400, Devyn Collier Johnson wrote: On 07/14/2013 02:17 PM, 8 Dihedral wrote: [...] Do we want volunteers to speed up search operations in the string module in Python? It would be nice if someone could spe

Re: RE Module Performance

2013-07-15 Thread Devyn Collier Johnson
On 07/14/2013 02:17 PM, 8 Dihedral wrote: On Saturday, July 13, 2013 1:37:46 PM UTC+8, Steven D'Aprano wrote: On Fri, 12 Jul 2013 13:58:29 -0400, Devyn Collier Johnson wrote: I plan to spend some time optimizing the re.py module for Unix systems. I would love to amp up my programs

Re: RE Module Performance

2013-07-12 Thread Devyn Collier Johnson
On 07/12/2013 12:21 PM, Chris Angelico wrote: On Fri, Jul 12, 2013 at 8:45 PM, Devyn Collier Johnson wrote: Could you explain what you mean? What and where is the new Flexible String Representation? (You're top-posting again. Please put your text underneath what you're respondi

Re: Question about mailing list rules

2013-07-12 Thread Devyn Collier Johnson
On 07/12/2013 07:11 AM, Chris “Kwpolska” Warrick wrote: On Fri, Jul 12, 2013 at 12:47 PM, Chris Angelico wrote: On Fri, Jul 12, 2013 at 8:44 PM, Devyn Collier Johnson wrote: I am going to love this mailing list even more. Really, only Python code? I wanted to ask Python users about Perl

Re: Question about mailing list rules

2013-07-12 Thread Devyn Collier Johnson
I am going to love this mailing list even more. Really, only Python code? I wanted to ask Python users about Perl! (^u^) Devyn Collier Johnson On 07/12/2013 03:26 AM, Chris Angelico wrote: On Fri, Jul 12, 2013 at 9:59 AM, Devyn Collier Johnson wrote: Am I allowed to ask questions like

Re: RE Module Performance

2013-07-12 Thread Devyn Collier Johnson
Could you explain what you mean? What and where is the new Flexible String Representation? Devyn Collier Johnson On 07/12/2013 05:23 AM, wxjmfa...@gmail.com wrote: Le vendredi 12 juillet 2013 01:44:05 UTC+2, Devyn Collier Johnson a écrit : I recently saw an email in this mailing list about

Re: Question about mailing list rules

2013-07-12 Thread Devyn Collier Johnson
On 07/12/2013 09:04 AM, Roy Smith wrote: In article , Chris Angelico wrote: On Fri, Jul 12, 2013 at 9:59 AM, Devyn Collier Johnson wrote: Am I allowed to ask questions like "Here is my code. How can I optimize it?" on this mailing list? Sure you can! And you'll get a

RE Module Performance

2013-07-12 Thread Devyn Collier Johnson
missed that part of the module? Can the RE module be optimized in any way or at least the "re.sub" portion? Mahalo, Devyn Collier Johnson devyncjohn...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Question about mailing list rules

2013-07-12 Thread Devyn Collier Johnson
Am I allowed to ask questions like "Here is my code. How can I optimize it?" on this mailing list? Mahalo, Devyn Collier Johnson devyncjohn...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list