python-idle

Same Interpreter(?), Different Package Version in Spyder

爱⌒轻易说出口 提交于 2019-12-11 09:17:42
问题 I got this import error, which as this answer indicates occurs because the requests package is out of date. I updated the package using pip , but still got the same error. So I tried from requests.utils import to_native_string , which to my surprise works just fine in either the command prompt shell or IDLE, but throws an error in Spyder. I checked the version of the requests package: import requests print(requests.__version__) The version number in Spyder ( '1.2.3' ) is indeed different from

IDLE 3.7 can't scroll up

妖精的绣舞 提交于 2019-12-11 08:07:46
问题 IDLE 3.6.2 suddenly started crashing repeatedly today on my Mac (OSX 10.12.6), so I installed 3.7.0. I can't scroll up in 3.7; when I do a two-finger scroll on the trackpad either up or down, the IDLE window scrolls down. This suggests that it was an issue that they fixed. So how come it's still a problem for me? Update: I installed 3.6.6 over 3.6.2 and now I can't scroll up in 3.6 either. Please help!! 回答1: The fix for this and other problems is in the release candidate at https://www.python

Emoji symbols/emoticons in Python IDLE

余生颓废 提交于 2019-12-11 07:49:55
问题 I can't encode and display characters in the range \U0001f600-\U0001f650. They are called emoji or emoticons and they are used in all social media. Python error message: File "C:\Python\Python342x64\lib\encodings\cp1251.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f62d' in position 108: character maps to <undefined> This character must look like - 😭 . I work in Python 3.4.2 (from

Python IDLE game won't run and shows SHELL: RESTART message

自闭症网瘾萝莉.ら 提交于 2019-12-11 07:33:58
问题 When I run it, it says: ===============RESTART: Volumes/NONAME/myuser/finalProject.py=============== ===============================RESTART: Shell=============================== and it just won't run. This is the code: import pygame import sys import random import math from timeit import default_timer as timer from pygame.locals import * from Platform import Platform from Player import Player from Coin import Coin from fireBall import fireBall import time pygame.init() main_clock = pygame

How do I import my user-defined function without having to call the .py file it is in?

ぐ巨炮叔叔 提交于 2019-12-11 06:05:20
问题 To solve the problem of the (Python) IDLE not having a built-in "clear" function, I created a user-defined function [cls()], that I have stored in a functions.py file in my sys.path. import sys, functions My user-defined function works, but I do not prefer always typing in: functions.cls() Amendment after Terry's comment How do I reference my functions.py file with my environmental variable IDLESTARTUP? I have tried the aforementioned by editing my .bash_profile with: $IDLESTARTUP="/Users/Mac

Private Unicode Character displays differently in Python 3 Interpreter

冷暖自知 提交于 2019-12-11 05:51:58
问题 So I created a unicode character privately using Private Character Editor on Windows 10. The character was saved with the code E000 . I copied it from the Character Map and pasted into a text editor and it worked. However, when I paste it into the Python IDLE editor it changes to a different unicode character, even before running the program. I can't use u'unicode_string' or anything like that because my unicode character doesn't even work in the interpreter. I am new to programming. My

How to ignore user input during sleep in Python 3?

孤街醉人 提交于 2019-12-11 04:54:50
问题 I'm new to programming and am stuck with this problem in a small RPG game I'm making. It's mostly text based but uses tkinter for a simple GUI. During battles, I have a for loop that goes through all creatures that are participating in the battle, and executes their action one by one with small sleeps between each action. My problem is that when the user presses keys or clicks buttons, the commands are buffered and executed after the for loop completes. Is there an easy way to ignore the user

My program works fine in IDLE and PyScripter, but not in PowerShell and command line

落花浮王杯 提交于 2019-12-11 02:54:43
问题 This seems like a really basic question, but I wasn't able to find the solution anywhere, so here it goes: I'm writing a small program, mostly for practice, that does difefrent things, depending on my input, like so: while True: switch = input('a, b or c:') if switch == "a": print("In command line and Powershell...") elif switch == "b": print("...these lines will never run.") elif switch == "c": print("Neither will this one, no matter what my input(switch) is.") else: print("meh...") break If

python win32api.LoadKeyboardLayout(), doesnt change language in IDLE shell?

筅森魡賤 提交于 2019-12-11 02:04:20
问题 Can someone help me out please...I'm trying to start my first programming project. It will be implemented in python. I need to have a textbox (which i am using wxpython for). If the user enters any text into this text box, then I want it to appear as arabic. I wanted to this by automagically changing the users Keyboard to an arabic layout when the cursor lands in the given text box. So i found this pywin32 module, which has a function LoadKeyboardLayout() So i am trying to test this in IDLE,

Clear line in the Python IDLE shell

China☆狼群 提交于 2019-12-10 21:48:00
问题 Is there a keyboard shortcut to clear a line for the Python IDLE shell? I know Ctrl-K works if you are at the beginning of a line, but is there a shortcut to do it when you are at the end? 回答1: If you set idle's Key Set to IDLE Classic Unix ( Options -> Configure -> Use a Built-in Key Set -> IDLE Classic Unix ) you'll at least be able to get the same effect with C-a C-k . There doesn't seem to be anything that resembles C-u in Emacs, for example. You could look into EditorWindow.py and