3,386 Posted Topics

Member Avatar for meli123

In my computer it takes 16 iterations from 0.9 to reach floating point limit of accuracy, if you mean that: [CODE]1 0.99 2 0.999 3 0.9999 4 0.99999 5 0.9999990000000001 6 0.9999999 7 0.9999999900000001 8 0.999999999 9 0.9999999999 10 0.99999999999 11 0.999999999999 12 0.9999999999999001 13 0.99999999999999 14 0.999999999999999 15 0.9999999999999999 …

Member Avatar for doug65536
-1
273
Member Avatar for Fireprufe15

On the contrary, we want your teacher recognize your code to your work and appreciate it, but we can give hints and stuff. I think maybe simple XOR encryption would be enough for you, as you probably do not want to use [URL="http://www.cityinthesky.co.uk/opensource/dcpcrypt"]third party crypto modules[/URL].

Member Avatar for pritaeas
0
165
Member Avatar for TrustyTony

The [URL="http://pypy.org/"]PyPy [/URL]development team has announced the release of version 1.6 of its "very compliant" Python interpreter with integrated tracing just-in-time (JIT) compiler. According to the developers, the latest update fully implements Python 2.7.1 and brings speed and stability improvements. Code-named "kickass panda", PyPy 1.6 is said to be between …

Member Avatar for dresses623
0
183
Member Avatar for jdm

Here seems to be info how to interface Cards in Java: [url]http://www.oracle.com/technetwork/java/javacard/overview/index.html[/url]

Member Avatar for TrustyTony
0
110
Member Avatar for arson09

If you post your honest own effort we help you out. Notice that even though experienced coder could do this code quickly, you should basically add code line be line making sure you get intended result from your additions by debug prints (or debug decorator). Quality is important as is …

Member Avatar for arson09
0
250
Member Avatar for The Bl

Nobody seems to be in hurry. Normally you continue after password match and otherwise exit. Your code is joke as you would have error latest at line 4. I do not understand also how you would check passwords from everybody and accept them to all users.

Member Avatar for TrustyTony
0
339
Member Avatar for Skrell

sort is in place function, sometimes in other languages called procedure, which does not return value, but directly orders the list. So you must print list1 next line after sort or you should use sorted function.

Member Avatar for JoshuaBurleson
0
112
Member Avatar for darkfury18

Couldn't be simpler just decide between Python2 and Python3 (or install both, preffered one last, as it associates the .py files each times to installed Python version): [url]http://python.org/download/[/url]

Member Avatar for Stefano Mtangoo
0
231
Member Avatar for Skrell

You must put try around the fileinput that is in try to line "5.5" and indent the print line and 7 to same level as try: (current print indention).

Member Avatar for TrustyTony
0
498
Member Avatar for Janakiram2571

You can compare to this: [url]http://www.daniweb.com/software-development/computer-science/threads/324685[/url] [QUOTE] O(2^n) – exponential time, may God have mercy on our souls, because this thing is fast growing. The algorithm growth will double for each new element in the data input! For n=1 we will have 2 operations, for n=2 4 operations, for n=3 …

Member Avatar for TrustyTony
0
76
Member Avatar for Caraka

[QUOTE=dave8;1650459]This code only works for space separated files. It will not work for fixed width positional files.[/QUOTE] The input given is not positional, but variable width. You can see, if you look given input by clicking reply for the original post (as it has no code tags). Fixed width input …

Member Avatar for TrustyTony
0
3K
Member Avatar for Fyrox

Don't use the libraries, so can not test, but something similar to this, maybe: [CODE]import pythoncom, pyHook def stroke(event): if event.WindowName != stroke.current_window: print event.WindowName stroke.current_window = event.WindowName print event.Key stroke.current_window = None ph = pyHook.HookManager() ph.KeyDown = stroke ph.HookKeyboard() pythoncom.PumpMessages()[/CODE]

