Tagged Questions
0
votes
0answers
35 views
How should I decode arguments to my Python script?
I'm writing a Python (2.7) script that can receive arguments via the command line. But all my script will get are the encoded strings. How do I decide how to decode them for my own use?
If it's ...
1
vote
2answers
46 views
Is it possible to include command line options in the python shebang?
I have the canonical shebang at the top of my python scripts.
#!/usr/bin/env python
However, I still often want to export unbuffered output to a log file when I run my scripts, so I end up calling:
...
0
votes
1answer
43 views
How to not issue a new line in Python 3 when entering text with input()
I'm making a basic utility in Python 3 where the user inputs a command and gets feedback printed out into the console. When entering data using the input() or sys.stdin.readline() functions this is ...
0
votes
1answer
66 views
How to get input from a user in Python 3 without being cut off when printing?
I am making a basic utility in Python 3 running on Windows with which the user inputs commands and at any given time may receive a printed message. The issue is, when using the input() function if a ...
2
votes
2answers
59 views
Take a screenshot from a website from commandline or with python
i will take a screenshot from this page: http://books.google.de/books?id=gikDAAAAMBAJ&pg=PA1&img=1&w=2500 or save the image that it outputs.
But i can't find a way. With wget/curl i get ...
2
votes
1answer
46 views
Python - Creating a command line like interface for loading modules/functions
In my Python project I'm trying to make the interface somewhat like a command prompt where I can type the name of a function and it will be executed.
Example:
Prompt >>> run.check
Running ...
0
votes
1answer
41 views
Python Command Line App
I am unsure on how to implement an app command line method.
These would be my flags:
-g (male/female)
-p (phone number)
-r (reasons)
-e (endings)
-o (output name)
Each one of the flags ...
0
votes
1answer
36 views
How do I interact with a console app as if I'm a user typing things into it?
I'm trying to write a Python program that interacts with the bsdgames trek program. It's kind of like Zork with Klingons:
* * * S T A R T R E K * * *
Press return to continue.
What length ...
0
votes
0answers
45 views
Is there a Python equivalent of the shell command `cp -r <directory> <existing_directory>`? [duplicate]
In bash, if I have a directory foo but no directory bar, then the command
cp -r foo bar
will create the directory bar and this directory will contain the contents of foo.
The Python equivalent ...
0
votes
0answers
45 views
django-admin.py will not cooperate
I am new to Django and just trying to get it to start up. I downloaded it and it is on my path:
Ryans-MacBook-Pro:website ryansaxe$ python django-admin.py startproject mysite
python: cant open file ...
0
votes
3answers
126 views
Command line input in Python
Is it possible to run first the program then wait for the input of the user in command line.
e.g.
Run...
Process...
Input from the user(in command line form)...
Process...
0
votes
3answers
43 views
Identify and remove strange characters
What command can I use to identify and remove certain strange characters that form "words" such as:
í‰äó_
퀌¢í‰ä‰åí‰ä‹¢
it퀌¢í‰ä‰åí‰ä‹¢
í‰äóìgo
from a series of files? Those are some examples...
...
0
votes
2answers
80 views
Pass complex object to a python script in command line
I am beginner in Python programing, I want to pass a complex object (Python dictionary or class object) as an argument to a python script using command line (cmd). I see that sys.argv gets only string ...
1
vote
1answer
63 views
Interactive plotting with Python via command line
I am trying to use Python and the numpy and matplotlib libraries to do some data analysis and plotting and view my plots, adjust my code accordingly etc. So I need to be able to examine the plot. ...
0
votes
1answer
57 views
Use string variable **kwargs as named argument
I am trying to figure out a way to loop through a json config file and use a key name as the argument name to a method that uses **kwargs. I have created a json config file and used key names as ...