Programming Freaks  | دورات ومقالات برمجيه

Please login or register.

Login with username, password and session length
Advanced search  

News:

Please Read our FAQ

Author Topic: I need your Help with Python and xHTML..please help me  (Read 623 times)

Saturn

  • Just Joined
  • *
  • Posts: 4
    • View Profile
I need your Help with Python and xHTML..please help me
« on: May 01, 2009, 11:06:07 AM »
عندي مشكلة عالقة في
pickle>>Python
لتخزين لائحة بيانات
,جننتي المشكلة لعدة أيام أتمنى المساعدة,
لاأعرف كيف أخزن معلومات عن طريق Python وكذلك قصة Server مع Python أحتاج مساعدتكم للضرورة القصوى

هنا المسألة :

They should be simple Web application development, with the management of a warehouse stock can be simulated.
The following functional requirements:
the warehouse-stock can be stored for different products.
For each product will be a separate area
The product-list must be maintained
the list of warehouse area must be maintained:
the clear assignment to a product.
The definition of warehouse capacity (in pieces) and a minimum quantity.
Products can be taken from the warehouse, while the warehouse capacity may not be exceeded.
There must be an overview for the entire warehouse can be (list the warehouse area / products with a current stock)

On the realization of the following requirements:
There will be (the client) static websites are used, that is, it must not be a client-side ******ing can be used.
It must be XHTML 1.0 strict to be used.
It must be used CSS, CSS - Style rules must be in separate files (one or more) are stored.
The storage of data in files.


As a starting point for the implementation of web use "post_server.py". Implement the various processing methods directly in the do_GET and do_POST - method. Pass form data with POST method. The storage of data into files you can use the Python - module "pickle" (or cpickle) make
Logged

Saturn

  • Just Joined
  • *
  • Posts: 4
    • View Profile
Re: I need your Help with Python and xHTML..please help me
« Reply #1 on: May 01, 2009, 11:13:12 AM »
كيف نستطيع دمج
File
المتضمن لما تم تخزينه ب
Pickle
 xHTML  في كود
pickle  نخزن اللائحة ب
عند الضغط على زر
creat Product
  على صفحةالويب يجب تخزين معلوماته في
File Python
كيف يتم ذلك

ساعدوووووني يا اخوان في الموضوع ,أحتاج الأمر للضروووورة القصوى ولا دراية عندي ب   
Python :(

Logged

Saturn

  • Just Joined
  • *
  • Posts: 4
    • View Profile
Re: I need your Help with Python and xHTML..please help me
« Reply #2 on: May 01, 2009, 11:17:10 AM »
استفدت كثيرا من موضوع الذي وضعه الأخ أحمد ولكن أحتاج لنقطة البداية في حل الموضوع!
 :Pأخ أحمد لاتبخل علي بالمساعدة
وشكرا
 :)
Logged

Striky

  • Helping Freak
  • Administrator
  • Posting Freak
  • *****
  • Posts: 252
    • View Profile
    • WWW
    • Email
Re: I need your Help with Python and xHTML..please help me
« Reply #3 on: May 01, 2009, 11:35:11 AM »
الفكرة ان يكون عندك pickable objects
وتقدر تعملهم pickle فى ملفات بإستخدام dump, load وبعد كدا لما تيجى تستعيدهم تكون موفر string representation ربما عن طريق __repr__ or str على حسب استخدامك



Logged

Life is just a chance to grow a soul. - A. Powell
Weblog: http://ahmedyoussef.wordpress.com/

Saturn

  • Just Joined
  • *
  • Posts: 4
    • View Profile
Re: I need your Help with Python and xHTML..please help me
« Reply #4 on: May 02, 2009, 02:17:04 AM »
الفكرة ان يكون عندك pickable objects
وتقدر تعملهم pickle فى ملفات بإستخدام dump, load وبعد كدا لما تيجى تستعيدهم تكون موفر string representation ربما عن طريق __repr__ or str على حسب استخدامك


شكرا أخي أحمد على الرد
الفكرة نظريا واضحة تماما, أعلم أنه يتوجب عليه استعمال بيكل  ولكن كيف كيف كيف!!!!!!
كيف أخزن عمليا   معلومات كل منتج في بيكل ثم استدعيها من صفحة الويب!!!!
Logged

Striky

  • Helping Freak
  • Administrator
  • Posting Freak
  • *****
  • Posts: 252
    • View Profile
    • WWW
    • Email
Re: I need your Help with Python and xHTML..please help me
« Reply #5 on: May 02, 2009, 04:00:57 AM »

Code: [Select]
 
>>> class Product(object):
...     def __init__(self, n, price):
...             self.n=n
...             self.price=price
...
>>> p=Product("something", 1000)
>>> import pickle
>>> j=None
>>> dumped=pickle.dumps(p)
>>> j=pickle.loads(dumped)
>>> j
<__main__.Product object at 0xb798996c>
>>> j.n
'something'
>>> j.price
1000


انت ممكن تعمل dump ل list من ال products فى ملف وبعد كدا تبقة تعملها load وهتبقة عبارة عن list من ال products لما ترجعها
بخصوص الويب ففكر تستخدم ال cgi بما انك مش محتاج حاجات كتير
Logged

Life is just a chance to grow a soul. - A. Powell
Weblog: http://ahmedyoussef.wordpress.com/