-
Gave Reputation to jeffmylife in How To Make Quality Voronoi Diagrams
# What Are Voronoi Diagrams? # Voronoi Diagrams are an essential visualization to have in your toolbox. The diagram’s structure is a data-driven [tessellation](https://en.wikipedia.org/wiki/Tessellation) of a plane and may be … -
Replied To a Post in Graphics and Image processing
@ddanbe You only need to forget about [python 2](https://pythonclock.org/) and use only python 3. -
Replied To a Post in Graphics and Image processing
@ddanbe Don't you like python any more? -
-
Replied To a Post in Python Error Message "point object has no attribute"
The problem is that you write `from tkinter import *` after `from graphics import *`. Some objects defined in the [graphics.py](https://pypi.org/project/graphics.py/) package get shadowed by objects defined in the tkinter … -
Edited Python Error Message "point object has no attribute"
I am having trouble getting my button to work. What I am trying to do is when the button is pressed, it should call the function clickGame() The window is … -
Replied To a Post in Hey everyone!
I've been learning python for more than 20 years. It is an endless quest. -
Replied To a Post in Keyboard Layout for French
The best layout for french is the [BÉPO](https://en.wikipedia.org/wiki/Keyboard_layout#B%C3%89PO) layout. Install it and switch the layout everytime you want to type in French. -
Replied To a Post in Can we use bing instead of Google?
You can try [Qwant](https://www.qwant.com/) [Qwant](https://www.qwant.com/?q=foobar&t=all), although it is said to be bing + privacy. -
Replied To a Post in Reading an entire binary file
Read the file by chunks and also write chunks: with open("portrait1.dng", "rb") as binaryfile : with open("readfile.raw", "wb") as newFile: while True: chunk = binaryfile.read(4096) if not chunk: break newFile.write(binascii.hexlify(chunk)) … -
Replied To a Post in Creating a python game? redlight greenlight
Before even thinking of using python for this, you need to define what the computer will do and what the human player(s) will do. You don't need a specific programming … -
Replied To a Post in Reading a .raw file and display as hex
> hmm. it only displayes a few dozen lines of the end of the file. so then i tried: If you read by chunks, you need a while loop to … -
Replied To a Post in Reading a .raw file and display as hex
Don't use `readline()` with binary files, because they are not organized in lines. If this is a big file, invoke `read()` with a size argument to read iteratively chunks of … -
Replied To a Post in Reading a .raw file and display as hex
> but I only have the first 49 displayed. It is because of the `byte = content.read(1)`: you are only reading one byte. Use regular python code: with open(fileName, "rb") … -
Replied To a Post in Reading a .raw file and display as hex
In python 3, the value returned by `binascii.hexlify()` is a `bytes` instance instead of a `str` instance. As `setText()` is expecting a `str` instance, you need to convert hexadecimal to … -
Replied To a Post in Sort data from text file in python using quick sort
@pty The idea was to do the same in python. -
Replied To a Post in Sort data from text file in python using quick sort
It is `key(d_val[0])])` . SyntaxError always has a very simple solution. -
Replied To a Post in Sort data from text file in python using quick sort
You can use `>` and `<=` in the `qsort()` function to sort in descending order. Is there a question with this function? You could add a `key` argument like so … -
Replied To a Post in Sort data from text file in python using quick sort
The `sorted()` function has a boolean `reverse` parameter that allows to sort in descending order sorted(lines, key=itemgetter(3), reverse=True) This is much more efficient than trying to write your own quicksort … -
Replied To a Post in Need help with inserting new row, and saving user input in wxpython grid.
Try `self.GetTable()` instead of `self` as first argument when you call `gridlib.GridTableMessage()`. -
Replied To a Post in Need help with inserting new row, and saving user input in wxpython grid.
The error message won't suffice, can you post the whole exception traceback printed by python ? -
Replied To a Post in Need help with inserting new row, and saving user input in wxpython grid.
For problem 1, I think you could remove the 'data' argument in def OnCellChange(self, evt, data): ... For problem 2, you need to compute the `row` value that you want … -
Replied To a Post in Recursion error with performative property
In your example, I don't see why you need `A = property(...)` when you can directly use `i.a`. -
Replied To a Post in Recursion error with performative property
My code works because `newdict` is no longer a dictionary `vector --> value`. It is a dictionary `vector._key --> value` instead. It means that only the `._key` member is hashed … -
Replied To a Post in Recursion error with performative property
Strange code and strange specifications as usual, but well ... Two points: 1. Why do you want the vector to hash as a tuple ? What's the use of this … -
Replied To a Post in make multi plots in Python
Matplotlib can handle events such as keypress or mouse clicks. One only needs to write a few callbacks. Here is a small example adapted from the matplotlib's documentation. It first … -
Gave Reputation to rproffitt in Shell Sc ript
Here's the 411. First you do this manually then you convert those steps to a script. Some don't understand the need for the first step. -
Replied To a Post in Checking For a Solution
No I've never seen a solution. That's one of the many features of windows that waste the user's time! -
Gave Reputation to Matej_1 in Searching quadruplex sequence from a FASTA file by using Python
If you don't mind calling R from python (or vice versa), the pqsfinder package in R (http://bioconductor.org/packages/pqsfinder/) solves most of the quadruplex sequence search and manipulation. For example, it already … -
Replied To a Post in How can I work around this insecurity issue??
There is something interesting in your last post. You could indeed create a single UVproxy for each facepoint, only if and when it is needed. Just like a cached property. … -
Replied To a Post in populating wxgrid with data from mysql data base.
The 7L comes because you are using python 2 instead of python 3, which I disapprove, but it is your choice, and there are two integer types in python 2, … -
Replied To a Post in How can I work around this insecurity issue??
Why not return iterables indeed? It all depends on what the user wants to do with it. The risk is to store a whole list of all instances when one … -
Replied To a Post in How can I work around this insecurity issue??
A remark: if you create a lot of proxies such as UVProxy above, it is a good idea to make them *flyweight* by using the `__slot__` attribute. Basically, they are … -
Replied To a Post in populating wxgrid with data from mysql data base.
The error means that you tried to insert in a grid cell a value `v` which type is not `str` or `unicode`, and the `Grid` type doesn't accept that. We … -
Replied To a Post in How can I work around this insecurity issue??
It's impossible that `facepoint.UV` behaves like `facepoint.UV[0]`, because the result of `facepoint.UV[1]` would be the same as `facepoint.UV[0][1]`: in `facepoint.UV[1]`, the expression `facepoint.UV` is computed first. There is no way … -
Replied To a Post in populating wxgrid with data from mysql data base.
Can you post the whole exception traceback that gets printed instead of only TypeError: String or Unicode type required" ? -
Replied To a Post in How can I work around this insecurity issue??
Hi Tcll, it's been a while indeed! I don't think there is a flaw in python's descriptor implementation. Also I don't understand why you think there is a security issue … -
Replied To a Post in populating wxgrid with data from mysql data base.
Hi, it's been a long time since I last used wxpython, but I think it should be something like for i, seq in enumerate(data): for j, v in enumerate(seq): self.SetCellValue(i, … -
Replied To a Post in python
**What have you tried?** This is what everybody wants to know when you ask a homework question. We don't know what you know about programming in python. Obviously you must … -
Replied To a Post in Server with gui interface
In python 2, I usually start with from __future__ import (absolute_import, division, print_function, unicode_literals) but I write less and less python 2 code. -
Replied To a Post in Server with gui interface
> I tried to make all the print statements python2/python3 compatible Do you know you can use from __future__ import print_function to get immediate compatibility ? -
Gave Reputation to Rufus_1 in Server with gui interface
It's still a valid problem 7 years later, and no solutions or comments! I found it in a web search and when I ran it, it was not close to … -
Replied To a Post in TypeError: must be type, not classobj
@Rufus_1 It is true that the answer doesn't have to be "change to python 3", however this is strongly recommended as python 2 support will end in 2020. Let me … -
Replied To a Post in Dani isn't killing DaniWeb with Dazah, she's saving it
I'm sure only a few of us know that dazah [was already online](http://web.archive.org/web/20010407004107/http://dazah.com:80/index.html) in year 2000! -
Replied To a Post in python
Well, you can use `P_1*.txt` to work only with these files. For the `rna` files, you can use `rna*.txt` or simply `rna*` if only `.txt` files start with this prefix. … -
Tweeted python
I need to read a list of names from different files using python and produce the list of names that appear the first time from each file. Help!! -
Replied To a Post in python
@Sue_2 You can improve this by opening the ouput file only once. Also, you can use fileinput to iterate over the lines of many files with open('merge_BLASTP_results.out', 'w') as f: … -
Replied To a Post in why the C++ Mathematical Expression Library compiled so slow
We don't need the source file, but a link to the site where you found that library. -
Replied To a Post in python
Start by reading a list of names from a single file and print these names in the console. Post your code! -
Replied To a Post in Python + Qt on Windows 8.1
Is there a `setup.py` file in the extracted hierarchy? If so, open a terminal (cmd window), go to the directory where the setup.py file is and type `python setup.py install`. …
The End.