611 Posted Topics
Re: 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] | |
Re: 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. ;) | |
Re: [CODE]>>> d="hello" >>> d[0] 'h' >>> [/CODE] from idle. | |
Re: [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' … | |
Re: Better close this thread and ask your question in Django forum. I will do that if i were you. :) | |
Re: And where is his code..... What has he done so far? | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: [B][COLOR="Green"]Grib[/COLOR][/B] You eat and drink python..! What a man! ;) | |
Re: You dont even need to worry about closing the file. [B][COLOR="Red"]with [/COLOR][/B]does the magic. ;) | |
Re: 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 … | |
Re: [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. ;) | |
Re: well then close the thread my friend ;) | |
Re: And how do you intend to work with this data format? | |
Re: 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. | |
Re: 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 … | |
Re: Get life, Firefox rocks!!!!!!!!!!! ;) Just like my UBUNTU BABY ;) | |
Re: [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. ;) | |
Re: info ;) sys.maxsize also exist in py2.6 | |
Re: can you post your code so far? | |
Re: Look i dont get you friend. Can you explain well again what you want to achieve? | |
Re: I am currently using this module [B]difflib[/B] for a new app i am working on. Nice one. :) | |
Re: 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): … | |
Re: i Think graphics modules is taken more seriously for college guys thank tkinter the main module. | |
Re: 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. | |
Re: hhhmmmmm Slash12.. I think your algo. is too long to solve this case. Refactor i thing is needed. :) | |
Re: your error was expalined i think. no module name regex. [CODE]import re as regex[/CODE] thats if you cant do without regex. ;) | |
Re: All said Grib ! ;) | |
Re: 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" … | |
Re: 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? … | |
Re: 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] | |
Re: 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] | |
Re: 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. ;) | |
Re: 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. | |
Re: Are you looking something like search and replace stuff. I cant get you..... | |
Re: What a mechanized code tonyjv my man. ha ha ha :) | |
Re: [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 ;) | |
Re: 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.... ;) | |
Re: 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 ;) | |
The End.