Re: Loop Question

2013-06-24 Thread Dave Angel
On 06/24/2013 03:00 PM, John Gordon wrote: In =?UTF-8?B?Q2hyaXMg4oCcS3dwb2xza2HigJ0gV2Fycmljaw==?= writes: while True: username = raw_input("Please enter your username: ") password = raw_input("Please enter your password: ") if username == "john doe" and password == "fopwpo":

Re: What's wrong with this code? (UnboundLocalError: local variable referenced before assignment)

2013-06-24 Thread Dave Angel
On 06/24/2013 04:12 PM, John Gordon wrote: In pablobarhamal...@gmail.com writes: isWhite = True def change(event): if event.x > x1 and event.x < x2 and event.y > y1 and event.y < y2: if isWhite: w.itemconfig(rect, fill="blue") isWhite = False

Re: (newbye) exceptions list for python3 classes

2013-06-24 Thread Dave Angel
On 06/24/2013 05:43 PM, chrem wrote: Le 24/06/13 23:35, chrem a écrit : Hi, what is the best way to find out all exceptions for a class? E.g. I want to find out all exceptions related to the zipfile (I'm searching for the Bad password exception syntax). thanks for your help or feedback, Christ

Re: Unable to import NHunspell.dll using ctypes in Python

2013-06-25 Thread Dave Angel
On 06/25/2013 03:32 AM, akshay.k...@gmail.com wrote: Thanks for the reply Mark. I did what you suggested. But now I'm getting an error like this. Traceback (most recent call last): File "start.py", line 15, in hunspell = cdll.LoadLibrary('/home/kuro/Desktop/notepad/Hunspellx64.dll')

Re: Loop Question

2013-06-25 Thread Dave Angel
On 06/24/2013 08:20 AM, Lutz Horn wrote: Hi, Am 24.06.2013 14:12 schrieb christheco...@gmail.com: username=raw_input("Please enter your username: ") password=raw_input("Please enter your password: ") if username == "john doe" and password == "fopwpo": print "Login Successful" else: pr

Re: Unable to import NHunspell.dll using ctypes in Python

2013-06-25 Thread Dave Angel
On 06/25/2013 03:54 AM, Chris “Kwpolska” Warrick wrote: On Tue, Jun 25, 2013 at 9:45 AM, Dave Angel wrote: You're on Linux or similar, and dll's are the way a Windows executable is named. dll’s are libraries for windows, not executables (/lib not /bin) Try going back to

Re: Unable to import NHunspell.dll using ctypes in Python

2013-06-25 Thread Dave Angel
On 06/25/2013 03:58 AM, akshay.k...@gmail.com wrote: Thanks Dave. I'm using Python 2.7 and am working on Linux Mint. Does it mean that I cant load the functions within the dll whilst on Linux. I thought that was what ctypes was used for. Please correct me if I misunderstood what you meant. c

Re: Inconsistency on getting arguments

2013-06-25 Thread Dave Angel
On 06/25/2013 09:55 AM, Peter Otten wrote: Marco Perniciaro wrote: Hi, I've been working with Python for a long time. Yet, I came across an issue which I cannot explain. Recently I have a new PC (Windows 7). Previously I could call a Python script with or without the "python" word at the begin

Re: io module and pdf question

2013-06-25 Thread Dave Angel
On 06/25/2013 12:15 PM, jyoun...@kc.rr.com wrote: Thank you Rusi and Christian! Something I don't think was mentioned was that reading a text file in Python 3, and specifying latin-1, will work simply because every possible 8-bit byte is a character in Latin-1 That doesn't mean that those

Re: Looking for a name for a deployment framework...

2013-06-25 Thread Dave Angel
On 06/25/2013 03:38 PM, Stig Sandbeck Mathisen wrote: jonathan.slend...@gmail.com writes: Any suggestions for a good name, for a framework that does automatic server deployments? Whatever you choose, make sure it is easily searchable. Googling for "puppet" and "chef" only recently gave releva

Re: Limit Lines of Output

2013-06-25 Thread Dave Angel
On 06/25/2013 04:37 PM, Bryan Britten wrote: Joel - I don't want to send it to a text file because it's just meant to serve as a reference for the user to get an idea of what words are mentioned. The words being analyzed are responses to a survey questions and the primary function of this scr

Re: Parsing soap/xml result

2013-06-25 Thread Dave Angel
On 06/25/2013 06:28 PM, miguel olivares varela wrote: I try to parse a soap/xml answer like: http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> http://schemas.xmlsoap.org/soap/encoding/"

Re: class factory question

2013-06-27 Thread Dave Angel
On 06/27/2013 09:37 AM, Tim wrote: On Thursday, June 27, 2013 9:16:50 AM UTC-4, Joshua Landau wrote: On 26 June 2013 14:09, Tim wrote: I am extending a parser and need to create many classes that are all subclassed from the same object (defined in an external library). When my module is loa

Re: Running programs on mobile phones

2013-06-27 Thread Dave Angel
On 06/27/2013 11:11 AM, Mok-Kong Shen wrote: Could one write Python codes and have them run on one's own mobile phone? If yes, are there some good literatures? Thanks in advance. M. K. Shen I've not tried it, but that's what QPython is supposed to do. http://qpython.com/ -- DaveA -- http:

Re: Why is the argparse module so inflexible?

2013-06-27 Thread Dave Angel
On 06/27/2013 09:49 AM, Andrew Berg wrote: On 2013.06.27 08:08, Roy Smith wrote: Can you give us a concrete example of what you're trying to do? The actual code I've written so far isn't easily condensed into a short simple snippet. I'm trying to use argparse to handle all the little details o

Re: Devnagari Unicode Conversion Issues

2013-06-27 Thread Dave Angel
On 06/27/2013 11:39 AM, darpan6aya wrote: That worked out. I was trying to encode it the entire time. Now I realise how silly I am. Thanks MRAB. Once Again. :D you're not silly, it's a complex question. MRAB is good at guessing which part is messing you up. However, when you're writing a

Re: Why is the argparse module so inflexible?

2013-06-27 Thread Dave Angel
On 06/27/2013 02:05 PM, Terry Reedy wrote: On 6/27/2013 8:54 AM, Andrew Berg wrote: I've begun writing a program with an interactive prompt, and it needs to parse input from the user. I thought the argparse module would be great for this, It is outside argparse's intended domain of applicatio

Re: indexerror: list index out of range??

2013-06-28 Thread Dave Angel
On 06/28/2013 09:20 PM, Titiksha Joshi wrote: Hi, I am working on the following code but am getting the error: list index out of range. I surfed through the group but somehow I am not able to fix my error.Please guide.Structure is given below: m is a list of 5 elements. I have to match elements

Re: indexerror: list index out of range??

2013-06-29 Thread Dave Angel
On 06/28/2013 11:35 PM, Titiksha wrote: On Friday, June 28, 2013 8:20:28 PM UTC-5, Titiksha wrote: m=['631138', '601034', '2834', '2908', '64808'] ['LAKEFLD 3227,631138\n', 'NOBLES 3013,601034\n'] Since you're using the arrogant and buggy GoogleGroups, this

Re: MeCab UTF-8 Decoding Problem

2013-06-29 Thread Dave Angel
On 06/29/2013 07:29 AM, fob...@gmail.com wrote: Hi, Using Python 2.7 on Linux, presumably? It'd be better to be explicit. I am trying to use a program called MeCab, which does syntax analysis on Japanese text. The problem I am having is that it returns a byte string and if I try to print

Re: File exists but Python says 'not found'.

2013-07-01 Thread Dave Angel
On 07/01/2013 07:00 AM, preri...@gmail.com wrote: I got it. The working directory was different. Sorry, I'm new and didn't the working directory has to be the location of the data. I thought the location of .py file and data file should be same. Thanks! Es. Robert Kern. Python didn't make th

Re: python adds an extra half space when reading froma string or list -- back to the question

2013-07-01 Thread Dave Angel
On 07/01/2013 03:32 PM, Joel Goldstick wrote: I copied the original question so that the rant on the other thread can continue. Let's keep this thread ontopic number_drawn=() def load(lot_number,number_drawn): first=input("enter first lot: ") last=input("enter last lot: ") for l

Re: python adds an extra half space when reading froma string or list -- back to the question

2013-07-01 Thread Dave Angel
On 07/01/2013 05:16 PM, rusi wrote: On Tuesday, July 2, 2013 1:32:44 AM UTC+5:30, Dave Angel wrote: Yes in this specific instance all this is probably true. I believe however, that Joel's intent in reposting this is more global (and important) in its scope, viz: If this list per

Re: OSError [Errno 26] ?!?!

2013-07-02 Thread Dave Angel
On 07/02/2013 06:06 AM, Chris “Kwpolska” Warrick wrote: On Tue, Jul 2, 2013 at 11:40 AM, Νίκος wrote: Στις 2/7/2013 10:21 πμ, ο/η Cameron Simpson έγραψε: On 02Jul2013 08:57, Νίκος wrote: | Thank you, the error have been caused due to the fact that the | uploading procedure of my edited 'pela

Re: Default scope of variables

2013-07-04 Thread Dave Angel
On 07/04/2013 01:32 AM, Steven D'Aprano wrote: Well, if I ever have more than 63,000,000 variables[1] in a function, I'll keep that in mind. [1] Based on empirical evidence that Python supports names with length at least up to one million characters long, and assuming that eac

Re: Important features for editors

2013-07-04 Thread Dave Angel
On 07/04/2013 03:59 AM, Νίκος wrote: Στις 4/7/2013 10:32 πμ, ο/η cutems93 έγραψε: I am researching on editors for my own reference. I found that each of them has some features that other don't, but I am not sure which features are significant/necessary for a GOOD editor. What features do you a g

Re: Important features for editors

2013-07-04 Thread Dave Angel
On 07/04/2013 03:32 AM, cutems93 wrote: I am researching on editors for my own reference. I found that each of them has some features that other don't, but I am not sure which features are significant/necessary for a GOOD editor. What features do you a good editor should have? Keyboard shortcu

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-07-04 Thread Dave Angel
On 07/04/2013 04:37 AM, Νίκος wrote: I just started to have this error without changing nothing in my index.html(template) and metrites.py(which ipen the template) [Thu Jul 04 11:35:14 2013] [error] [client 108.162.229.97] Original exception was: [Thu Jul 04 11:35:14 2013] [error] [client 108.1

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-07-04 Thread Dave Angel
On 07/04/2013 06:03 AM, Νίκος wrote: Στις 4/7/2013 12:59 μμ, ο/η Dave Angel έγραψε: On 07/04/2013 04:37 AM, Νίκος wrote: I just started to have this error without changing nothing in my index.html(template) and metrites.py(which ipen the template) [Thu Jul 04 11:35:14 2013] [error] [client

Re: Coping with cyclic imports

2013-07-04 Thread Dave Angel
On 07/04/2013 08:48 AM, kanchan.n.maha...@gmail.com wrote: On Tuesday, April 8, 2008 10:06:46 PM UTC+2, Torsten Bronger wrote: Hallöchen! I have a rather fat module that represents a document parser -- inline elements, block elements, and the like. Now I want to split it into many modules to m

Re: Coping with cyclic imports

2013-07-04 Thread Dave Angel
On 07/04/2013 11:11 AM, kanchan.n.maha...@gmail.com wrote: On Thursday, July 4, 2013 5:03:20 PM UTC+2, Oscar Benjamin wrote: On 4 July 2013 13:48, wrote: On Tuesday, April 8, 2008 10:06:46 PM UTC+2, Torsten Bronger wrote: [snip] If you do "import foo" inside bar and "import bar" insi

Re: Important features for editors

2013-07-04 Thread Dave Angel
On 07/04/2013 08:38 PM, Joshua Landau wrote: On 4 July 2013 08:32, cutems93 wrote: I am researching on editors for my own reference. I found that each of them has some features that other don't, but I am not sure which features are significant/necessary for a GOOD editor. What features do you

Re: Default scope of variables

2013-07-04 Thread Dave Angel
On 07/04/2013 09:24 PM, Steven D'Aprano wrote: On Thu, 04 Jul 2013 17:54:20 +0100, Rotwang wrote: [...] Anyway, none of the calculations that has been given takes into account the fact that names can be /less/ than one million characters long. Not in *my* code they don't!!! *wink* The act

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-07-05 Thread Dave Angel
On 07/05/2013 02:51 AM, Νίκος Gr33k wrote: Please help because i just happened to noticed that after having this code: try: host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0] except Exception as e: host = "Reverse DNS Failed" Don't ever catch a bare Exception class.

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-07-05 Thread Dave Angel
On 07/05/2013 03:13 AM, Νίκος Gr33k wrote: Στις 5/7/2013 10:06 πμ, ο/η Lele Gaifax έγραψε: try: host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0] except: host = "Reverse DNS Failed" Yes i uses to had it like that, until i was looking for ways to make it h

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-07-05 Thread Dave Angel
On 07/05/2013 04:00 AM, Νίκος Gr33k wrote: Στις 5/7/2013 10:50 πμ, ο/η Dave Angel έγραψε: The line started as: > host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0] refactor that to: remadd = os.environ('REMOVE_ADDR') tuple3 = sock

