Re: Running flask on AWS SAM

2017-10-13 Thread sohcahtoa82
On Thursday, October 12, 2017 at 9:20:11 PM UTC-7, Frustrated learner wrote: > Hello, > > I have a flask based application which i am able to run locally. > > $ python swagger_server/app.py > * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit) > > I am trying to port this over to aws. I

Re: Want to write a python code for sending and receiving frames over wifi/wlan0 using python

2017-10-12 Thread sohcahtoa82
On Thursday, October 12, 2017 at 1:08:55 AM UTC-7, T Obulesu wrote: > Hello all, I want to send some frames defined by me{Example, > [0x45,0x43,0x32]} to the raspberry pi from any macine(Desktop/Laptop/other > raspberry pi). But I want to send those frames over wifi or use wlan0 using > python

Re: Boolean Expressions

2017-09-26 Thread sohcahtoa82
On Tuesday, September 26, 2017 at 2:54:32 PM UTC-7, Chris Angelico wrote: > On Wed, Sep 27, 2017 at 7:43 AM, Cai Gengyang wrote: > > Help check if my logic is correct in all 5 expressions > > > > > > A) Set bool_one equal to the result of > > False and False > > > > Entire

Re: String to Dictionary conversion in python

2017-09-19 Thread sohcahtoa82
On Thursday, September 14, 2017 at 11:01:46 PM UTC-7, santosh.y...@gmail.com wrote: > Hi, > > Can anyone help me in the below issue. > > I need to convert string to dictionary > > string = " 'msisdn': '7382432382', 'action': 'select', 'sessionId': '123', > 'recipient': '7382432382',

Re: Check Python version from inside script? Run Pythons script in v2 compatibility mode?

2017-07-07 Thread sohcahtoa82
On Friday, July 7, 2017 at 11:58:33 AM UTC-7, eryk sun wrote: > On Fri, Jul 7, 2017 at 7:53 AM, Steve D'Aprano > wrote: > > On Fri, 7 Jul 2017 04:30 pm, Ben S. wrote: > > > >> Is there a way to execute a python script with v3 python engine in v2 > >> compatibility

Re: How to build a simple neural network in 9 lines of Python code

2017-06-28 Thread sohcahtoa82
On Tuesday, June 27, 2017 at 12:31:49 PM UTC-7, John Ladasky wrote: > On Tuesday, June 27, 2017 at 9:24:07 AM UTC-7, Sam Chats wrote: > > https://medium.com/technology-invention-and-more/how-to-build-a-simple-neural-network-in-9-lines-of-python-code-cc8f23647ca1 > > OK, that's cheating a bit,

Re: How can I make a sentinel value NOT be initialized in a class/method - OOP?

2017-01-13 Thread sohcahtoa82
On Friday, January 13, 2017 at 2:27:04 PM UTC-8, David D wrote: > I am testing out some basic Object Oriented Programming in Python. The > basics: > > -User enters a name > -While loop with a sentinel value of "quit" will continue entering names > until the sentinel value is reached > -The

Re: Cache memory and its effect on list searching

2016-12-16 Thread sohcahtoa82
On Friday, December 16, 2016 at 6:27:24 PM UTC-8, Chris Angelico wrote: > On Sat, Dec 17, 2016 at 1:20 PM, wrote: > > I thought this was curious behavior. I created a list of random-looking > > strings, then made a sorted copy. I then found that using "in" to see if a

Cache memory and its effect on list searching

