Using the internet information/information using this platform, I manage to write a small Python code which reads 200 csv and then able to distinguish the different values corresponding to the index of the column. Now I am interested in writting a csv/txt file in which 2 columns should there one of variable “time” and another variable “alpha.water” . Using the
Tag: file
Python Get File Length Of Keyboard Buffer
I am coding a text-based game, and I need to read key presses. For various reasons, I’m doing this by reading the keyboard buffer. This is my current code for that: The problem is, that the program will wait until it has read 45 bytes. I do not want this, because the program should do other stuff (like recharging mana).
Why can’t I load a .OBJ file into Python Ursina?
I am using the python Ursina engine. I want to import a .OBJ file, but it never works, yet no errors are raised. I have tried: I have also tried it without the .obj ending. Any help? I have now tried: I get the error: Answer The issue is triangulation. The models faces must only be triangles. You can do
Why do the first two inputs I enter when I run my program repeat in the text file?
I’m trying to make a flash card generator, and I’m having trouble gathering the inputs from the text file. When the program asks the user for the questions and answers, it drops the information into a text file that will be used later, when the user wishes to review the information. However, whenever the program runs for the first time,
How can I turn a python file into a exe file withou this error
Well, I am making a personal project, for this project, I need to run a python script every time on the computer, and this script needs to start when the computer is turned on, for this, I used PyInstaller to turn the script in a “.exe” file, but an error is shown. Python Code, filename; “teste.py”: this code just show
Can you write to the middle of a file in python?
I would like to write to the middle of a line in a file. for exemple i have a file: Text.txt: Is is it possible to precise an index where: file.write() has to start writing? I have started with this: Answer I think what you can do is to substitute already existing characters with the same amount of other characters
How do I run another file in python?
So I know how to write in a file or read a file but how do I RUN another file? for example in a file I have this: a = 1 print(a) How do I run this using another file? Answer using subprocess standard lib or using os standard lib or extract python code from the file and run it
Reading file and counting repeated elements automation
I need help to solve a problem quickly. At work I have a file that has 18 characters per line (there are more than 600 lines). I need to read each line and on each line read 6 characters at a time. And in these 6 characters I want to count how many times it is repeated in this file.
How do I find duplicates and print the line in a text file?
I am trying to go through a .txt and find duplicate names in the file, but also print out the line that duplicate is located on. This is what I have so far for finding the duplicate names: But I am unsure of how to show what line they are located on. I read about finding a keyword in file
How to create a file object from a zipfile?
I want to create a file object from a file that is inside a zip. I don’t wanna extract that file. Actually I wanna use seek method on a file that is inside a zip. My code: But I can’t use seek method on it. I wanna make it like this but without extracting the file: Answer The documentation says