Re: question please

2013-07-05 Thread Dave Angel
On 07/05/2013 03:48 AM, bill papanastasiou wrote: hello , good morning how i can pùt one python file in website ? Whose website? If it's your own, log into the server, and use cp. Or if you're remote with ssh access, use scp. And if you really have a bunch of files to remotely transfer, u

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-07-05 Thread Dave Angel
On 07/05/2013 04:49 AM, Νίκος Gr33k wrote: I don't think running it via 'cli' would help much, since its a cgi-script and ip addr function have no meaning calling them in plain our of a cgi environment but here it is: No idea how to parse "have no meaning calling them in plain our of

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-07-05 Thread Dave Angel
On 07/05/2013 06:33 AM, Νίκος Gr33k wrote: Στις 5/7/2013 12:21 μμ, ο/η Dave Angel έγραψε: Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.3/os.py", line 669, in __getitem__ value = self._data[self.encodekey(key)] KeyError: b

Re: Geo Location extracted from visitors ip address

2013-07-05 Thread Dave Angel
On 07/05/2013 04:44 PM, Tim Roberts wrote: ? Gr33k wrote: Is there a way to extract out of some environmental variable the Geo location of the user being the city the user visits out website from? Perhaps by utilizing his originated ip address? It is possible to look up the geographic r

