3,386 Posted Topics
Re: This is not database or excel forum but here for example seems to be instructions [url]http://www.automateexcel.com/2005/11/01/connect_excel_to_mysql_database/[/url] | |
![]() | Re: But one sure thing is that you are calling findroots instead of giving findroots method as parameter in line 37 in error message, line 18 in posted code. |
Re: I think you have infinite loop with recursions, as you do not return the result of the recursive calls. | |
Re: Sometimes it is too easy, no dir (kwlist is suprisingly list): [CODE]>>> keyword.kwlist ['and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'not', 'or', 'pass', 'print', 'raise', 'return', 'try', 'while', 'with', 'yield'] >>> print('\n'.join(keyword.kwlist)) and as assert break … | |
Re: Reading does not create file, only writing does: [CODE]>>> f = open('newfile.txt','w+') >>> import os >>> print([ n for n in os.listdir('.') if n.startswith('new')]) ['newfile.txt', 'new_top95_s.txt'] >>> [/CODE] | |
One solitaire game practice until the first win or 'q' after game. | |
Re: Don't the[URL="http://www.linuxjournal.com/article/8381"] /proc file system[/URL] have all those details in Linux? | |
Re: Really single "turing machine types" googling brought the information to me. Time 10 s tops. | |
Re: There is [url]http://pypi.python.org/pypi/setuptools[/url] and the better [url]http://pypi.python.org/pypi/pip[/url], then most big name packages have also Windows installer in binary format, like here for SciPy: [url]http://www.scipy.org/Download[/url] | |
Re: By joining room that does not exist before, looks like. | |
Re: IronPython runs under .NET: [url]http://ironpython.codeplex.com/[/url] so you do not need convert. If you want to ask some question ask specifically about that function, but the wiki algorithm should be easy to convert to your language and already in pseudocode more suitable for coding than code in other language: [CODE]Algorithm: set … | |
| |
Re: post your code with code tags and probably you get help with your difficult parts. | |
Re: You have looked through Code snippets, haven't you? What you think of my snippet [url]http://www.daniweb.com/software-development/python/code/364647?[/url] Not helpfull? | |
Re: I wrote one snippet reasently and also vegaseat put some swing stuff in his sticky threads. My snippet is in code snippet archive: [url]http://www.daniweb.com/software-development/python/code/358809[/url] | |
Re: I do not think that any reasonable question stays very long with no answers at all, if it is going to be answered. So maybe it would be ok to have initial state "no indexing" and have reply side effect as turning the indexing on. But problem is the threads … | |
Re: Tilde is valid file name in windows and I do not think you meant it. It is quite common to have the script and the work file in same directory, then you can just use the name without directory part. Or you can give proper name of directory that exist … | |
Re: You imported complex but did not use it. You must include the module name: [CODE]complex.Complex(3.0, -4.5)[/CODE] By the way Python has complex numbers like 3.0-4.5j (enginering style j instead of i for imaginary unit) | |
Re: I trust that you have actual user who think they prefer this compared to learning to progrm (say easygui) | |
Re: You could gain some insight from my upvoted Python code for floating point number check, at least it is not cheating as it is in other language. [url]http://www.daniweb.com/software-development/python/threads/278529/1203340#post1203340[/url] | |
Re: Maybe you need to save the pieces in some kind of data structure. I see only control variables in your program. | |
Re: Nobody in they right mind should write 200+ lines of code before compiling the code. 10-20 lines is more like it with fixed data in code and simple printf instead fancy stuff. BTW (*variable_pointer).record is same as variable_pointer->record and generally thought to be more readable. You must be sure that … | |
Re: Post your code and explain the status of your progress (Something like "I tested these functions with these values and they work, now I am writing function xxx with these input values it should return .... but I am getting ...." Or you can post the function you have problem … | |
Re: [CODE]mydict = dict(line.strip().split('\t') for line in open('mytabfile.txt')) print(mydict) [/CODE] This prepare the dictionary with [B]string key 1 and 2[/B], if you want numbers as key, you must first change the keys to int and divide the job in more lines. | |
Re: I do not know about the error you are now getting, but I see other problems. You define two variables x and y to same value which is confusing. And you are not changing variables any time inside your while loop which leads to program not stopping as you have … | |
Re: At least with GNU GCC, there is not need to reinvent the wheel, they are declare (very logically) in [B]math.h[/B]: [url]http://www.gnu.org/s/hello/manual/libc/Rounding-Functions.html[/url]. As that is standard header they could be even part of standard: [url]http://en.wikipedia.org/wiki/Math.h[/url] | |
Re: Example: [CODE]filetype = 'rtf' files = ['doc.txt', 'stuff.rtf', 'artfunction.exe', 'rtfunc.bat', 'doc2.rtf'] print('\n'.join(filename for filename in files if filename.endswith('.'+filetype))) [/CODE] BTW iteritems is being deprecated, use items method instead. | |
This I did also after 'spying' discussions in other forum. Of course you would use sieve prime generation for bigger numbers, but I proved other simple way for a change. Slightly more advanced primes list generator would use primes % 6 in (1,5) property: [CODE]def primes(n): """ primitive non-sieve prime … | |
Re: Of course you can move the triangle up/down or left/right only as canvas is 2d surface. | |
Re: Usually now a days recommended way is normally subprocess, there is also nice code snippet from gribouillis easying the use:[URL="http://www.daniweb.com/software-development/python/code/257449"] A Command class to run shell commands.[/URL] | |
Re: All your if branches self.Make_Red(), use the string value of selection for configure instead. | |
I did some code to refresh my C. So many things have happened since 1987, but at least I started with ANSI instead of K&R. As I used the language so little, I think it is time to do some practise and even to learn some C++ to support my … | |
Re: Use access instructions here [url]http://eutils.ncbi.nlm.nih.gov/entrez/query/static/eutils_help.html[/url] or ftp access. [url]http://www.ncbi.nlm.nih.gov/guide/data-software/#downloads_[/url] | |
Re: Any sample of data possible say 20x20 top left corner? And formula for output in normal form with one example count from that data? | |
Re: For me hard disk is plenty fast enough. My Python code for candidates for multiword anagrams can be found in: [url]http://www.daniweb.com/software-development/python/code/365540/1566911#post1566911[/url], based on my only exact anagram words finding one. Of course with many words the most simple approach takes little time, like with long names. It is highly usable … ![]() | |
Re: [CODE]>>> print(chr(76), bin(76)[2:].zfill(8)) ('L', '01001100') [/CODE] | |
Re: if 'sieged' in lastline or 'attacked' in lastline or ') pillaged' in lastline: is never true, as there is not those words in your input. Also the output sample has not any 'counters' as in your print statements. | |
Re: You aren't using the variables you are defining, but define ans as 12. And you should post to c# forum. | |
Re: low+random(maximum-low+1) So 10 + random(100-10+1) random(10) gives values until 9. | |
Re: You as original poster should mark it solved. | |
Re: One more way is to use defaultdict, but I think this is unnecessary optimization, as your alternatives are what I consider good Python style. [CODE]from collections import defaultdict keys = defaultdict(list) for key, value in results: keys[key].append(value) [/CODE] Then there is more functional programming style with groupby, must transpose and … | |
Re: Can I request the purpose of doing this? We are not here to do your home works one by one. | |
Re: Please fix your enter key and use CODE tags. Please explain your package structure and what does not function in it. | |
Re: Here test, subprocess module functions OK in Jython, as it should: Test batch file batch.bat [CODE=text]@echo off echo Hello, from batch file [/CODE] Test in Jython prompt: [CODE]>>> import subprocess >>> subprocess.call("batch.bat") Hello, from batch file 0 >>>[/CODE] | |
Re: Maybe you would benefit from reading how [URL="http://bugs.python.org/issue476814"]universal newline support[/URL] is implemented in Python (or you can use it yourself)? | |
Re: It would pay to separate your data pay load from node as in that case you could have pointer to same info and do not need only have three pointers twice instead of two pointers and much string data. So I think you should use pointer to entry not entry … | |
Re: 3. You allocate needed amount and let operating system deal with virtual memory. | |
Re: Are you sure that for example Address never has ' ' in it? See for example [url]http://www.crasseux.com/books/ctutorial/sscanf.html[/url] how to allocate memory while reading in file and do error check. Notice that arguments of sscanf must be pointers. |
The End.