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
  No matter what I do I get back "List indices must be integers or slices, not list" Radical 4 1,091 Sep-24-2023, 05:03 AM
Last Post: deanhystad
  Delete strings from a list to create a new only number list Dvdscot 8 1,466 May-01-2023, 09:06 PM
Last Post: deanhystad
  List all possibilities of a nested-list by flattened lists sparkt 1 878 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,738 Oct-26-2022, 04:03 PM
Last Post: deanhystad
Question Keyword to build list from list of objects? pfdjhfuys 3 1,500 Aug-06-2022, 11:39 PM
Last Post: Pedroski55
  search a list or tuple for a specific type ot class Skaperen 8 1,854 Jul-22-2022, 10:29 PM
Last Post: Skaperen
  TypeError: unsupported opperand type(s) for %: 'int' and 'list' cool_person 7 2,099 May-07-2022, 08:40 AM
Last Post: ibreeden
  unsupported operand type(s) for %: 'list' and 'int' RandomCoder 4 32,707 May-07-2022, 08:07 AM
Last Post: menator01
  Split a number to list and list sum must be number sunny9495 5 2,199 Apr-28-2022, 09:32 AM
Last Post: Dexty
  How to check if a list is in another list finndude 4 1,793 Jan-17-2022, 05:04 PM
Last Post: bowlofred

Forum Jump:

User Panel Messages

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