Posts
 
Reputation
Joined
Last Seen
Ranked #160
Strength to Increase Rep
+10
Strength to Decrease Rep
-2
94% Quality Score
Upvotes Received
107
Posts with Upvotes
94
Upvoting Members
49
Downvotes Received
5
Posts with Downvotes
5
Downvoting Members
4
28 Commented Posts
12 Endorsements
Ranked #136
Ranked #182
~328.13K People Reached
About Me

Working as a business analyst and system designer for financial companies in Hungary.

Interests
Software design, python
Favorite Tags
Member Avatar for isendre

[code] n=6 print "\n".join([str(i+1)+'.'*n for i in range(n)]+["".join(chr(i) if i>=97 else '.' for i in range(96,97+n-1))]) [/code]

Member Avatar for cossy254
1
6K
Member Avatar for Luka_1

Yes. Someone can. But there is [no real automated converter](http://stackoverflow.com/questions/11792529/c-to-simpler-language-python-lua-etc-converter). This task sounds like (boring) work. And work is paid. To get someone to do this you have to motivate them with your own effort. If you write down the specification and the goal of the program, someone will help.

Member Avatar for Adina_2
0
72K
Member Avatar for vegaseat

I hope nobody thinks these algos are used in the real world. There are much better [algos](http://en.wikipedia.org/wiki/Primality_test) to determine if a number is prime. Since the beginning of the 20th century. These functions are good to understand how to program, and how to program in python. They are hardly usable …

Member Avatar for paddy3118
1
2K
Member Avatar for linny_faith

Your teacher is right. If you see lots of lines in the code, that differ from each other only in a few characters, then your code (or your programming language) is inefficient. Please remove globals. They render the code very hard to read. If you use "import \* " then …

Member Avatar for slate
0
630
Member Avatar for vegaseat

Simple RSA primtest. Does not work on universal pseudo primes. [code=python] def isprime(n,PROB): '''returns if the number is prime. Failure rate: 1/4**PROB ''' if n==2: return '1' if n==1 or n&1==0:return '0' s=0 d=n-1 while 1&d==0: s+=1 d>>=1 for i in range(PROB): a=random.randint(2,n-1) composit=True if pow(a,d,n)==1: composit=False if composit: for …

Member Avatar for amir_19
3
24K
Member Avatar for sarfrazashfaq

One solution would be putenv. On linux: abc.py: [code] import os uname="Some uname value" os.putenv("UNAME",uname) os.system("./test.sh") [/code] test.sh: [code] echo $UNAME [/code]

Member Avatar for jaakdentrekhaak
0
5K
Member Avatar for ayushi_3

Beside Gribouillis' explanation. > Although, sounds simple but still not able to understand the concept behind. Core concepts are the most hard things. > I would like to know how they picked up the module sys or how we gonna decide from where we need to import. The author picked …

Member Avatar for hastings.george.5
0
212
Member Avatar for Mark_64

I know, you did not ask, but the program should be more tight (compact). Something like this: import random def main() : tie_message="It's a draw. You both threw %s." win_message="You win! Your opponent threw %s." lose_message="You lost. Your opponent threw %s." values=("rock","paper","scissors") # must be in increasing beating order while …

Member Avatar for slate
0
296
Member Avatar for Jeah_1

Good luck! from random import randint def guess(): if int(input("Guess the number (1-10):"))==randint(1,10): print("Got it") else: print("Wrong!") guess() guess()

Member Avatar for slate
0
175
Member Avatar for Saif_6

You did not mention any reason that justifies creating a new tkinter mainloop. So take a look at these: http://tkinter.unpythonic.net/wiki/ModalWindow http://effbot.org/tkinterbook/tkinter-dialog-windows.htm You can make FirstScreen a modal toplevel window. If you want to keep the functionality to run the FirstScreen separately, then you can put it in a module (separate …

Member Avatar for slate
0
606
Member Avatar for Lucas_10

First try to make a version of it, that actually can be run by others. If I copy-paste your code into notepad, then save it, it does not run. I would recommend the following improvements after that: * Place imports at the top * Remove global variables, get rid of …

Member Avatar for Lucas_10
0
348
Member Avatar for wine_1

> I am not very clear about what does this mean, my original understanding is that x will keep data's first two dimensions, and take a slice from data on the third and fouth dimension. It keeps the first and fourth dimension and slices the two inbetween. `x=data[:,c:-c,d:-d]` The first …

Member Avatar for slate
0
278
Member Avatar for Mengchen

I/ if you import everything from turtle, like this: `from turtle import *` Then you cannot make statements like this: `point = turtle.Point(x,y)` You should do: `import turtle` II/ allTriMedian function is never called. So it is never executed. You should call it like: `allTriMedian()` III/ There is no Point …

Member Avatar for slate
0
984
Member Avatar for Gowda_1

Google is your friend. https://www.google.hu/search?q=python+smtplib+tutorial+gmail First hit: http://naelshiab.com/tutorial-send-email-python/ Which sais: [ EDIT: Gmail made some security change change recently. You now have to allow “less secure apps” on your account. Otherwise, you won’t be able to connect to it with your python script. ]

Member Avatar for Lucas_10
0
607
Member Avatar for Tim_10

* You are not adding up the even cubes. You are adding up all cubes of numbers between 0 and natn-1.Look up [range documentation](https://docs.python.org/3/library/functions.html#func-range), how to generate even numbers. * Average is sum divided by count. You can count the numbers by (python3): add = 0 counter=0 for i in …

Member Avatar for tinstaafl
0
378
Member Avatar for Amber_6

I do not understand. * Do you want to draw the maritime flag images using turtle graphics or you want to put the downloaded flag images on a canvas? * What is the expected output of the function?

Member Avatar for slate
0
300
Member Avatar for Pandey_1

python3: import tkinter as tk master = tk.Tk() menu={'pizza':1,'Burger':1,'sandwitch':0} menuvars={} for row, (key, value) in enumerate(menu.items()): menuvars[key]=tk.IntVar() menuvars[key].set(value) tk.Checkbutton(master, text=key, variable=menuvars[key]).grid(row=row, sticky=tk.W) tk.mainloop()

Member Avatar for slate
0
177
Member Avatar for Pandey_1

> How to make panel in tkinter or which widget will be used to hide and show checkbox? I am not sure, I understand this sentence. Something about the keywords "widget" and "hide" http://effbot.org/tkinterbook/pack.htm#Tkinter.Pack.pack_forget-method

Member Avatar for Pandey_1
0
362
Member Avatar for Pandey_1

Line 46: v = IntVar() ** v goes out of scope.** If you bind v to something persistent (self), then it works. How did you plan to read that variable anyway?

Member Avatar for Pandey_1
0
7K
Member Avatar for bob_15

Yes. There is a way to convert it to a GUI based program. Before you do that, I would recommend: * Make a self containained version, so others can run it. That helps you to get help. * Make the program shorter. At first glance the program can be reduced …

Member Avatar for slate
0
704
Member Avatar for zero_1
Member Avatar for engrjd91

Hello there! Short version: I do not understand the question. Long version: My eagle eye detected you posting the [second](https://www.daniweb.com/programming/software-development/threads/504480/python-comparing-two-values-of-lists-) question about the same project. This should be a very secret project. If you would tell us what this is about, we could provide much more help. However your code …

Member Avatar for slate
0
258
Member Avatar for grand_78

Please post a working code, to help others. Try to copy-paste your own posted code into a .py file and see, that it does not work. There is a syntax error, not just intendation problems. The mainloop call is missing, too. I have corrected the code, and hopefully solved your …

Member Avatar for slate
0
231
Member Avatar for Mickey_2

You use global imported variables locally. There is no need to pass ScrolledText and Tk to the Scratchpad class's dunder init. This is redundant. This is the same, but cleaned up: from tkinter import Tk, END, INSERT from tkinter.scrolledtext import ScrolledText from tkinter.filedialog import asksaveasfilename, askopenfilename class Scratchpad: def __init__(self): …

Member Avatar for John_103
0
301
Member Avatar for zero_1

class Date(object): def __init__(self, year, month, day): self.year=year self.month=month self.day=day def __add__(self, other): if not isinstance(other,Delta): raise Exception("can only add Delta object") #FIXME handle the calendar year=self.year+other.year month=self.month+other.month return Date(year,month,self.day) def __str__(self): return "("+",".join(map(str,(self.year,self.month,self.day)))+")" class Delta(object): def __init__(self, year, month): if not (1<=month<=12) or year<0 or \ not isinstance(year,int) or …

Member Avatar for zero_1
0
315
Member Avatar for firdevs

Besides from [whathaveyoutried.com](whathaveyoutried.com) , I can only say: values=[int(input("Give the number(%s): " % i)) for i in range(1,6)] print("Highest: {} \n Lowest: {} \n Average: {}".format(max(values),min(values), sum(values)/len(values))) But beleve me. You should try something.

Member Avatar for slate
0
158
Member Avatar for Mickey_2

I think the most used layout for tkinter is grid. So grid paper and pen. I know, this is not software. [Others](http://stackoverflow.com/questions/14142194/is-there-a-gui-design-app-for-the-tkinter-grid-geometry) recommend that, too.

Member Avatar for slate
0
127
Member Avatar for j.parkerrrr

Here you are. I hope, this makes you a really good programmer. f=open("states.txt").readlines() states=sorted([(f[i].strip(),f[i+1].strip(),int(f[i+2])) for i in range(0,len(f)-3,3)],key=lambda x:x[2]) print("minimum population:",states[0]) print("maximum population:",states[-1])

Member Avatar for slate
-2
358
Member Avatar for Subin raj
Member Avatar for rebekah.stacy1

Python3 nums=[(int(input("Give me the number numero {}: ".format(i+1)))) for i in range(20)] print("Lowest: {}\nHighest: {}\nTotal: {}\nAverage: {}".format(min(nums),max(nums),sum(nums),sum(nums)/len(nums))) I hope that makes you smarter.

Member Avatar for vegaseat
0
525