Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > write()

Reply
Thread Tools

write()

 
 
Hyun-su
Guest
Posts: n/a
 
      08-22-2011
Hi,
I have a file which is 3D data ([pixel_x, pixel_y, pixel_z])

I want to plot and write into other file as 1 dimension ([:, y_cut,
z_cut])

How can I do it?

 
Reply With Quote
 
 
 
 
Ulrich Eckhardt
Guest
Posts: n/a
 
      08-22-2011
Hyun-su wrote:
> I have a file which is 3D data ([pixel_x, pixel_y, pixel_z])
>
> I want to plot and write into other file as 1 dimension ([:, y_cut,
> z_cut])
>
> How can I do it?


I'd write a loop along these lines:

with open(outputfile, 'w') as o:
for pixel_x, pixel_y, pixel_z in input_data:
o.write(...)


If you want a better suggestion, I'd suggest that you provide more info.
Also, and that is very important, you should indicate which efforts you
already too. In particular, I'd suggest the introductory tutorial on Python
(see http://docs.python.org) and E.S. Raymonds essay on smart questions
(search the web for it). If you don't show effort, people will assume you
are lazy and just need someone to do your homework for you.

Good luck!

Uli

--
Domino Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments