611 Posted Topics

Member Avatar for Boubakr

try this [CODE]import time before = time.time() print("Started time stamp"),time.ctime(before) somme = raw_input('1 + 1 = ') if somme.strip() == '2': diff = time.time() # time difference in seconds as a floating point number print("ended time: "),time.ctime(diff) print("Time diff in seconds :"),diff-before [/CODE]

Member Avatar for richieking
0
167
Member Avatar for saransh60

well said ;) Also d is just there to show the type of variable the method can use. int,char,float ...etc. But in python variables types are not much worried about since python takes care of that. ;)

Member Avatar for vegaseat
0
142
Member Avatar for Thropian
Member Avatar for Enders_Game

[QUOTE]Im not too familiar with http so what is the key I want to use for the values dict for that line? topic_title? or input_text?... I dont wanna brute force it because people might get angry at like 20 test threads lol.[/QUOTE] the Dict keys are [CODE] <input id='topic_title' class='input_text' …

Member Avatar for snippsat
0
224
Member Avatar for meensatwork
Member Avatar for oooooops
Member Avatar for richieking
0
467
Member Avatar for vik.singh
Member Avatar for woofers

As Grib said. Its always a good idea to overide and declare just after the [CODE]def __ini__()[/CODE] Not only for threading but all. It will save you from pain. Also i will like an open server binding. line 31. with that, the server can be used any where. Secondly, client …

Member Avatar for woofers
0
147
Member Avatar for nima3188
Member Avatar for altXerror

Because text your classs for text2 is wrong. Try this.. (text2.py) [CODE] class Text(object): ## object not very important. you can remove that. def text(self): return("Hello world") [/CODE] now call text2.py class. (text1.py) [CODE] from text2 import Text hello = Text() print hello.text() ##output Hello world [/CODE] Very simple. I …

Member Avatar for richieking
0
118
Member Avatar for woofers

Well i think your code here is not complete to trace all the errors. But The global name display is a method . so do this where ever you call the display method. [CODE] display() # This will call a function dispaly(). Note that display is not the same as …

Member Avatar for woofers
0
157
Member Avatar for ddndd
Member Avatar for Gribouillis
0
16K
Member Avatar for rssk

You dont even need to worry about closing the file. [B][COLOR="Red"]with [/COLOR][/B]does the magic. ;)

Member Avatar for snippsat
0
132
Member Avatar for hema dhevi.N

This is possible in python my friend. [CODE] alist=["one","foo","spam","more","spam",1,5] # to Add alist.append("bingo")## to add to the last slot alist.insert(3, "three")# Insert to where you wantt. eg in C alist[3]="three" print(alist) ##Out Put ['one', 'foo', 'spam', 'three', 'more', 'spam', 1, 5, 'bingo'][/CODE] Play around with python list. This is the …

Member Avatar for TrustyTony
0
2K
Member Avatar for dougn

[CODE]wx.TextCtrl(panel,-1,style=wx.TE_MULTILINE|wx.TE_RICH2)[/CODE]wxpython will save textctrl as text format. It will keep basic formating like indentaions,spaces, etc. But to save to doc,docx or other format. You will have to convert to that format. ;)

Member Avatar for dougn
0
167
Member Avatar for pixeldroid
Member Avatar for kailashbuki
Member Avatar for fredfredfred
Member Avatar for r3bol

A proper build server will no just give access to its directories. There must e some checks here and there. You will also need the [B]ftplib[/B]. I think thats your best hit.

Member Avatar for richieking
0
80
Member Avatar for iwanttolearnc

Just refactored...... [CODE]import matplotlib.pyplot as mpl import numpy as npy # Redundant imports import os # import sys # import string # def isFloat(flt): try: float(flt) return True except ValueError: return False fileopen = open ('output.txt' , 'r') filelist = fileopen.readlines() angle = [] timeset = [] for onefile in …

Member Avatar for shibby
0
945
Member Avatar for lewashby
Member Avatar for happygeek
Member Avatar for FAITH2011

[QUOTE]pygame.image.load('player.png')[/QUOTE] Give the fullpath to the image file ok ?[CODE]pygame.image.load('fullimagepath')[/CODE] Then forget about the sys.path.append() stuff. image is not a module. ;)

Member Avatar for richieking
0
153
Member Avatar for -ordi-
Member Avatar for superhe
Member Avatar for rssk
Member Avatar for foren

Look i dont get you friend. Can you explain well again what you want to achieve?

Member Avatar for olaji
0
95
Member Avatar for romes87
Member Avatar for richieking
0
910
Member Avatar for linux