Re: Geo Location extracted from visitors ip address

2013-07-06 Thread Dave Angel
On 07/06/2013 04:41 AM, Νίκος Gr33k wrote: Στις 6/7/2013 11:30 πμ, ο/η Chris Angelico έγραψε: On Sat, Jul 6, 2013 at 6:01 PM, � Gr33k wrote: Is there any way to pinpoint the visitor's exact location? Yes. You ask them to fill in a shipping address. They may still lie, or they may choose

Re: capture html screen with pexpect

2013-07-08 Thread Dave Angel
On 07/07/2013 01:06 PM, inq1ltd wrote: python help, I can log into a web site with pexpect but what I want to do is pipe the opening window to a file. Logging into the site opens the site window but I can't get the window to a file. I can't use screen capture I need to get pexpect to pipe it

Re: How do I write a script to generate 10 random EVEN numbers and write them to a .txt file?

2013-07-08 Thread Dave Angel
On 07/08/2013 08:01 AM, Kenz09 wrote: Hi, I have been given a task to do. I am a new to programming and Python. My task is to : -Create a function that is called from the main function, that accepts a number as a parameter and determines if the number is even or odd. the next one is, -To create

Re: A small question about PEP 8

2013-07-08 Thread Dave Angel
On 07/08/2013 08:02 AM, Steven D'Aprano wrote: On Mon, 08 Jul 2013 11:39:21 +0100, Joshua Landau wrote: Or you can (be sane) and put it at no indentation: """ a_wonderful_set_of_things = { ..., not_missing_an_end_brace } """ I consider that the least aesthetically pleasing,

