Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
35 views

I'm on windows using vscode, while True: command = input("enter to next, 0 to append and next (or type 'e' to quit): ") if command.lower() == 'e': print("Exiting ...
Deepak's user avatar
  • 1
0 votes
0 answers
101 views

I'm working on Alembic migration github action and need to import base metadata class inside python migration script which locates in another directory. I can't import it directly inside python ...
andrey's user avatar
  • 1,197
1 vote
2 answers
69 views

So I'm trying to use Python to analyze images of cells taken in multiple wells of a 96 well plate. I was able to generate a csv of my data from said images from each field and group them by well. I ...
Alexander Morano's user avatar
0 votes
0 answers
36 views

data_path = '/Users/acer/Downloads/t-less_v2/' info_path_mask = os.path.join(data_path, 'test_{}','{:02d}','info.yml') path_mask = os.path.join(data_path, 'test_{}','{}','info.yml') print(f"...
Civil Er's user avatar
0 votes
1 answer
193 views

Traceback (most recent call last): File "Ish.py", line 1, in <module> File "PyInstaller\loader\pyimod02_importers.py", line 378, in exec_module File "...
Eesh Gharat's user avatar
2 votes
0 answers
74 views

Right now I am working on a project a Files manager #delete file import os file_path = r"The\\path_file" try: os.remove(file_path) print("The file has been removed") ...
user avatar
0 votes
0 answers
68 views

Some programs emit colored text when their output is connected to a terminal, and non colored text when their output goes to a pipe. Is there a way in Python to open a pipe to a subprocess such that ...
zapta's user avatar
  • 135
-1 votes
1 answer
44 views

I am trying to get the size of a a file called fGDB.gdb using python. but while the Windows Property shows the size of file as 146 KB (150,399 bytes) Using this code import os gdb = r"C:\Users\....
GISGUY's user avatar
  • 13
0 votes
0 answers
118 views

I have some interesting issue with saving Image via PIL library. Aim: to change metadata like "Date Taken", "Creation Date" to pictures from picture name (name is standardize by ...
Jan Vaško's user avatar
0 votes
1 answer
180 views

i try to print a document on windows using the following code import os import sys os.startfile(r"D:/DEV/Python-Diverses/os/testb.png", "print") But nothing happens at all - ...
Rapid1898's user avatar
  • 1,559
1 vote
1 answer
76 views

Tkinter will open a window with buttons, like I want, when I am not trying to import a variable from another Python program I wrote. But when I do, Tkinter will not open. When I use from my_program ...
Theodore Leon's user avatar
3 votes
2 answers
133 views

Is it possible to split os.environ into default environment variables and custom addon variables? For example, using syntax of sets representing the key/ENV_VAR_NAME: custom_addon_env_var_keys = set(...
Head Cracked's user avatar
0 votes
2 answers
215 views

I'm creating an installer for one of my projects, which downloads the binaries of the project (in a ZIP file) and then unzips it into a directory in the programs folder of the OS, and I want to add ...
foxypiratecove37350's user avatar
-2 votes
1 answer
80 views

I currently have a folder full of epubs that I would like to read, a folder of epubs I've already read and would like to read again, and a corresponding file with the names of the epub files in each. ...
HarlequinTRT's user avatar
0 votes
0 answers
76 views

I am trying to iterate through a folder with html files to filter them according to whether they contain a keyword or not in their string form. I download them to a folder through wget and ...
user24330119's user avatar
0 votes
1 answer
60 views

I am using the following code to semi-automate renaming of media files def findingmedia(directory): media=[] for path,subdir, files in os.walk(directory): for file in files: ...
Mayank Gupta's user avatar
0 votes
0 answers
331 views

I am trying to do a kind of analyzer. To do that I need to work with different distributions I decided on trying chroot. What im trying to do is, using a python script on main machine Go into chroot ...
fatih's user avatar
  • 1
0 votes
1 answer
72 views

I have a python program that takes integer only inputs like this: Valid = False while not Valid: try: x = int(Input("enter integer value")) Valid = True except: ...
Nathan Sloley's user avatar
-1 votes
1 answer
145 views

def tdata_move(): number_of_acc = len([file for file in os.scandir(fr"D:\tdata for accs")]) for item in range(0, number_of_acc): for folder in os.listdir(r"D:\tdata for ...
Just Legendary's user avatar
1 vote
0 answers
149 views

I have a strange program where trying to remove a file in my python program will hang. I have tried multiple methods to remove and they all hang. The original code had just this command: os.remove(...
chiwal's user avatar
  • 71
-1 votes
1 answer
131 views

I am trying to rename files from a directory. But for some reason which I do not know, the files are not getting renamed. Code: def extract_info_from_filename(file_name): parts = file_name.split('...
srinivas muralidharan's user avatar
0 votes
0 answers
51 views

I am making a program which is an interface for a command-line application. When running the command-line app directly through CMD it opens a new window and shows the percentage complete. I want to ...
Henry Walker's user avatar
-2 votes
4 answers
108 views

I am working to add a file in temporary folder like so: self._dir = tempfile.mkdtemp() self._dir = os.path.join(self._dir, "test") os.mkdir(self._dir) self.checkpoint = os.path.join(self....
user avatar
0 votes
1 answer
269 views

I'm trying to load multiple documents using langchain's PyPDF loader using as ususal: import os from langchain.document_loaders import PyPDFLoader documents = [] for file in os.listdir("docs&...
Crn's user avatar
  • 1
0 votes
1 answer
89 views

I am working on a project where I am turning my Python file into a .exe at the end, but every time I run it it gives me the following error: OSError: Failed to read "BIG FILE PATH"\...
Lucca hp's user avatar
0 votes
0 answers
45 views

# Caminho para o arquivo de origem caminho_origem = 'C:\\TesteScript/' # Substitua pelo caminho real do arquivo de origem # Caminho para a pasta de destino compartilhada na rede caminho_destino = r'\...
Rafael Ferraria's user avatar
-1 votes
1 answer
46 views

I have 4000 csv files in a folder in windows 10, each files has around 500 rows,where i read text column and few identity column, each file got processed in a loop and saved. Because of system ...
Remrem's user avatar
  • 25
0 votes
1 answer
1k views

I need to iterate through folders in a directory, one by one, and perform a function on the files within those folders as a group. Those files need to be passed together, with their respective folder ...
Clouseau's user avatar
1 vote
0 answers
57 views

I have java code corresponding to a policy mining algorithm in a repository and have to execute this using commands on the git bash terminal (Using a Windows PC). I have generated test data and stored ...
Gaurav's user avatar
  • 11
-3 votes
1 answer
353 views

I've just updated to Python 3.11 from 3.9 by reinstalling Anaconda and this super-basic piece of code now doesn't work in Jupyter-lab. import os folder = r'Z:\Chris_ResearchDrive\20220520_horopito' ...
Ninja Chris's user avatar
1 vote
1 answer
337 views

I'm trying to verify the time of most recent modification of a file and got to the following: print("before", time.time()) with open(file, "wb") as fh: fh.write(b&...
Gerry's user avatar
  • 2,180
0 votes
0 answers
25 views

My code doesn't work, the intention was to create folders within folders. import os path = "D:\DOCS\Desktop" n_folders = 100 x = 0 y = 0 os.chdir(path) os.mkdir("Initial_Folder") ...
Erthelgane's user avatar
1 vote
1 answer
983 views

I'm currently building a text based console application to manage printing, scanning, etc but as usuall i have stumped my self and have had to come to stackoverflow for help. Any help is appreciated. ...
Feeder-carp-tango's user avatar
1 vote
0 answers
100 views

I am trying to copy a file from a source NFS volume to destination NFS volume. The file name has non-utf8 character and I am using bytes to open/read/write. Using os.open, the path opens fine on the ...
CodeTry's user avatar
  • 312
1 vote
1 answer
306 views

I'm running Linux, and would like for my project to replace the tilde character, '~', at the beginning of a path with my home directory, in the same way the terminal does. I've found a method of the ...
MillerTime's user avatar
0 votes
0 answers
105 views

I want to create a txt file in appdata/roaming/Helloworld with os method. The file is my_file.txt and when I launch the programm, there is no error and python says that the file and the folder exists (...
Henry Tancré's user avatar
0 votes
2 answers
183 views

So, I'm looking to move some images from my downloads folder to my pictures folder (Windows 11), but I am continually being met with errors. Here is my code: import shutil import os source = r"...
Zane Ritchie's user avatar
0 votes
1 answer
61 views

I am using python to develop a json parser. The idea is to write a json that holds a specific token ($$INSERT_VAR$$) Since this is only a single token whose value(s) I obtain through a command, I ...
Hernies's user avatar
0 votes
1 answer
58 views

I have a html file where consists of 400 html tags and I wanted to extract some specific text from the tag. This file is a local file and not online webpage. I just tried using 1 html file first to ...
AriffKmy's user avatar
1 vote
0 answers
40 views

I have a jupyter notebook in which I read files from my desktop and then run my analysis on them resulting in a feature matrix (pandas dataframe). As my files are heavy, my laptop crashes if I read ...
S C's user avatar
  • 294
2 votes
1 answer
3k views

I am using windows 11 and the latest version of Pycharm. I try to save environment variable using pycharm termimal by typing 'export API_KEY=dfdfdg' and when I type 'env' and run then the termianl ...
Ali Sadain Tanvir's user avatar
0 votes
1 answer
25 views

I was making a simple script for switching between different directories. However, whenever I run the script, all of the commands attatched to the buttons automatically execute. import os from ...
Bennett Kohler's user avatar
0 votes
1 answer
664 views

I have two files, a.py: import os, subprocess os.chroot(".") subprocess.run(["./b.sh"]) and b.sh: #!/usr/bin/env bash echo whateva in an otherwise empty directory. b.sh has ...
food's user avatar
  • 27
-1 votes
1 answer
104 views

I am trying to use shutil.copy to copy files that I don’t know the whole name for. The names typically are 11_11_2023_functional. The date changes each for each file but they are in separate folders. ...
Will V's user avatar
  • 1
0 votes
0 answers
79 views

I was running a program used to find the number with the longest sequence in the collatz conjecture, and I was trying to implement a progress bar. I successfully did so, in my own weird way, but I ...
Jackson Vliet's user avatar
0 votes
1 answer
100 views

I am trying to understand how the underlying process differs if I call the os.listdir() function as compared to running ls in the terminal. After much searching, I came across these 2 keypoints GNU ls ...
Anushka's user avatar
  • 13
0 votes
1 answer
158 views

I'm writing a Python function that requires exporting a MySQL database into a .sql file with bash. For it, I'm using mysqldump. mysqldump -u bandana -p movies > /Users/Mac/Downloads/testOutput.sql ...
HarlequinTRT's user avatar
0 votes
0 answers
34 views

I am trying to identify .txt files by scanning every folder which meets a criterion i.e. minimum of the file is less than half of the maximum of that file and then take the average of all these files ...
KeplerNick123's user avatar
0 votes
1 answer
27 views

I am making a file sorter in Python and I have two lists. One is called downloads, which holds the names of all of my files in my downloads directory, and the other is called files, which is intended ...
Pink Pit's user avatar
0 votes
1 answer
677 views

Let me preface this by I have never worked with python before but have spent the past several days researching and watching videos. Although I've found solutions that helps with components of this, I'...
lunaliz's user avatar
  • 25

1
2 3 4 5
12