4,305 Posted Topics

Member Avatar for sneekula

In the news lately: Google seems to take this endless virus check stuff serious. Their new Google Chrome OS is supposed to be safe from virus trespass. .

Member Avatar for vegaseat
0
230
Member Avatar for iliketacos

[QUOTE=iliketacos;906567]nevermind i got it i forgot to specify len(post) in parse[/QUOTE]Thanks for letting us know!

Member Avatar for vegaseat
0
117
Member Avatar for jlm699

[QUOTE=jlm699;906499]Nope, sorry same thing. You're saying that link allows you to download 2.8 and it works? Then maybe I [B]AM[/B] crazy, because it still takes me to the "older versions" (2.7 and earlier) page. Yes, this is exactly what I'm experiencing. So maybe I'm [B]NOT[/B] crazy?![/QUOTE]You are not crazy, or …

Member Avatar for vegaseat
0
221
Member Avatar for gianniszaf

This might be a little simpler ... [code=python]data = """\ dasj dhsahdwe dhasdhajks ewqhehwq dsajkdhas edward das dsaw das daswf fjdk ewf jken dsajkw dskdw hklt ewq vn1 daskcn daskw """ # find the length of the longest word and add 2 length = max(len(w) for w in data.split()) + …

Member Avatar for vegaseat
0
553
Member Avatar for Zetlin

You can simply modify your code a little ... [code=python]test = open("Hello_World.txt", "w") test.write("Hello World!") test.close() test = open("Hello_World.txt", "r") print test.read() test.close() print '-'*20 test = open("Hello_World.txt", "a") # add the newline char in front test.write("\nhello world!") test.close() test = open("Hello World.txt", "r") print test.read() test.close() """ my result …

Member Avatar for Zetlin
0
249
Member Avatar for Jonx

Thanks shadwickman for your thoughts. Using C:/python26/stuff/bg.jpg with the Windows OS would be recommendation too.

Member Avatar for vegaseat
0
2K
Member Avatar for kes_ee

Here is an example for the use of deepcopy with a nested list. First without ... [code=python]# a nested list list1 = ['a', 'b', 'c', 'd', [1, 2, 3]] list2 = [x for x in list1] # now replace 2 with 77 in list1 list1[4][1] = 77 print(list1) # ['a', …

Member Avatar for vegaseat
0
130
Member Avatar for Grn Xtrm
Member Avatar for Flyin dagger

Did Obama cause the drop in the US stockmarket? Maybe, there was a similar drop in 2002 after W took over. It still doesn't explain why the Japanese stockmarket went through the same decline a few months earlier.

Member Avatar for Aia
0
783
Member Avatar for dello

The simplest way is to do it in a do ... while() loop like this: [code=cplusplus]// Dev C++ #include <cstdlib> #include <iostream> using namespace std; int main() { int n; // keeps looping until a number < 100 is entered do { cout << "Enter an integer number (< 100): …

Member Avatar for Sky Diploma
0
360
Member Avatar for funfullson

The py2exe module does not compile to an executable. It packages your Python bytecode files, other needed files and the Python interpeter to run from an executable file. At this point py2exe is not yet out for Python3.

Member Avatar for shadwickman
0
113
Member Avatar for freddiecool

Actually an interesting project that combines images and text information. I would use a record like structure easily implemented by a class ... [code=python]# -*- coding: cp1252 -*- # My encyclopedia. # An interactive encyclopedia which shows # pictures and information about them. import Tkinter as tk from PIL import …

Member Avatar for freddiecool
0
174
Member Avatar for Your_mum

I took the liberty to use sneekula's test setup ... [code=python]# a test setup for pickle dump and load # note that pickle does not save the class itself # if the dumped data file is used in another program, # you need to code a matching class in that …

Member Avatar for leegeorg07
0
575
Member Avatar for tomtetlaw

[QUOTE=tomtetlaw;906936]Thanks guys, it turns out that I had to only put the function name, not call the function. :)[/QUOTE]Better test it, that won't work!

Member Avatar for lllllIllIlllI
0
131
Member Avatar for Your_mum

If you are using Python2 ... [code=python]import urllib pagetext = urllib.urlopen("http://www.python.org").read() print pagetext [/code]For Python3 use ... [code=python]import urllib.request pagetext = urllib.request.urlopen("http://www.python.org").read() print(pagetext) [/code]

