sys Questions
4
Solved
when I accept arguments how do I check if two show up at the same time without having a compound conditional
i.e.
#!/usr/bin/python
import random, string
import mymodule
import sys
z = ' '.join(...
12
Solved
suppose there is a script doing something like this:
# module writer.py
import sys
def write():
sys.stdout.write("foobar")
Now suppose I want to capture the output of the write function and st...
4
Solved
I have the following function:
def getInput():
# define buffer (list of lines)
buffer = []
run = True
while run:
# loop through each line of user input, adding it to buffer
for line in sys.s...
4
Solved
I'm using python to analyse some large files and I'm running into memory issues, so I've been using sys.getsizeof() to try and keep track of the usage, but it's behaviour with numpy arrays is bizar...
1
Accordingo to the python python documentation concerning sys.stdout and sys.stderr:
stdout is used for the output of print() and expression statements and for the prompts of input();
The interpr...
7
Solved
What does sys.stdout.flush() do?
6
Solved
This might be a silly question, but as I can't find an answer, I have to ask it.
In interactive python I want to process a message which i get with:
>>> message = sys.stdin.readlines()
...
Gluten asked 5/4, 2011 at 8:26
4
I'm trying to run the anaconda distribution of python libraries in a Jupyter Notebook, but when I run the notebook I keep getting ImportErrors because the python path is set to the default distribu...
Apices asked 8/10, 2017 at 18:35
10
Solved
I want to get the parent of current directory from Python script. For example I launch the script from /home/kristina/desire-directory/scripts the desire path in this case is /home/kristina/desire-...
2
Solved
I am looking to pass a user entered arguments from the command line to an entry point for a python script. Thus far I have tried to used argparse to pass the arguments from the command line to the ...
2
I've configured jupyter to be used from a remote computer and set a password to it while initial anaconda setup. Then after fixing this issue, I am trapped in another one. sys.path and sys.executab...
Pushover asked 19/12, 2020 at 18:20
5
Solved
I tried to setup in DataGrip an Oracle connection under SYS user.
But got error:
ORA-28009: connection as SYS should be as SYSDBA or SYSOPER
But there is no option in GUI to choose as SYSDBA ...
6
Solved
I get how to open files, and then use Python's pre built in functions with them. But how does sys.stdin work?
for something in sys.stdin:
some stuff here
lines = sys.stdin.readlines()
What's ...
2
Jupyter==4.1.0, Python==2.7.10, IPython==4.2.0
I'm writing a SQL UI for my Jupyter Notebooks and would like to incorporate multithreading so that I can run a query in one cell and continue to work ...
Seyler asked 13/11, 2016 at 23:7
3
I have a Google Colab notebook that I want to distribute to other users, and I want to include relative paths for files and directories in my mounted Google Drive so that the code doesn't break whe...
Forde asked 10/6, 2020 at 22:42
5
Solved
I have written some libraries in Python for use in my project. I have stored them locally on my system and also remotely on Github. Now every time I write some code I use sys.path.append() in the b...
7
Solved
In what encoding are the elements of sys.argv, in Python? are they encoded with the sys.getdefaultencoding() encoding?
sys.getdefaultencoding(): Return the name of the current default string enc...
4
Solved
I have a piece of code which is working in Linux, and I am now trying to run it in windows, I import sys but when I use sys.exit(). I get an error, sys is not defined. Here is the begining part of ...
9
Solved
I receive this error:
java.sql.SQLException: ORA-28009: connection as SYS should be as SYSDBA or SYSOPER
How to fix? (I need to be SYS).
Thanks.
2
I am new to python and trying some coding problems online. i come across sys.sdnin a lot for accepting input. I would like to know how input() and sys.stdin differs in action?
3
Solved
I would like to access the $PATH variable from inside a python program. My understanding so far is that sys.path gives the Python module search path, but what I want is $PATH the environment variab...
Dosh asked 16/8, 2014 at 23:9
5
Solved
Python uses the PYTHONPATH environment-variable to determine in which folders it should look for modules.
You can play around with it by modifying sys.path, which works nicely for pure Python-Modul...
Uncork asked 23/4, 2014 at 12:33
5
Solved
I'm having trouble implementing a simple countdown in python using a carriage return. I have two versions, each with problems.
Print Version:
for i in range(10):
print "\rCountdown: %d" % i
tim...
Bechtold asked 2/7, 2013 at 21:37
4
Solved
sys.argv takes arguments at the shell command line when running a program. How do I make these arguments optional?
I know I can use try - except. But this forces you to insert either no extra argu...
Ratite asked 7/8, 2012 at 20:21
1
Solved
I want to import a module in a project and it gives me lots of troubles because of an import error. So I decided to write a little test to see where the problem lies. I add a folder to my sys path ...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.