Python Forum
removing quotes from a list and keep type list
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
removing quotes from a list and keep type list
#1
hello all ..
im trying to use sys.argv take and ip like : 192.168.1.99 and convert it to [192.168.1.99] ... but it add '
import sys

start = sys.argv[1]
start = start.replace(".", ",")
start = [start]
print(start)
Output:
['85,8,8,8']
i need to remove ' from it and print it like : [85,8,8,8] but i need to keep the type (list) not str
how i can do that
Reply


Messages In This Thread
removing quotes from a list and keep type list - by evilcode1 - Aug-03-2019, 08:38 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Strange behavior list of list mmhmjanssen 3 398 May-09-2024, 11:32 AM
Last Post: mmhmjanssen
  No matter what I do I get back "List indices must be integers or slices, not list" Radical 4 1,317 Sep-24-2023, 05:03 AM
Last Post: deanhystad
  Delete strings from a list to create a new only number list Dvdscot 8 1,666 May-01-2023, 09:06 PM
Last Post: deanhystad
  List all possibilities of a nested-list by flattened lists sparkt 1 975 Feb-23-2023, 02:21 PM
Last Post: sparkt
  Сheck if an element from a list is in another list that contains a namedtuple elnk 8 1,947 Oct-26-2022, 04:03 PM
Last Post: deanhystad
Question Keyword to build list from list of objects? pfdjhfuys 3 1,656 Aug-06-2022, 11:39 PM
Last Post: Pedroski55
  search a list or tuple for a specific type ot class Skaperen 8 2,029 Jul-22-2022, 10:29 PM
Last Post: Skaperen
  TypeError: unsupported opperand type(s) for %: 'int' and 'list' cool_person 7 2,284 May-07-2022, 08:40 AM
Last Post: ibreeden
  unsupported operand type(s) for %: 'list' and 'int' RandomCoder 4 33,021 May-07-2022, 08:07 AM
Last Post: menator01
  Split a number to list and list sum must be number sunny9495 5 2,391 Apr-28-2022, 09:32 AM
Last Post: Dexty

Forum Jump:

User Panel Messages

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