Python Forum
converting string object inside a list into an intiger
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
converting string object inside a list into an intiger
#1
Hi,guys!

import sys
a = sys.argv
a.remove('C:\\Users\\USER\\Desktop\\app\\as4t.py')

print(a)

C:\Users\USER\Desktop\app>as4t.py 1 2 3
['1', '2', '3']

How can i make that output [1, 2, 3]?
Reply


Messages In This Thread
converting string object inside a list into an intiger - by bwdu - Mar-29-2020, 07:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Possible to create an object inside another object that is visible outside that objec MeghansUncle2 17 2,265 May-25-2023, 02:08 PM
Last Post: MeghansUncle2
  How do I call sys.argv list inside a function, from the CLI? billykid999 3 802 May-02-2023, 08:40 AM
Last Post: Gribouillis
  add object and name in list 3lnyn0 4 1,314 Nov-24-2022, 07:33 PM
Last Post: buran
  bytearray object - why converting to ascii? Chepilo 2 1,646 Nov-21-2022, 07:25 PM
Last Post: Chepilo
  Converting '1a2b3c' string to Dictionary PythonNoobLvl1 6 1,887 May-13-2022, 03:44 PM
Last Post: deanhystad
  AttributeError: 'list' object has no attribute 'upper' Anldra12 4 4,918 Apr-27-2022, 09:27 AM
Last Post: Anldra12
  AttributeError: 'list' object has no attribute 'values' ilknurg 4 15,041 Jan-19-2022, 08:33 AM
Last Post: menator01
  Need to parse a list of boolean columns inside a list and return true values Python84 4 2,125 Jan-09-2022, 02:39 AM
Last Post: Python84
  Need help converting string to int dedesssse 7 2,696 Jul-07-2021, 09:32 PM
Last Post: deanhystad
  Converting a list to dictinary tester_V 8 2,737 Jul-02-2021, 09:04 PM
Last Post: tester_V

Forum Jump:

User Panel Messages

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