file-writing Questions

2

Solved

I'm using Node.js and I'm having trouble figuring out how could I read a YAML file, replace a value in it, and write the updated value to the YAML file. I'm currently using the module "yamljs" whi...
Earthshine asked 2/10, 2018 at 21:12

6

Solved

I have a PDF as a base64 string and I need to write it to file using Python. I tried this: import base64 base64String = "data:application/pdf;base64,JVBERi0xLjQKJeHp69MKMSAwIG9iago8PC9Qcm9kdWNlci...
Mooney asked 4/1, 2018 at 21:50

3

I'm trying my hand at this rosalind problem and am running into an issue. I believe everything in my code is correct but it obviously isn't as it's not running as intended. i want to delete the con...
Jannjanna asked 28/1, 2017 at 21:40

7

The following code throws an error if it's run by a non-root user for a file owned by root, even when the non-root user has sudo privileges: try: f = open(filename, "w+") except IOError: sys.std...
Zoogloea asked 14/9, 2016 at 20:34

2

I am trying to write to a file with Transact-SQL using a stored procedure that I can pass input to. However, every time I run the commands in SQL Server 2012 it displays Command(s) completed succes...
Chainplate asked 17/6, 2016 at 14:28

2

Solved

In pytorch, I want to write a tensor to a file and visually read the file contents. For example, consider T = torch.tensor([3,4,5,6]). I want to write the tensor T to a file, say file_T.txt, and wa...
Mohun asked 16/6, 2020 at 16:13

15

Solved

I want to redirect the print to a .txt file using Python. I have a for loop, which will print the output for each of my .bam file while I want to redirect all output to one file. So I tried to put:...
Carrack asked 22/8, 2011 at 19:47

11

Solved

I have a dictionary and am trying to write it to a file. exDict = {1:1, 2:2, 3:3} with open('file.txt', 'r') as file: file.write(exDict) I then have the error file.write(exDict) TypeError: ...
Stephaniestephannie asked 1/5, 2016 at 10:19

16

Solved

How can I indicate a newline in a string in Python, so that I can write multiple lines to a text file?
Detect asked 16/7, 2012 at 2:14

8

Solved

I can't seem to find this question yet, but what is the simplest, most-idiomatic way of opening/creating a file, writing to it, and then closing it? Looking at the kotlin.io reference and the Java ...
Protestation asked 16/2, 2016 at 22:29

1

Is there any way of writing to a file on github pages using javascript? I want to save some info that i wanna use elsewhere to a json file (preferably, but txt would also work), and was wondering i...
Augean asked 6/8, 2018 at 7:35

2

Solved

I wrote a bot that performs some network queries once every so often and dumps the latest state into a file stored on disk. This is my code: let log_file = OpenOptions::new() .read(true) .write(t...
Xylotomous asked 18/1, 2021 at 22:23

2

Solved

I currently am trying to get the code from this website: http://netherkingdom.netai.net/pycake.html Then I have a python script parse out all code in html div tags, and finally write the text from ...
Faithfaithful asked 6/3, 2016 at 18:41

4

Solved

I have a resulting RDD labelsAndPredictions = testData.map(lambda lp: lp.label).zip(predictions). This has output in this format: [(0.0, 0.08482142857142858), (0.0, 0.11442786069651742),.....] W...
Limy asked 8/8, 2015 at 21:53

3

Solved

I am trying to write a struct to a file and read it back. The code to do so is here: #include <fstream> #include <iostream> #include <cstring> using namespace std; struct info ...
Wadesworth asked 15/3, 2019 at 10:57

2

Solved

I have a question about Python 2.7 read/write csv file with 'utf-8-sig' code, my csv . header is ['\xef\xbb\xbfID;timestamp;CustomerID;Email'] there have some code("\xef\xbb\xbfID") I read from ...
Fairground asked 2/5, 2018 at 8:49

2

Solved

I'm working on a Python 3 Tkinter app (OS is Windows 10) whose overall functionality includes the following details: Reading a number of text files which may contain data in ascii, cp1252, utf-8,...
Knotgrass asked 22/2, 2019 at 21:10

3

Now I get about 3.6GB data per second in memory, and I need to write them on my SSD continuously. I used CrystalDiskMark to test the writing speed of my SSD, it is almost 6GB per second, so I had t...
Kodak asked 23/1, 2019 at 8:2

1

Solved

Is there a way to dump a buffer to file atomically? By "atomically" I mean: if for example someone terminates my application during writing, I'd like to have file in either before- or after-writin...
Medovich asked 25/3, 2015 at 16:48

1

I run the same Python program concurrently as different processes, and these all want to write to the same hdf5 file, using the h5py Python package. However, only a single process may open a given ...
Tubercle asked 22/3, 2018 at 21:30

2

Solved

I've been trying to understand K&R's version of putc for some time now, and I'm out of resources (google, stack overflow, clcwiki don't quite have what I'm looking for and I have no friends or ...
Houseboat asked 23/7, 2018 at 19:33

1

Solved

I am writing a program that scrapes a website and extracts the names and the links from a table. I store each name and respective link in an object and append it to a list of objects by running a f...
Yovonnda asked 15/6, 2018 at 20:55

3

Solved

I want to know how to create a file if it does not exist in the directory. I want to only append data. I am getting this error in Python: No such file or directory. This is my code: with open (...
Lippi asked 19/8, 2015 at 6:10

1

Solved

I have a CSV with approximately 40 million rows. Each row is a training instance. As per the documentation on consuming TFRecords I am trying to encode and save the data in a TFRecord file. All t...
Beatnik asked 21/2, 2018 at 16:16

7

Solved

We have some information that we need to write (about 18 KB) to a .txt file stored on one of our network drives. The file is re-written about once every 15 minutes, but it is read practically ...
Persecute asked 24/1, 2011 at 19:37

© 2022 - 2025 — McMap. All rights reserved.