2016-12-16 Thread sohcahtoa82
Alternatively...why you should definitely use binary searches: Python 3.5.2+ (default, Aug 30 2016, 19:08:42) [GCC 6.2.0 20160822] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import hashlib >>> import timeit >>> hashes = [hashlib.md5(bytes(str(i),

Re: How to sort this without 'cmp=' in python 3?

2016-10-14 Thread sohcahtoa82
On Friday, October 14, 2016 at 4:35:08 PM UTC-7, 38016...@gmail.com wrote: > nums=['3','30','34','32','9','5'] > I need to sort the list in order to get the largest number string: '953433230' > > nums.sort(cmp=lambda a,b: cmp(a+b, b+a), reverse=True) > > But how to do this in python 3? > >

Re: Without compilation, how to find bugs?

2016-10-14 Thread sohcahtoa82
On Friday, October 14, 2016 at 5:46:14 AM UTC-7, Steve D'Aprano wrote: > On Fri, 14 Oct 2016 08:04 pm, BartC wrote: > > > On 14/10/2016 01:59, sohcahto...@gmail.com wrote: > >> On Thursday, October 13, 2016 at 4:06:36 PM UTC-7, pozz wrote: > > > >>> Are the things exactly how I understood, or do

Re: Without compilation, how to find bugs?

2016-10-14 Thread sohcahtoa82
On Friday, October 14, 2016 at 2:05:01 AM UTC-7, BartC wrote: > On 14/10/2016 01:59, sohcahto...@gmail.com wrote: > > On Thursday, October 13, 2016 at 4:06:36 PM UTC-7, pozz wrote: > > >> Are the things exactly how I understood, or do I miss something in Python? > > > > As others have said, user

Re: Without compilation, how to find bugs?

2016-10-13 Thread sohcahtoa82
On Thursday, October 13, 2016 at 4:06:36 PM UTC-7, pozz wrote: > I come from the C language, that is a compiled and strongly typed > language. I learned many good tricks to write good code in C: choose a > coding style, turn on as many warnings as possible, explicitly declare > static

Re: How to process syntax errors

2016-10-12 Thread sohcahtoa82
On Wednesday, October 12, 2016 at 3:01:26 AM UTC-7, mr.pune...@gmail.com wrote: > Hi All > > Its really good to see that some discussion happening around this topic. > Sorry I was out from my work for sometime so couldn't follow up but I really > find it useful. It gives me good opportunity to

Re: Is that forwards first or backwards first? (Re: unintuitive for-loop behavior)

2016-10-03 Thread sohcahtoa82
On Monday, October 3, 2016 at 2:11:12 AM UTC-7, Gregory Ewing wrote: > Rustom Mody wrote: > > My new car goes in reverse when I put it in first gear but only on > > full-moon > > nights with the tank on reserve when the left light is blinking > > OT aside: When I went to take my current car (a

Re: Python non blocking multi-client service

2016-08-25 Thread sohcahtoa82
On Tue, Aug 23, 2016 at 11:39 PM, wrote: > On Tuesday, August 23, 2016 at 6:42:53 AM UTC-7, Chris Angelico wrote: > > On Tuesday, August 23, 2016 at 4:09:07 PM UTC+3, dimao wrote: > > > except: > > >print ('Error') > > > > > > Don't do this. > > > >

Re: I am new to python. I have a few questions coming from an armature!

2016-08-15 Thread sohcahtoa82
On Monday, August 15, 2016 at 8:07:32 AM UTC-7, alister wrote: > On Mon, 15 Aug 2016 07:00:47 -0700, Sickfit92 wrote: > > > 1. How long did it take you guys to master the language or, let me put > > it this way to completely get the hang and start writing code? > > > Some concepts took more

Re: Don't understand why I'm getting this error

2016-07-14 Thread sohcahtoa82
On Thursday, July 14, 2016 at 10:39:35 AM UTC-7, Carter Temm wrote: > Hi all. > I've been looking at this for a bit, and can't seem to come to a possible > conclusion on what could be happening to get an error. Anyway, here is the > code, then I'll explain. > > http://pastebin.com/raw/YPiTfWbG

Re: Assignment Versus Equality

2016-06-27 Thread sohcahtoa82
On Monday, June 27, 2016 at 7:09:35 AM UTC-7, Marko Rauhamaa wrote: > Grant Edwards : > > > On 2016-06-26, BartC wrote: > > > >> (Note, for those who don't know (old) Fortran, that spaces and tabs > >> are not significant. So those dots are needed,

Re: Beginner Question

2016-06-02 Thread sohcahtoa82
On Thursday, June 2, 2016 at 6:38:56 AM UTC-7, Igor Korot wrote: > Steven, > > On Thu, Jun 2, 2016 at 1:20 AM, Steven D'Aprano > wrote: > > On Thursday 02 June 2016 14:21, Igor Korot wrote: > > > >> Hi, guys, > >> > >> On Wed, Jun 1, 2016 at 9:42 PM, boB

Re: A strange one: a commented line throws an error

2016-05-16 Thread sohcahtoa82
On Monday, May 16, 2016 at 10:25:54 AM UTC-7, DFS wrote: > print "test" > # stz source pytz.timezone() instance (for naïve local datetimes) > > $ python temp.py >File "temp.py", line 2 > SyntaxError: Non-ASCII character '\xc3' in file temp.py on line 2, but > no encoding declared; see

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread sohcahtoa82
On Monday, May 16, 2016 at 10:35:28 AM UTC-7, Peter Otten wrote: > Grant Edwards wrote: > > > This is not Python specific, though I'm turning to Python to do some > > experimentation and to try to prototype a solution. > > > > Is there any way to limit the number of connections a browser uses to

Re: String concatenation

2016-05-11 Thread sohcahtoa82
On Wednesday, May 11, 2016 at 12:14:43 PM UTC-7, Thomas 'PointedEars' Lahn wrote: > sohcahto...@gmail.com wrote: > > > I don't blame people for not wanting to use their real name on the > > Internet, especially if you're a woman. There are a lot of crazy people > > out there that will find out

Re: String concatenation (was: Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?)

2016-05-10 Thread sohcahtoa82
On Sunday, May 8, 2016 at 5:44:25 PM UTC-7, Thomas 'PointedEars' Lahn wrote: > Also, it would be a good idea if you posted under your real name. Internet > is the thing with cables; Usenet is the thing with people. I for one tend > to avoid communicating with few-letter entities; exceptions to

Re: The irony

2016-05-10 Thread sohcahtoa82
On Tuesday, May 10, 2016 at 11:03:47 AM UTC-7, DFS wrote: > "There should be one-- and preferably only one --obvious way to do it." > > https://www.python.org/dev/peps/pep-0020/ > > Each method of string concatenation has different uses. > --- > sSQL = "line

Re: pygame easy create

2016-05-09 Thread sohcahtoa82
On Monday, May 9, 2016 at 3:15:45 AM UTC-7, hariram...@gmail.com wrote: > On Monday, May 9, 2016 at 10:50:47 AM UTC+5:30, hariram...@gmail.com wrote: > > is there anyway (IDE/package) that allows me to create graphics/game just > > like that (by instructing..., if i say create hills on the

Re: After a year using Node.js, the prodigal son returns

2016-05-04 Thread sohcahtoa82
On Wednesday, May 4, 2016 at 1:59:15 AM UTC-7, Steven D'Aprano wrote: > A year ago, Gavin Vickery decided to move away from Python and give > Javascript with Node.js a try. Twelve months later, he has written about his > experiences: > > >

Re: Re: Error 0*80070570

2016-04-21 Thread sohcahtoa82
On Thursday, April 21, 2016 at 10:47:04 AM UTC-7, Allan Leo wrote: > I need help with this setup error. > -- Forwarded message -- > From: "Allan Leo" > Date: Apr 21, 2016 10:06 AM > Subject: Re: Error 0*80070570 > To: > Cc: > >

Re: Xlms namespace

2016-04-20 Thread sohcahtoa82
On Wednesday, April 20, 2016 at 10:05:02 AM UTC-7, Joaquin Alzola wrote: > Hi Guys > > I am currently doing this: > > IP client(Python) --> send SOAPXML request --> IP Server (Python) > > SOAP request: > http://schemas.xmlsoap.org/soap/envelope/; > xmlns:req="http:/ >

Re: Guido sees the light: PEP 8 updated

2016-04-19 Thread sohcahtoa82
On Tuesday, April 19, 2016 at 1:59:48 PM UTC-7, Chris Angelico wrote: > On Wed, Apr 20, 2016 at 6:50 AM, Ben Finney > wrote: > >> > On Tue, 19 Apr 2016 01:04 pm, Rustom Mody wrote: > >> > > And more generally that programmers sticking to text when rest of world > >> >

Re: Guido sees the light: PEP 8 updated

2016-04-18 Thread sohcahtoa82
On Monday, April 18, 2016 at 2:14:17 PM UTC-7, Pete Forman wrote: > Why is it that Python continues to use a fixed width font and therefore > specifies the maximum line width as a character count? > > An essential part of the language is indentation which ought to continue > to mandate that lines

Re: Looking for feedback on weighted voting algorithm

2016-04-15 Thread sohcahtoa82
On Thursday, April 14, 2016 at 1:48:40 PM UTC-7, Michael Selik wrote: > On Thu, Apr 14, 2016, 7:37 PM justin walters > wrote: > > > On Apr 14, 2016 9:41 AM, "Martin A. Brown" wrote: > > > > > > > > > Greetings Justin, > > > > > > >score =

Re: [beginner] What's wrong?

2016-04-08 Thread sohcahtoa82
On Friday, April 1, 2016 at 3:57:40 PM UTC-7, Mark Lawrence wrote: > On 01/04/2016 23:44, sohcahto...@gmail.com wrote: > > On Friday, April 1, 2016 at 3:10:51 PM UTC-7, Michael Okuntsov wrote: > >> Nevermind. for j in range(1,8) should be for j in range(8). > > > > I can't tell you how many times

Re: [beginner] What's wrong?

2016-04-01 Thread sohcahtoa82
On Friday, April 1, 2016 at 3:10:51 PM UTC-7, Michael Okuntsov wrote: > Nevermind. for j in range(1,8) should be for j in range(8). I can't tell you how many times I've gotten bit in the ass with that off-by-one mistake whenever I use a range that doesn't start at zero. I know that if I want to

Re: Why do you use python?

2016-03-21 Thread sohcahtoa82
On Saturday, October 31, 2009 at 12:11:02 AM UTC-7, sk wrote: > What would be your answer if this question is asked to you in an > interview? > > a modified version might be: > "Where would you use python over C/C++/Java?" > > (because my resume says I know C/C++/Java)? I use Python when speed

Re: How to waste computer memory?

2016-03-19 Thread sohcahtoa82
On Thursday, March 17, 2016 at 7:34:46 AM UTC-7, wxjm...@gmail.com wrote: > Very simple. Use Python and its (buggy) character encoding > model. > > How to save memory? > It's also very simple. Use a programming language, which > handles Unicode correctly. *looks at the other messages in this

Re: Another python question

2016-03-19 Thread sohcahtoa82
On Friday, March 18, 2016 at 3:46:44 PM UTC-7, Alan Gabriel wrote: > Sorry for the multiple questions but my while loop is not working as intended. > > Here is the code : > n = 1 > list1 = [] > count = 0 #amount of times program repeats > steps = 0 # amount of steps to reach 1 > step_list = [] >

Re: Encapsulation in Python

2016-03-14 Thread sohcahtoa82
On Friday, March 11, 2016 at 6:39:53 PM UTC-8, Rick Johnson wrote: > On Friday, March 11, 2016 at 9:48:22 AM UTC-6, Ian wrote: > > On Thu, Mar 10, 2016 at 5:45 PM, Rick Johnson > > The honorable Rick Johnson wrote: > > > Many times, i would have preferred to define my module space > > > across

Re: Perl to Python again

2016-03-11 Thread sohcahtoa82
On Friday, March 11, 2016 at 3:42:36 PM UTC-8, Fillmore wrote: > So, now I need to split a string in a way that the first element goes > into a string and the others in a list: > > while($line = ) { > > my ($s,@values) = split /\t/,$line; > > I am trying with: > > for line in sys.stdin:

Re: context managers inline?

2016-03-10 Thread sohcahtoa82
On Thursday, March 10, 2016 at 10:33:47 AM UTC-8, Neal Becker wrote: > Is there a way to ensure resource cleanup with a construct such as: > > x = load (open ('my file', 'rb)) > > Is there a way to ensure this file gets closed? with open('my file', 'rb') as f: x = load(f) --

Re: it doesn't want to open

2016-03-09 Thread sohcahtoa82
On Wednesday, March 9, 2016 at 10:40:27 AM UTC-8, mashaer elmekki wrote: > Sent from Windows Mail Did you try to attach a screenshot or something? This mailing list is text only. Your attachment will be removed. -- https://mail.python.org/mailman/listinfo/python-list

Re: Pythonic love

2016-03-07 Thread sohcahtoa82
On Monday, March 7, 2016 at 2:51:50 PM UTC-8, Fillmore wrote: > learning Python from Perl here. Want to do things as Pythonicly as possible. > > I am reading a TSV, but need to skip the first 5 lines. The following > works, but wonder if there's a more pythonc way to do things. Thanks > > ctr =

Re: Continuing indentation

2016-03-04 Thread sohcahtoa82
On Friday, March 4, 2016 at 4:43:57 PM UTC-8, Simon Ward wrote: > On 4 March 2016 23:31:43 GMT+00:00, Erik wrote: > >On 04/03/16 21:14, sohcahto...@gmail.com wrote: > >> You guys are spending way too much time fighting over something that > >is clearly subjective.

Re: Continuing indentation

2016-03-04 Thread sohcahtoa82
On Friday, March 4, 2016 at 3:41:29 PM UTC-8, Ben Finney wrote: > alister writes: > > > On Fri, 04 Mar 2016 10:23:37 +0900, INADA Naoki wrote: > > > > > Because PEP8 says: > > > > > >> The preferred place to break around a binary operator is after the > > >> operator,

Re: Continuing indentation

2016-03-04 Thread sohcahtoa82
On Friday, March 4, 2016 at 6:03:48 AM UTC-8, alister wrote: > On Fri, 04 Mar 2016 10:12:58 +, cl wrote: > > > Steven D'Aprano wrote: > >> On Fri, 4 Mar 2016 12:23 pm, INADA Naoki wrote: > >> > >> > >> >> > >> >> Indeed. I don't understand why, when splitting a

Re: How to know if an object is still be referenced?

2016-03-02 Thread sohcahtoa82
On Wednesday, March 2, 2016 at 3:35:32 AM UTC-8, jf...@ms4.hinet.net wrote: > Terry Reedy at 2016/3/2 UTC+8 3:04:10PM wrote: > > On 3/1/2016 9:35 PM, jf...@ms4.hinet.net wrote: > > > Recently I was puzzled by a tkinter problem. The codes below (from a > > > book) can display the picture

Re: common mistakes in this simple program

2016-02-29 Thread sohcahtoa82
On Monday, February 29, 2016 at 10:21:57 AM UTC-8, Ganesh Pal wrote: > >> How do we reraise the exception in python , I have used raise not > >> sure how to reraise the exception > > > > raise with no arguments will reraise the exception currently being handled. > > > > except Exception: > >

Re: "from module import data; print(data)" vs "import module; print(module.data)"

2016-02-25 Thread sohcahtoa82
On Wednesday, February 24, 2016 at 5:07:57 PM UTC-8, Dan Stromberg wrote: > Could people please compare and contrast the two ways of doing imports > in the Subject line? > > I've long favored the latter, but I'm working in a code base that > prefers the former. > > Is it fair to say that the

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-17 Thread sohcahtoa82
On Wednesday, February 17, 2016 at 11:49:44 AM UTC-8, wrong.a...@gmail.com wrote: > I am mostly getting positive feedback for Python. Good! > > It seems Python is used more for web based applications. Is it equally fine > for creating stand-alone *.exe's? Can the same code be compiled to run

Re: working

2016-02-12 Thread sohcahtoa82
On Friday, February 12, 2016 at 1:47:24 AM UTC-8, Mohammed Zakria wrote: > hello > i want to know the company that ican work as freelance python devloper There are some recruiters that read this mailing list and will send unsolicited e-mail about job openings, but they might pass right over you

Re: psss...I want to move from Perl to Python

2016-01-29 Thread sohcahtoa82
On Friday, January 29, 2016 at 1:12:34 AM UTC-8, Ulli Horlacher wrote: > Steven D'Aprano wrote: > > > Every time I make a half-hearted attempt to learn enough Perl syntax to get > > started, I keep running into the differences between $foo, %foo and @foo > > and dire

Re: psss...I want to move from Perl to Python

2016-01-29 Thread sohcahtoa82
On Thursday, January 28, 2016 at 6:34:34 PM UTC-8, Chris Angelico wrote: > On Fri, Jan 29, 2016 at 1:06 PM, Paul Rubin wrote: > > Fillmore writes: > >> I look and Python and it looks so much more clean > > > > Yes it is, I forgot

Re: I'm missing something here...

2016-01-11 Thread sohcahtoa82
On Monday, January 11, 2016 at 3:27:21 PM UTC-8, Skip Montanaro wrote: > Here's a dumb little bit of code, adapted from a slightly larger script: > > #!/usr/bin/env python > > "dummy" > > import glob > import os > > def compare_prices(*_args): > "dummy" > return set() > > def

Re: Problem to read from array

2015-11-23 Thread sohcahtoa82
On Monday, November 23, 2015 at 12:58:49 PM UTC-8, Crane Ugly wrote: > Thank you all. > Here is the last piece of code that caused me so much troubles but now > working the way I wanted it: > > fRawData = [] > with open(fStagingFile2) as fStagingFile2FH: > fRawData =

Re: pip does not work anymore

2015-11-23 Thread sohcahtoa82
On Sunday, November 22, 2015 at 11:59:13 PM UTC-8, Cecil Westerhof wrote: > When I try to install something with pip2 I get: > Traceback (most recent call last): > File "/usr/bin/pip2", line 9, in > load_entry_point('pip==7.1.2', 'console_scripts', 'pip2')() > File

Re: How To Create A Endles List Of Lists In Python...???

2015-11-20 Thread sohcahtoa82
On Friday, November 20, 2015 at 10:16:34 AM UTC-8, robert...@si.t-com.hr wrote: > Dana petak, 20. studenoga 2015. u 18:16:52 UTC+1, korisnik Denis McMahon > napisao je: > > On Fri, 20 Nov 2015 08:43:04 +0100, HKRSS wrote: > > > > > Thanks In Advance, Robert...;) > > > > Just keep appending

Re: variable scope of class objects

2015-10-19 Thread sohcahtoa82
On Monday, October 19, 2015 at 11:39:59 AM UTC-7, JonRob wrote: > Hi, > > I've having trouble understanding the self concept as it applies to > variables. I think I understand how it affects methods. > > I haven't been able to fully grasp the scope of class variables and > the effect of the

Re: TCP sockets python timeout public IP adresss

2015-10-16 Thread sohcahtoa82
On Friday, October 16, 2015 at 2:44:53 AM UTC-7, lucasfneves14 wrote: > How did you do it? I took the advice of just being myself. -- https://mail.python.org/mailman/listinfo/python-list

Re: Pyarmor, guard your python scripts

2015-10-05 Thread sohcahtoa82
On Thursday, September 17, 2015 at 10:55:19 PM UTC-7, Jondy Zhao wrote: > On Friday, September 18, 2015 at 11:06:25 AM UTC+8, Ben Finney wrote: > > Jondy Zhao writes: > > > > > For example, I develop a game by python. What I want to do is that the > > > player or the agent

Re: Check if a given value is out of certain range

2015-09-30 Thread sohcahtoa82
On Tuesday, September 29, 2015 at 1:33:23 PM UTC-7, Mark Lawrence wrote: > On 29/09/2015 17:48, Rob Gaddi wrote: > > On Tue, 29 Sep 2015 10:16:04 +0530, Laxmikant Chitare wrote: > > > >> Hi, > >> > >> I know there is an elegant way to check if a given value is within > >> certain range. > >>

Re: Idiosyncratic python

2015-09-24 Thread sohcahtoa82
On Wednesday, September 23, 2015 at 11:02:38 PM UTC-7, Steven D'Aprano wrote: > I was looking at an in-house code base today, and the author seems to have a > rather idiosyncratic approach to Python. For example: > > > for k, v in mydict.items(): > del(k) > ... > > > instead of the

Re: A little test for you Guys

2015-09-22 Thread sohcahtoa82
On Tuesday, September 22, 2015 at 11:45:00 AM UTC-7, Lj Fc wrote: > you have 10 minutes Good luck!! > > > 1. What is PEP8 ? > > 2. What are the different ways to distribute some python source code ? > > 2 Lists > > Let's define the function plural : > > def plural(words): > plurals = []

Re: Problem configuring apache to run python cgi on Ubuntu 14.04

2015-09-21 Thread sohcahtoa82
On Monday, September 21, 2015 at 11:41:54 AM UTC-7, tropical...@gmail.com wrote: > Hello everybody, > > I installed the LAMP stack on in Ubuntu, but I am having > problems configuring Apache to run python CGI scripts. > > I ran: > sudo a2enmod cgi > > I added to apache2.conf > >

Re: Bug!

2015-08-21 Thread sohcahtoa82
On Friday, August 21, 2015 at 3:42:36 PM UTC-7, hamilton wrote: On 8/21/2015 1:41 PM, Chris Angelico wrote: Python 3.5 does not support Windows XP. Is there a simple explanation for this ? Or is it just is. I have no relationship with the Python developers, but I would say that running

Re: except block isn't catching exception

2015-08-07 Thread sohcahtoa82
On Thursday, August 6, 2015 at 5:46:19 PM UTC-7, Chris Angelico wrote: On Fri, Aug 7, 2015 at 10:34 AM, sohcahto...@gmail.com wrote: Despite my except KeyboardInterrupt, the KeyboardInterrupt forced by the thread.interrupt_main() in the worker thread isn't being caught. Other things

except block isn't catching exception

2015-08-06 Thread sohcahtoa82
I've run into strange behavior involving a blocking call to a socket accept() on the main thread and thread.interrupt_main() being called on a worker thread. Here's my code: # BEGIN exception_test.py import socket import thread import threading import time def worker(): time.sleep(2)

Re: Uninstall

2015-08-04 Thread sohcahtoa82
On Tuesday, August 4, 2015 at 7:29:29 AM UTC-7, Grant Edwards wrote: On 2015-08-04, milos zorica miloshzor...@gmail.com wrote: you can't fully uninstall python from OSX, linux, BSD as there are many python dependent system tools Well, technically you _can_ uninstall Python if you really

Re: Integers with leading zeroes

2015-07-21 Thread sohcahtoa82
On Tuesday, July 21, 2015 at 10:22:44 AM UTC-7, Antoon Pardon wrote: On 07/19/2015 07:39 AM, Steven D'Aprano wrote: In Python 2, integer literals with leading zeroes are treated as octal, so 09 is a syntax error and 010 is 8. This is confusing to those not raised on C-style octal

Re: Integers with leading zeroes

2015-07-21 Thread sohcahtoa82
On Tuesday, July 21, 2015 at 11:07:43 AM UTC-7, Emile van Sebille wrote: On 7/21/2015 10:58 AM, sohcahto...@gmail.com wrote: IMO, leading zeroes just looks like visual noise, and if I wanted to align numbers, I'd just use spaces. Aligning numbers using spaces doesn't always align --

Re: Integers with leading zeroes

2015-07-21 Thread sohcahtoa82
On Tuesday, July 21, 2015 at 11:38:53 AM UTC-7, sohca...@gmail.com wrote: On Tuesday, July 21, 2015 at 11:07:43 AM UTC-7, Emile van Sebille wrote: On 7/21/2015 10:58 AM, sohcahto...@gmail.com wrote: IMO, leading zeroes just looks like visual noise, and if I wanted to align numbers,

Re: how to play

2015-07-20 Thread sohcahtoa82
On Sunday, July 19, 2015 at 12:04:26 PM UTC-7, Aron Barsam wrote: i have trouble trying to play python please can you respond soon  ... play python http://i.imgur.com/x2KwTbw.jpg -- https://mail.python.org/mailman/listinfo/python-list

Re: how do you play python because i have gone on the website but i haven't managed to code?

2015-07-17 Thread sohcahtoa82
On Thursday, July 16, 2015 at 12:31:04 PM UTC-7, Aron Barsam wrote: how do you play python because i have gone on the website but i haven't managed to code? http://i.imgur.com/x2KwTbw.jpg -- https://mail.python.org/mailman/listinfo/python-list

Re: Proposed keyword to transfer control to another function

2015-07-17 Thread sohcahtoa82
On Friday, July 17, 2015 at 12:17:55 AM UTC-7, Antoon Pardon wrote: On 07/17/2015 01:46 AM, Chris Angelico wrote: Open for bikeshedding: What should the keyword be? We can't use exec, which would match Unix and shell usage, because it's already used in a rather different sense in Python.

Re: Idle Not Working.

2015-07-08 Thread sohcahtoa82
Help us help you. every time I try to bring up Idle I cannot does not tell us the problem. Do you get error messages? What do they say? -- https://mail.python.org/mailman/listinfo/python-list

Re: Idle Not Working.

2015-07-08 Thread sohcahtoa82
On Wednesday, July 8, 2015 at 2:12:29 PM UTC-7, Mark Lawrence wrote: On 08/07/2015 19:44, sohcahto...@gmail.com wrote: Help us help you. every time I try to bring up Idle I cannot does not tell us the problem. Do you get error messages? What do they say? Would you please be kind

Re: Classic OOP in Python

2015-06-17 Thread sohcahtoa82
On Wednesday, June 17, 2015 at 1:39:31 PM UTC-7, Marko Rauhamaa wrote: Ned Batchelder n...@nedbatchelder.com: TDD is about writing tests as a way to design the best system, and putting testing at the center of your development workflow. It works great with Python even without interfaces.

Re: Classic OOP in Python

2015-06-17 Thread sohcahtoa82
On Wednesday, June 17, 2015 at 12:21:32 PM UTC-7, Jason P. wrote: Hello Python community. I come from a classic background in what refers to OOP. Mostly Java and PHP ( 5.3). I'm used to abstract classes, interfaces, access modifiers and so on. Don't get me wrong. I know that despite the

Re: Testing random

2015-06-16 Thread sohcahtoa82
On Tuesday, June 16, 2015 at 3:01:06 PM UTC-7, Thomas 'PointedEars' Lahn wrote: Ned Batchelder wrote: [...] This is done empirically, by producing `nseq` sequences of `nrolls` rolls of the die. Each sequence is examined to see if it has a zero. The total number of no-zero

Re: Testing random

2015-06-16 Thread sohcahtoa82
On Tuesday, June 16, 2015 at 4:48:36 PM UTC-7, Thomas 'PointedEars' Lahn wrote: Ned Batchelder wrote: On Tuesday, June 16, 2015 at 6:01:06 PM UTC-4, Thomas 'PointedEars' Lahn wrote: Your programmatic proof, as all the other intuitive-empirical proofs, and all the other counter-arguments

Re: Creating .exe file in Python

2015-06-15 Thread sohcahtoa82
On Monday, June 15, 2015 at 5:08:58 AM UTC-7, Mark Lawrence wrote: On 15/06/2015 12:42, subhabrata.bane...@gmail.com wrote: Dear Group, I am trying to learn how to create .exe file for Python. I tried to work around http://www.py2exe.org/index.cgi/Tutorial of Py2exe. The sample program

Re: Set a flag on the function or a global?

2015-06-15 Thread sohcahtoa82
On Monday, June 15, 2015 at 4:57:53 PM UTC-7, Steven D'Aprano wrote: I have a function in a module which is intended to be used by importing that name alone, then used interactively: from module import edir edir(args) edir is an enhanced version of dir, and one of the

Re: Testing random

2015-06-12 Thread sohcahtoa82
On Friday, June 12, 2015 at 3:12:26 PM UTC-7, Thomas 'PointedEars' Lahn wrote: Ian Kelly wrote: [...] Thomas 'PointedEars' Lahn [...] wrote: Ian Kelly wrote: The probability of 123456789 and 1 are equal. The probability of a sequence containing all nine numbers and a sequence

Re: OT ish Blocking telemarketers

2015-06-12 Thread sohcahtoa82
On Friday, June 12, 2015 at 3:23:32 PM UTC-7, Seymore4Head wrote: Is there a program what runs on Windows that uses a national blacklist to block phone calls? Are you talking about a Windows Phone? Windows for a PC doesn't make phone calls unless that's a new feature that I don't know about.

Re: How may I Integrate Python Code with REST

2015-06-12 Thread sohcahtoa82
On Friday, June 12, 2015 at 10:52:30 AM UTC-7, subhabrat...@gmail.com wrote: Dear Group, I wrote a Python code. In the code there are two modules where we may insert data from outside. They are updating some training module and updating index. As a standalone code this is working fine.

Re: zip as iterator and bad/good practices

2015-06-12 Thread sohcahtoa82
On Friday, June 12, 2015 at 4:44:08 PM UTC-7, Terry Reedy wrote: On 6/12/2015 4:34 PM, Laura Creighton wrote: The real problem is removing things from lists when you are iterating over them, not adding things to the end of lists. One needs to iterate backwards. ints = [0, 1, 2, 2, 1,

Re: zip as iterator and bad/good practices

2015-06-12 Thread sohcahtoa82
On Friday, June 12, 2015 at 5:27:21 PM UTC-7, Chris Angelico wrote: On Sat, Jun 13, 2015 at 10:02 AM, sohcahto...@gmail.com wrote: ints = [0, 1, 2, 2, 1, 4, 6, 5, 5] ints[:] = [i for i in ints if not i % 2] ints [0, 2, 2, 4, 6] -- Terry Jan Reedy On the second line of

Re: OT ish Blocking telemarketers

2015-06-12 Thread sohcahtoa82
On Friday, June 12, 2015 at 5:03:25 PM UTC-7, Seymore4Head wrote: On Fri, 12 Jun 2015 15:57:53 -0700 (PDT), sohcahto...@gmail.com wrote: On Friday, June 12, 2015 at 3:23:32 PM UTC-7, Seymore4Head wrote: Is there a program what runs on Windows that uses a national blacklist to block phone

Re: I don't like the OO part of python. In particular the self keyword everywhere.

2015-06-11 Thread sohcahtoa82
On Thursday, June 11, 2015 at 4:19:59 AM UTC-7, Skybuck Flying wrote: Hello, I don't like the object orientated part of Python. The idea/prospect of having to write self everywhere... seems very horrorific and a huge time waster. (Perhaps the module thing of python might help in future

Re: Testing random

2015-06-10 Thread sohcahtoa82
On Wednesday, June 10, 2015 at 10:06:49 AM UTC-7, Thomas 'PointedEars' Lahn wrote: Jussi Piitulainen wrote: Thomas 'PointedEars' Lahn writes: Jussi Piitulainen wrote: Thomas 'PointedEars' Lahn writes: 8 3 6 3 1 2 6 8 2 1 6. There are more than four hundred thousand ways to get

Re: Can Python function return multiple data?

2015-06-05 Thread sohcahtoa82
On Wednesday, June 3, 2015 at 2:57:00 PM UTC-7, Mark Lawrence wrote: On 03/06/2015 22:35, Chris Angelico wrote: On Wed, Jun 3, 2015 at 11:56 PM, Thomas Rachel nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa...@spamschutz.glglgl.de wrote: Am 03.06.2015 um 01:56 schrieb Chris Angelico: and

Re: Can Python function return multiple data?

2015-06-03 Thread sohcahtoa82
On Wednesday, June 3, 2015 at 2:57:00 PM UTC-7, Mark Lawrence wrote: On 03/06/2015 22:35, Chris Angelico wrote: On Wed, Jun 3, 2015 at 11:56 PM, Thomas Rachel nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa...@spamschutz.glglgl.de wrote: Am 03.06.2015 um 01:56 schrieb Chris Angelico: and

Re: Multiple thread program problem

2015-06-03 Thread sohcahtoa82
On Wednesday, June 3, 2015 at 4:45:52 PM UTC-7, M2 wrote: On Wednesday, June 3, 2015 at 5:34:31 PM UTC-5, Waffle wrote: You think (f) makes a tuple, but it does not. the parentesis is not the tuple constructor, the comma is try: t=thread.start_new_thread(proc,(f,)) Thanks for the

Re: Can Python function return multiple data?

2015-06-02 Thread sohcahtoa82
On Tuesday, June 2, 2015 at 2:27:37 PM UTC-7, fl wrote: Hi, I just see the tutorial says Python can return value in function, it does not say multiple data results return situation. In C, it is possible. How about Python on a multiple data return requirement? Thanks, You return a

Re: Where is 'palindrome' defined?

2015-06-01 Thread sohcahtoa82
On Monday, June 1, 2015 at 5:55:14 PM UTC-7, fl wrote: On Sunday, May 31, 2015 at 9:46:56 PM UTC-7, fl wrote: Hi, When I search solution of reverse a string/number, I came across a short function online: def palindrome(num): return str(num) == str(num)[::-1] I thought

Re: What is considered an advanced topic in Python?

2015-05-29 Thread sohcahtoa82
On Friday, May 29, 2015 at 9:02:06 AM UTC-7, Mike Driscoll wrote: Hi, I've been asked on several occasions to write about intermediate or advanced topics in Python and I was wondering what the community considers to be intermediate or advanced. I realize we're all growing in our abilities

Re: What is considered an advanced topic in Python?

2015-05-29 Thread sohcahtoa82
On Friday, May 29, 2015 at 10:18:29 AM UTC-7, Ethan Furman wrote: On 05/29/2015 10:03 AM, sohcahto...@gmail.com wrote: On Friday, May 29, 2015 at 9:02:06 AM UTC-7, Mike Driscoll wrote: I've been asked on several occasions to write about intermediate or advanced topics in Python and I

Re: Logic problem: need better logic for desired thruth table.

2015-05-28 Thread sohcahtoa82
On Thursday, May 28, 2015 at 2:50:18 PM UTC-7, Skybuck Flying wrote: Hello, I was just coding and ran into a little logic problem which is as follows: There are two booleans/variables which can be either false or true. The desired thrutle table is: A = input B = input C = output

Re: Logic problem: need better logic for desired thruth table.

2015-05-28 Thread sohcahtoa82
On Thursday, May 28, 2015 at 3:17:10 PM UTC-7, Michael Torrie wrote: On 05/28/2015 03:58 PM, sohcahto...@gmail.com wrote: I think the logic you're really looking for is: return BotWaitForCooldown or (not (BotWaitForCooldown or CooldownDetected)) Yes this is the simplest form. For more

Re: Survey -- Move To Trash function in Python?

2015-05-15 Thread sohcahtoa82
On Friday, May 15, 2015 at 11:27:18 AM UTC-7, rand...@fastmail.us wrote: On Fri, May 15, 2015, at 00:25, Chris Angelico wrote: The main thing is that trashing invites the system to delete the file at its leisure, I've never seen a system whose trash can emptied itself without user

Re: Python re to extract useful information from each line

2015-04-29 Thread sohcahtoa82
On Wednesday, April 29, 2015 at 1:42:18 PM UTC-7, Kashif Rana wrote: Hello Experts I have below lines with some variations. 1- set policy id 1000 from Untrust to Trust Any 1.1.1.1 HTTP nat dst ip 10.10.10.10 port 8000 permit log 2- set policy id 5000 from Trust to Untrust Any

  1   2   >