15,181 Topics

Member Avatar for
Member Avatar for mcroni

hi, i have created a drug dispensing client to be used by a pharmacy shop as a project. i need to add a function that can tell whether a drug has expired in the database. Csv was used. any idea how i should go about it. Thanks

Member Avatar for Santanu.Das
0
62
Member Avatar for DragonMastur

I am try to make a program that alows the user to input their username and password to recive a set of options. Right now the options are to look at a file or quit. In order to complete it I need to know how to turn of the visability …

Member Avatar for DragonMastur
0
513
Member Avatar for Gribouillis

Given a unicode string or file, what is the best way to find a short unicode string that is **not** a substring of the first one ? I want a working algorithm that avoids transforming the first string into a list of characters. My first idea is to choose a …

Member Avatar for Gribouillis
0
331
Member Avatar for Kai_Chang

Well this is my basic code for my RPG, can I have help improving it? import cmd import json from rpg_data import * class RPG(cmd.Cmd): def do_n(self, line): try: Me.location = Me.location.exits["north"] except: print("You can't go north") def do_s(self, line): try: Me.location = Me.location.exits["south"] except: print("You can't go south") def …

Member Avatar for vegaseat
0
274
Member Avatar for Niloofar24

Hi again. I want to create a robot or spider or crawler with python urllib. Still couldn't find any good tutorial. Any suggestion?!

Member Avatar for vegaseat
0
420
Member Avatar for Niloofar24

Hi friends. With `datetime.datetime.now()` or `datetime.datetime.today()` i can get the current date (English calendar) for my program but what about if i want to get the current date (from Persian calendar) for my program; then what should i do? As my pc os date is set to English calendar so …

Member Avatar for Niloofar24
0
333
Member Avatar for Niloofar24

Hello. I want to learn python urllib. I have installed it and now looking for a good tutorial, any suggestion?

Member Avatar for Niloofar24
0
279
Member Avatar for Niloofar24

Hi friends! import urllib url = 'http://www.python.org' text = urllib.urlopen(url).read() I have typed the code above on the terminal and in the next line with `print text` an html file printed there. I want to send it to a text file, how can i do that?

Member Avatar for Niloofar24
0
295
Member Avatar for Niloofar24

I want to exchange line 18 text with line 23 lable text, but here line 18 doesn't work in my code? Any idea?! from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.uix.label import Label def timer(): delta = datetime.datetime(2015, 3, 21, 2, 15, 11) - datetime.datetime.now() days = delta.days …

Member Avatar for Niloofar24
0
3K
Member Avatar for Andrae
Member Avatar for Andrae
0
415
Member Avatar for bikash_2

