Tagged Questions
3
votes
6answers
47 views
Is it possible get a dictionary of passed in parameters similar to kwargs(python)?
I'm currently creating an object like this:
class Obj(object):
def __init__(self,**kwargs):
params = ['val1','val2','val3','val4',...]
for p in params:
...
1
vote
1answer
10 views
Relative importing modules from parent folder subfolder
Given a directory structure like this
/main/
/main/common/foo.py
/main/A/
/main/A/src/
/main/A/src/bar.py
How can I use Python's relative imports to import foo from bar? I've got a working solution ...
0
votes
1answer
28 views
Python output mistakes caused by csv, txt, and xls switching date formats (MM/DD/YYYY and M/D/YY)
I wrote a python script that takes a csv which has dates in an M/D/YYYY format, then matches them with dates in an xlwt generated .xls file. I was wondering why only some dates are matched and then I ...
1
vote
3answers
35 views
Write a list to csv file without looping in python
I have a list of list of lists that I need to write to a csv file.
mylist = [['Siddharth','Bangalore','[email protected]'],
['Rahul','Bangalore','[email protected]'],.....and so on]
This ...
4
votes
3answers
75 views
python: number sequence
just wondering what's the easiest way to do this.. I have a file with the following contents:
01 04
02 04
04 04
I plan to edit my file to append "missing to the file, since 04 means there are 4 ...
4
votes
2answers
23 views
TypeError: Argument given by name “id” and position(2) — wxPython
I'm attempting to make tabs in wxPython using the Notebook class. Using the tutorial linked above, I came up with the following code:
#!/usr/bin/env python
import wx
class DeployTab(wx.Panel):
...
0
votes
0answers
16 views
Python telnet connection not able to moniter the Shell which is Invoked from telnet
[python]
I telnet to a windows machine through python Telnetlib and
i have an interactive tool in my windows machine. In order to access that
tool, I have to type this command "nxshell" in command ...
-1
votes
1answer
64 views
Regular expression using in python
I want to remove }, { from this txt file , but it not doing this !
I think its problem in my loop because if i check it i give me some thing like this
k = """ my name is acting angel
},
{
who are ...
1
vote
1answer
29 views
NameError: name 'Game' is not defined, but it is
I am learning python using the book Learn python the hard way. I am doing one of the exercises, which contains many if loop's. I met an error which says Game is not defined, but I did define it ...
0
votes
1answer
28 views
What WSGI version should i use to build a python framework from scratch?
I'm about to build a python framework from scratch...
so, im confused about the WSGI/Python version, (WSGI 1.0 used for python 2.x, WSGI 1.0.1 for python 3.x).
what is the best version should i start ...
-2
votes
0answers
31 views
How to write test case for file download? [closed]
I developed one application which is rest webservice which will give file in response of request. Now how to write test case if i am getting proper file or not, because in response i will get file ...
0
votes
2answers
47 views
Writing a Python list of lists to a csv file
I have a long list of lists of the following form ---
a = [[1.2,'abc',3],[1.2,'werew',4],........,[1.4,'qew',2]]
i.e. the values in the list are of different types -- float,int, strings.How do I ...
2
votes
3answers
72 views
split the file in many other files using python
I have a file which I want to split it into many other parts. i want to use python code...
Eg: the data in my file is like this
>2165320 21411 200802 8894-,...,765644-
...
1
vote
1answer
35 views
UnicodeDecodeError: 'ascii' codec… when trying to encode a structure for JavaScript
I'm trying to create a unicode string out of a python structure. I don't want to use python's default string conversion methods since I want this unicode string to be in a particular structure so that ...
0
votes
1answer
23 views
How to pass xsrf cookie to host?
In Tornado app I put settings for
settings = dict(
cookie_secret="11oETzKXQAGaYdkL5gEmGeJJFuYh7EQnp2XdTP1o/",
xsrf_cookies=True,
autoescape="xhtml_escape",
)
(copied from web, gonna ...