Posts
 
Reputation
Joined
Last Seen
Ranked #57
Strength to Increase Rep
+14
Strength to Decrease Rep
-3
92% Quality Score
Upvotes Received
916
Posts with Upvotes
812
Upvoting Members
325
Downvotes Received
66
Posts with Downvotes
60
Downvoting Members
38
192 Commented Posts
~3.76M People Reached
About Me

IT Pro doing Eng-Fin-Eng translations

Interests
Family values, world peace, translation, Python
PC Specs
Asus i7-3770 @ 3.4 GHz, 8 GB, 1.5 TB / TUF Gaming 10th gen laptop
Favorite Tags
Member Avatar for deepakgupta2186
Member Avatar for masocha

Paste a piece of code which is unclear to you and we can clarify it's meaning in pseudocode. Do not post externally, but include as normal attachment or preferably just code block. The files in your rar file seemed to be OK, except wrong file types and one of the …

Member Avatar for Mike_106
0
6K
Member Avatar for isendre

Post your code and we will check it out. It is not very hard if you keep your head straight! If you have learned about dictionaries, simplest to operate with is to index dictionary like: board['b2'] or board['b',2] and get user input like: b2, 4

Member Avatar for cossy254
1
6K
Member Avatar for RoqueyB

Your display routine is at least too complicated and line 12 does not make sense. Same shorter: [CODE]def count(sticks): print("* %s *" % (sticks * '|')) count(33) [/CODE] Indents of lines 64 and 65 does not make sense. I see for example "How many sticks would you like to pick …

Member Avatar for Ben_493
0
9K
Member Avatar for colby.christensen

