read line

  • Thread starter moustafa.elmihy
  • Start date
M

moustafa.elmihy

hi every body,

I'm a new python user and I'm making a program to run useing Abaqus
and there is something I can't do,

if i have a text file that has a line like this " 10 20 30 40
50" and I wana do the coding to put every number of these like 10 or
20 in a separate variable .. any suggestions ??

thanks in advance
 
D

Diez B. Roggisch

hi every body,

I'm a new python user and I'm making a program to run useing Abaqus
and there is something I can't do,

if i have a text file that has a line like this " 10 20 30 40
50" and I wana do the coding to put every number of these like 10 or
20 in a separate variable .. any suggestions ??

Look up on the file-objects in the documentation, as well as string-methods
such as split and the int-function.

Diez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top