Member Avatar for Fyrox
0
5K
Member Avatar for pelin

for loop with user input count is not as user friendly as input until special value, say 0. Using eval on direct user input is considered bad idea as with suitable input user can do any OS command.

Member Avatar for pelin
0
370
Member Avatar for meli123

It is against most nature to do very fixed function programs, when they can be general but in the case of 3 letters (be they numbers or so what) you could do comparision of a and b against others until success. pseudocode: [CODE] read characters in as a,b,c if a …

Member Avatar for TrustyTony
0
297
Member Avatar for Coopish

other way is to remove one by one the letter from the copy of the usable letters, succeed if all were found, otherwise fail at first letter not found. Maybe you want to check first that length of the target word is shorter than usable letter string.

Member Avatar for TrustyTony
0
770
Member Avatar for twgray
Member Avatar for JoshuaBurleson

Probably problem with garbage collected image, if you do not do OO, you must have clear loop of main action in main code/single function. (The way you chain functions by calling show at end of get_image is uggly, better to have only one function) I found it easier to change …

Member Avatar for TrustyTony
0
3K
Member Avatar for TrustyTony
Member Avatar for CalculusG
Member Avatar for JoshuaBurleson

May the DaniWeb (and Vegaseat) be with you! [url]http://www.daniweb.com/software-development/python/threads/191210/948470#post948470[/url]

Member Avatar for TrustyTony
0
204
Member Avatar for Brenhines

Do you mean AES/Rijndael? There is also this component [url]http://code.google.com/p/delphidec/downloads/list[/url] It has example.txt file on how to use it. Maybe you find it easier to use, haven't used it myself, just googled it.

Member Avatar for Brenhines
0
262
Member Avatar for TrustyTony

Roman numbers is a standard programming exercise, to give it a small twist, we input roman numeral, turn it to value and prepare minimal version of it using the substraction rule. Correctness of the input is not checked so Garbage in - Garbage out.

0
337
Member Avatar for georgeoshardo
Member Avatar for TrustyTony

While looking stuff about idlelib, I came to [URL="http://stackoverflow.com/questions/3431498/what-code-can-i-use-to-check-if-python-is-running-in-idle"]this thread in stackoverflow[/URL], so I posted own solution. I post it also here, as maybe somebody needs it (as for example \b looks ugly in IDLE)

0
259
Member Avatar for radhika kotecha

Probably most known is [url]http://garage.cse.msu.edu/software/lil-gp/[/url]

Member Avatar for TrustyTony
0
250
Member Avatar for ausgurl

c: I do not have dishes in my computer but disc I have however. Also why not a) explanation: What if you deleted 50 pages by mistake, does auto save help?

Member Avatar for Reverend Jim
0
152
Member Avatar for sohel807

Is the Python version same and both 32 or both 64 bits version? Could you post the profiler outputs?

Member Avatar for sohel807
0
88
Member Avatar for Intrikate
Member Avatar for abders

You need to actually save the widget only if you refer to it later to change it, also some case it is necessary to store the widget somewhere so garbage collector does not collect it as rubbish. If you do grid together with creation, you should not assign the None …

Member Avatar for abders
0
210
Member Avatar for dustbunny000
Member Avatar for JoshuaBurleson
Member Avatar for now how abt tht

I do not know about your Personal Digital Assistant to answer this question. Or you mean Pennsylvania Dentist Association:-/

Member Avatar for TrustyTony
-1
260
Member Avatar for kaskoraja

split, like I mailed you in first post but now from ',', and convert to int or float each value.

Member Avatar for woooee
0
102
Member Avatar for hughesadam_87

You are calling the __init__ of inherited class in beginning of child __init__ , aren't you? Could you post restricted example with only the problem behaviour?

Member Avatar for TrustyTony
0
2K
Member Avatar for nitzanh
Member Avatar for N1GHTS

