Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Application Programming › Assignment Help (Python/Jython) please
New Posts  All Forums:Forum Nav:

Assignment Help (Python/Jython) please

post #1 of 7
Thread Starter 
Hey guys,

So I have an assignment and I have NO clue what to do.

It has to do with python programming and I need a lot of help.

I'll post the question below.

Thanks so much!
Olivia

Note: We are using JES (jython)

Question:

A fairly simple function is required that will obtain a file name (using pickAFile), and then recognise if it is a picture or a sound file, or even some other file type. The file should then be interpreted as either a picture—if of type jpg (then call makePicture, display the picture then exit) or a sound—if of type wav (then call makeSound, play the sound then exit) and if it is neither a picture nor a sound file, then an error message must be printed. This error message should include the type of the file (or the lack of a type, e.g. a file name that might not have a period in it, e.g. ducksjpg). Remember that file types can be 2, 3, 4 or even more letters long! The rfind method (see page 250) is useful here, as is the len function. Don't open any files using file.open!

Typical output for attempting to access a file of type 'html' would be:
Code:
>>> openSoundOrPicture()
Oops! Did not choose a picture or a sound file.
Type is: html
post #2 of 7
This sounds rather easy, not having done python I think you would do something like this..

//Files:
String[] {.html, kawoekaw, aowkeoakwe}

read file (Split the string based on delimiter ( "." ))
loop --> to find the corresponding value...
Add logic to find the suitable error code? No ?

I'll give python a read... but that sounds about right, and you want to add a function to read the folder for the filetype.. or loop a file finder to look for a file with the values in the array?

That help smile.gif?
post #3 of 7
I love how female students sign up just to get "geeks" to do their homework for them.
    
CPUMotherboardGraphicsRAM
Intel Core i5 2500K @ 5GHz Asrock Z68 Extreme4 Gen3 ASUS 690 GTX  PATRIOT BE 16GB 
Hard DriveHard DriveCoolingOS
SAMSUNG 840 PRO 240GB 2xWD Green 2TB  Noctua DH14 Win 7 x64 
MonitorKeyboardPowerCase
Asus 27" Gigabyte Osmodius Corsair 850W Corsair Carbide 400R 
MouseMouse PadAudio
Razer Deathadder Black Edition XL soft TDL Studio 2, HK690, Beresford DAC 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Intel Core i5 2500K @ 5GHz Asrock Z68 Extreme4 Gen3 ASUS 690 GTX  PATRIOT BE 16GB 
Hard DriveHard DriveCoolingOS
SAMSUNG 840 PRO 240GB 2xWD Green 2TB  Noctua DH14 Win 7 x64 
MonitorKeyboardPowerCase
Asus 27" Gigabyte Osmodius Corsair 850W Corsair Carbide 400R 
MouseMouse PadAudio
Razer Deathadder Black Edition XL soft TDL Studio 2, HK690, Beresford DAC 
  hide details  
Reply
post #4 of 7
Quote:
I love how female students sign up just to get "geeks" to do their homework for them.

Not really fair to only say this about female students. I'm sure plenty of male students do this as well. Help with homework is gender neutral.
Edited by Tadaen Sylvermane - 3/30/13 at 5:40pm
 
Micromachine
(8 items)
 
 
CPUMotherboardGraphicsRAM
i7 4500u Inspiron 15 7000 Integrated 8gb 
Hard DriveOSMouse
120gb Samsung EVO SSD Debian Logitech m705 
CPUMotherboardRAMHard Drive
AMD 5350 Kabini AsRock AM1H-ITX 8gb Gskill Ripjaws (2x4) Samsung 120 Evo 
Hard DriveHard DriveOSCase
WD 1tb 2.5 WD 2tb USB 3.0 Ubuntu Server 16.04 Antec ISK 
  hide details  
Reply
 
Micromachine
(8 items)
 
 
CPUMotherboardGraphicsRAM
i7 4500u Inspiron 15 7000 Integrated 8gb 
Hard DriveOSMouse
120gb Samsung EVO SSD Debian Logitech m705 
CPUMotherboardRAMHard Drive
AMD 5350 Kabini AsRock AM1H-ITX 8gb Gskill Ripjaws (2x4) Samsung 120 Evo 
Hard DriveHard DriveOSCase
WD 1tb 2.5 WD 2tb USB 3.0 Ubuntu Server 16.04 Antec ISK 
  hide details  
Reply
post #5 of 7
Is it? When I was at uni nearly all the females in the class, you know, the blonde ones with blue eyes and big chests, were flirting with all the geeky looking types to get their homework done.