Member Avatar for vegaseat
0
129
Member Avatar for MosaicFuneral

Jif low fat extra chrunchy. My choosy mom picked it out! Tastes good as long as you don't put any Smucker's Jelly on it! Actually, I like Trader Joe's Almond Butter better, but I have to hide it from my students.

Member Avatar for jephthah
0
392
Member Avatar for johndoe444

I used IDLE and Python25, for some odd reason IDLE takes unicode best. Looks like regex works fine, but the resulting string escapes the escape ( '' turns into '\' ) ... [code=python] # -*- coding: cp1252 -*- # fiddling with unicode import re def func(mylist): for e in mylist: …

Member Avatar for The_Kernel
0
168
Member Avatar for amrith92

Ghosts exist only in a person's mind. Pretty harmless thing most of the time. Odd stuff happens and one has to explain it somehow.

Member Avatar for jephthah
1
347
Member Avatar for joshSCH

[QUOTE=jbennet;477363]fart isnt a bad word, its socially acceptable.[/QUOTE]Not quite sure what it has to do with immigration, I prefer "passing wind" or "singing the backdoor song"

Member Avatar for GrimJack
1
1K
Member Avatar for grisha83

I think there is a Python plugin available for NetBeans. Another good IDE is DrPython that is wxPython based, clean and quick, and works on Windows, Linux, and Mac Unix.

Member Avatar for vegaseat
0
104
Member Avatar for starsinthesky

Write the basic architecture of a new Operating System that would be secure from virus attack.

Member Avatar for starsinthesky
0
100
Member Avatar for ndeniche

I have met a fair number of intelligent women in my life, good looks and all. Invariably, the men they were interested in were the physical type, sort of SS troopers on steroids. That left me out in the cold! Maybe I am just lucky!

Member Avatar for ditz
0
1K
Member Avatar for tomtetlaw
Member Avatar for Your_mum

@Your_mum Firstly, welcome to our Python community. Secondly, I recommend to create a new thread when you have a different question. Also. please be a bit more specific about the thread title.

Member Avatar for Your_mum
0
91
Member Avatar for sravan953

If you have a Linux/Unix machine then you can use module termios ... [code=python]# get a character without pressing Enter # see http://www.daniweb.com/forums/post898236-3.html import termios # linux/unix Python installations only def getkey(): fd = sys.stdin.fileno() old = termios.tcgetattr(fd) new = termios.tcgetattr(fd) new[3] = new[3] & ~termios.ICANON & ~termios.ECHO new[6][termios.VMIN] = …

Member Avatar for scru
0
493
Member Avatar for ckaiser813

[QUOTE=tomtetlaw;901181]So input() in python 3 returns a string?[/QUOTE]Yes, that's what a quick look in the manual will tell you.

Member Avatar for jlm699
0
126
Member Avatar for Jintu

[QUOTE=wildgoose;900287]Are you using a 32-bit compiler or a 16-bit? If 16-bit then you have a problem! 100000000 is 05f5e100 in hex requiring 32-bits to store. Since you are being signed due to the -1, It seems a Highes score of 32767 would be a more suitable test, IFF you are …

Member Avatar for vegaseat
0
141
Member Avatar for dude93

If you are filthy rich, you can buy "Programming in Python3" by Mark Summerfield. That book has plenty of exercises at the end of each chapter. The book promisses to have "extensive downloadable example code" on the back page, so far I have not found it!!!!

Member Avatar for vegaseat
0
114
Member Avatar for tomtetlaw
Member Avatar for vegaseat
0
159
Member Avatar for scru
Member Avatar for jbennet
0
332
Member Avatar for sravan953

Remember, using Microsoft's msvcrt.dll dynamic link library makes your program specific for the Windows OS.

Member Avatar for vegaseat
0
129
Member Avatar for winmic
Member Avatar for sravan953

Think about this, You want to start with a line of 9 spaces and one '*' , the second line is 8 spaces and two '*' and so on, with the last line zero spaces and ten '*'. So you have to decrease the space counter and increase the '*' …

Member Avatar for vegaseat
0
96
Member Avatar for tomtetlaw

The temporary sys.path.append() specific to your program is probably the best solution in your case.

Member Avatar for vegaseat
0
158
Member Avatar for poeticinsanity
Member Avatar for hughesadam_87

The main idea about using module glob is to look for specific files. If you give glob a more specific wildcard like '*.jp*' then it will only list .jpg or .jpeg files and not subdirectories. The way you are using glob makes little sense and you might better use os.listdir(folder).

Member Avatar for vegaseat
0
154
Member Avatar for iambinary

The function print() is part of the core of Python (Python25 and Python30) It simply prints to the console what you put into its parameter: [code=python]print(2 + 3) pi = 355/113.0 print(pi) print("pi = %0.4f" % pi) print('Helen') print('') s1 = 'Jim is ' x = 24 s2 = ' …

Member Avatar for vegaseat
0
116
Member Avatar for gislik

Here is a typical wxPython template you can start with ... [code=python]# a wxPython general frame and button template # click the button and show a string in a label import wx class MyFrame(wx.Frame): def __init__(self, parent, mytitle, mysize): wx.Frame.__init__(self, parent, -1, mytitle, size=mysize) self.SetBackgroundColour("yellow") # self allows path to …

Member Avatar for vegaseat
0
135
Member Avatar for sravan953

I used to program with Delphi for many years, pretty much the original RAD. It used object Pascal and had a great form designer. Lots of folks supplied components/widgets for it. However, Borland started screwing around with it, bringing out expensive new versions frequently, making older versions incompatible to cash …

Member Avatar for sneekula
0
2K
Member Avatar for Jintu

Just a note to remind you that range(start, stop, step) has a step option, so you could have used ... [code=python]for celsius in range(0, 101, 2): fahrenheit = 1.8 * celsius + 32 print ('%0.2f %0.2f' % (celsius,fahrenheit)) [/code]All in all, nice clean coding style. Hope you enjoy your Python …

Member Avatar for vegaseat
0
231
Member Avatar for bluetie

Give us a short code of what gives you problems, and we could actually help.

Member Avatar for vegaseat
0
77
Member Avatar for sravan953

With wxPython your input() and raw_input() are done with the wx.TextCtrl() widget and you need to bind the return key or use a button widget. Also, wxPython has its own timer. Also, do all of us a favor and don't use those horrible "8 space tabs" for indents!

Member Avatar for Stefano Mtangoo
0
231
Member Avatar for rustysynate

Let's hope your code does not look like the one you showed. Try to run just this ... [code=python]import wx [/code]If a similar error message comes up, then there is something wrong with your wxPython installation.

Member Avatar for rustysynate
0
176
Member Avatar for rustysynate
Member Avatar for rustysynate
0
156
Member Avatar for The Champ

In Python you don't have to initialize a list. You simply start with an empty list and append to it ... [code=python]print "You are asked to enter ten 2 digit integers ..." # an empty list to start with mylist = [] for k in range(10): print k + 1,') …

