You say that if int(splitLine[0]) > int(lastUnix):
is causing the trouble, but you don’t actually show anything which suggests that. I think this line is the problem instead:
print 'Pulled', + stock
Do you see why this line could cause that error message? You want either
>>> stock = "AAAA" >>> print 'Pulled', stock Pulled AAAA
or
>>> print 'Pulled ' + stock Pulled AAAA
not
>>> print 'Pulled', + stock PulledTraceback (most recent call last): File "<ipython-input-5-7c26bb268609>", line 1, in <module> print 'Pulled', + stock TypeError: bad operand type for unary +: 'str'
You’re asking Python to apply the +
symbol to a string like +23
makes a positive 23, and she’s objecting.
Related Posts:
- TypeError: unsupported operand type(s) for -: ‘list’ and ‘list’
- Permanently add a directory to PYTHONPATH?
- Conda command not found
- why numpy.ndarray is object is not callable in my simple for python loop
- numpy division with RuntimeWarning: invalid value encountered in double_scalars
- TypeError: ‘float’ object is not subscriptable
- What is the maximum recursion depth in Python, and how to increase it?
- What to do with “Unexpected indent” in python?
- _tkinter.TclError: no display name and no $DISPLAY environment variable
- How do I merge two dictionaries in a single expression (taking union of dictionaries)?
- How do I create an empty array/matrix in NumPy?
- error: command ‘gcc’ failed with exit status 1 while installing eventlet
- Python foreach equivalent
- sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype(‘float64’)
- What do the symbol “=” and “==” mean in python?
- what does the __file__ variable mean/do?
- Difference between os.getenv and os.environ.get
- syntaxError: ‘continue’ not properly in loop
- How to check if the string is empty?
- Get the data received in a Flask request
- How do I install Python OpenCV through Conda?
- How to do superscripts and subscripts in Jupyter Notebook?
- How to get a random number between a float range?
- Cannot install Beautiful Soup in Anaconda Python 3.6.4 Windows 10
- ImportError: cannot import name
- How can you profile a Python script?
- How to set the current working directory?
- heroku: no default language could be detected for this app
- ‘DataFrame’ object has no attribute ‘sort’
- “VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path”
- What is __pycache__?
- TypeError: ‘NoneType’ object is not iterable in Python
- Understanding slice notation
- Add list to set?
- Infinite integer in Python
- Determine Whether Integer Is Between Two Other Integers?
- If vs. else if vs. else statements?
- Quoting backslashes in Python string literals
- AttributeError: Can only use .dt accessor with datetimelike values
- Python string class like StringBuilder in C#?
- How do I clear all variables in the middle of a Python script?
- How to tell if tensorflow is using gpu acceleration from inside python shell?
- What is the easiest way to get current GMT time in Unix timestamp format?
- xlrd.biffh.XLRDError: Excel xlsx file; not supported
- Python/Json:Expecting property name enclosed in double quotes
- Normalize columns of pandas data frame
- Normalize columns of pandas data frame
- Python Error: “ValueError: need more than 1 value to unpack”
- Python: can’t assign to literal
- “Initializing” variables in python?
- Difference between except: and except Exception as e:
- Flask raises TemplateNotFound error even though template file exists
- Python: Declare as integer and character
- Is there a way to specify which pytest tests to run from a file?
- Python function overloading
- Breaking out of nested loops
- Youtube_dl : ERROR : YouTube said: Unable to extract video data
- How to stop a function
- What is the common header format of Python files?
- Is it possible to decompile a compiled .pyc file into a .py file?
- Writing string to a file on a new line every time
- Creating lowpass filter in SciPy – understanding methods and units
- Python 2: AttributeError: ‘list’ object has no attribute ‘strip’
- Get Confusion Matrix From a Keras Multiclass Model
- AttributeError: ‘list’ object has no attribute ‘lower’ gensim
- Insert a row to pandas dataframe
- Anaconda Installed but Cannot Launch Navigator
- How to save a Seaborn plot into a file
- How to get the unit vector from a numpy array
- How to replace multiple substrings of a string?
- How to use cookies in Python Requests
- How do I disable “missing docstring” warnings at a file-level in Pylint?
- How to convert column with dtype as object to string in Pandas Dataframe
- When I use matplotlib in jupyter notebook,it always raise ” matplotlib is currently using a non-GUI backend” error?
- How to fix ‘RuntimeWarning: divide by zero encountered in double_scalars’
- IndexError: index 2 is out of bounds for axis 0 with size 2
- ‘if’ statement in jinja2 template
- How to search through dictionaries?
- Element-wise addition of 2 lists?
- Converting integer to binary in python
- Open File in Another Directory (Python)
- Python: Making a beep noise
- Negation in Python
- Checking if a string can be converted to float in Python
- Python conversion from binary string to hexadecimal
- ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly
- How to set NotebookApp.iopub_data_rate_limit and others NotebookApp settings in JupyterHub?
- What’s the correct way to convert bytes to a hex string in Python 3?
- How can I install a .egg Python package on Windows (attempt using easy_install not working)
- Case insensitive regular expression without re.compile?
- replace characters not working in python [duplicate]
- ElementClickInterceptedException: element click intercepted:
- During handling of the above exception, another exception occurred
- Python Remove last char from string and return it
- Base language of Python
- How do operator.itemgetter() and sort() work?
- python ValueError: invalid literal for float()
- How to convert .sav file into csv file
- Anaconda “failed to create process”
- Parse the JavaScript returned from BeautifulSoup