15,175 Topics

Member Avatar for
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
818
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
Member Avatar for kailashgkg

I am learning python and trying to connect my satellite decoder using telnet. When I tried to connect my device through telnet python script, I could successfully connected to the device. But i want to capture/save as well as read the output and logs of device (connected thru telnet) from …

0
66
Member Avatar for MustafaScript

I started to learn python today by myself using this course: https://www.youtube.com/watch?v=bX3jvD7XFPs&list=PLB2BE3D6CA77BB8F7 Is that a good start? which book for beginners do you recommend ? *the problem with that course is that i found a lots of things in that code i do not understand i need a book which …

Member Avatar for fonzali
0
413
Member Avatar for Niloofar24

Hello again. How can i limit my list indexes? I want my list to take only 3 indexes for example.

Member Avatar for Niloofar24
0
611
Member Avatar for Niloofar24

Hi, me again :) Look at this error please: File "./kivycal-1", line 103, in number_two self.check() TypeError: check() takes exactly 2 arguments (1 given) The error is pointing to here: def number_two(self, event): global numbers numbers.append(2) print numbers self.check() This is a part of a class in a .py file. …

Member Avatar for Niloofar24
0
305
Member Avatar for TObannion

Here is my encryption program. The decryption program is what is giving me some trouble. Here is the description of the first part: # encrypt.py - ENCODE MESSAGE AND WRITE TO FILE # # initialize a cipher list to store the numeric value of each character # input a string …

Member Avatar for TObannion
0
373
Member Avatar for Niloofar24

Hello. mylist = [6, '/', 3, '+', 9, '+', 8, '+', 1, '/', 2] How can i delete that list indexes? I tried: def clear(self, event): global numbers for i in numbers: print i del numbers[i] But it didn't work: File "./kivycal", line 83, in clear del numbers[i] TypeError: list …

Member Avatar for Niloofar24
0
274

The End.