Data dodania Pytanie
2017-04-24 23:04 How to pass dynamic length variables with values in one line to a function »
I've already looked into this SO answer here for passing dict key,value pair to a function, but it does not solve my problem completely. I've an ex...
(1) odpowiedzi
2017-04-23 14:04 Error after "from new import instancemethod" when importing scipy.stats »
I am getting an exception from scipy whenever I try to import the nltk package. The command and the error looks like this: >>> import nltk T...
(1) odpowiedzi
2017-04-23 04:04 SQLAlchemy Unicode Problems in Exceptions »
I'm working on a Flask app with a postgres/SQLAlchemy/Flask-Admin. However, in the Admin interface, any DB error that contain Unicode letters can't be...
(0) odpowiedzi
2017-04-21 16:04 A confusion on type.__init__ in Python 2 »
Take a look at the following example class Base(type): def __init__(cls, name, bases, dict_): print 'Base.__init__() with cls %s, name %s...
(1) odpowiedzi
2017-04-19 23:04 How to get source code of function that is wrapped by a decorator? »
I wanted to print the source code for my_func, that is wrapped by my_decorator, import inspect from functools import wraps def my_decorator(some_fun...
(2) odpowiedzi
2017-04-19 18:04 Python € in filename »
I need to be able to read or rename a file that contains the character: €. This character has a random position that I get with a. How can I do it? ...
(2) odpowiedzi
2017-04-19 08:04 What is python .. ("dot dot") notation syntax? »
I recently came across a syntax I never seen before when I learned python nor in most tutorials, the .. notation, it looks something like this: f = 1...
(4) odpowiedzi
2017-04-18 22:04 Using PrettyTable, Can I write a function that will take inputs and add them into a table so I don't have to continuously repeat myself? »
I made a multiplication table, but I had to manually type out the code to add to my table. I want to write a loop that does it for me so the multiplic...
(1) odpowiedzi
2017-04-18 00:04 Python2 datetime - Convert epoch time to UTC timestamp with offset »
I am using Python 2 due to reasons beyond my control and hence cannot upgrade to Python 3 (which has better support for timezones). I have an epoch t...
(2) odpowiedzi
2017-04-16 21:04 Python Recrusive Statement Error not Defined »
I am trying to test each input then return that the number is cleared then do the math. For Example is a user inputs N instead of a number I want it t...
(2) odpowiedzi
2017-04-16 18:04 Recursive Statement Errror »
Alright So I seem to be having an issue somewhere in my main function . I am able to input both Base and Exponent yet, When It moves onto the next fun...
(1) odpowiedzi
2017-04-13 20:04 Using python-onvif, is there some way that I can get the text of error responses? »
I'm experimenting with the python-onvif library and command line client to work with a network camera I have. When things are working it's fine, but...
(0) odpowiedzi
2017-04-13 17:04 Whitespace in the path of Windows filepath getting WindowsError: [Error 2] »
I am getting the error shown below. It looks like a path issue because of space. >>> from _winreg import * >>> aReg = ConnectRegist...
(0) odpowiedzi
2017-04-13 00:04 Python script can't be terminated through Ctrl+C or Ctrl+Break »
I have this simple python script called myMain.py to execute another python program automatically with incremental number: #!/usr/bin/python import ...
(0) odpowiedzi
2017-04-12 14:04 Why does my regex works on pythex and not in python? »
I've tested the following regex: r"([\d\s]{1,})\b(\s?[€]\s?)([\d]{1,})" on http://pythex.org and it actually works. The pattern is made to recogn...
(0) odpowiedzi
2017-04-12 05:04 How to iterate over all keys of a json with nested dictionaries and lists? »
I need to modify the following json file, test.json: { "install": { "site": { "acls": { "dns": { "authorized_ports": ["...
(2) odpowiedzi
2017-04-11 11:04 Python urlencode special character »
I have this variable here reload(sys) sys.setdefaultencoding('utf8') foo = u'"Esp\xc3\xadrito"' which translates to "Espírito". But when I pass m...
(2) odpowiedzi
2017-04-10 15:04 pycrfsuite : how to recall the saved models for more training »
I am using pycrfsuite now. I Know crf training model's saving. crf_trainer = pycrfsuite.Trainer() crf_trainer.train('crf.crfsuite') So, When I want...
(0) odpowiedzi
2017-04-09 09:04 Some characters stick to my colorized prompt in Python cmd »
I am using Python 2's cmd module to make a command line for a program. Everything works nicely as long as I don't add color to my prompt. Working co...
(1) odpowiedzi
2017-04-09 04:04 Using lambda functions to sum digits and count digits »
How can I convert these two functions to use lambda notation? def sum_digits(number): if number == 0: return 0 else: return (...
(3) odpowiedzi
2017-04-08 15:04 Lambda Return Payload botocore.response.StreamingBody object prints but then empty in variable »
I'm invoking a lambda function from another function and want to take a different action depending on the response, pretty standard stuff. However I g...
(1) odpowiedzi
2017-04-07 17:04 how to iterate on xml nodes (both elements and text nodes) in python2 etree »
I have a xml, in where an element contains multiple text nodes. Using python2 etree, I want to navigate the tree with the same order. So, for this in...
(1) odpowiedzi
2017-04-07 02:04 Unable to encode or decode the string properly »
I tried to look at bunch of stackoverflow examples. Python version used: Python 2.7.10 Output of the string s looked like u'bh\xfcghi' where \xfc=
(2) odpowiedzi
2017-04-06 19:04 Windows based application for firmware upgrade scripts written for Linux »
I am new to Python. I need to develop a windows based application for firmware update process. Firmware upgrade scripts, written in python 2.3, are un...
(0) odpowiedzi
2017-04-05 15:04 tkinter not letting 2 threads run at once »
I have a game and I have the world moving towards you, and you can jump at the same time. both functions work separately, but they don't work when use...
(0) odpowiedzi
2017-04-03 12:04 Python removing 'u' character from print »
I want to remove 'u' and '' from print row (u'CAN Initialisation Failure',) My Output need to be CAN Initialisation Failure My code: connection...
(0) odpowiedzi
2017-04-01 14:04 numpy import erro in anaconda »
I installed anaconda 64 bit python 3 and i am working on python 2. I got ImportError: No module named numpy even though i updated all packages. I sti...
(0) odpowiedzi
2017-03-31 11:03 ftp process takes 10 minutes to complete, how to continue to the next step with python/pexpect without the wait »
child.sendline("ftp://user:password@11.11.11.11/%s" %(file_name)) child.expect('erase') child.sendline('y') above command (after steps 1,2,3) takes...
(0) odpowiedzi
2017-03-30 20:03 Python: Output while waiting for input »
So I currently have a thread that is outputting, and I need a way to handle input while still allowing output from the thread in the meantime. Curren...
(1) odpowiedzi
2017-03-29 03:03 Why should I use python2 rather than python3 in building an Android app? »
What are the main problems (for now) of building an apk in Python3? ...
(0) odpowiedzi
2017-03-28 14:03 Python how to iterate two infinite generators at the same time? »
I'd like to iterate over a number of infinite generators: def x(y): while True: for i in xrange(y): yield i for i,j in zip(x...
(4) odpowiedzi
2017-03-27 15:03 Why are integers missing some special methods in python 2? »
In python 2 or 3 the built-in classes have the special method defined explicitly. Explicit is better than implicit and all that jazz. 5. > 4. # Tr...
(1) odpowiedzi
2017-03-25 08:03 How to read bytes from user in python »
May I know how can I read bytes from end user using command line. I tried with a = input("Enter your bytes data\n") but that is reading strings. I...
(1) odpowiedzi
2017-03-24 13:03 is there a book for python web scraping in python2.x? »
okay, i took from lessons for python 2.7 and web scraping is kinda amazing. so I tried Web Scraping with Python from O'Reilly and its kinda too much o...
(0) odpowiedzi
2017-03-22 07:03 How to Get Index of Selected Option inTkinter Combobox »
Following code lets me to print out the selected value from the Combobox, but I need to print(get) the indexnumber of selected item in the list. Can y...
(2) odpowiedzi