Quite why you sign up for that kind of class if you arent going to do the homework beats me.
    
CPUMotherboardGraphicsRAM
Intel Core i5 2500K @ 5GHz Asrock Z68 Extreme4 Gen3 ASUS 690 GTX  PATRIOT BE 16GB 
Hard DriveHard DriveCoolingOS
SAMSUNG 840 PRO 240GB 2xWD Green 2TB  Noctua DH14 Win 7 x64 
MonitorKeyboardPowerCase
Asus 27" Gigabyte Osmodius Corsair 850W Corsair Carbide 400R 
MouseMouse PadAudio
Razer Deathadder Black Edition XL soft TDL Studio 2, HK690, Beresford DAC 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Intel Core i5 2500K @ 5GHz Asrock Z68 Extreme4 Gen3 ASUS 690 GTX  PATRIOT BE 16GB 
Hard DriveHard DriveCoolingOS
SAMSUNG 840 PRO 240GB 2xWD Green 2TB  Noctua DH14 Win 7 x64 
MonitorKeyboardPowerCase
Asus 27" Gigabyte Osmodius Corsair 850W Corsair Carbide 400R 
MouseMouse PadAudio
Razer Deathadder Black Edition XL soft TDL Studio 2, HK690, Beresford DAC 
  hide details  
Reply
post #6 of 7
Never went to college myself so I don't have that first hand experience. But don't reinforce a stereotype. You saw something, maybe it's common... but it doesn't mean every single one does or is like that. It's no different than the stereotype of girls not being gamers, and the ones that are are fat and ugly. It's simply not true.
On the coding note, I don't know where lua stands in the hierarchy of coding but some of the warcraft mods I use are written by women and they are some of the most beautiful mods I've ever seen. I don't know coding though so I can't speak to the quality of the code but the memory usage is low with a huge number of features.

Either way I just noticed the date on this thread, no activity for over a week except our little exchange. no sense keeping it going.
Edited by Tadaen Sylvermane - 3/30/13 at 11:13pm
 
Micromachine
(8 items)
 
 
CPUMotherboardGraphicsRAM
i7 4500u Inspiron 15 7000 Integrated 8gb 
Hard DriveOSMouse
120gb Samsung EVO SSD Debian Logitech m705 
CPUMotherboardRAMHard Drive
AMD 5350 Kabini AsRock AM1H-ITX 8gb Gskill Ripjaws (2x4) Samsung 120 Evo 
Hard DriveHard DriveOSCase
WD 1tb 2.5 WD 2tb USB 3.0 Ubuntu Server 16.04 Antec ISK 
  hide details  
Reply
 
Micromachine
(8 items)
 
 
CPUMotherboardGraphicsRAM
i7 4500u Inspiron 15 7000 Integrated 8gb 
Hard DriveOSMouse
120gb Samsung EVO SSD Debian Logitech m705 
CPUMotherboardRAMHard Drive
AMD 5350 Kabini AsRock AM1H-ITX 8gb Gskill Ripjaws (2x4) Samsung 120 Evo 
Hard DriveHard DriveOSCase
WD 1tb 2.5 WD 2tb USB 3.0 Ubuntu Server 16.04 Antec ISK 
  hide details  
Reply
post #7 of 7
First post, asking for homework... yeah...
Back in Black
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Phenom II X4 965 BE (C3) Biostar TA790GX A3+ Sapphire HD 5770 (v2) CORSAIR XMS3 4GB DDR3 
Hard DriveOptical DriveOSMonitor
WD Caviar Black 640GB Sony Optiarc CD/DVD RW Windows 7 Ultimate x64 NEC MultiSync LCD 1960NXi 
KeyboardPowerCaseMouse
Microsoft Comfort Curve Keyboard 2000 Corsair 650TX Cooler Master Storm Scout Logitech MX 400 Laser 
  hide details  
Reply
Back in Black
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Phenom II X4 965 BE (C3) Biostar TA790GX A3+ Sapphire HD 5770 (v2) CORSAIR XMS3 4GB DDR3 
Hard DriveOptical DriveOSMonitor
WD Caviar Black 640GB Sony Optiarc CD/DVD RW Windows 7 Ultimate x64 NEC MultiSync LCD 1960NXi 
KeyboardPowerCaseMouse
Microsoft Comfort Curve Keyboard 2000 Corsair 650TX Cooler Master Storm Scout Logitech MX 400 Laser 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Application Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Application Programming › Assignment Help (Python/Jython) please