Print statement

2020-01-28 Thread L A Smit
Please help me with this. squares =input("\nSquares: ") print(float((squares) *float(.15)) *(1.3)) Cant print answer. print(float((squares) * float(.15)) *(1.3)) TypeError: can't multiply sequence by non-int of type 'float' Thx L Smit -- https://mail.python.org/mailman/listinfo/python-lis

Re: Clarification on Immutability please

2020-01-28 Thread Daniel Haude
Am 27.01.2020 15:23 schrieb Chris Angelico: The way execution works in Python, you first evaluate the object, then assign it to the target. The new object HAS to exist before the old one is replaced. There's no such thing as "atomic reassignment" that simultaneously destroys the old object and a

Re: Print statement

2020-01-28 Thread Frank Millman
On 2020-01-28 12:14 PM, L A Smit wrote: Please help me with this. squares =input("\nSquares: ") print(float((squares) *float(.15)) *(1.3)) Cant print answer.   print(float((squares) * float(.15)) *(1.3)) TypeError: can't multiply sequence by non-int of type 'float' You have some superfluo

Re: Clarification on Immutability please

2020-01-28 Thread Chris Angelico
On Tue, Jan 28, 2020 at 9:33 PM Daniel Haude wrote: > > Am 27.01.2020 15:23 schrieb Chris Angelico: > > > The way execution works in Python, you first evaluate the object, then > > assign it to the target. The new object HAS to exist before the old > > one is replaced. There's no such thing as "at

Re: Clarification on Immutability please

2020-01-28 Thread Random832
On Wed, Jan 22, 2020, at 02:34, Stephen Tucker wrote: > Oh dear, I am sorry. I have created quite a storm. > > Moreover, I am sorry because I misremembered what I had typed into Idle. My > original tuple only had two elements, not three, so the slicing [:2] didn't > affect the tuple at all - and s

Re: Clarification on Immutability please

2020-01-28 Thread Chris Angelico
On Wed, Jan 29, 2020 at 1:50 AM Random832 wrote: > > On Wed, Jan 22, 2020, at 02:34, Stephen Tucker wrote: > > Oh dear, I am sorry. I have created quite a storm. > > > > Moreover, I am sorry because I misremembered what I had typed into Idle. My > > original tuple only had two elements, not three,

Simple Python github library to push/pull files?

2020-01-28 Thread Malcolm Greene
Any recommendations on a library providing a simple interface to Github for basic push/pull type of actions? I know there's a native GitHub RESTful API but wondering if anyone has placed a friendly Python wrapper on top of that interface? PyGithub supports a rich set of actions, but doesn't appe

Re: Simple Python github library to push/pull files?

2020-01-28 Thread Chris Angelico
On Wed, Jan 29, 2020 at 3:38 AM Malcolm Greene wrote: > > Any recommendations on a library providing a simple interface to Github for basic push/pull type of actions? I know there's a native GitHub RESTful API but wondering if anyone has placed a friendly Python wrapper on top of that interface? P

Dynamic Data type assignment

2020-01-28 Thread sushma ms
Hi Please find below example and the compiler error, when i'm assigning value dynamically and when we comparing in "if" loop it is throwing compiler error. It should not throw error it should assign and act as int why it is thinking as string. *Code Snippet:* print("Hello World") num = input("E

Re: [docs] Dynamic Data type assignment

2020-01-28 Thread Mariatta
input() returns a string. If you want it to be treated as an int you need to cast it, example: num =int(input ("Enter number")) On Tue, Jan 28, 2020, 5:13 AM sushma ms wrote: > Hi > > Please find below example and the compiler error, > > when i'm assigning value dynamically and when we comparin

Re: Dynamic Data type assignment

2020-01-28 Thread Rhodri James
On 28/01/2020 12:03, sushma ms wrote: Hi Please find below example and the compiler error, when i'm assigning value dynamically and when we comparing in "if" loop it is throwing compiler error. It should not throw error It absolutely should throw an error. it should assign and act as int wh

Re: Simple Python github library to push/pull files?

2020-01-28 Thread Barry Scott
> On 28 Jan 2020, at 16:40, Chris Angelico wrote: > > On Wed, Jan 29, 2020 at 3:38 AM Malcolm Greene wrote: >> >> Any recommendations on a library providing a simple interface to Github > for basic push/pull type of actions? I know there's a native GitHub RESTful > API but wondering if anyon

Is asyncio.sleep() necessary when yielding?

2020-01-28 Thread rmlibre
I'm trying to figure out how the event loop handles switching tasks inside of an async generator, and consequently, the constraints on its calling code. For example: > async def > > > > > > -- https://mail.python.org/mailman/listinfo/python-list

Is asyncio.sleep() necessary when yielding?

2020-01-28 Thread rmlibre
(Sorry about the double submission) I'm trying to figure out how the event loop handles switching tasks inside of an async generator, and consequently, the constraints on its calling code. For example: > async def gen(): > for number in range(10 ** 7): > yield number > > > async def

Interactively online Python learning environment freely available

2020-01-28 Thread Kent Tong
Hi, I've made an online python learning environment available at https://p4kweb.appspot.com Please take a look and let me know what you think :-) -- https://mail.python.org/mailman/listinfo/python-list

Re: on sorting things

2020-01-28 Thread Tony Flury via Python-list
On 20/12/2019 18:59, Peter Otten wrote: Chris Angelico wrote: On Sat, Dec 21, 2019 at 5:03 AM Peter Otten <__pete...@web.de> wrote: PS: If you are sorting files by size and checksum as part of a deduplication effort consider using dict-s instead: Yeah, I'd agree if that's the purpose. But l

Re: [docs] Dynamic Data type assignment

2020-01-28 Thread sushma ms
Thanks a lot. But why can't we make output of input also dynamic data assignment. Thanks & Regards, Sushma MS On Tue, Jan 28, 2020, 9:54 PM Mariatta wrote: > input() returns a string. If you want it to be treated as an int you need > to cast it, example: > > num =int(input ("Enter number")) >

Re: [docs] Dynamic Data type assignment

2020-01-28 Thread DL Neil via Python-list
On 29/01/20 4:51 PM, sushma ms wrote: Thanks a lot. But why can't we make output of input also dynamic data assignment. 1 please don't 'top post': the normal sequence of a conversation is question THEN answer! 2 ambiguity! It is not possible for the input() mechanism to tell whether you la

Is there a character that never appears in the output of zlib.compress?

2020-01-28 Thread Peng Yu
Hi, I'd like to tell what part is zlib.compress data in an input stream. One way is to use some characters that never appear in zlib.compress output to denote the boundary. Are there such characters? Thanks. -- Regards, Peng -- https://mail.python.org/mailman/listinfo/python-list

How to read the original data line by line from stdin in python 3 just like python 2?

2020-01-28 Thread Peng Yu
Suppose that I use this to read from stdin. But `line` contains decoded data in python 3. In python 2, it contains the original data. What is the best way to get the original data in python 3? Thanks. ``` for line in sys.stdin: ... ``` -- Regards, Peng -- https://mail.python.org/mailman/list

Re: How to read the original data line by line from stdin in python 3 just like python 2?

2020-01-28 Thread Greg Ewing
On 29/01/20 6:27 pm, Peng Yu wrote: Suppose that I use this to read from stdin. But `line` contains decoded data in python 3. In python 2, it contains the original data. What is the best way to get the original data in python 3? Read from stdin.buffer, which is a stream of bytes. -- Greg -- ht