0
votes
3answers
45 views

Confusion regarding mutable and immutable data types in Python 2.7

I have read that while writing functions it is good practice to copy the arguments into other variables because it is not always clear whether the variable is immutable or not. [I don't remember where ...
2
votes
1answer
33 views

How can I detect special word occurs in teraterm log in run time using Python

I use teraterm as my client-console and save the console log somewhere. When I open the teraterm and do something on my COM1 serial port (attached with a device), it will print messages on the screen ...
11
votes
2answers
157 views

What is […] in Python 2.7?

I was playing around in python. I used the following code in IDLE p = [1, 2] p[1:1] = [p] print p The output was [1, [...], 2] What is this […]? Interestingly I could now use this is a list of ...
1
vote
0answers
13 views

Resolving Python package version conflict in Reddit install

I'm trying to get the Python libraries for Reddit installed on my Mac. I want to run them using PyCharm for development as I like it as a Python IDE. I'm running the Cassandra, Memcached, RabbitMQ, ...
1
vote
1answer
41 views

python - Using argparse, pass an arbitrary string as an argument to be used in the script

How do I define an arbitrary string as an optional argument using argparse? Example: [user@host]$ ./script.py FOOBAR -a -b Running "script.py"... You set the option "-a" You set the option "-b" You ...
-1
votes
4answers
28 views

Strip down %Z to only return the timezone not daylight savings in python

I have some code as shown below, but the timezone %Z is returning: 01:04:48 GMT Daylight Time I need it return: 01:04:48 GMT import time timenew = time.strftime('%H:%M:%S %Z') print timenew ...
0
votes
1answer
12 views

Two functions calling Time lib causing error, workaround possible?

I have two pieces of code in one script which individually work fine, however because they are both calling the "time" library within the same script, I am receiving the error "TypeError: 'module' ...
0
votes
0answers
23 views

Get the error code from tweepy exception instance

I'm new to python and I'm trying to use a library. It raises an exception, and I am trying to identify which one. This is what I am trying: except tweepy.TweepError as e: print e print ...
1
vote
1answer
17 views

Generating a British date/time pubDate for an RSS in Python

I have some code creating an RSS feed, but I have an issue with generating a publication date <pubDate>%s</pubDate> How can I create a function or use a function to get the current date ...
0
votes
1answer
26 views

Creating rank 3 numpy arrays

I would like to create a rank 3 array, using numpy, such that the array resembles a stack of 9x9 rank 2 arrays. Each of these arrays will be completely filled with ones, twos, threes, etc. So, ...
0
votes
1answer
24 views

Deleting Multiple Rows in a Matrix

I'm working on writing a program that takes data from a CSV and turns it into a table to be exported to a PDF. The CSV I am working with has a bunch of empty rows so when I create my Matrix in Python, ...
1
vote
1answer
39 views

Python Automated Click Script

I am working on a program to make python auto click and type something in. I know this has been done before and asked before but no one has asked about recording mouse clicks to be "Played back" later ...
1
vote
3answers
50 views

Multiple levels of keys and values in Python

I wanted to know if the functionality i am trying to implement in python is possible. I have a global hash called Creatures. Creatures contain sub-hashes called mammals, amphibians, birds, insects. ...
0
votes
4answers
66 views

How to apply a function on each item in a list

I have a sitemap with about 21 urls on it and each of those urls contains about 2000 more urls. I'm trying to write something that will allow me to parse each of the original 21 urls and grab their ...
1
vote
2answers
36 views

NameError: global name 'is_sequence' is not defined

I have created the function is_sequence(arg) in the class degree_day(osv.osv) When I call this function from the write function the system generates the error: NameError: global name 'is_sequence' ...

1 2 3 4 5 341
15 30 50 per page