Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I changed my shell from tcsh to bash, but i observe a strange behavior when using python interactively.
When i exit python using quit() or exit() or ctrl+D bash starts behaving like this, that is everytime i hit enter with no commands no newline is added and if i try to type anything, nothing actually is written, but somehow it is recorded and when i press enter it is executed if it is recognized as a legitimate command, othewise a command not found error appears, like this.
Using a reset on the shell brings everything back to normal. New shells behave normally.
I really don't know what could be causing this, can someone please help me?
PS: please ask if it is not clear enough.
EDIT - Result of env:
TERM_PROGRAM=Apple_Terminal
SHELL=/bin/bash
TERM=xterm-256color
TMPDIR=/var/folders/6s/ff31kwgj13s7ftrr_jdy06tc0000gq/T/
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.rPKPaf8CHZ/Render
TERM_PROGRAM_VERSION=361.1
TERM_SESSION_ID=3973FE8A-ABFF-455D-8278-E43CFC75A7D3
USER=mazzalex02
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.ZBZiVF7Brq/Listeners
__CF_USER_TEXT_ENCODING=0x1F7:0x0:0x4
PATH=/opt/local/bin:/opt/local/sbin:/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/local/lib/pgsql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin:/Library/TeX/texbin
PWD=/Users/mazzalex02
DBUS_LAUNCHD_SESSION_BUS_SOCKET=/private/tmp/com.apple.launchd.HDW6moBcXw/unix_domain_listener
LANG=it_IT.UTF-8
XPC_FLAGS=0x0
XPC_SERVICE_NAME=0
SHLVL=1
HOME=/Users/mazzalex02
LOGNAME=mazzalex02
DISPLAY=/private/tmp/com.apple.launchd.sgSgWxHdhI/org.macports:0
_=/usr/bin/env
OLDPWD=/Users/mazzalex02
EDIT2 - This does not happen using python in /usr/bin/
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
enter image description hereI have attached a shortcut of my Python file in startup using shell:startup so that after user login python script is popping up but i don't want it to pop-up is there any way to sort this to not pop-up.
ideas please..
If you don't want py file to pop up immediately after login
you can try
add this in the starting of your python file
import win32gui, win32con
import time
the_program_to_hide = win32gui.GetForegroundWindow()
win32gui.ShowWindow(the_program_to_hide , win32con.SW_HIDE)
time.sleep(10)
win32gui.ShowWindow(the_program_to_hide , win32con.SW_SHOW)
this will hide the window for 10 seconds after startup and show it
good luck!
You can start your python script in the a minimized window with the help of executing python script from command line.
Example:
cmd /c start /B /min mspaint
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
This is a weird one. Whenever I enter the python3 shell (doesn't happen in python [2]) and type "e" it immediately replaces that character with "HI THERE". For example, if I try to type "exit()" it turns into "HI THERExit()".
Here's what happens when I type python3<CR>exit() in my default shell (zsh).
% python3
>>> HI THERExit()
And I just discovered this same behavior happens when I invoke the bash shell.
% bash
bash-3.2$ HI THERExit
I have no idea where the problem could be. Bash/zsh settings? Vim command mode remap? Some kind of python3 alias or auto expansion? Please give me some places to check, or a strategy to find it (e.g. grep folder XYZ). A "HI THERE" test string seems like something I would have set up at some point but I have no recollection of it.
Thank you to all who offered ideas. And a big thanks to #chepner who suggested ~/.inputrc, the first line of which was echo "HI THERE". Case closed.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
So my iPython notebook comes up in my browser (chrome) and when I open my specific notebook a new tab opens. However the work does not load up! The page also freezes. Is this an iPython issue or something wrong with the file? Was working yesterday. I've restared comp etc. but no luck
Update: just tried renaming notebook to open again with no luck
Update 2: One has now shown up - but can't do anything with it! Is iPython simply extremely extremely slow...
Is it possible that one of the cells got a lot of output data?
if so,
try editing the file manually (with notepad++ or something like this), and delete cell's output
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I am new to python and am now learning about 'traceroute'. I don't exactly understand how this works. If I am typing the traceroute in python command line, I receive a syntax error:
traceroute www.somewebsite.com
I receive a syntax error pointing to ^www
Am I misunderstanding or doing something wrong? I'm trying to work on this in practice from a book reading assignment.
Can someone explain what traceroute is exactly?
Your help is appreciated, thank you.
This is not supposed to work, because python does not understand terminal/cmd commands. So you need to use os.system in this case:
So, in your case:
import os
os.system('traceroute www.somewebsite.com`)
In windows its tracert not traceroute.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I’m trying to print a string that is too long to be displayed on one line, so it automatically wraps to the next line. The problem is that I need it to all stay on one line and just go off the screen (where I can just scroll left to right to see it all).Is there a way to to disable word wrap in python IDLE
by changing somethings in configure option
Text wrapping is a function of your terminal, not python. All that python does is send a string to the terminal - think about it, when you say print "abcdef\n", there's no character in there that tells the terminal to wrap-text!
You just need to configure the environment you're coding in. There should be a pretty easily accessible 'settings' option. However, if you can't find it, then tell us what environment you're using - we might be able to help.