Re: How do I write a script to generate 10 random EVEN numbers and write them to a .txt file?

2013-07-08 Thread Dave Angel
On 07/08/2013 09:10 AM, Joshua Landau wrote: On 8 July 2013 13:27, Dave Angel wrote: One of your classmates has already posted the question. However, you win the prize for a better subject line. Or are you the same student, changing your name and wasting our time by starting a new thread

Re: hex dump w/ or w/out utf-8 chars

2013-07-08 Thread Dave Angel
On 07/08/2013 01:53 PM, ferdy.blat...@gmail.com wrote: Hi Steven, thank you for your reply... I really needed another python guru which is also an English teacher! Sorry if English is not my mother tongue... "uncorrect" instead of "incorrect" (I misapplied the "similarity principle" like "unplea

Re: hex dump w/ or w/out utf-8 chars

2013-07-08 Thread Dave Angel
On 07/08/2013 05:49 PM, Chris Angelico wrote: On Tue, Jul 9, 2013 at 6:56 AM, Dave Angel wrote: But Unicode has nothing to do with Guido, and it has existed for about 25 years (if I recall correctly). Depends how you measure. According to [1], the work kinda began back then (25 years ago

Re: hex dump w/ or w/out utf-8 chars

2013-07-09 Thread Dave Angel
On 07/09/2013 08:22 AM, Neil Cerutti wrote: On 2013-07-08, Dave Angel wrote: I appreciate you've been around a long time, and worked in a lot of languages. I've programmed professionally in at least 35 languages since 1967. But we've come a long way from the 6bit characters

Re: hex dump w/ or w/out utf-8 chars

2013-07-09 Thread Dave Angel
On 07/09/2013 09:00 AM, Neil Cerutti wrote: Interestingly similar scheme. It wonder if 5-bit chars was a common compression scheme. The Z-machine spec was never officially published either. I believe a "task force" reverse engineered it sometime in the 90's. Baudot was 5 bits. It used s

Re: Reading File Into 2D List

2013-07-09 Thread Dave Angel
On 07/09/2013 09:30 AM, alex.ha...@gmail.com wrote: Hello! I'm new here and fairly new to Python. I am attempting to read a data file into python and adding it to a 2D list to make it easy to use further down the line. My data file is just 7 numbers in a row seperated by commas and each bulk o

Re: crack a router passcode

2013-07-09 Thread Dave Angel
On 07/09/2013 10:26 AM, Ferrous Cranus wrote: Στις 9/7/2013 4:32 μμ, ο/η Chris Angelico έγραψε: On Tue, Jul 9, 2013 at 11:23 PM, Ferrous Cranus wrote: Could python somehow brute force http://192.168.1.1/login.php giving user and pass trying to guess the password? Could it be able to pass valu

Re: crack a router passcode

2013-07-09 Thread Dave Angel
On 07/09/2013 12:06 PM, Ferrous Cranus wrote: What is the reason of a spambot? Spam a usenet forum to gain what? Spam is unsolicited advertising. A bot is a robot, or other automated device. So Spambots on a usenet newsgroup send apparently innocent questions that also contain lin

Re: looking for a new router

2013-07-09 Thread Dave Angel
On 07/09/2013 01:29 AM, Kumita Bruce wrote: Agree. Sir, this mailing list is for Python discussion. :) Save your breath. saadharana and saishreemathi are spambots, and are undoubtedly not "listening." -- DaveA -- http://mail.python.org/mailman/listinfo/python-list

Re: Recursive class | can you modify self directly?

2013-07-09 Thread Dave Angel
On 07/09/2013 06:01 PM, Russel Walker wrote: Sorry for the vague title. Probably best to just show you the code that explains it better. This is a simplified example of what I want to do: # THIS DOESN'T WORK from random import choice class Expr(object): """ Expr(expr, op, val) -> a

Re: Best Scripting Language for Embedded Work?

2013-07-09 Thread Dave Angel
On 07/09/2013 09:29 PM, David T. Ashley wrote: We develop embedded software for 32-bit micros using Windows as the development platform. We are seeking a general purpose scripting language to automate certain tasks, like cleaning out certain directories of certain types of files in preparation f

Re: Concurrent writes to the same file

2013-07-10 Thread Dave Angel
On 07/11/2013 12:57 AM, Jason Friedman wrote: Other than using a database, what are my options for allowing two processes to edit the same file at the same time? When I say same time, I can accept delays. I considered lock files, but I cannot conceive of how I avoid race conditions. In gener

Re: Question about mailing list rules

2013-07-12 Thread Dave Angel
On 07/12/2013 08:34 AM, Chris “Kwpolska” Warrick wrote: On Fri, Jul 12, 2013 at 2:25 PM, Devyn Collier Johnson wrote: One more thing Devyn should do is watch the “To:” field and make sure it says python-list@python.org, because the above message was sent to Chris only, and that is not

Re: GeoIP2 for retrieving city and region ?

2013-07-12 Thread Dave Angel
On 07/12/2013 10:18 AM, Νικόλας wrote: Hello, iam still looking for a way to identify the city of my website visitors. I cant even import the module even though my 'pip install geopip2' wa successful Either it wasn't successful, or it's not the package you thought. There are lots of

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-07-12 Thread Dave Angel
On 07/12/2013 07:56 AM, Ferrous Cranus wrote: Στις 12/7/2013 2:47 μμ, ο/η Wayne Werner έγραψε: On Thu, 4 Jul 2013, Νίκος Γκρ33κ wrote: Στις 4/7/2013 6:10 μμ, ο/η MRAB έγραψε: What do you mean "I don't know how to catch the exception with OSError"? You've tried "except socket.gaierror" and "ex

Re: hex dump w/ or w/out utf-8 chars

2013-07-13 Thread Dave Angel
On 07/13/2013 10:37 AM, wxjmfa...@gmail.com wrote: The FSR is naive and badly working. I can not force people to understand the coding of the characters [*]. That would be very hard, since you certainly do not. I'm the first to recognize that Python and/or Pike are free to do what they wis

Re: Python - remote object protocols and security

2013-07-15 Thread Dave Angel
On 07/15/2013 06:20 AM, Jean-Michel Pichavant wrote: In text format... sorry for my previous html post Hello everyone, I'd like to exchange some simple python objects over the internet. I initially planned to use Pyro, after reading http://pythonhosted.org/Pyro4/security.html I'm still puzzled

Re: Python - remote object protocols and security

2013-07-15 Thread Dave Angel
On 07/15/2013 08:30 AM, Chris Angelico wrote: On Mon, Jul 15, 2013 at 10:26 PM, Jean-Michel Pichavant wrote: Basically, I need to transfer numbers (int). Possibly dictionaries like {string: int} in order to structure things a little bit. I strongly recommend JSON, then. It's a well-known sys

Re: Help with pygame

2013-07-16 Thread Dave Angel
On 07/16/2013 01:29 PM, Daniel Kersgaard wrote: I'm having a little trouble, tried Googling it, but to no avail. Currently, I'm working on making a snake game, however I'm stuck on a simple border. The only thing I need help with is when you run the program, the bottom right corner of the bord

Re: tkinter redraw rates

2013-07-16 Thread Dave Angel
On 07/16/2013 08:57 PM, fronag...@gmail.com wrote: Hm. So I've written a GUI in tkinter. I've found two performance issues, I was hoping someone could point me in the right direction. Firstly, I'm using an image as a border, namely: This works, yes, but is annoyingly laggy on an older

Re: tkinter redraw rates

2013-07-16 Thread Dave Angel
On 07/16/2013 09:51 PM, fronag...@gmail.com wrote: If you are going to use googlegroups, then at least bypass its worst bugs, like double-spacing everything it quotes. http://wiki.python.org/moin/GoogleGroupsPython Yeah, I understand that tkinter isn't really designed for 'logic is runn

Re: tkinter redraw rates

2013-07-17 Thread Dave Angel
On 07/16/2013 11:04 PM, fronag...@gmail.com wrote: Noted on the quoting thing. Regarding the threading, well, first, I'm not so much a programmer as someone who knows a bit of how to program. And it seems that the only way to update a tkinter window is to use the .update() method, which is wh

Re: tkinter redraw rates

2013-07-17 Thread Dave Angel
On 07/17/2013 07:10 AM, fronag...@gmail.com wrote: On Wednesday, July 17, 2013 6:07:22 PM UTC+8, Dave Angel wrote: On 07/16/2013 11:04 PM, fronag...@gmail.com wrote: Noted on the quoting thing. Regarding the threading, well, first, I'm not so much a programmer as someone who knows a b

Re: tkinter redraw rates

2013-07-17 Thread Dave Angel
On 07/17/2013 09:18 AM, fronag...@gmail.com wrote: On Wednesday, July 17, 2013 7:42:45 PM UTC+8, Dave Angel wrote: On 07/17/2013 07:10 AM, fronag...@gmail.com wrote: On Wednesday, July 17, 2013 6:07:22 PM UTC+8, Dave Angel wrote: On 07/16/2013 11:04 PM, fronag...@gmail.com wrote: Noted on

Re: tkinter redraw rates

2013-07-17 Thread Dave Angel
On 07/17/2013 08:44 PM, fronag...@gmail.com wrote: On Thursday, July 18, 2013 1:38:34 AM UTC+8, Dave Angel wrote: On 07/17/2013 09:18 AM, fronag...@gmail.com wrote: On Wednesday, July 17, 2013 7:42:45 PM UTC+8, Dave Angel wrote: On 07/17/2013 07:10 AM, fronag...@gmail.com wrote: On Wednesday

Re: Need help with network script

2013-07-17 Thread Dave Angel
On 07/17/2013 09:50 PM, Chris Angelico wrote: On Thu, Jul 18, 2013 at 11:44 AM, wrote: Hi everyone. I am starting to learn python and I decided to start with what I though was a simple script but I guess now. All I want to do is return what current network location I am using on my mac. Ever

Re: tkinter redraw rates

2013-07-17 Thread Dave Angel
On 07/18/2013 12:38 AM, fronag...@gmail.com wrote: On Thursday, July 18, 2013 9:07:24 AM UTC+8, Dave Angel wrote: On 07/17/2013 08:44 PM, fronag...@gmail.com wrote: On Thursday, July 18, 2013 1:38:34 AM UTC+8, Dave Angel wrote: On 07/17/2013 09:18 AM, fronag...@gmail.com wrote: On Wednesday

Re: Creating a Program to Decompose a Number and Run a Function on that Decomposition

2013-07-18 Thread Dave Angel
On 07/18/2013 07:04 PM, CTSB01 wrote: On Thursday, July 18, 2013 6:49:03 PM UTC-4, Ian wrote: On Jul 18, 2013 4:23 PM, "CTSB01" wrote: File "", line 2 ... rtn = [] ^ The "..." is the continuation prompt from the interactive interpreter, not part of the code. Don't

Re: Creating a Program to Decompose a Number and Run a Function on that Decomposition

2013-07-18 Thread Dave Angel
On 07/18/2013 08:35 PM, CTSB01 wrote: > It's only obvious if you're using Python 3.x. You have forgotten the parentheses in the call to the print() function. On the other hand, if this is Python 2.x, I have no idea. Next time, please paste the actual error, not paraphrased. The error me

Re: Creating a Program to Decompose a Number and Run a Function on that Decomposition

2013-07-18 Thread Dave Angel
On 07/18/2013 10:16 PM, CTSB01 wrote: Does something like def phi_m(x, m): rtn = [] for n2 in range(0, len(x) * m - 2): n = n2 / m r = n2 - n * m rtn.append(m * x[n] + r * (x[n + 1] - x[n])) print ('n2 =', n2, ': n ='

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: 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: 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 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

Re: Find and Replace Simplification

2013-07-20 Thread Dave Angel
On 07/20/2013 01:03 PM, Joshua Landau wrote: On 20 July 2013 12:57, Serhiy Storchaka wrote: 20.07.13 14:16, Joshua Landau написав(ла): However, some quick timing shows that translate has a very high penalty for missing characters and is a tad slower any way. Really, though, there sh

Re: Find and Replace Simplification

2013-07-20 Thread Dave Angel
On 07/20/2013 02:37 PM, Joshua Landau wrote: On 20 July 2013 19:04, Dave Angel wrote: On 07/20/2013 01:03 PM, Joshua Landau wrote: Still, it seems to me that it should be optimizable for sensible builtin types such that .translate is significantly faster, as there's no theoretical extra

Re: How to read a make file in python and access its elements

2013-07-22 Thread Dave Angel
On 07/22/2013 03:09 PM, san wrote: How to read/load the cmake file in python and access its elements. I have a scenario, where i need to load the make file and access its elements. I have tried reading the make file as text file and parsing it,but its not the ideal solution Please let me know h

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

2013-07-24 Thread Dave Angel
On 07/24/2013 08:51 PM, David M. Cotter wrote: update: okay so the python27.dll is in /windows/system32 so ignore that i've set my include directory correct, so i can compile i've set my "additional libraries" directory to the "libs" directory (where the ".lib" files are. (note: NOT including

Re: Creating a Simple User Interface for a Function

2013-07-25 Thread Dave Angel
On 07/25/2013 12:03 PM, CTSB01 wrote: I have the following code that runs perfectly: def psi_j(x, j): rtn = [] for n2 in range(0, len(x) * j - 2): n = n2 / j r = n2 - n * j rtn.append(j * x[n] + r * (x[n + 1] - x[n]))

Re: Creating a Simple User Interface for a Function

2013-07-25 Thread Dave Angel
On 07/25/2013 04:58 PM, CTSB01 wrote: Sorry Dave, to answer each part of your response: 1) I decided to use Python 2.7, and I will be sure to specify this in all future threads. 2) It is a list of positive integers. In fact, it is always going to be a list of positive increasing integer

Re: Critic my module

2013-07-27 Thread Dave Angel
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". I tested this in Guake running Python3.3. >>> os.getcwd() '/home/collier'

Re: Critic my module

2013-07-27 Thread Dave Angel
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? The user runs the Python interpreter, and types

Re: Critic my module

2013-07-27 Thread Dave Angel
On 07/27/2013 12:32 PM, Alister wrote: On Sat, 27 Jul 2013 08:56:10 -0400, Devyn Collier Johnson wrote: Good point about the Made by/Copyright suggestion. Although, I have not copyrighted the file, can I still say "Copyrighted by ...".-- There is no special process to Copyright anything. the

Re: import syntax

2013-07-29 Thread Dave Angel
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 Why is that? Is there a performance advantage to one of the styles? Pep 8 is not about performance, it's about readability. And unless the two l

Re: importing modules

2013-07-30 Thread Dave Angel
On 07/29/2013 05:57 PM, syed khalid wrote: I am attempting to import modules from Shogun to python from a non-standard python directory ie from my /home/xxx directory. is there a way on ubuntu to selectively some modules, scripts, data from one directory and others modules, scripts from another

Re: Is python a interpreted or compiled language?

2012-06-20 Thread Dave Angel
On 06/20/2012 07:30 PM, gmspro wrote: > Hi, > > Is python a interpreted or compiled language? > What does happen after this command: python f.py > > I knew python makes file.pyc file to store the bytecode. For java , .class > file is the bytecode file, someone can run that file from any machine. S

Re: Can parellelized program run slower than single process program?

2012-06-20 Thread Dave Angel
On 06/21/2012 01:05 AM, Yesterday Paid wrote: > from multiprocessing import Pool > from itertools import product > > def sym(lst): > x,y=lst > tmp=x*y > if rec(tmp): > return tmp > else: > return None > > def rec(num): > num=str(num) > if num == "".join(rever

Re: Strange threading behaviour

2012-06-21 Thread Dave Angel
On 06/21/2012 11:19 AM, Rotwang wrote: > Hi all, I'm using Python 2.7.2 on Windows 7 and a module I've written > is acting strangely. I can reproduce the behaviour in question with > the following: > > --- begin bugtest.py --- > > import threading, Tkinter, os, pickle > > class savethread(threading

Re: Strange threading behaviour

2012-06-21 Thread Dave Angel
On 06/21/2012 02:03 PM, Rotwang wrote: > On 21/06/2012 18:07, Dave Angel wrote: >> On 06/21/2012 11:19 AM, Rotwang wrote: >>> Hi all, I'm using Python 2.7.2 on Windows 7 and a module I've written >>> is acting strangely. I can reproduce the behavio

Re: cPickle - sharing pickled objects between scripts and imports

2012-06-23 Thread Dave Angel
On 06/23/2012 12:13 PM, Peter Otten wrote: > Rotwang wrote: > >> Hi all, I have a module that saves and loads data using cPickle, and >> I've encountered a problem. Sometimes I want to import the module and >> use it in the interactive Python interpreter, whereas sometimes I want >> to run it as a

Re: exception problem

2012-06-24 Thread Dave Angel
On 06/24/2012 06:30 PM, Charles Hixson wrote: > Sorry, I left out: > er$ python3 --version > Python 3.2.3rc1 > > On 06/24/2012 03:26 PM, Charles Hixson wrote: >> The code: >> print("pre-chunkLine") >> chunks=[] >> try: >>

Re: exception problem

2012-06-24 Thread Dave Angel
On 06/24/2012 07:16 PM, Charles Hixson wrote: > On 06/24/2012 03:43 PM, MRAB wrote: >> On 24/06/2012 23:26, Charles Hixson wrote: >>> >>> >>> >> Don't use a bare "except"; it'll catch _any__exception. Catch only what >> you expect. >> >> For all I know, it could be that the name "l" doesn't exist.

Re: Executing Python Scripts on Mac using Python Launcher

2012-06-26 Thread Dave Angel
On 06/26/2012 01:19 PM, David Thomas wrote: > I have installed Python 2.7.3 from Python.org also in Terminal it states that > I have 2.7.3. > How can I execute the script from Terminal? I've tried typing python into > the window and then dragging the file to terminal but I get a syntax error.

Re: Executing Python Scripts on Mac using Python Launcher

2012-06-26 Thread Dave Angel
(You forgot to include the list on this message, but I'm including them in my reply) On 06/26/2012 02:07 PM, David Thomas wrote: > > > On Tuesday, June 26, 2012 6:37:42 PM UTC+1, Dave Angel wrote: >> >> On 06/26/2012 01:19 PM, David Thomas wrote: >>>

Re: Executing Python Scripts on Mac using Python Launcher

2012-06-26 Thread Dave Angel
On 06/26/2012 03:16 PM, Hans Mulder wrote: > > > Python is an executable, and is > typically located in a "bin" directory. To find out where > it is, type > > type python > > at the shell prompt (that's the first prompt you get if you > open a Terminal window). > > That's a typo. You presu

Re: Executing Python Scripts on Mac using Python Launcher

2012-06-26 Thread Dave Angel
On 06/26/2012 05:48 PM, Hans Mulder wrote: > On 26/06/12 22:41:59, Dave Angel wrote: > > No, I meant: $ type python python is > /Library/Frameworks/Python.framework/Versions/2.7/bin/python 'type' is > a bash builtin that tells you how bash would interpret a command

<    1   2   3   4   5   6   7   8   9   10   >