FAQ Database Discussion Community


Reduce writing time of data

python,optimization,time,writing
I'm post-processing CFD data (applying a rotation to the coordinates). To do that, I'm doing the following: -Read a file -Store the data into structured array -Manipulate the data (do the calculations) -Write a new file It works but it takes 7seconds per file. And I have (15000 * 4)...

Python 2.7 : Entire code getting written in a file issue

python,file,python-2.7,canopy,writing
I've kind of a simple issue. In a program - the program doesn't matter -, only the first lines, i open an empty file (named empty.txt). Then i define functions, but never use them on main ... so, I do not actually write anything. This the nearly complete code: from...

Writing to user defined XML file

c#,xml,writing
I have been following a Youtube tutorial on creating lists and saving/loading them to xml files. However, I have been playing around with it and I just cant quite seem to get my head around having a dialog box appear and let the user select a location and enter the...

Counting to 100,000 and writing that to a file

python,file,counter,writing
I haven't used Python for a while but I decided to create a program today to help me with some work I am trying to do. I am trying to create a program that writes the numbers 1-100,000 with the symbol | after each but can't seem to strip the...

NoClassDefFoundError: UnsupportedFileFormatException while using apache poi to write to an excel file

java,excel,apache-poi,writing
I am trying to write to an excel(.xlsx) file using Apache poi, I included the apache poi dependencies in my pom.xml file. But I am getting the following exception in execution. Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/poi/UnsupportedFileFormatException at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at...

The position of int main() function [closed]

c++,function,styles,main,writing
I know that it's possible to write a code in that way: void foo() {...} void bar() {...} string qix(){...} int main() { //functions calling } And also it's possible to write the same like: /* function's prototypes here*/ int main() { //functions calling } void foo() {...} void bar()...

How to .write() two items, a zero and an iterator in Python?

python,csv,formatting,conditional-statements,writing
I may have a simple formatting question here - I would like to do something like hrOut.write('0',i) in order to add/preface a zero to 'i' which is a timestamp, but I don't know the correct syntax. My code is below. Thank you all. hrIn = open('HrsInput.csv') hrOut = open('HrsOutput.csv', 'wt')...

Writing to multiple columns (not rows) - Python

csv,writing
I am trying to write two lists to a csv file. I want the lists to feed vertically into the spreadsheet into two columns. import csv import os name = "rr" newname = name+".csv" rs = [1,2,3,4] dr = [2,3,4,5] with open(newname, 'w') as output: writer = csv.writer(output, lineterminator='\n') writer.writerow(rs)...