` #Author : Bikash Guragai #versione : 1.0 #email : bikashguragai@gmail.com or bikashguragai@programmer.net import random print ("Hello and welcome") Name = input("What is your name: ") print ("Nice to meet you",Name) ok = input("Click enter to move on") play = input("Lets play a game") b = input("Think of any Any …

Member Avatar for DragonMastur
0
197
Member Avatar for DragonMastur

This is a PyEditor I made because I couldn't get a IDLE working on windows 95.

Member Avatar for DragonMastur
0
418
Member Avatar for DragonMastur

Is it posible to have an optional veriable in a funtion? Such as this: >>>def Say(msg, (optional)): >>> print msg >>> print optional >>> >>>Say('hi', 'option') hi option >>>Say('not') not If so How?

Member Avatar for DragonMastur
1
365
Member Avatar for Soujanya_2

import sys slayer=int(input("enter your guess for SLAYERS:")) count_letters=len(str(slayer)) if count_letters!=6: print('Your guess is incorrect: SLAYER must be a 6-digit number. ') else: new_slayer=3*slayer i=1 while(i<=1000): a=[] a=str((slayer//i)%10) i=i*10 layers=a[1]*100000+a[2]*10000+a[3]*1000+a[4]*100+a[5]*10+a[0]*1 if new_slayer==layers: print('Your guess is correct: ') print('SLAYER+SLAYER+SLAYER=',new_slayer) print('LAYERS=',layers) else: print('Your guess is incorrect: ') print('SLAYER+SLAYER+SLAYER=',new_slayer) print('LAYERS=',layers) I want to store …

0
56
Member Avatar for Andrae

I want to send an email using python. The contents of the message is from a sql querry placed inside a ttk treeview widget. so how do i select and send the selected items? the code below prints (I001) inside the email. # Specifying the from and to addresses self.fromaddr …

Member Avatar for Andrae
0
20K
Member Avatar for Niloofar24

Hello. I have copied these 2 files of code from a website. main.py: from kivy.app import App from kivy.uix.label import Label from kivy.uix.boxlayout import BoxLayout from kivy.clock import Clock from kivy.properties import StringProperty import datetime class Counter_Timer(BoxLayout): def update(self, dt): delta = datetime.datetime(2015, 9, 13, 3, 5) - datetime.datetime.now() self.days …

Member Avatar for vegaseat
0
1K
Member Avatar for biocompute

I have a Tkinter GUI that is composed of two widgets, the first is a widget class with an entry field and a button and the second is a scrollable text widget class. I have combined these two widget classes to make a single GUI. Each of these widget classes …

Member Avatar for vegaseat
0
8K
Member Avatar for davidbr

Hi, I am looking for a little example of making a window visible or invisible. I have a main window with 2 buttons (option1 and option2). If i press option one i open a new window with something else but i want that keep stored in a variable that i …

Member Avatar for vegaseat
0
380
Member Avatar for Niloofar24

Hello friends. I want to create a countdown program for the new year that is comming. I know i can use this code for example, for short certain time: from threading import Timer def sayhi(): print "hello everybody!" t = Timer(10, sayhi) t.start() But the new year begins in 29 …

Member Avatar for Niloofar24
0
820
Member Avatar for kiddo39

I have code that when executed will give me a long list output, which is fine, but how can I get it to print without the parenthesis and commas? example: answer =('7', 'Q', '5', 'H', '9', '4', '3', '8', 'L') but I'd like it to print like this: 7Q5H9438L I …

Member Avatar for TrustyTony
0
31K
Member Avatar for Slyte

Ok, so while practicing python, plotting and quadratic equations - I found this weird behaviour in plotting. The function 'func' defines one of the solution to a quadratic equation. The solution being *0.5(x+1 - sqrt((x+1)^2 - 4x))* And so I tried plotting this value against different x values. I get …

Member Avatar for Slyte
0
191
Member Avatar for bikash_2

import pygal data = [ ["Python", 30.3], ["Java", 22.2], ["C++", 13], ["Ruby", 10.6], ["Javascript", 5.2], ["C#", 5], ["C", 4.1], ["PHP", 3.3], ["Perl", 1.6], ["Go", 1.5], ["Haskell", 1.2], ["Scala", 1], ["Objective-C", 0.4], ["Clojure", 0.2], ["Bash", 0.1], ["Lua", 0.04], ["TCL", 0.03] ] # Make a Pygal chart pie_chart = pygal.Pie() # add …

Member Avatar for Gribouillis
0
128
Member Avatar for gmantsang

I have code that when executed will give me a long list output, which is fine, but how can I get it to print without the parenthesis and commas? example: answer =('7', 'Q', '5', 'H', '9', '4', '3', '8', 'L') but I'd like it to print like this: 7 Q …

Member Avatar for gmantsang
0
265
Member Avatar for sarathsshanker

The code: print [c[i] for c in ['as','df'] for i in range(len(c))] outputs: ['a','s','d','f'] while, print [c[0] for c in ['as','df']] outputs: ['a','d'] - The first letter of each word. shouldn't the output be ['a','d','s','f'] - Why is this different?

Member Avatar for sarathsshanker
0
369
Member Avatar for vegaseat
Member Avatar for juanpa_2510
2
2K
Member Avatar for dannyb270

Hey guys I have a program download link here... (link deleted) This program is used to purchase a pair of sneaker on adidas.com. I am a rookie in coding and have no idea what to do with it. I know it is a python file and you are supposed to …

Member Avatar for dannyb270
-1
421
Member Avatar for ZZMike

I'm new to Python, but have a long background in Perl, Ksh &c, C, and others. """One of the different things about Python is the import statement. How do you tell where a function or class name should be imported from? Some are obvious, like sys and math, but others …

Member Avatar for ZZMike
0
151
Member Avatar for Andrae

I'm working on a program to log the work i do as well as email the monthly log. The problem i'm having is that every time i try to test out the smtp i get an error ` Traceback (most recent call last): File "C:/Users/palmer_a/Documents/App/testy.py", line 5, in <module> import …

Member Avatar for Andrae
0
259
Member Avatar for Niloofar24

Hello. I have a list: mylist = [2,4,4] How can i take number 244 out from the list? Something like: number = 244 Here 244 is integer.

Member Avatar for vegaseat
0
296
Member Avatar for vegaseat

The End.