text
stringlengths
226
34.5k
Setting up database for testing in Flask Question: I am developing my first Flask app. It is my side project, so I focus on good practises and design and take my time. I am a bit stuck on testing - I found some examples in docs and here on SO, but they either do not apply to my app or do not seem Pythonic/well designed...
get raw_input data from main Question: I'm new in python and have not much experience in programming also. I have this code in my main file: def user_input(): import re name_check = re.compile(r"[^A-Za-z\s. ]") print("Please enter name input: ") name = raw_input("> ") ...
Cannot remove a reference in Visual Studio 2013 Question: I am building ironpython3 with Visual Studio 2013. In the references Visual Studio shows a yellow triangle on Microsoft.Scripting.Core reference. Since I read this reference has been moved to System.Core I simply removed the reference to Microsoft.Scripting.Core...
matlplot lib fails on clean numpy installation Question: I'm trying to install `matplotlib` on OpenSUSE 11.4 Clean installation of Numpy with `pip` (success) Then clean installation of `matplotlib` (success) Then when I run import matplotlib matplotlib.test() I get RuntimeErro...
Python list of variables inside a class Question: this is my first question, and combined with my being fairly noob feel free to tell me if there is a completely different way I should be going about this! Anyways, I am building a program that involves coloring a map with the four color theorem in Python 2.7, attempti...
Unicode error being thrown when trying to make rosserial module Question: I've recently started a project in using ROS to publish events using an arduino from the rosserial module. Whenever I invoke catkin_make on the workspace I make it through many of the packages in rosserial, but get errors when trying to make Topi...
Manipulate value before inserting it with format(**locals()) in python Question: Is it possible to manipulate a local variable before using it in .format() with **locals() without making a new variable? So something that has the same effect as this: medium="image" size_name="double" width=200 ...
python locale currency to 0 decimals Question: I can't figure out how to set my currency to 0 decimals. for now it always puts .00 behind my currency. locale.setlocale(locale.LC_ALL, 'en_US.UTF-8') damn = locale.currency(self.damn, grouping=True).replace('$','') + " Dmn" self.damn is always an ...
Kivy crashes in Android on launch Question: When I start my Kivy app on my Android phone (Samsung GSIII) the splash screen appears then it crashes and returns to my previous screen. After trail and error I settled on the fact that my import of ws4py was causing the error. I added ws4py to my buildozer.spec file under ...
Centralize logs from Python and NodeJS thanks to RabbitMQ Question: I have a service using NodeJS, RabbitMQ and Python workers. The NodeJS brokers use MongoDB and the Python workers have only a connection to the rabbitMQ server. I would like to be able to centralize all the logs from the different languages in a db. ...
blocking api redirect with requests in python 3.4 Question: I am creating a python program that uses an online thesaurus and returns synonyms. Unfortunately sometimes it will take a word that is spelled wrong, and redirect to a page for a word that is close to it, which is sometimes problematic. How can I stop it from ...
Python - Flask: render_template() not found Question: I'm new in flask. I have this code: Will you give me an advice what I'm doing wrong? Thanks from flask import Flask from flask import request from flask import render_template app = Flask(__name__) @app.route('/') def my_...
Installing NodeboxOpenGL on windows Question: Hello I am trying to install and make use of NodeboxOpenGL, the python library so I can create my own graphs with nodes and edges. But I am running into some trouble, starting off at [NodeBox OpenGL site](http://www.cityinabottle.org/nodebox/). I downloaded NodeBox for Open...
How to draw a ring of colors using turtle module in python Question: I have the following code which is supposed to draw a ring of colors around a circle but only one color if printed and changed 8 times before moving to the next import turtle def drawCircle(colorList, radius): for color...
return http error code for curl in python Question: status, output = commands.getstatusoutput("curl -k -v --cookie cookie_name 'URL' -o filename") Above is my code , I am trying to return http response code of curl. So i tried the following option -w %{http_code} status, output = commands.gets...
Python 3.4 Issue with writing to a file with time.sleep() Question: I am using Python 3.4. I'm trying to figure out why the writerow() is not working if I put a sleep timer at the end it does not write the data to the Test.dat file. The code looks like this import csv, time fileName = "Test.dat"...
Python not inserting data's into mysql Question: I am testing Python and Mysql in that i am able to create and delete table's but i am unable to insert data in them.I searched stackoverflow and mostly they suggest to use commit() So i used it and even after i used the data is not inserted into the ...
Affine 3D transformation in Python Question: I'm programming a function in Python in Autodesk Maya (using PyMel for Maya) I have three 3D points; p0, p1, p2. Then they make a rigid transformation, so after the transformation (an affine transformation) I have their new positions; q0, q1, q2. I also have a fourth poin...
Storing username and password into a dictionary? Question: Currently at the moment im working a small login screen in python, What i want it to do is ask a user to register if theyre isnt a account already created, But one small problem im having is how can i save the username and password into a dictionary, I would al...
How do I only print out the message instead of the whole text Question: This is my Python code to read an email: import imaplib mailserver=imaplib.IMAP4_SSL('imap.gmail.com',993) user = 'm****[email protected]' passs = 'm****s' mailserver.login(user,passs) status, count = mailserv...
Why does line_profiler in python not add up the times correctly? Question: I am new to the line_profiler package in python. Am I reading the result incorrectly, or shouldn't the components in the output below add up to 1.67554 seconds? Instead, they add up to 3.918 seconds (2426873 microseconds + 1491105 microseconds)....
Can't get ipython console in spyder Question: I'm having trouble getting an **ipython** console in Spyder. It only offers a **python** interpreter under the "interpreters" menu. I've seen this issue for a couple of others in Stackoverflow, but didn't have much joy with the proffered solutions. I'm running linux Mint ...
how to test a jline based console application Question: I'm trying to test a console application that uses [jline](http://jline.sourceforge.net/) for handling interaction with the user. I'm starting the application using [ProcessBuilder](http://docs.oracle.com/javase/7/docs/api/java/lang/ProcessBuilder.html) which giv...
Oop for class circle Question: Im writing a class in python called Circle. Now as part of the class I want to define methods so I did but when I run the program it crashes and says they are not defined. I cant find the problem. class Circle(): """ Holds data on a circle in the plane """ def _...
Making Python list in file and editing it later Question: I'm making an program which stores certain data in txt files. I did it like this and it works, but I want to change it to lists, so it's easier to edit stuff inside with list.remove and list.append... This is format I made: Username:data1:data2:da...
NurbsCurve MatrixMath Maya api Python Question: I am creating a toolset for creating nurbs curves/surfaces inside maya using python. I have a set of dictionaries that include cvPositions, knots, form etc. each of which describe a preset 3d shape (cube, circle, pyramid etc). I also have a 3d matrix stored in the nodes ...
Display or save a List of URL images Question: Python is known to be an easy and powerful language. I have a List, literally, of URL images, >>> for i in images: print i http://upload.wikimedia.org/wikipedia/commons/8/86/Influenza_virus_research.jpg http://upload.wikimedia.org/wikipedia/comm...
How check if current date and time is after a given date and time Question: In Python: 1. How check if current date and time is after a given date and time object named "next_check" 2. Add X number of minutes to next check Answer: You can do both of those things with [`datetime`](https://docs.python.org/2/librar...
Rotate a square by an angle in degree Question: I have a square with center x0, y0. I wish to rotate the vertex of this square for a given angle (theta) expressed in degree and return the new rotated vertex in clockwise direction. I am using this [approach](http://stackoverflow.com/questions/786472/rotate-a-point-by-an...
size of .apk when coded with kivy compared to the one in Java Question: I just created an apk after creating an app in kivy however it seems to me that the size of the apk created is really big on the android and after running the app the size is becoming bigger an bigger . See example below : 1. The Code for this e...
Why is the conversion between RGB and HLS color systems imprecise? Question: For one of my applications, I need to convert colors from the RGB to the HLS color system and vice versa. I found that Python has the [colorsys](https://docs.python.org/2/library/colorsys.html) module in its standard library. The problem is, ...
Fastest way to filter json string in Python Question: I have a json structure like { "a": "1", "b": "2", "c": { "d": "3" } } What I want is to only keep the 1st level of the json, i.e. remove if 1st level's value is not a string, so I have a program l...
Function unwantedly alters variables Question: I am wanting to use the baseTriangle and baseSquare variables in my for loops in the rotateshape(), but when they are put in, the funnction seems to alter them, meaning that they get bigger with every loop. not sure why it does this, please help!!! #! /u...
Python Not Executing MySQLdb connect Question: I am having some issues connecting to my hosted mysql database using python. My code is as follows: import MySQLdb db = MySQLdb.connect(host="xxxxxx.db.1and1.com", user="xxxxxxx",passwd="xxxxxxx", db="xxxxxxx") I get the following error: ...
Python - import external file via command line Question: I am aware that this is in principle a question that has been asked a lot already. But I have a more specific question within this general thing of importing external files. So, I have a few external files that each contain a database - different grammars for pa...
Matrix input from a text file(python 3) Question: Im trying to find a way to be able to input a matrix from a text file; for example, a text file would contain 1 2 3 4 5 6 7 8 9 And it would make a matrix with those numbers and put it in matrix = [[1,2,3],[4,5,6],[7,8,9]] And then this ha...
Implement cache inPython Question: I want to implement a basic cache in Python. It's like this. I've 2 files named :- `cache.py` , `main.py`. In my cache.py, I want to build a list every 24 hours. So, i run a cronjob `cache.py` every 24 hours which returns me the latest list. **cache.py** def get_hubc...
simple dictionary manipulation in python Question: groups = ['A','B','C'] ranges = [1,2,3,4,5,6,7,8,9] my_dict = {} for g in groups: my_dict[g] = ??? The result (my_dict) should be as follows: {'A': array([1, 2, 3], dtype=int64), 'B': array([4,5,6], dtype=int64)), ...
Generate Django behave code Question: I am using behave for acceptance testing of my Django app. Is there any possibility to generate the python code needed for the actual tests? What I have so far is the skeleton as follows: @given('I am logged in') def step_impl(context): assert False ...
How to prevent python requests from percent encoding my URLs? Question: I'm trying to GET an URL of the following format using requests.get() in python: [http://api.example.com/export/?format=json&key=site:dummy+type:example+group:wheel](http://api.example.com/export/?format=json&key=site%3adummy+type%3aexample+group%...
Added subprocess, error that variable is not defined Question: My script gets arguments such as C:\> python lookup.py "sender-ip=10.10.10.10" And would take sender-ip and find wmi information Now I added a ping subprocess to pint the machine BEFORE attempting to get wmi information and I get follo...
python line profiler view result Question: I have ran `kernprof` on a file called `RP.py` and it spits out `RP.py.lprof` Now, i'm trying to view this file. If i open a `cmd` window and type `python -m line_profiler RP.py.lprof` it gives me the text, but it not formatted in a way that I can read it. Is there a way to ...
matplotlib pgf savefig(pdf) fails Question: On a modern texlive installation on fedora 20, using pgf backend fails in savefig ('blah.pdf'). Example: # -*- coding: utf-8 -*- import matplotlib as mpl mpl.use("pgf") pgf_with_rc_fonts = { "font.family": "serif", "font.serif"...
f2py loses double precision when passing to python Question: I can't seem to get my module created with f2py to keep a number at double precision when it is passed back to python. A minimal example, with file fmodules.f90: subroutine example(output) implicit none ...
Print float (x,y) data in a graph with Python Question: I need to print data saved in a file in this format: 0.1545,0.68954 0.1548,0.87854 0.2545,0.54854 0.7956,0.41548 (All values between 0.0 and 1.0) And also the possibility of printing more than one graph in the same figure differen...
Multiprocessing with python to find Max value Question: I'm working with Python 2.7.5 and OpenCV. I have a test image and I want to find it's most similar image in an array of images. I have written a function using OpenCV that will give me the total number of similarity points. The more similar points I have the more ...
django no module named wiki Question: Okay, so I am following along with a tutorial about how to make a wiki with django for practice. I'm using Python 2.7 with Django 1.6.4. I am trying to run the server so I can refresh a page but I am all of a sudden getting the error `"ImportError: No module named wiki."` I've sea...
subscribing to a tag with python-instagram API in python failing Question: I'm trying to subscribe to a hashtag using the python-instagram wrapper for python. I have previously used cURL to perform the authentication handshake and it worked fine. However, I would like to use all the wrapper functionality. ...
Error with concatenating list to string in Python Question: I am trying to pass class element to method. Element is formed dynamically inserting current time in it. Mine class looks something like this: class MineContact(dict): def __init__(self, **kwargs): # set your default values ...
How to implement multiple signals in a program? Question: I am starting to learn Python (newbie), so not much idea about the different modules etc. Scenario that I want to simulate: I have a program `prg1.py` that I want to run for some user defined time say `t` seconds. After this time (`t` seconds), the program sho...
Run py file with different arguments each time in pyCharm Question: I have some script : **run.py** , I was using it in terminal like : python run.py -t 10 -s adidas -f mozilla python run.py -t 2 -s nike -f chrome python run.py -t 100 -s puma -f safari python run.py -t 1 -s tom but how ...
Can't install mongoengine inside virtualenv Question: When I try to install mongoengine in virtualenv, I've got problem: Requirement already satisfied (use --upgrade to upgrade): flask-mongoengine in ./lib/python2.7/site-packages Requirement already satisfied (use --upgrade to upgrade): Flask>=0.8 in...
Classify type of tweet (tweet/retweet/mention) based on tweet text in Python Question: Pulling from a couple of different examples, I've been able to create a simple Python script that parses the JSON output from the Twitter Streaming API, and prints out the `screen_name` and `text` for each tweet. I would like to modi...
Change focus to Tkinter program using system-wide hotkey Question: I'm trying to register a system-wide hotkey that will trigger some action in my Tkinter program. I'm using [this](http://timgolden.me.uk/python/win32_how_do_i/catch_system_wide_hotkeys.html) as reference. When I run the code from that link, it works fin...
Python pandas tagging entries in dataframe shortening code Question: So I am using python pandas have an the following variables: * a dataframe `df` with a column 'TAG' I created to tag data into groups based on data from a column 'IDnumber'. * regex patterns stored in arrays `pattern1`, `pattern2`, `pattern2-2`,...
A variable list parameters in a Python Class Question: I'm trying to make a class with a variable parameter list, the code: **Vector.py class code:** class Vector(tuple): def __new__(cls, *V): return tuple.__new__(cls, V) def __init__(self, *V): self.V = V ...
How to print non-BMP Unicode characters in Tkinter (e.g. ) Question: So, today I was making shortcuts for entering certain Unicode characters. All was going well. Then, when I decided to do these characters (in my Tkinter program; they wouldn't even try to go in IDLE), and , I got a strange unexpected error and my prog...
Merge two lists with labels Question: I want to merge two sorted lists into a new sorted lists, but I want to include labels into the new list to see which list was the origin of each value. So far that's my code: l1 = [1, 40, 90, 104] l2 = [5, 20, 70, 85, 230] test = [(i, "l1") for i in l1 ] + ...
Python 3 pandas Marking data in dataframes using strings vs Regex Question: So I have 2 ways of doing the same thing and was wondering which one is more efficient: The first way loads a list from a text file or array and marks up a dataframe using the list: import pandas as pd ban_list = ['Al G...
Login vs Register in PythonSocialAuth Question: I'm using [PythonSocialAuth](https://github.com/omab/python-social-auth) (v0.1.23) and I need to differentiate "Register" (create a new user account) from Login. In the [PSA Django example](https://github.com/omab/python-social- auth/tree/master/examples/django_example), ...
RabbitMQ brokers on different machines Question: The [hello world example](http://www.rabbitmq.com/tutorials/tutorial-one- python.html) in the tutorial section of rabbitMQ, asks just to change the hostname with the ip of the different machine. But that isn't working for me. I have tried [Binding external IP address to ...
Image manipulation in Python using MPI Question: I'm trying to do some image manipulation using MPI (mpi4py) in Python. This is my code so far: from mpi4py import MPI from PIL import Image comm = MPI.COMM_WORLD size = comm.size #number of processors rank = comm.rank #calling process ...
Album app process in Django Question: I want to know how to display images separated by albums onto a page in Django. So far, I've learned how to do so with the line `<img src="{% static "images/[email protected]" %}">` in my html file. structure: /PersonalWebsite /static /img ...
Pydrive authentication using Question: I was using gdata module to access, upload, download files from google doc. I have the oauth key and secret with me. Now I want to switch to google drive api. Learning and studying a bit on google drive api , it looks like a bit different in the authentication. I also have downloa...
How to timeout a statement Question: how to time-out a statement/block of code in python? I tried using the below looking at a post but it couldn't identify the signal: wls:/offline> import signal Traceback (innermost last): File "<console>", line 1, in ? ImportError: no mod...
Importing user defined modules in Python Question: I have the following module definition for a Stack: class Stack: def __init__(self): self.items = [] def isEmpty(self): return self.items == [] def push(self, item): self.items.append(item) de...
ImportError: No module named gi.repository Question: I'm trying to launch python script on Ubuntu 10.04: from gi.repository import Nautilus, GObject It doesn't work: Traceback (most recent call last): File "script.py", line 1, in from gi.repository import N...
Pandas dataframe manipulation and plotting Question: Using WinPython 3.4, matplotlib 1.3.1, I'm pulling data for a dataframe from a mysql database. The raw dataframe that I get from the query looks like: wafer_number test_type test_pass x_coord y_coord test_el_id wavelength intensity ...
python/ast: evaluate an ast.Subscript node Question: I'm using ast to parse python files and I can't work out how to get an ast.Subscript node to evaluate. I can't even see how to get the text out of it (so I could use eval(text) ). Can anyone see what I'm missing? For example, here the default value for the A arg is ...
Subprocess library won't execute compgen Question: I am trying to make list of every command available on my linux (Lubuntu) machine. I would like to further work with that list in Python. Normally to list the commands in the console I would write "compgen -c" and it would print the results to stdout. I would like to ...
Make my_average(a, b) work with any a and b for which f_add and d_div are defined. As well as builtins Question: In short: what I want is for the majority of mathematical functions I've written (e.g., `my_average(a, b)`) to work with any `a` and `b` for which an `f_add` and `f_div` have been defined. Without overloadin...
Python myro module importerror Question: I am completely new in Python. Installed just today in school purposes. I need to use myro module but I am getting this error `ImportError: No module named 'myro'` all the time. I've found out that I have installed older versions of Python already with another software like Blen...
How do you deal with importing built-in libraries under windows using PyCharm? Question: I have python-2.6 installed and use pycharm-3.1.3 (community edition) to develop. But the imports of the built-in libraries (for instance - `datetime`) are marked as errors by the given IDE. ![enter image description here](http:/...
Appending Windows Directories In Python Question: I am creating a program that appends audio files the user selects together using Sox. I originally created the program for linux but I am making it compatible with Windows. On windows when I pass the list of files to Sox, the program raises 'The filename, directory nam...
Moving specific file types with Python Question: I know this is going to be frustratingly easy for many of you. I am just beginning to learn Python and need help with some basic file handling. I take a lot of screenshots, which end up on my desktop (as this is the default setting). I am aware I can change the screensh...
python xlrd error with old xls file Question: I have got an excel file, that was created by some rather old soft. This file couldn't be opened in OpenOffice(some encoding errors) and in Excel 2010 at first it could only be opened in Protected View. When I tried to open it by xlrd: from xlrd import open_w...
Blank Page with web.py and Google App Engine Question: I'm trying to get web.py app running on local Google App Engine. My yaml: application: appname version: 1 runtime: python27 api_version: 1 threadsafe: true handlers: - url: /.* script: code.app My code.py: ...
How to change permissions on a couchdb database with python Question: I am trying to add a user in the "_security" document of a database with python-couchdb. I am getting an error because the "_security" document doesn't have an "_id" attribute. import couchdb couch=couchdb.Server("http://admin:admi...
Using argparse to create output file Question: I have been using argparse in a program I am writing however it doesnt seem to create the stated output file. My code is: parser.add_argument("-o", "--output", action='store', dest='output', help="Directs the output to a name of your choice") with open(...
Foreign key not available on object Question: Very very beginner question that puzzles me. I have problems showing the foreign key ArtWorkImages in my template, so i wanted to debug it in the view, but the foreign key ArtworkImage is not available on Artwork: my model: from django.db import models ...
python what is the import for threading? Question: I want to run some python code every 120 seconds. I tried this: class AppServerSvc : def f(self): # call f() again in 120 seconds spider = FantasySerieaSpider() settings = get_project_settings() ...
Break python long into limbs Question: I'm trying to write an implementation of [Montgomery multiplication](https://en.wikipedia.org/wiki/Montgomery_reduction#Modular_multiplication) in Python and I need an equivalent to GMP's [`mpz_getlimbn()`](https://gmplib.org/manual/Integer-Special-Functions.html) for Python longs...
c++ error on a python progam Question: in my python program a c++ error pops up. i know that my program is glitchy and has bugs but why is there a error with c++ Assertion failed! Program: C:\Python33\pythonw.exe File: .-\--\audio\mpegtoraw.cpp Line: 505 Expression: audio->rawdatawriteoff...
Python handling username and password for URL Question: Messing with Python and I'm trying to use this <https://updates.opendns.com/nic/update?hostname=>, when you got to the URL it will prompt a username and password. I've been looking around and I found something about password managers, so I came up with this: ...
Python Change Directory Google App Engine Question: I have my webapp written in Python running on Google App Engine; so far only testing in my localhost. My script needs to read text files located in various directories. So in my Python script I would simply use os.chdir("./"+subdirectory_name) and then start opening a...
Miller-Rabin code - can't find any mistakes? Question: I used some code taken from Rosetta Code. I renamed a few things but I didn't really change anything. import random def is_probable_prime(n, num_trials = 5): assert n >= 2 if n == 2: return True if n % 2 =...
Numpy and matplotlib Import errors Question: I have installed matplotlib 1.2.0 and numpy 1.6.2 for python 2.7.4 And I get the below import errors when i try to run my code. Traceback (most recent call last): File "D:\Python\IQ_polar.py", line 16, in <module> from matplotlib import pyplot ...
Removing and updating lines in a text file - Python Question: I'm learning Python and as a learning project, I'm developing a twitter bot. I'm using Python 3. I use the following lines for tweets. > What is Bruce Lee’s favorite drink? Wataaaaah! > The dyslexic devil worshipper sold his soul to Santa. > You kill ve...
Create a certain triangle with stars Question: I'm using python IDE wing version 4.1 I'm trying to write a function with only 1 input which will be an integer and return the next shape of stars: * ** *** I tried using the following code but it gave another shape: from mat...
Change list in python Question: How can make several lists like this: ['The Lord of the Rings: The Fellowship of the Ring (2001)'] ['The Lord of the Rings: The Two Towers (2002)'] ['"5 Second Movies" (2007) {The Lord of the Rings and the Two Towers (#1.63)}'] Into one list like th...
Automate compilation of protobuf specs into python classes in setup.py Question: I have a python project that uses google protobufs as a message format for communicating over the network. Generating python files from the .proto files is straight-forward using the `protoc` program. How can I configure my `setup.py` file...
Python client server to send a file Beginner Error Question: I am trying to do simple code to send file from the client to the server after saving in t some data. I am a beginner so I can't figure where the problem is or what is the missing function or line in my code The Server : import socket ...
The PyDev plugin can not find python 3.4 Question: I have been using eclipse 3.8+PyDev+python 3.3 on ubuntu 13. Recently I upgraded ubuntu to 14.04. It seems that ubuntu 14.04 comes with new python 3.4, so, during upgrading, the old python 3.3 is removed and new python 3.4 is installed. Then, the PyDev plugin of my ecl...
Setting an ID3 comment using EyeD3 in Python Question: I have the following python script in a folder with a mp3 file: import os import eyed3 def track(file): tag = eyed3.load(file) tag.tag.comment = u"teststring" tag.tag.genre = u"Pop" tag.tag.save() ...
Run multiple python files at same time Question: I understand that we can use Python `multiprocessing` module and will import `Process` for this. But what will be our Python code, suppose we want to execute 2 files like `a.py`, `b.py` at same time. I was expecting a Python script to include the above and not running ...
Streaming sockets from ProcessPoolExecutor Question: I'm trying to create a Python application in which one process (process 'A') receives a request and puts it into a ProcessPool (from concurrent.futures). In handling this request, a message may need to passed to a second process (process 'B'). I'm using tornado's ios...
How to import a python module from a relative path? Question: I've got the following file structure: ![enter image description here](http://i.stack.imgur.com/hxn4B.png) I'm trying to initialize some objects in `main.py` that belong to modules in the `Listener`, `Parser` and `Configurations` folders. I understand I ca...
Alert message on Google App Engine for Python Question: I want to pop an alert message for error handling on an app that runs via Google App Engine for Python. I tried this already but non worked: `from Tkinter import * msg = Message(text="Please, make sure you fill out the boxes and agree with the terms") msg.config...
matplotlib 3d scatter from 2d numpy array vertices error Question: I'm stumped as to why this is not working. I am pulling a bunch of floating point data in to a numpy array from a csv file, and I just want to create a 3d scatter plot based from 3 of the columns in the array. #import data from the csv fi...
Python: MySQL-Query fails Question: In general, I am familiar with MySQL but not with Python. I try to generate .py script which inserts an user with a hashed password into a mysql-database of the radius-server. That's my script so far: #!/usr/bin/python2.7 import sys import MySQLdb fro...