well as [B]Grib[/B] is found of helping.... I like his idea. basics will work like this.... [CODE] class Hero: def __init__(self,name,size,strenght): self.name=name self.size=size self.strenght=strenght def foo(self): pass # contains methods common to all heroes ... class Lord(Hero): def __init__(self,foo,bar): Hero.__init__(self,foo,bar) pass # contains methods specific to Lords ... class MainHero(Lord): …

Member Avatar for richieking
0
5K
Member Avatar for Blackberryy

i Think graphics modules is taken more seriously for college guys thank tkinter the main module.

Member Avatar for richieking
0
2K
Member Avatar for Nassarofficial
Member Avatar for vbx_wx

Why cant you calculate the time interval for the shows and know how long a show takes so that you can provide how many minutes left for a show to end and start of a new show. Very easy and handy it will.

Member Avatar for richieking
0
85
Member Avatar for kylpi07
Member Avatar for JJHT7439

hhhmmmmm Slash12.. I think your algo. is too long to solve this case. Refactor i thing is needed. :)

Member Avatar for TrustyTony
0
334
Member Avatar for bob24bob

your error was expalined i think. no module name regex. [CODE]import re as regex[/CODE] thats if you cant do without regex. ;)

Member Avatar for TrustyTony
0
187
Member Avatar for yond
Member Avatar for qingmui

Try this fancy one. [CODE]def chec(sa): data=[]; #make a list for x in sa: data.append(x.lower()); #pack the result into the list d1 ,d2 =(data[0], data[-1]); if d1 == d2: #check up the results print d1 ,d2 , "are the same"; else: print d1 , d2 , "are not the same" …

Member Avatar for vegaseat
0
780
Member Avatar for novice20

Happy Newyear. This is your newyear gift. [CODE]str="4:14.4-17M,5:14.4-2e13M,6:14.4-4e9M,7:14.4-8e,22:28.4-35M,\ 23:28.4-2e30M,24:28.4-4e26M,25:28.4-8e18M,26:28.4-16e2M,27:28.4-18e,\ 28:14.16-36M,29:14.16-2e32M,30:14.16-4e28M,31:14.16-8e20M" d=[c for c in str.split(",")] print([int(f.split(":")[0]) for f in d ]) ##out Put [4, 5, 6, 7, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31] [/CODE] And if you like it. you can upvote me a lil ok? …

Member Avatar for novice20
0
109
Member Avatar for vik.singh
Member Avatar for FreezeBlink

why not also in wxpython.... [CODE]import wx app=wx.App() msg= wx.MessageBox("Are you sure you want to quit?","Press yes To quit",style=wx.YES_NO) if msg == wx.ID_OK: msg.Destroy()[/CODE]

Member Avatar for richieking
0
14K
Member Avatar for rotexhawk

Take this [CODE]ad =[[x for x in range(1,10,2)],[w for w in range(2,20,3)]] print(ad) ## out put [[1, 3, 5, 7, 9], [2, 5, 8, 11, 14, 17]] [/CODE]

Member Avatar for djidjadji
0
213
Member Avatar for linux

PIL uses image Magic on linux system. Images can be printed out even from the cmd very simple. There will only be a popup window. eg. [CODE] From PIL import Image im = Image.open("path","r") im.show() [/CODE] This simple pseudo will show the image. ;)

Member Avatar for richieking
0
4K
Member Avatar for hughesadam_87

Dic data can be sorted even if it conytain lists in list. But you have to sort them out yourself. They are not sorted automaticaly.

Member Avatar for djidjadji
0
377
Member Avatar for LogicallyInsane

Are you looking something like search and replace stuff. I cant get you.....

Member Avatar for vegaseat
0
120
Member Avatar for dbphydb
Member Avatar for novice20
Member Avatar for felix001

[CODE]elif outputDic.has_key(keyIndex) == True:[/CODE] No need for True keyword. You can do this without the keyword True as If statement defaults to true. simply... [CODE]elif outputDic.has_key(keyIndex):[/CODE] Also helps ;)

Member Avatar for TrustyTony
0
115
Member Avatar for sravi.pearl

You will need the API for notepad python bindings. Its not like the webbrowser. Or write your own notepad in 1 hour or less. Or a basic GUI to display your data for 10-20 munites. wxPython baby.... ;)

Member Avatar for richieking
0
2K
Member Avatar for KSS

There are already E-COM ready to go sites out there. Google free shoping/ecommerce builder . Get that change one or two stuffs and you are ready to go in a day. They are mostly php stuff. Happy coding ;)

Member Avatar for jkon
0
125
Member Avatar for Thisisnotanid

The End.