Hi, I think the style of programming for reading that Python philosophy encourages agrees with interests of your business logic. I do not know exactly what are your requirements, source to source translation you have ready, otherwise you could have tried to adapt pypy JIT environment for your application. Usually …

Member Avatar for TrustyTony
0
242
Member Avatar for daggeras008

I do not know what problem you have, the conversion with `2to3.py` script did not succeed? Next time push (CODE) before pasting your code and put your imports (only once) at beginning of the code (moved those) #! /usr/bin/python import socket import struct import sys import os import string import …

Member Avatar for TrustyTony
0
288
Member Avatar for TrustyTony

Picked up from old thread but currently applicable (the IBAN number became more widely required actually this year in Finland). The style was quite alien for modern Python coders, so I massaged the code to my own liking. I removed many temporary variables, as for my opinion they did not …

Member Avatar for TrustyTony
2
416
Member Avatar for hqt

I think the previous poster mistook question dealing with Fibonacci numbers. Reference in wikipedia: [url]http://en.wikipedia.org/wiki/Fibonacci_heap[/url]

Member Avatar for hqt
-1
107
Member Avatar for Reverend Jim

I did it slightly differently but same, without re (you loose the special meaning of [] though, so I added -e flag for exact replacement for []): [CODE]import glob import sys # use -e flag to replace [] pattern = ''.join(c if c not in '[]' else '[' + c …

Member Avatar for Reverend Jim
0
116
Member Avatar for kaskoraja

You have zero in your input at second column, not first one. Input has float but you have output with integer string value, is output value integral You can split task in two, just read in the float numbers with with open ...as. And process with strip and split methods, …

Member Avatar for kaskoraja
0
278
Member Avatar for felix001

Easiest way could be to use Gribouillis Cmd class: [url]http://www.daniweb.com/software-development/python/code/257449[/url] For hostname, I think you can find it through environment variable: [url]http://www.comptechdoc.org/os/linux/usersguide/linux_ugenvironment.html[/url] [CODE]import os print(os.environ.get('HOSTNAME'))[/CODE]

Member Avatar for TrustyTony
0
119
Member Avatar for TrustyTony

By coding algorithm and using some liberal prints with small set of data, you can learn to understand the basic algorithms better than just reading about them. Here simple selection sort.

Member Avatar for TrustyTony
0
217
Member Avatar for dappe

For second one I point you to this other current thread, even there is much better ones, as I want you to have practice to doing it yourself: [url]http://www.daniweb.com/software-development/python/threads/381869/1644529#post1644529[/url] As I have researched anagrams as training project when learning Python myself, I want to wish you luck!

Member Avatar for TrustyTony
0
8K
Member Avatar for Reverend Jim

You have long experience in programming, and it shows. Code optimizes checking brick hits from only one wall, however I feel that using attribute containing all bricks would simplify much the program. You could even calculate crossing point mathematically, direction is changed only at walls and pad, which can be …

Member Avatar for Reverend Jim
0
499
Member Avatar for TrustyTony

How about doing some effort instead of immediately voicing your desperation to Daniweb for 1001st tictactoe problem? Here is some ideas for those young spirits (I did not say newbies ;) ) 1. What is this search box here over in right hand corner? 2. What a heck is this …

Member Avatar for Azmah
4
775
Member Avatar for Wiemers11

Maybe because you set m = len(numberlist) and indexes of numberlist goes until len(numberlist) - 1 (and start from zero). With code tags your code would be much nicer to read.

Member Avatar for TrustyTony
0
212
Member Avatar for JoshuaBurleson
Member Avatar for mhillig1

It never has the first time through as it reads first and if the file does not exist it stops with error message.

Member Avatar for JoshuaBurleson
0
1K
Member Avatar for GeoBob

How about defining dictionary of dictionaries and using the desired names as lookup from that table. Actually the variables of Python are defined that way, one table for globals and other for locals, if I have not understood wrong. See for example documentation of eval function.

Member Avatar for JoshuaBurleson
0
435

The End.