4,305 Posted Topics

Member Avatar for Alok_3
Member Avatar for ddanbe

You can claim, but the rub is that you have to be willing to defend your claim in a court of law at great expense.

Member Avatar for ddanbe
0
280
Member Avatar for pyguy25

[code]s = "abcdefg\n" print s print '-'*10 # strip off trailing '\n' char s = s.rstrip('\n') print s print '-'*10 [/code]

Member Avatar for FaZeSkwlSh00ter
0
7K
Member Avatar for tony75

If your program is any good, then sooner or later someone will simply write a better program without reverse engineering.

Member Avatar for Slavi
0
3K
Member Avatar for jkon

Some posters are rude because they don't know any better. For instance they grew up in a home/society where everything was handed to them. My solution, give them an answer that needs work.

Member Avatar for rproffitt
5
353
Member Avatar for Ghost0s
Member Avatar for Jacktheclimber

Python function int() will do this for you ... hx = "FFFF" # convert hexadecimal string hx to a denary (base 10) number n = int(hx, 16) print(n) # 65535

Member Avatar for vegaseat
0
201
Member Avatar for vegaseat

The Swift computer language is the brainchild of a number of Apple associates. In my humble opinion it shows some nice features, but also some warts. Part 1 (constants, variables, strings, tuples, arrays) explores a number of the features to give you a taste of the language. I hope I …

Member Avatar for vegaseat
2
1K
Member Avatar for Tomi_1

One of the many ways ... table =[ ["_","_","_"], ["_","_","_"], ["_","_","_"] ] header = [1, 2, 3] sf = "{} {} {}" print(sf.format(*header)) for line in table: print(sf.format(*line))

Member Avatar for vegaseat
0
152
Member Avatar for surfingturtle

You have quite a few errors in your code. Line 16 needs a " Line 27 replace o with 0 Line 32 replace ! with 1 To see what's going on use a few temporary test prints.

Member Avatar for surfingturtle
0
202
Member Avatar for Reverend Jim

Let's all take a selfie as we park in the driveway and drive on the parkway.

Member Avatar for Reverend Jim
7
5K
Member Avatar for oldnier
Member Avatar for ~s.o.s~

Write a program that gives the weekday you were born. Write a program that tells you many days old you are. Write a program that lists the date of the third Wednesday of the month for the whole year. Write a program that gives the difference in days between two …

Member Avatar for gyno
22
7K
Member Avatar for sajidk25

