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', 'language

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 Expression : False and F

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 A

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 h

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 time

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. > > > > ChrisA > > I did that only f

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 m

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 k

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 variables

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 a

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

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), "utf-8")

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 > > string exists in the

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 o

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

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 = sum_of_votes/num_of_votes > > > > > > >votes = [(72,

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: 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 > >> > > has moved on is rather bac

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:/ > /request.messagepush.inte

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: > > When running the setup for your 3.5.1(32-bit versio

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: > > > http://geekforbrains.com/post/after-a-year-of-nodejs-in

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

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 1\

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

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

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 Stepp wrote: > >>> On Wed, Jun 1, 2016 at

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, otherwise "a eq b" > >> would be parsed as "aeqb

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

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 everything I knew about Perl shortly after starting > > to use

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 warnings about what happens i

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 i

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 o

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 form

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

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 correctly

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 condition such as > >> >> thi

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, not before it. http://pep8.

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. Nobody is "correct" here. There

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: 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: 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) -- https://mail.p

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

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

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 o

Re: I am out of trial and error again Lists

2014-10-22 Thread sohcahtoa82
On Wednesday, October 22, 2014 2:06:35 PM UTC-7, Seymore4Head wrote: > On Wed, 22 Oct 2014 16:57:00 -0400, Joel Goldstick > wrote: > > >On Wed, Oct 22, 2014 at 4:30 PM, Seymore4Head > > wrote: > >> def nametonumber(name): > >> lst=[""] > >> for x,y in enumerate (name): > >> lst=ls

Re: FYI: Micro Python running on kickstarter pyBoard project, now shipping

2014-10-23 Thread sohcahtoa82
On Thursday, October 23, 2014 10:07:26 AM UTC-7, jkn wrote: > Hi all > I haven't heard in mentioned here, but since I saw one of the boards > today thought I'd pass on the news: > > The Kickstarter 'MicroPython' project, which has a tiny 'pyboard' (only a > couple of sq.inches in size) with

Re: I am out of trial and error again Lists

2014-10-24 Thread sohcahtoa82
On Friday, October 24, 2014 11:17:53 AM UTC-7, Seymore4Head wrote: > On Fri, 24 Oct 2014 11:52:15 -0600, Ian Kelly > wrote: > > >On Fri, Oct 24, 2014 at 11:03 AM, Seymore4Head > > wrote: > >> Actually I was a little frustrated when I added that line back in as > >> the other lines all work. > >>

Re: I am out of trial and error again Lists

2014-10-24 Thread sohcahtoa82
On Friday, October 24, 2014 12:12:10 PM UTC-7, Seymore4Head wrote: > On Fri, 24 Oct 2014 11:57:12 -0700 (PDT), sohcahto...@gmail.com wrote: > > >On Friday, October 24, 2014 11:17:53 AM UTC-7, Seymore4Head wrote: > >> On Fri, 24 Oct 2014 11:52:15 -0600, Ian Kelly > >> wrote: > >> > >> >On Fri, Oc

Re: I am out of trial and error again Lists

2014-10-24 Thread sohcahtoa82
On Friday, October 24, 2014 12:36:23 PM UTC-7, Seymore4Head wrote: > On Fri, 24 Oct 2014 12:25:33 -0700 (PDT), sohcahto...@gmail.com wrote: > > >On Friday, October 24, 2014 12:12:10 PM UTC-7, Seymore4Head wrote: > >> On Fri, 24 Oct 2014 11:57:12 -0700 (PDT), sohcahto...@gmail.com wrote: > >> > >>

Re: different behavior from idle/pycharm and shell

2014-10-27 Thread sohcahtoa82
On Monday, October 27, 2014 3:38:31 PM UTC-7, kiuh...@yahoo.it wrote: > Consider this code: > > --- > from ctypes import * > > user32 = windll.user32 > user32.MessageBoxA(0, 'ok', 'ok', 0) > --- > > If I run it in idle or from pycharm, the messagebox shows 'o' instead of > 'ok', but if I run it

Re: Classes

2014-10-30 Thread sohcahtoa82
On Thursday, October 30, 2014 1:19:57 PM UTC-7, Seymore4Head wrote: > class pet: > def set_age(self,age): > self.age=age > def get_age(self): > return self.age > pax=pet > pax.set_age(4) > > Traceback (most recent call last): > File "C:\Functions\test.py", line 18, in >

Re: Classes

2014-10-30 Thread sohcahtoa82
On Thursday, October 30, 2014 2:37:54 PM UTC-7, Seymore4Head wrote: > On Thu, 30 Oct 2014 14:28:19 -0700, Larry Hudson > wrote: > > >On 10/30/2014 01:16 PM, Seymore4Head wrote: > >> class pet: > >> def set_age(self,age): > >> self.age=age > >> def get_age(self): > >> r

Re: Teaching Python

2014-10-31 Thread sohcahtoa82
On Friday, October 31, 2014 10:10:33 AM UTC-7, Seymore4Head wrote: > On Mon, 29 Sep 2014 11:44:01 -0400, Seymore4Head > wrote: > > >On Mon, 29 Sep 2014 15:18:31 +0200, Gabor Urban > >wrote: > > > >>Hi, > >> > >>my 11 years old son and his classmate told me, that they would like to > >>learn Pyth

Re: Classes

2014-10-31 Thread sohcahtoa82
On Friday, October 31, 2014 1:51:23 PM UTC-7, Chris Angelico wrote: > On Sat, Nov 1, 2014 at 4:43 AM, Rob Gaddi > wrote: > > Define a Square class, subclassed from Rectangle. Use getters/setters > > to enforce that the length and width must be equal. Confirm that > > length and width remain lock

Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-04 Thread sohcahtoa82
On Tuesday, November 4, 2014 8:49:36 AM UTC-8, françai s wrote: > I intend to write in lowest level of computer programming as a hobby. > > It is true that is impossible write in binary code, the lowest level > of programming that you can write is in hex code? > > What is the lowest level of prog

Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-04 Thread sohcahtoa82
On Tuesday, November 4, 2014 10:51:53 AM UTC-8, ast wrote: > a écrit dans le message de > news:e5c95792-f81f-42b4-9996-5545f5607...@googlegroups.com... > On Tuesday, November 4, 2014 8:49:36 AM UTC-8, françai s wrote: > > > >I can't think of any reason why someone would WANT > >to program in bi

Re: Code review

2014-11-04 Thread sohcahtoa82
On Tuesday, November 4, 2014 12:35:32 PM UTC-8, John Gordon wrote: > C Smith writes: > > > I was wondering if I could get some feedback on the biggest thing I > > have done as an amateur Python coder. > > Comments. > > You need a *lot* more comments. > > Like, every line or two of code should

Re: generating 2D bit array variants with specific algorythm

2014-11-07 Thread sohcahtoa82
On Friday, November 7, 2014 1:13:27 PM UTC-8, Gregory Ewing wrote: > Robert Voigtländer wrote: > > > I need to generate all variants of a 2D array with variable dimension sizes > > which fit a specific rule. (up to 200*1000) > > Um... you realise there are 200**1000 solutions for the > 200x1000 c

I don't read docs and don't know how to use Google. What does the print function do?

2014-11-10 Thread sohcahtoa82
Please help me this assignment is due in an hour. Don't give me hints, just give me the answer because I only want a grade. I'm not actually interested in learning how to program, but I know software engineers make lots of money so I want to be one. -- https://mail.python.org/mailman/listinfo

Re: I don't read docs and don't know how to use Google. What does the print function do?

2014-11-10 Thread sohcahtoa82
On Monday, November 10, 2014 1:01:05 PM UTC-8, Grant Edwards wrote: > On 2014-11-10, sohcahtoa82 wrote: > > > Please help me this assignment is due in an hour. Don't give me > > hints, just give me the answer because I only want a grade. I'm not > > actu

Re: Help with Python Multiprocessing

2014-11-13 Thread sohcahtoa82
On Thursday, November 13, 2014 10:07:56 AM UTC-8, Anurag wrote: > I am having trouble understanding the Multiprocessing module. > I need to run three different files 'Worker1' , 'Worker2', 'Worker3' all at > once. Currently I am doing this : > > from multiprocessing import Process > > import Wor

Re: How to recover bytes function?

2014-11-13 Thread sohcahtoa82
On Thursday, November 13, 2014 2:32:47 PM UTC-8, satish...@gmail.com wrote: > file = open('data.bin', 'rb') > bytes = file.read() > bytes > b'\x00\x00\x00\x02spam\x00\x03?\x9d\xf3\xb6' > records = [bytes([char] * 8) for char in b'spam'] > TypeError: 'bytes' object is not callable > > How to recove

Re: io.UnsupportedOperation: fileno

2014-11-13 Thread sohcahtoa82
On Thursday, November 13, 2014 3:23:24 PM UTC-8, satish...@gmail.com wrote: > import sys > for stream in (sys.stdin, sys.stdout, sys.stderr): >print(stream.fileno()) > > > io.UnsupportedOperation: fileno Yup. That's what I'd expect to see. -- https://mail.python.org/mailman/listinf

Re: Bad file descriptor

2014-11-13 Thread sohcahtoa82
On Thursday, November 13, 2014 3:40:50 PM UTC-8, satish...@gmail.com wrote: > import os > os.write(1, b'Hello descriptor world\n') > OSError: Bad file descriptor > > How to give a file descriptor number to this function? How to get a file > descriptor number? http://bit.ly/1zRWHyq -- https://ma

Re: Help with Python Multiprocessing

2014-11-14 Thread sohcahtoa82
On Thursday, November 13, 2014 3:22:49 PM UTC-8, Anurag wrote: > On Thursday, November 13, 2014 2:18:50 PM UTC-5, sohca...@gmail.com wrote: > > On Thursday, November 13, 2014 10:07:56 AM UTC-8, Anurag wrote: > > > I am having trouble understanding the Multiprocessing module. > > > I need to run thr

Re: How modules work in Python

2014-11-18 Thread sohcahtoa82
On Tuesday, November 18, 2014 12:14:15 AM UTC-8, Larry Hudson wrote: > First, I'll repeat everybody else: DON'T TOP POST!!! > > On 11/16/2014 04:41 PM, Abdul Abdul wrote: > > Dave, > > > > Thanks for your nice explanation. For your answer on one of my questions: > > > > *Modules don't have method

Re: How modules work in Python

2014-11-19 Thread sohcahtoa82
On Tuesday, November 18, 2014 11:44:53 PM UTC-8, Larry Hudson wrote: > On 11/18/2014 12:59 PM, sohcah...@gmail.com wrote: > > On Tuesday, November 18, 2014 12:14:15 AM UTC-8, Larry Hudson wrote: > >> First, I'll repeat everybody else: DON'T TOP POST!!! > >> > >> On 11/16/2014 04:41 PM, Abdul Abdul

Re: Most gratuitous comments

2014-11-20 Thread sohcahtoa82
On Wednesday, November 19, 2014 8:59:01 PM UTC-8, Steven D'Aprano wrote: > And the award for the most gratuitous comments before an import goes to > one of my (former) workmates, who wrote this piece of code: > > # Used for base64-decoding. > import base64 > # Used for ungzipping. > import gzip >

Re: Most gratuitous comments

2014-11-20 Thread sohcahtoa82
On Thursday, November 20, 2014 1:33:16 PM UTC-8, c...@isbd.net wrote: > s...@gmail.com wrote: > > > > # increment x > > x += 1 > > But it shouldn't say 'increment x', it should say 'add one to the line > count' or some such. Although changing the variable name to > 'lineCount' would do almost as

Re: Most gratuitous comments

2014-11-20 Thread sohcahtoa82
On Thursday, November 20, 2014 3:16:33 PM UTC-8, Steven D'Aprano wrote: > sohcahto...@gmail.com wrote: > > > On Thursday, November 20, 2014 1:33:16 PM UTC-8, c...@isbd.net wrote: > >> s...@gmail.com wrote: > >> > > >> > # increment x > >> > x += 1 > >> > >> But it shouldn't say 'increment x', it

Re: Most gratuitous comments

2014-11-20 Thread sohcahtoa82
On Thursday, November 20, 2014 4:17:33 PM UTC-8, Chris Angelico wrote: > On Fri, Nov 21, 2014 at 10:59 AM, wrote: > >> (By the way, whatever tool you are using to post comments is badly breaking > >> attributions. It is polite to give the person's full name when quoting > >> them, when they provi

Re: PyWart: "Python's import statement and the history of external dependencies"

2014-11-21 Thread sohcahtoa82
On Friday, November 21, 2014 3:21:31 PM UTC-8, Rick Johnson wrote: > On Friday, November 21, 2014 4:25:49 PM UTC-6, Rick Johnson wrote: > > > > # STEP 3 # > > #

Re: Help with Python Multiprocessing

2014-11-24 Thread sohcahtoa82
On Sunday, November 23, 2014 12:56:51 PM UTC-8, Anurag wrote: > Hey Socha, > Your solution works. But then, all my 3 workers are running in a single > command window. How do I make them run in three different command windows? That, I don't know. You would probably need to open a new command wind

Re: Cherrypy - prevent browser "prefetch"?

2014-12-01 Thread sohcahtoa82
On Monday, December 1, 2014 12:29:04 PM UTC-8, Israel Brewster wrote: > I don't know if this is a cherrypy specific question (although it will be > implemented in cherrypy for sure), or more of a general http protocol > question, but when using cherrypy to serve a web app, is there anyway to > p

Re: Python handles globals badly.

2014-12-03 Thread sohcahtoa82
On Wednesday, December 3, 2014 10:05:06 AM UTC-8, mm0fmf wrote: > On 03/12/2014 04:32, Skybuck Flying wrote: > > Some issues I'd like to address to you: > > > > 1. Structured programming requires more programming time. > > 2. Structured programming implies structure which might be less flexible. >

Re: Tabs for indentation & Spaces for alignment in Python 3?

2014-12-05 Thread sohcahtoa82
On Friday, December 5, 2014 9:47:10 AM UTC-8, Aahan Krish wrote: > I have two general questions regarding Python that I couldn't find any good > answers for. This is not the often-asked Tabs vs Spaces question, so kindly > read it in whole. > > Q1. This is not to debate the decision, but I reall

Re: [newbie] how to make program suggest to install missing modules

2014-12-08 Thread sohcahtoa82
On Monday, December 8, 2014 9:44:50 AM UTC-8, hugocoolens wrote: > I'd like to add the following to a python-program: > > when a module (take rtlsdr as an example) is not installed on the system I'd > like to ask the program something like: > > module rtlsdr is missing, shall I install it? y or

Re: [newbie] how to make program suggest to install missing modules

2014-12-08 Thread sohcahtoa82
On Monday, December 8, 2014 10:46:47 AM UTC-8, Jean-Michel Pichavant wrote: > - Original Message - > > From: sohcahto...@gmail.com > > try: > > import someModule > > except ImportError: > > print "Module is missing" > > # handle it! > > > > Just make sure to attempt to import i

Re: Maintaining Maximum Line Length When Using Tabs Instead of Spaces?

2014-12-08 Thread sohcahtoa82
> On Mon, Dec 8, 2014 at 10:15 AM, Aahan Krish wrote: > My understanding from talking to different people is that many do use > > tabs (instead of spaces) for indentation in their code. > > > > My question is to them (because I want to use tabs too) is: how do you > > maintain a line-length o

Re: [newbie] how to make program suggest to install missing modules

2014-12-09 Thread sohcahtoa82
To: Jean-Michel Pichavant On Monday, December 8, 2014 10:46:47 AM UTC-8, Jean-Michel Pichavant wrote: > - Original Message - > > From: sohcahto...@gmail.com > > try: > > import someModule > > except ImportError: > > print "Module is missing" > > # handle it! > > > > Just make

Re: [newbie] how to make program suggest to install missing modules

2014-12-09 Thread sohcahtoa82
To: hugocoolens On Monday, December 8, 2014 9:44:50 AM UTC-8, hugocoolens wrote: > I'd like to add the following to a python-program: > > when a module (take rtlsdr as an example) is not installed on the system I'd like to ask the program something like: > > module rtlsdr is missing, shall I ins

Re: Maintaining Maximum Line Length When Using Tabs Instead of Spaces?

2014-12-09 Thread sohcahtoa82
To: jtan > On Mon, Dec 8, 2014 at 10:15 AM, Aahan Krish wrote: > My understanding from talking to different people is that many do use > > tabs (instead of spaces) for indentation in their code. > > > > My question is to them (because I want to use tabs too) is: how do you > > maintain a li

Re: Python script isn't producing text in data file

2014-12-10 Thread sohcahtoa82
On Wednesday, December 10, 2014 3:11:28 PM UTC-8, Chris Angelico wrote: > On Thu, Dec 11, 2014 at 10:04 AM, Docfxit wrote: > > This is the Python Script that I'm having trouble with: > > http://theoffice.la/m/CGPLogSummaryTest.py > > > > If I haven't provided enough information please let me know.

Re: Text Code(from 'Getting Started in Beautiful Soup' re: cd Soup , returns 'Syntax Error, invalid syntax'

2014-12-11 Thread sohcahtoa82
On Thursday, December 11, 2014 11:21:52 AM UTC-8, Simon Evans wrote: > At the start of Chapter 3 of 'Getting Started in Beautiful Soup' it has said > to create a html file, 'ecological > > pyramid.html' - which I have already done re: > ---

Re: Run Programming ?????

2014-12-12 Thread sohcahtoa82
> On Friday, December 12, 2014, William Ray Wing wrote: > > > > > On Dec 12, 2014, at 8:03 AM, Chris Warrick wrote: > > > > > On Dec 12, 2014 1:40 PM, "Delgado Motto" wrote: > > > > > > I travel alot, if not just interested in things of pocketable portability, > > and was curious if

Re: Neat little programming puzzle

2014-12-16 Thread sohcahtoa82
On Monday, December 15, 2014 9:52:58 PM UTC-8, Jason Swails wrote: > This was a problem posed to me, which I solved in Python.  I thought it was > neat and enjoyed the exercise of working through it; feel free to ignore.  > For people looking for little projects to practice their skills with (or

Re: Creating interactive command-line Python app?

2014-12-18 Thread sohcahtoa82
On Saturday, December 13, 2014 6:50:50 AM UTC-8, Steven D'Aprano wrote: > rfreundlic...@colonial.net wrote: > > > um, what if I want to USE a command line for python WITHOUT downloading or > > installing it > > Who are you talking to? What is the context? > > Like all software, you can't use

Re: Changing script's search path at install time

2014-12-19 Thread sohcahtoa82
On Friday, December 19, 2014 6:00:15 PM UTC-8, Mitko Haralanov wrote: > Hi all, > > > I have a question regarding installation of Python scripts and modules using > distutils that I can't find an answer to by searching through Google and the > Python website. Hopefully, someone on this list mig

Re: what is wrong with d.clear()?

2014-12-22 Thread sohcahtoa82
On Monday, December 22, 2014 12:16:15 AM UTC-8, shawool wrote: > Hi, > > where am i going wrong ? > > $ python3 > Python 3.2.5 (default, Oct  2 2013, 22:58:11) > [GCC 4.8.1] on cygwin > Type "help", "copyright", "credits" or "license" for more information. > >>> d = {} > >>> import sys > >>> d =

Re: what is wrong with d.clear()?

2014-12-22 Thread sohcahtoa82
On Monday, December 22, 2014 12:54:55 PM UTC-8, Rick Johnson wrote: > On Monday, December 22, 2014 12:16:03 PM UTC-6, sohca...@gmail.com wrote: > > On Monday, December 22, 2014 12:16:15 AM UTC-8, shawool wrote: > > > > [snip: OP's adolescent accessorizing] @_@ > > > > Is there a reason you're com

Re: Program calling unwanted functions

2014-12-22 Thread sohcahtoa82
On Monday, December 22, 2014 3:57:31 PM UTC-8, Dave Angel wrote: > On 12/22/2014 06:48 PM, Ian Kelly wrote: > > On Dec 22, 2014 2:37 PM, "Dave Angel" wrote: > >> > >> I'll pick on one function first, called instructions(). If the user > > types something invalid, you print "Invalid input." and ca

Re: Hello World

2014-12-22 Thread sohcahtoa82
On Monday, December 22, 2014 4:56:13 PM UTC-8, Roy Smith wrote: > In article , > Tim Chase wrote: > > > On 2014-12-22 19:05, MRAB wrote: > > > On 2014-12-22 18:51, Mark Lawrence wrote: > > > > I'm having wonderful thoughts of Michael Palin's favourite Python > > > > sketch which involved fish sl

Re: Threading in Python, Please check the script

2015-01-14 Thread sohcahtoa82
On Tuesday, January 13, 2015 at 10:22:32 PM UTC-8, Robert Clove wrote: > Hi All, > > I have made a script in which i have started two thread named thread 1 and > thread 2. > In thread 1 one function will run named func1 and in thread 2 function 2 will > run named func 2. > Thread 1 will execute

  1   2   >