43,549 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for MarkWalker84

Hi guys! Im new to this forum so go easy on me :-) I've got a background in C programming and have recently moved to Python for a GUI project im working on. So far im loving it - compared to VC++ wxPython is pure bliss. Im having a slight …

Software Development engineering gui python
Member Avatar for MarkWalker84
0
435
Member Avatar for NewVBguy

Hi there, I'm new to this sqlserver package. Is VB6 can able to work with this package like connectivity issues?. Can somebody advice me about this because my previous experience is purely on ms access database as backend front end vb6. thnx in advance.. newvbguy

Software Development visual-basic
Member Avatar for NewVBguy
0
90
Member Avatar for Mouche

I'd like to flip the keys and the values in a dictionary. Say I have this dictionary: [php] positions = {'secretary' : 'Jessica', 'IT manager' : 'Matt', 'sales worker' : 'Linda', 'boss' : 'Chris'} [/php] and I want this: [php] employees = {'Jessica' : 'secretary', 'Matt' : 'IT manager', 'Linda' …

Software Development python
Member Avatar for Ene Uran
0
302
Member Avatar for slacke

Hello I need to work out some parallel port output signals. I found a short program to test bits on that port. It tells I need to set the permission with ioperm() as this: [CODE] #include <asm/io.h> #include <iostream> #include <cstdlib> #include <unistd.h> #define base 0x378 /* printer port base …

Software Development c printer
Member Avatar for slacke
0
205
Member Avatar for macca1111