Member Avatar for shadwickman
0
107
Member Avatar for sravan953

Here is the poop ... [code=python]# getpass works in the Windows Console itself # and does not echo the password as it is entered: # (does not work in DrPython or IDLE output windows) import getpass #usr = getpass.getuser() usr = "Frank" pwd = getpass.getpass("enter password for user %s: " …

Member Avatar for sneekula
0
2K
Member Avatar for Surge591

This is an example on how to run Python code externally ... [code=python]# pipe the output of calendar.prmonth() to a string: import subprocess code_str = \ """ import calendar calendar.prmonth(2006, 3) """ # save the code filename = "mar2006.py" fout = open(filename, "w") fout.write(code_str) fout.close() # execute the .py code …

Member Avatar for vegaseat
0
2K
Member Avatar for aakaashjois

For wxPython you can use: Boa Constructor or wxGlade wxGlade comes as a tool with Stani's Python Editor (SPE), a very nice wxPython based IDE that can be downloaded from: [url]http://developer.berlios.de/project/showfiles.php?group_id=4161[/url] PyQT installs with a designer program that is pretty good I hear.

Member Avatar for shadwickman
0
133
Member Avatar for tiger86

Wonderful project! Study C++ in detail and then move to GUI programming with C++. I expect your first game out in about five years.

Member Avatar for vegaseat
0
203
Member Avatar for andriod

[QUOTE=andriod;895804]Well the book that I have is called "How to think like a Computer Scientist: Learning with Python" Printed in 2002. The version of Python on my computer is Python 3.0 IDLE(GUI). What version would you say the example that I posted from the book is in? Thank you[/QUOTE]If you …

Member Avatar for andriod
0
134

The End.