Python Forum
how to use thread without locking up terminal
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to use thread without locking up terminal
#12
Lists and arrays are always passed as a reference if you do a simple assignment. But there is an easy way to solve this problem.
a = [1, 2, 3, 4]
last = list(a)
now a copy of list a is made and passed to last.
import numpy as np
a = np.array([1,2,3,4])
last = a.copy()
a copy is made of the array and then passed to last.
Reply


Messages In This Thread
RE: how to use thread without locking up terminal - by ThiefOfTime - May-05-2018, 02:56 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020