Hi, I have a class for Cards, that the suits and ranks are placed in suitList = ("Hearts","Diamonds"... rankList = ("","Ace","2"... however I need to read these values from a file instead. Once I read the file I need to be able to sort the suits and ranks then print …

Software Development python
Member Avatar for macca1111
0
107
Member Avatar for macca1111

Hi, I need some help on how to read a file 2 h 3 s 6 d Ace s ... Importing this into Python and then sorting and printing in order. I have done some work, yet I can never seem to get the data to Python and split it …

Software Development python
Member Avatar for macca1111
0
319
Member Avatar for macca1111

Hi, I have the following code working fine. What I would like to try is when n cards are randomly selected, to print the cards in a graphics window. I want to add a new class draw(self,win,center) that displays the card. I have a set of bmp cards. [php]# Import …

Software Development python
Member Avatar for Zonr_0
0
1K
Member Avatar for sneekula

What is the most efficient way to spell a string in reverse, for instance s = "banana".

Software Development python
Member Avatar for Mouche
0
126
Member Avatar for mruane

i get this error when trying to run my program. Traceback (most recent call last): File "C:\Python24\secretgarden.pyw", line 12, in -toplevel- denaystart() File "C:\Python24\secretgarden.pyw", line 7, in denaystart prompt_login() NameError: global name 'prompt_login' is not defined

Software Development python
Member Avatar for vegaseat
0
155
Member Avatar for DarkFlash

Hey guys Just joined up the forum, I've been looking for a good community of python users! I'm 17 and I'm in colleg right now getting my transfer degree so I can go major in software development. I've worked with mostly web based langauges for the last couple of years …

Software Development perl python
Member Avatar for DarkFlash
0
278
Member Avatar for sneekula

If I have an integer like x = 12345, how do I separate that into individual integers 1, 2, 3, 4, 5?

Software Development python
Member Avatar for sneekula
0
122
Member Avatar for mruane

I hope this thread does not offend anyone. I get the impression that most of us are college age prog5rammers, so this might be easily solved. I am attempting to make a menstrual cycle calculator for my fiance. To begin with, I thought about going about it in the following …

Software Development python
Member Avatar for vegaseat
0
89
Member Avatar for Mouche

So if I want to store a list of items (such as a bunch of instances of a class), what's better to use: tuples or lists? I understand that lists are mutable, so what are the advantages to tuples?

Software Development python
Member Avatar for vegaseat
0
141
Member Avatar for jondo

I need to format a 4 byte numeric value that decodes results = (byte1 * 256 * 256 * 256) + (byte2 * 256 * 256) + (byte3 * 256) + byte4 can it be done :?: /jondo

Software Development visual-basic
Member Avatar for Comatose
0
70
Member Avatar for naheed

i wanna know how to draw text over picture box in multiple lines using print method if i used label control over picture box to draw text in multiple lines then i dont know how to save picture with label if anybody hve solution of my problems then pls reply …

Software Development visual-basic
Member Avatar for naheed
0
183
Member Avatar for vickzbrit

Enter the miles driven, use -1 to end: Enter the gallons : The miles / gallon for this tank was Enter the miles driven, use -1 to end: Enter the gallons used (-1 to end) : The miles / gallon for this tank was Enter the miles driven, use -1 …

Software Development vb.net
Member Avatar for vickzbrit
0
112
Member Avatar for snedan

hi guys i need a little hint on how to break an integer into its component so if you have like 1567 i need to get 4 integers with 1,5,6,7. Thank you

Software Development c
Member Avatar for ~s.o.s~
0
100
Member Avatar for Juggler

I have a question about manipulating an array in C++. In my program, a cstring is entered. The string is printed. Finally, the string must be printed in reverse and displayed. The final part is where I am having my problem. I have the strlen function determine the legnth of …

Software Development c c# c++
Member Avatar for Juggler
0
227
Member Avatar for DarkFlash

Hey guys, I'm just about done with a program and I need to know how to launch an IE window (or any browser I suppose) from the command prompt. Can anybody help me? thanks!:cheesy:

Software Development python
Member Avatar for DarkFlash
0
353
Member Avatar for spacecowboy123

Hi all, I'm new to C++ and am having a problem with a piece I am writing for an assignment. The problem area is below. [code] //arrival process on the corporate links if (clock % 4 == 0) { double randomno randomno = randgen; // Generate random number if (randomno …

Software Development c++ queue
Member Avatar for spacecowboy123
0
2K
Member Avatar for s88

The problem is that when I enter the choice, nothing happens and the answer remains 0. Please help I'm new at this and I tried everything!! Thanks [code=c] #include <stdio.h> #include <conio.h> main () { int a,b; float answer; char choice; clrscr(); printf ("\nEnter a number: "); scanf ("%d",&a); printf …

Software Development c
Member Avatar for s88
0
300
Member Avatar for matrimforever

In the following code, how do I change the line under [code] cout << "\nThe value of bogus in num1 is " << num1.bogus;[/code] to get it to compile correctly. I know its calling for theValue which is private. Not sure what to change to make it work: [code] #include …

Software Development c++
Member Avatar for matrimforever
0
108
Member Avatar for matrimforever

Hi all, I need help turning this: W = 35.74 + 0.6215t - 35.75 (v0.16) + 0.4275t(v0.16) into code. I guess the real problem is the how to turn v to the .16th power using this function: double pow(double [I]x[/I], double [I]y[/I]) I know how to open a file with …

Software Development c++
Member Avatar for matrimforever
0
168
Member Avatar for waldis

Hi, Once I had a similar problem when I tried to read a binary file on a pc and I failed, but I was able to read it in Linux (there were actually different versions of the file), so I figured it's a corrupted file, thou the hex dump looked …

Software Development c
Member Avatar for waldis
0
96
Member Avatar for kissiwat

All I'm trying to do is write a very simple loop program in C to enter the ages of four sprogs between 5 and 7. To display their total and average age using do, while and if statements. I also need to display an error message if an invalid number …

Software Development c
Member Avatar for Lerner
0
144
Member Avatar for mruane

Alright, so far, what I think the problem begins with is not having a full understanding of syntax, and tabs versus spaces. I have my tab set to four spaces. When I run the following code, the Python GUI (the black ms-dos looking thing, right?) flashes for only a few …

Software Development gui open-source python
Member Avatar for vegaseat
0
173
Member Avatar for Brent.tc

I need help with using the cin command\function. Any time I try to use it outside of the main function it does not work what am I doing wrong?

Software Development c++
Member Avatar for WaltP
0
111
Member Avatar for macca1111

Hi, A simple question I think. I want to create a function that updates variables if a certain condition is met. For example def main(): c=d=e=0 if c[1] == 0: c=c+1 d=d+1 e=e+1 I want to create a function that adds the 1 to c,d,e automatically. def BB(c,d,e) Add 1 …

Software Development python
Member Avatar for Ene Uran
0
83
Member Avatar for Mouche

hey... I wasn't able to find much information on these class methods other than __init__ ... could you explain what these (and maybe some others) do or perhaps just give me a link to a page that explains them: def __repr__ def __str__ def __cmp__

Software Development python
Member Avatar for Mouche
0
108
Member Avatar for FireSBurnsmuP

Alright, I cannot get the getline function to work. I have iostream included, using namespace std, and here is the syntax I have down: [inlinecode]cin.getline(playerOne, 21);[/inlinecode] with playerOne declared previously as a string, and I want its max input to be 20 characters. What's going on here? It's not working …

Software Development c c# c++
Member Avatar for WolfPack
0
153
Member Avatar for Mouche

I searched the forum and couldn't find anything on this, so I guses I'll give this tiny topic its own thread. What's the point of creating a main() function and calling it at the end of your program? Are there advantages to this method in comparison to just writing the …

Software Development python
Member Avatar for vegaseat
0
137
Member Avatar for Mouche

say you have a list: [php] list = [1,a,2,b,3,c,4,d,5,e,6,f,7,g,8,h,9,i,10,j,11,k,12,l,13] [/php] What's the easiest loop set up if I want to store each number (every other slot) into another list? The above list is actually text from a file read and then split with "1 a" and such on each line …

Software Development python
Member Avatar for vegaseat
0
164
Member Avatar for HLA91

Hi When i place this in my script import time.sleep (2) i would like my script to wait for 2 seconds then continue. But when i run it the left bracket is highlighted in red then when iremove the left bracket as i assume that is not supposed to be …

Software Development python
Member Avatar for vegaseat
0
178
Member Avatar for ReDeViL

Write a program that accepts a number and produces a pattern as shown in the following sample outputs. Line = 3 *.* .* * Line = 8 .*.*.*.* *.*.*.* .*.*.* *.*.* .*.* *.* .* i've just learnt to use the setw() command..... but how do you fill up the alternate …

Software Development c++ display
Member Avatar for ReDeViL
0
137
Member Avatar for HLA91

Hi Im looking for a time delay code so my script runs to certain line waits for the time specified then continues.Ive found some but they seem to long and complicated. any ideas or links, books ect... Many Thanks HlA91 STAY COOL AND DONT GET STRESSED!:cool:

Software Development python
Member Avatar for Mouche
0
345
Member Avatar for macca1111

Hi, I have the following code: import string def main(): rank=[] suit=[] fname=string.split(open('H:\card.txt').read()) for line in fname: rank.append(line) print rank The file (card.txt) is: 2 h 3 h ... How's the easiest was to get the 2 into rank and the h equal hearts Ultimately i need it to print: …

Software Development python
Member Avatar for Ene Uran
0
127
Member Avatar for theking11

So a kid in my class wanted more of a challenge...the professor gave us one...and I have no idea on this problem. Here's the instructions: Darts scorer. Write a program that draws a darts target and allows the user to click on the target to represent darts hitting the target. …

Software Development python
Member Avatar for Ene Uran
0
3K
Member Avatar for mruane

I recently downloaded Py2exe to make my python2.4 programs executable in motive of possible distribution. I looked online, and most of them tell me I need to use my ms-dos prompt, or command prompt. If these are two different things on my Windows 98 O.S., i cannot find command prompt. …

Software Development python
Member Avatar for Ene Uran
0
100
Member Avatar for macca1111

Hi, If the following def shows if a deck is empty, how do I change it to show the number of cards left??? def isEmpty(self): return (len(self.cards) == 0) I was thinking just taking the ==0 should work, by returning number of cards. macca1111

Software Development python
Member Avatar for Ene Uran
0
115
Member Avatar for disc

Hello, Can anyone tell me what the code beneath means. I've searched but can't find a clear explanation. Maybe someone can give an example of how to use it. Thanks... [code] [COLOR=#0000ff]bool[/COLOR][COLOR=#000000] MyClass::[/COLOR][COLOR=#0000ff]operator[/COLOR][COLOR=#000000]()()[/COLOR] [COLOR=#000000]{ [/COLOR] [COLOR=#000000] ....[/COLOR] [COLOR=#000000]}[/COLOR] [COLOR=#000000]class MyClass[/COLOR] [COLOR=#000000]{[/COLOR] [COLOR=#0000ff]virtual[/COLOR] [COLOR=#0000ff]bool[/COLOR] [COLOR=#0000ff]operator[/COLOR]()(); } [/code]

Software Development c++
Member Avatar for disc
0
166
Member Avatar for sneekula

With the ease of argument passing to and from functions in Python, why would anyone want to use global variables. Isn't that an open invitation for mistakes to happen? Yet, I see code in threads here that abound with globals. I am a little confused here.

Software Development python
Member Avatar for jrcagle
0
143
Member Avatar for tehloki

I am taking a programming course, and since we have not been introduced to string functions (puts(), gets(), etc) I need to take some input from the user using scanf. The assignment is to read a DNA sequence, storing it in a char array. The array must be 512 characters, …

Software Development c
Member Avatar for tehloki
0
251
Member Avatar for macca1111

Hi, I was running Python 2.3 an although I had a few problems it generally worked. I today tried to upgrade to 2.5 and it installs (apparantely) ok, yet when I click on the IDLE icon nothing happens. No error message, nothing. I can however click on the Python (Command …

Software Development python
Member Avatar for macca1111
0
83
Member Avatar for HLA91

Hi Ive got this word count script when i check it there is no probs but when i run it it says Traceback (most recent call last): File "H:\Scripts\count.py", line 9, in <module> infile = file(data, 'r') NameError: name 'data' is not defined This is my script #The number of …

Software Development python
Member Avatar for bumsfeld
0
182
Member Avatar for cancer10

Hello Friends, I am willing to learn python, so can someone please guide me how do I get started? I mean wot compiler would I need and which editor etc Also tell me wot is the scope of python in web programming? Thanx

Software Development python
Member Avatar for HLA91
0
219
Member Avatar for HLA91

Hi The info "joeprogrammer's" gave me to place the python directory at the end of my path but im confused. My path at the moment looks like this %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Common Files\Adobe\AGL Python on my pc is in my H:\ drive under a folder called python. …

Software Development adobe python
Member Avatar for vegaseat
0
199
Member Avatar for HLA91

Hi i Made a shell script like this [code] name = raw_input ("Please enter your name: ") if name == Harry: print "Welcome" else: print "you smell" [/code] What i want it to do is ask for my name and if i dont enter Harry it says "YOU Smell" But …

Software Development python
Member Avatar for vegaseat
0
164
Member Avatar for sneekula

How to I best pass multiple arguments to and from a function?

Software Development python
Member Avatar for vegaseat
0
275
Member Avatar for SammyHasibi

I have written a program with 2 functions which compute factorials & combinations. The functions work perfectly when called but I cannot insert a for loop at the end which sums up the combos. This part works (I have omitted the functions because they work when called for). [code]long factorial(int …

Software Development c
Member Avatar for SammyHasibi
0
97
Member Avatar for mruane

Hey all. I was hoping somebody on here, preferably vegaseat or any other long time and reputable poster and/or moderater would have any Ideas for a program that I should write. Basically, I fear I am trying to push myself to hard and to fast with python. I really want …

Software Development python
Member Avatar for Ene Uran
0
116

The End.