A further look at the memory locations ... >>> a = 10.1 >>> b = 10.1 >>> a is b False >>> c = 10.1; d = 10.1 >>> c is d True >>> id(a) 4298630584 >>> id(b) 4298631760 >>> id(c) 4298630704 >>> id(d) 4298630704 >>> `c = 10.1; d …

Member Avatar for vegaseat
0
361
Member Avatar for vegaseat

The recent flood of "technical problems" with computers at Delta Airlines, the New York Stock Exchange, the Wall Street Journal etc. make me wonder if we have become too dependent on these machines? Are they maintained by less and less competent people? Has the complexity exceeded human comprehension?

Member Avatar for Reverend Jim
0
669
Member Avatar for ddanbe

It would only go away if "something" better came along. Maybe finally "something" the hackers couldn't abuse at will. I just got a letter from the UCLA hospital that their database got hacked/stolen with all their patients (present and past) private information on it! I could do without this grap!

Member Avatar for webecedarian
0
391
Member Avatar for vegaseat

What are the natural disasters that you have to learn to live with in your area? I just moved from the Las Vegas area where we had to live with drought, very high summer temperatures (up to 45 degree C) and the occasional smoke of a far away wildfire. The …

Member Avatar for ddanbe
3
570
Member Avatar for _ibyang13

"Replacing the Judicial System with a Computer Database"

Member Avatar for jkon
0
118
Member Avatar for vegaseat

Frank Gifford, America's most beloved sports entertainer has passed away in an untimely manner. A great loss for the country and the world.

0
223
Member Avatar for vegaseat

Part 2 of exploring/tasting the Swift language takes a look at dictionaries; process flow controls like loops, if/else and switch/case; functions and sorting. I hope I can follow this up with part 3, a closer look at class operations.

Member Avatar for Lardmeister
2
509
Member Avatar for Mike Askew
Member Avatar for sneekula

Here is one example that explains a little about self and class instance and method: [code=python]# a typical Python class example # newer class convention uses inheritance place holder (object) class Account(object): # __init__() initializes a newly created class instance, # 'self' refers to the particular class instance # and …

Member Avatar for Vineetha_1
0
4K
Member Avatar for ship69

You can pay DropBox a few extra bucks to add some capacity. That is the idea to get you started for free. Google, MS and Apple all do this. A totally free service will not survive on the long run.

Member Avatar for Reverend Jim
0
389
Member Avatar for vegaseat

In part 4 of tasting Swift, we explore structures. Swift has added some interesting features to structures like defaults, methods, multiple init(). This way struct objects come close to class objects with a little less overhead. As an option, methods can be added externally too. Take a look! Down the …

Member Avatar for vegaseat
1
290
Member Avatar for Ahmed91za

In the Windows world Swift/Xcode would have to compete with the combination of C# and Visual Studio, that might be too much of an obstacle. You can test drive Swift on Windows using the playground at http://swiftstub.com

Member Avatar for vegaseat
0
262
Member Avatar for vegaseat

This is the updated version of the Tiny Tkinter Calculator. It has more power, since you can type in functions contained in the Python math module then press the equals key. You can then move the result into memory for other calculations. The code is written in OOP class style …

Member Avatar for vegaseat
4
2K
Member Avatar for asif49

Looking at the zoo in the USA of who is running for president, I would say design a computer program that allows people to elect good leadership from a good choice of candidates.

Member Avatar for weitau
0
7K
Member Avatar for vegaseat

Like most modern languages Swift has sets and set operations. Here is a quick look. Coming in the fall of 2015 ... Swift2 replaces println() with just print() that has a newline default. The sort of thing that Python3 did to print(). There are some other syntax changes. Good news, …

Member Avatar for vegaseat
1
281
Member Avatar for Zeinab_1

FYI ... # get your current locale encoding import locale print(locale.getpreferredencoding(False)) # eg. US-ASCII As of Python 3.4.3 these are the options with open() ... open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None) I you use a default encoding of None, then your current locale ancoding is applied. Also your …

Member Avatar for vegaseat
0
268
Member Avatar for Atul_4

You could also look at this posting ... https://www.daniweb.com/software-development/python/code/498083/create-a-random-password-python

Member Avatar for snippsat
0
660
Member Avatar for vegaseat

The example shows how to establish a dictionary of (row, column):value pairs to mimic a two dimensional array. This can be easily expanded to more dimensions. Python3 has dictionary comprehension, making the process of creating a dictionary of this type easier.

Member Avatar for vegaseat
1
7K
Member Avatar for vegaseat

The idea of this thread is to help the beginning Python programmer with hints and helpful code. Please feel free to contribute! If you have any questions start your own thread! The creators of Python are very active, improving the language all the time. Here is a little of the …

Member Avatar for vegaseat
23
34K
Member Avatar for vegaseat

Just a simple password creator using Python code. The length of the password can be set and the characterset could be changed if you so desire.

0
576
Member Avatar for Siberian

I remember some C compilers that created assembly code first and then went on to object code and then added an executable stub. That allowed you to add assembly code directly to the C code. Python compiles to a byte code (looks somewhat like assembly code), that is then interpreted. …

Member Avatar for Rashakil Fol
0
347
Member Avatar for vegaseat

After you got the basics of Python under your belt, the best way to get a good knowledge of the language and improve your coding skills is to start on a project you are interested in. Maybe an image viewer, a slide show, computer generated random or fractal art, a …

Member Avatar for vegaseat
20
18K
Member Avatar for getanshub4u

Swaroop C.H. has rewritten his excellent beginning Python tutorial for Python3: [url]http://www.swaroopch.com/notes/Python_en:Table_of_Contents[/url] "Dive Into Python" Mark Pilgrim's Free online book, novice to pro, is updated constantly, and has been rewritten for Python3 [url]http://diveintopython3.org/[/url] check appendix A for Py2-to-Py3 differences: [url]http://diveintopython3.org/porting-code-to-python-3-with-2to3.html[/url]

Member Avatar for dewhales
0
450
Member Avatar for DragonMastur

In Python range() will do the work for you, no reason to go back to the medieval times. Even the newer curly brace languages have gone to on "in range" iterative approach.

Member Avatar for vegaseat
0
823
Member Avatar for vegaseat

This is a test to get the Python snippets going! For those of you who are scared of snakes, the language is named after the TV program, not the snake. Python is an interpreted language, but programs to compile/combine the code to an exe file are available (Py2Exe). The latest …

Member Avatar for vegaseat
2
3K
Member Avatar for anumash

If you create a list or dictionary object in Python, you are really creating an instance of a class. Class instances are reference types. You can test that out on a class you write yourself.

Member Avatar for megaflo
0
334
Member Avatar for Slavi

It depends on the computer language you are using. You can specify the size of an integer (16, 32, 64 bits). Also your characters nowadays are unicode and take up more than 1 byte.

Member Avatar for vegaseat
0
111
Member Avatar for halo_123
Member Avatar for PartVIII
-11
2K
Member Avatar for vegaseat

Just wondering. Exploring Google's Go language, a modern day C with the Google in it.

Member Avatar for vegaseat
0
399
Member Avatar for vegaseat

Part 3 of the taste of Swift explores class objects in Apple's Swift language. A class allows you to group methods (class functions) together that belong together. Class Person groups some information of people working in an office. Class Pay inherits class Person and adds pay information. Class File groups …

Member Avatar for ddanbe
1
355
Member Avatar for DaveAmour
Member Avatar for vegaseat

Ever since I got a fancy iMac and started using the Xcode IDE, I got hooked on Apple's new Swift language. From what I heard, it is supposed to replace the aging Objective C. I left a couple of Swift code snippets in the Computer Science section about my one-month …

Member Avatar for vegaseat
1
397
Member Avatar for Brandon500

At first glance it is a problem with indentation in your function. Move the return out of the for loop.

Member Avatar for BustACode
1
1K
Member Avatar for hadisur_rahman

If you mean your hard drive: 1) you can delete all the data and still leave the format 2) formatting will not only remove all data, but also the old format

Member Avatar for vegaseat
-2
162
Member Avatar for Elizabeth_6

Rather than parallel arrays I would use an array of tuples, this way there is some connectivity during sorting.

Member Avatar for vegaseat
0
189
Member Avatar for bharat_3

This might shed a little light on it ... a = 5; cout << a << " " << ++a << " " << ++a << '\n';

Member Avatar for shajin c l
0
197
Member Avatar for Riya_2

This is a tough piece of homework! As a hint, I used something like this ... for ix, line in enumerate(textList): # change to lower case and strip newline char # then create a list of words for each line wordList = line.lower().strip().split() print(wordList) # test for word in wordList: …

Member Avatar for DragonMastur
0
312

The End.