Skip to main content
Filter by
Sorted by
Tagged with
-3 votes
0 answers
49 views

Python sys.exit() hexidecimal value [closed]

I am looking to set an exit code of sys.exit(2) My issue is that, when I port this to a non-windows system, 2 actually translates to hexidecimal 200, which on this system is being returned as decimal ...
yodish's user avatar
  • 801
-4 votes
0 answers
39 views

Networked File Synchronization System [closed]

I want make client and server to sync file between each other , Now through socket I received (server) from client information about files my problem how I can distinguish if these name file or the ...
Abdulaziz's user avatar
0 votes
1 answer
44 views

Using \r to overwrite a progress bar not working in Windows

I have this snippet of code that does not work. Well, it works fine, but it does not delete on my Windows computer. Please Help! import time import sys def loading_bar(count, total, suffix=''): ...
TH3KINGOFHYRULE's user avatar
1 vote
1 answer
53 views

How do I erase the last word printed onto the terminal?

I would like to be able to erase the last word printed onto the terminal. The last word should be the last string of text following a space. The following code simulates what I am trying to achieve. I ...
ERROR 404's user avatar
0 votes
0 answers
31 views

Setting sys.displayhook only works if it's ran at the same time as other commands

I'd like to have Spyder print newlines between commands, so I run this: # Force Spyder to print newlines every command def alwaysprint_displayhook(value): if value is not None: sys.stdout....
Breck Emert's user avatar
1 vote
1 answer
94 views

Can't change recursion limit python

sys.setrecursionlimit is set to 20000, but I get error because of "996 more times", despite setting limit to a bigger number import sys from functools import * sys.setrecursionlimit(20000) @...
lumba's user avatar
  • 43
-1 votes
1 answer
194 views

Why does /usr/bin/python3 report /Library/Developer/CommandLineTools/usr/bin/python3 as sys.executable?

I encountered a situation on macOS where the path reported by sys.executable is different from the Python interpreter I explicitly ran. Here's what I observed: I started Python using `/usr/bin/...
StaY_Hungry's user avatar
1 vote
2 answers
52 views

R, how to get current time miliseconds, without extra information ? (Sys.time(), format("%X"))

I have tried to get just the current miliseconds from the current second in R with the following code: options("digits.secs" = 6) # since 6 is the maximum digits for seconds apparently Sys....
Julien Larget-Piet's user avatar
-1 votes
1 answer
54 views

When debugging in VS Code, it doesn't take command inputs for Python

While debugging in VS Code, I am trying to give command lines but it doesn't take any and it moves directly to input(). Here len(sys.argv) is always equal to one. I saw an old question which was ...
icecream's user avatar
0 votes
1 answer
18 views

Inside pdb just before executing a Python script, can you set up your own sys.audit() hook?

Just before running a Python script inside pdb (using python -m pdb), I tried to add a handler for sys.audit() calls: interact ← puts pdb into interactive Python mode import sys def myaudit(event, ...
nickpelling's user avatar
2 votes
2 answers
216 views

How to make the window size to constantly shrink in pygame?

I'm making a game in pygame and for one of the levels in my game, the window would shrink constantly, forcing the player to move fast before they couldn't see the screen anymore but I don't know how ...
DiamondCat64's user avatar
2 votes
1 answer
103 views

Why my code prints multiple same lines when it reaches the end of terminal?

import time import sys def animate_string(input_string, delay_second=0.01): current_string = "" for target_char in input_string: if target_char == '\n': # Print ...
bluepiplup's user avatar
0 votes
1 answer
211 views

OSError: [WinError 10093] Either the application has not called WSAStartup, or WSAStartup failed

import sys import select print("Who is your best friend?") print("You have ten seconds to answer!") a, b, c = select.select([sys.stdin], [], [], 10) if (a): print("You stated ...
Swapravo Roy's user avatar
0 votes
1 answer
48 views

Import modules from a subfolder

I cannot import modules from a subfolder,where from a subfolder that I am in it; the folders that I work with, is like this: Project __init__.py /objects __init__.py button.py ...
Amirali's user avatar
  • 11
0 votes
1 answer
62 views

Terminating a python program from within a try block [duplicate]

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

15 30 50 per page
1
2 3 4 5
74