Data dodania Pytanie
2017-03-18 21:03 Storing names and grades in python »
I'm writing a program for A teacher. The teacher is suppose to ask the name of the student and then the grade of the student. And this for as many tha...
(2) odpowiedzi
2017-03-17 01:03 How to handle 2 versions of Python on same client? »
I use ArcGIS 10.3 at work and it comes with Python 2.7.8; so when I run any of the .py/.pyc/.pyw files, it defaults to the path leading that versions ...
(1) odpowiedzi
2017-03-16 17:03 Unable to capture result of ls -la with subprocess.Popen »
I am trying to capture the output when I execute a custom command using Popen: import subprocess def exec_command(): command = "ls -la" # will b...
(1) odpowiedzi
2017-03-15 22:03 Read transactions in Orange »
I want to use the Orang for association Rules here is my code: import Orange data = Orange.data.Table("trans.csv") rules = Orange.associate.Associ...
(0) odpowiedzi
2017-03-14 14:03 Use Pool with apply_async or map_async? »
first time poster, please be patient with me. I'm using Python 2.7.12 and I want to use the multiprocessing module to speed up my code. My program g...
(0) odpowiedzi
2017-03-13 21:03 Upload Image File to server »
Have a little problem with uploar file image to server That is JS code for ajax send file to server /** * * Init Crope Image * *...
(1) odpowiedzi
2017-03-11 16:03 Python dart scoreboard not working »
I have already asked a question about this project, since asking that one i have fixed the error in that question. However, i now run into another pro...
(1) odpowiedzi
2017-03-10 22:03 Tensorflow: Why is tf.case giving me the wrong result? »
I'm trying to use tf.case (https://www.tensorflow.org/api_docs/python/tf/case) to conditionally update a Tensor. As shown, I'm trying to update learni...
(0) odpowiedzi
2017-03-08 18:03 How to make logic based on `unicode` compatible with python2-3 »
I want to make this code compatible with python2-3 : def normalize_text(text, ignore_characters=''): if type(ignore_characters) not in [list, st...
(1) odpowiedzi
2017-03-08 17:03 Algorithm with Scrypt and PBKDF2 - Python »
I have tried to reproduce this algorithm on Python (Double pipes mean to add 0x1 or 0x2 to the passphrase) s1 = scrypt(key=(passphrase||0x1), salt=(...
(1) odpowiedzi
2017-03-08 14:03 Are there any use cases for raise foo, bar in Python? »
Python 2 supports the following syntax for raise: raise FooException(bar) # call raise FooException, bar # positional I thought that the positional...
(1) odpowiedzi
2017-03-07 03:03 Display text on both sides of a scrollbar »
I am very new to Tkinter. I'm trying to build a chat system in which I want to display the user's query on the left of the scrollbar and the respons...
(1) odpowiedzi
2017-03-07 03:03 SyntaxError: Non-ASCII character '\xfe' in file error happen »
SyntaxError: Non-ASCII character '\xfe' in file error happen. I wanna read tsv file,and change into csv file.When I run this app,this error happen. I...
(1) odpowiedzi
2017-03-04 17:03 How can I make a portable curses interface? »
I'm trying to make an interface in Curses in Python, but I was wondering how could I make it more portable when the window's terminal increases while ...
(1) odpowiedzi
2017-03-01 17:03 how to find vowels in a string using linked list »
I'm finding vowels in user giving string using linked list and for loop but it's not working. def find(s): Count = 0 l=[a,e,i,o,u] for...
(0) odpowiedzi
2017-03-01 16:03 Python: Pulling data from excel Type error: list indices must be integers or slices, not str »
I have been trying to run the script below which pulls a certain cell value from every excel file in a directory and compiles them in a new excel file...
(1) odpowiedzi
2017-02-28 18:02 Spawn a process in Python without forking »
I'm working with Python (2.7) and pymongo (3.3), and I need to spawn a child process to run a job asynchronously. Unfortunately pymongo is not fork-sa...
(4) odpowiedzi
2017-02-27 13:02 Request to subdomain using sockets »
Is it possible to make GET request to subdomain of some site, using sockets? I tried to do it for the site on my hosting but it looks like connection ...
(0) odpowiedzi
2017-02-27 02:02 Python: Pretty Print in Jupyter Notebook »
I am trying to pretty print a dict in Jupyter Notebook. I am using the following: import pprint stuff = ['spam', 'eggs', 'lumberjack', 'knights', 'n...
(1) odpowiedzi
2017-02-26 17:02 In python 2.7, how do I detect if the value in a dictionary's (key, value) pair is an iterable itself so I iterate through it? »
I have a dictionary (created by plistlib) that has some values which are displayed enclosed in {}. How do I detect these values and iterate through th...
(1) odpowiedzi
2017-02-26 17:02 Why input will only add 1 byte to list? »
I am semi new to python. I know I should be using functions a lot in this code. This is my first real script that is in depth using many different fea...
(0) odpowiedzi
2017-02-26 03:02 How to convert hexadecimal string to character with that code point? »
I have the string x = '0x32' and would like to turn it into y = '\x32'. Note that len(x) == 4 and len(y) == 1. I've tried to use z = x.replace("0", "...
(3) odpowiedzi
2017-02-24 18:02 Gzip Python 3 vs Gzip Python 2 »
The problem: I have an older code that it's using Py2 'str' and that is using gzip to compress that string and I want to have the same output from gzi...
(1) odpowiedzi
2017-02-24 12:02 Appending a range to a list »
I have some basic code that I'm not grasping the behaviour of: L = [ 'a', 'bb', 'ccc' ] L.append(range(2)) print len(L) print len(L + range(1)) pr...
(1) odpowiedzi
2017-02-24 04:02 Why does Python 3's tkinter importing syntax seem to work in Python 2? »
I am running Python 2.7 via Anaconda and do not have Python 3 installed as far as I know. I'm confused about importing tkinter. Several other questi...
(1) odpowiedzi
2017-02-22 00:02 Relaxing multiple edges in a graph (Dijkstra's) »
I recently ran into a problem where I have to find the shortest path between two nodes in an undirected weighted multigraph. I am new to multigraphs s...
(0) odpowiedzi
2017-02-20 21:02 How to use map to lowercase strings in a dictionary? »
I'm experimenting around with the use of map, filter, and reduce in Python 3.6 at the moment. What I'm trying to do is, given a list of dictionaries, ...
(4) odpowiedzi
2017-02-19 16:02 pygtk2, how to delete all connected callback of widget or window? »
how can i do that ? i searched on net but i didn't find any solution for this problem. ...
(0) odpowiedzi
2017-02-18 15:02 Django mocking storage on model with update() throws error »
I have a small project and I'm working on some tests. Recently I asked a question: django-test-mocked-imagefield-prevent-upload-or-clean-after-test. I...
(0) odpowiedzi
2017-02-17 21:02 Strange Python boolean operator »
I saw some variations of the following simple piece of code: if dist_1>dist_2 : print enemy_2 else: print enemy_1 Variation 1: print (...
(2) odpowiedzi
2017-02-17 19:02 Where is console input history stored on Python for Windows? »
Good afternoon, The Question Is there a particular spot that the entries are stored, or is it just a local set of stored variables, for the windows ...
(0) odpowiedzi
2017-02-16 07:02 Django Test mocked ImageField prevent upload or clean after tests »
I am working on a TestCase for my project, involving some Image and FileFields. Some objects are loaded with fixtures, some objects are created during...
(1) odpowiedzi
2017-02-13 18:02 Python: indexing - Project Euler 8 »
When trying to answer this question using python, I ran into a problem with the indexing on the list I created. The question is: What is the greates...
(1) odpowiedzi
2017-02-12 15:02 How to append a new list to an existing CSV file? »
I already have a CSV file created from a list using CSV writer. I want to append another list created through a for loop columnwise to a CSV file. Th...
(2) odpowiedzi
2017-02-12 08:02 python class calls itself in __init__ using super »
i have a code like this: class sampleClass(object): def __init__(self): super(sampleClass, self).__init__() my question is that why it ...
(1) odpowiedzi