[Here](http://matrixprogramming.com/2011/03/linear-solve-in-python-numpy-and-scipy) for example is one example about solving by Gaussian elimination with numpy/scipy with reference to LAPACK libraries. Scipy also has matrix IO routines: http://docs.scipy.org/doc/scipy/reference/tutorial/io.html You might like to install Enthought Canopy Python which has numerous libraries ready installed: https://www.enthought.com/products/canopy/

Member Avatar for Reverend Jim
0
4K
Member Avatar for WolfShield
Member Avatar for markusd5454

[code] # program that checks that the username and password are correct # username = input("Please enter your username : ") password = input("Please enter your password : ") print ("Greetings," , username, "you are now logged in now with a password") command = input("Please type a command :") if …

Member Avatar for Reverend Jim
0
86K
Member Avatar for guidely

n is undefined. I do not understand your int statement. I would index a tuple of the values instezd of nested if.. Sorry but mobile posting is not working at the moment correctly. Could you post the error you are getting and how you are using the function.

Member Avatar for Sukant_1
0
18K
Member Avatar for pelin

You are missing essential part calling the main! Otherwise it looks like working, even input is in text window.

Member Avatar for Devarshi_1
0
628
Member Avatar for Peter_TARAS

I do not know pack method so well, but here is how I do it with pack: [CODE]from Tkinter import * import tkFont def killme(): root.quit() root.destroy() root=Tk() dFont=tkFont.Font(family="Arial", size=30) lb=Text(root, width=16, height=5, font=dFont) lb.pack(side=LEFT, fill=BOTH, expand = YES) yscrollbar=Scrollbar(root, orient=VERTICAL, command=lb.yview) yscrollbar.pack(side=RIGHT, fill=Y) lb["yscrollcommand"]=yscrollbar.set root.mainloop() [/CODE]

Member Avatar for bevis.hobbs
0
22K
Member Avatar for daviddoria

I do not get the problem, only I got not found error from mag function found in code, so I replaced it with distance from origin. I did some renaming to make the program more "PEP8 understandable" [CODE]from __future__ import division from math import * class Point(object): def __init__(self, x=0.0, …

Member Avatar for Ratan_2
0
6K
Member Avatar for vegaseat

OK, here is a really optimized version for this classic problem. This is not originally mine (but have done very similar). It utilizes the fact that primes > 4 are 1(mod 6) or 5(mod 6). Actually I editted it a lot now before posting to be more according to format …

Member Avatar for amir_19
3
24K
Member Avatar for Iceman10284

So you have not learned the syntax, good place to start to learn it is to go through the tutorial at http://docs.python.org/tutorial/index.html

Member Avatar for UNIQUE_PRINCE
-1
4K
Member Avatar for tjsilver

I would prefer to have functions themselves as first value and just call it instead of using eval. be sure to rename the functions according to choice. Best naming would be to use verb and if need to join words in name use _. Do not use capital letters.

Member Avatar for August.Garcia
0
3K
Member Avatar for vegaseat

That is because unnecessary update of the screen weakens the quality of the display. Maybe not, or only with slower computer, but it is good practice to avoid unnecessary refresh. Especially when you do more action on screen than just changing number.

Member Avatar for Vinay_17
2
26K
Member Avatar for sarfrazashfaq

Please include the error messages. The variable must of course be global variable in the python file. At least saving the value to text file to be read by the script should work.

Member Avatar for jaakdentrekhaak
0
5K
Member Avatar for Fo.katia
Member Avatar for abders

Gribouillis means that obviously those two functions have no business in being in the class Player. Interestingly I have exactly same functions in module called games for a Blackjack game from one book, without the class Player. in range(low, high) is not the world's most efficient way to check value …

Member Avatar for Kaushik_2
0
986
Member Avatar for abders

Why you are not calling the mainloop at last line? Shouldn't the parameter to parent init be self?

Member Avatar for Gribouillis
0
2K
Member Avatar for TrustyTony

This is one small snippet of after event usage. You could express if you find this kind of simple code to be usefull as snippet. Notice also vegaseat's sticky message threads in begining of Python forum in addition to code snippets.

Member Avatar for Gribouillis
0
5K
Member Avatar for thinkerman

Agreed, WaltP. As example, here is what Code::Blocks AStyle plugin makes out of your code #include<iostream> #include<cstdio> #include<conio.h> using namespace std; int weight[20][20],visited[20],d[20],p[20]; int v,e; void creategraph() { int i,j,a,b,w; cout<<"Enter number of vertices: "; cin>>v; cout<<"\nEnter number of edges: "; cin>>e; for(i=1; i<=v; i++) for(j=1; j<=v; j++) weight[i][j]=0; for(i=1; …

Member Avatar for Aiman_1
0
1K
Member Avatar for sheltask

What was the best program you have done this far? Of course you have to do some kind of design of the program algorithm first and be able to do the task yourself and able to list all steps of it before teaching the computer to do it. Are you …

Member Avatar for Less_1
1
823
Member Avatar for vegaseat

Are you sure that you initialize the midi system like in this snippet before playing the file?

Member Avatar for Rufus_1
5
12K
Member Avatar for ruwach

Everything should work as long as you replace the print command with print function, manually or by 2to3. More shortly: [CODE]# find the last line, change to a file you have with open('test.txt') as myfile: print (list(myfile)[-1]) [/CODE]

Member Avatar for gunjan_3
0
63K
Member Avatar for vegaseat

Of course it could be considered user responsibility, but I do not personally like that the calculator does not allow to continue from result and saves formula to memory instead of evaluating the result automatically. For example: 10/3 M-> = result: 3.333333 * M<- = result: *10/3.0first char not in …

Member Avatar for Charles_24
5
10K
Member Avatar for Gribouillis

Is that 3.2 3.2.2 as there was an issue with input statement with 3.2.1? Probably not reason though, at that problem would make program OK in IDLE and not OK in direct excecution.

Member Avatar for Gribouillis
5
75K
Member Avatar for tjy92

Good luck, we are always ready to help, you only have to post in your code and explain where you have difficulty.

Member Avatar for Reverend Jim
0
3K
Member Avatar for sandman64

Are you sure you need while for this job. BTW it has no else part not to talk about elif. And in you new version while condition is always True as <condition> or -2 is always True.

Member Avatar for Swathi_4
0
218
Member Avatar for Viasur

Would it maybe easier to use my code snippet for text file based database (actualy card file would be more proper term)

Member Avatar for Gribouillis
0
4K
Member Avatar for tkpanther

M+ does addition to existing contents in memory, MS stores there [CODE] M+ =+ MS =[/CODE]

Member Avatar for Gribouillis
0
22K